From patchwork Sun Mar 1 04:40:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattia Dongili X-Patchwork-Id: 9417 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n214otWO004498 for ; Sun, 1 Mar 2009 04:50:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751577AbZCAEuZ (ORCPT ); Sat, 28 Feb 2009 23:50:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751639AbZCAEuZ (ORCPT ); Sat, 28 Feb 2009 23:50:25 -0500 Received: from static-220-247-10-204.b-man.svips.gol.ne.jp ([220.247.10.204]:48649 "EHLO smtp.kamineko.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756335AbZCAEuS (ORCPT ); Sat, 28 Feb 2009 23:50:18 -0500 Received: from tadamune.kamineko.org (unknown [192.168.1.21]) by smtp.kamineko.org (Postfix) with ESMTP id DA3C91F238; Sun, 1 Mar 2009 13:40:45 +0900 (JST) Received: by tadamune.kamineko.org (Postfix, from userid 1000) id 108071313C; Sun, 1 Mar 2009 13:40:45 +0900 (JST) From: Mattia Dongili To: Len Brown Cc: linux-acpi@vger.kernel.org, Mattia Dongili Subject: [PATCH 1/9] [sony-laptop] merge Type4 into Type3 Date: Sun, 1 Mar 2009 13:40:37 +0900 Message-Id: <1235882445-2404-2-git-send-email-malattia@linux.it> X-Mailer: git-send-email 1.6.1.3 In-Reply-To: <1235882445-2404-1-git-send-email-malattia@linux.it> References: <1235882445-2404-1-git-send-email-malattia@linux.it> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Creating Type4 was a mistake in the first place. Some users report that also Type3 vaios require the same extra hotkey handling which the Type4 for was menat to guard from. Merging down Type4 into Type3 will just remove a useless distinction. Signed-off-by: Mattia Dongili --- drivers/platform/x86/sony-laptop.c | 28 ++++++---------------------- 1 files changed, 6 insertions(+), 22 deletions(-) diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 537959d..5e43d0a 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -1195,7 +1195,6 @@ static struct acpi_driver sony_nc_driver = { #define SONYPI_TYPE1_OFFSET 0x04 #define SONYPI_TYPE2_OFFSET 0x12 #define SONYPI_TYPE3_OFFSET 0x12 -#define SONYPI_TYPE4_OFFSET 0x12 struct sony_pic_ioport { struct acpi_resource_io io1; @@ -1438,14 +1437,6 @@ static struct sonypi_eventtypes type3_events[] = { { 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev }, { 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev }, { 0x31, SONYPI_PKEY_MASK, sonypi_pkeyev }, - { 0 }, -}; -static struct sonypi_eventtypes type4_events[] = { - { 0, 0xffffffff, sonypi_releaseev }, - { 0x21, SONYPI_FNKEY_MASK, sonypi_fnkeyev }, - { 0x31, SONYPI_WIRELESS_MASK, sonypi_wlessev }, - { 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev }, - { 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev }, { 0x05, SONYPI_PKEY_MASK, sonypi_pkeyev }, { 0x05, SONYPI_ZOOM_MASK, sonypi_zoomev }, { 0x05, SONYPI_CAPTURE_MASK, sonypi_captureev }, @@ -1511,11 +1502,11 @@ static u8 sony_pic_call3(u8 dev, u8 fn, u8 v) /* * minidrivers for SPIC models */ -static int type4_handle_irq(const u8 data_mask, const u8 ev) +static int type3_handle_irq(const u8 data_mask, const u8 ev) { /* * 0x31 could mean we have to take some extra action and wait for - * the next irq for some Type4 models, it will generate a new + * the next irq for some Type3 models, it will generate a new * irq and we can read new data from the device: * - 0x5c and 0x5f requires 0xA0 * - 0x61 requires 0xB3 @@ -1545,16 +1536,10 @@ static struct device_ctrl spic_types[] = { }, { .model = SONYPI_DEVICE_TYPE3, - .handle_irq = NULL, + .handle_irq = type3_handle_irq, .evport_offset = SONYPI_TYPE3_OFFSET, .event_types = type3_events, }, - { - .model = SONYPI_DEVICE_TYPE4, - .handle_irq = type4_handle_irq, - .evport_offset = SONYPI_TYPE4_OFFSET, - .event_types = type4_events, - }, }; static void sony_pic_detect_device_type(struct sony_pic_dev *dev) @@ -1578,14 +1563,14 @@ static void sony_pic_detect_device_type(struct sony_pic_dev *dev) pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, NULL); if (pcidev) { - dev->control = &spic_types[3]; + dev->control = &spic_types[2]; goto out; } pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4, NULL); if (pcidev) { - dev->control = &spic_types[3]; + dev->control = &spic_types[2]; goto out; } @@ -1598,8 +1583,7 @@ out: printk(KERN_INFO DRV_PFX "detected Type%d model\n", dev->control->model == SONYPI_DEVICE_TYPE1 ? 1 : - dev->control->model == SONYPI_DEVICE_TYPE2 ? 2 : - dev->control->model == SONYPI_DEVICE_TYPE3 ? 3 : 4); + dev->control->model == SONYPI_DEVICE_TYPE2 ? 2 : 3); } /* camera tests and poweron/poweroff */