From patchwork Sun Dec 20 14:17:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattia Dongili X-Patchwork-Id: 68979 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBKEHr6i015457 for ; Sun, 20 Dec 2009 14:18:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752761AbZLTOSG (ORCPT ); Sun, 20 Dec 2009 09:18:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751775AbZLTOSG (ORCPT ); Sun, 20 Dec 2009 09:18:06 -0500 Received: from static-220-247-10-204.b-man.svips.gol.ne.jp ([220.247.10.204]:54554 "EHLO smtp.kamineko.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752761AbZLTOSC (ORCPT ); Sun, 20 Dec 2009 09:18:02 -0500 Received: by smtp.kamineko.org (Postfix, from userid 1004) id 4D596742B8; Sun, 20 Dec 2009 23:18:00 +0900 (JST) Received: from caligola.kamineko.org (unknown [192.168.1.34]) by smtp.kamineko.org (Postfix) with ESMTP id 2A186742AD; Sun, 20 Dec 2009 23:17:59 +0900 (JST) Received: by caligola.kamineko.org (Postfix, from userid 1000) id 4357C15E7B; Sun, 20 Dec 2009 23:17:59 +0900 (JST) From: Mattia Dongili To: Len Brown Cc: linux-acpi@vger.kernel.org, Dmitry Torokhov , Dmitry Torokhov , Mattia Dongili Subject: [PATCH 3/3] sony-laptop: simplify keymap initialization Date: Sun, 20 Dec 2009 23:17:39 +0900 Message-Id: <1261318659-5980-4-git-send-email-malattia@linux.it> X-Mailer: git-send-email 1.6.5.7 In-Reply-To: <1261318659-5980-3-git-send-email-malattia@linux.it> References: <1261318659-5980-1-git-send-email-malattia@linux.it> <1261318659-5980-2-git-send-email-malattia@linux.it> <1261318659-5980-3-git-send-email-malattia@linux.it> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 90400f0..0d129ef 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -420,18 +420,15 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device) key_dev->dev.parent = &acpi_device->dev; /* Initialize the Input Drivers: special keys */ - set_bit(EV_KEY, key_dev->evbit); - set_bit(EV_MSC, key_dev->evbit); - set_bit(MSC_SCAN, key_dev->mscbit); + input_set_capability(key_dev, EV_MSC, MSC_SCAN); + + __set_bit(EV_KEY, key_dev->evbit); key_dev->keycodesize = sizeof(sony_laptop_input_keycode_map[0]); key_dev->keycodemax = ARRAY_SIZE(sony_laptop_input_keycode_map); key_dev->keycode = &sony_laptop_input_keycode_map; - for (i = 0; i < ARRAY_SIZE(sony_laptop_input_keycode_map); i++) { - if (sony_laptop_input_keycode_map[i] != KEY_RESERVED) { - set_bit(sony_laptop_input_keycode_map[i], - key_dev->keybit); - } - } + for (i = 0; i < ARRAY_SIZE(sony_laptop_input_keycode_map); i++) + __set_bit(sony_laptop_input_keycode_map[i], key_dev->keybit); + __clear_bit(KEY_RESERVED, key_dev->keybit); error = input_register_device(key_dev); if (error) @@ -451,9 +448,8 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device) jog_dev->id.vendor = PCI_VENDOR_ID_SONY; key_dev->dev.parent = &acpi_device->dev; - jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); - jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE); - jog_dev->relbit[0] = BIT_MASK(REL_WHEEL); + input_set_capability(jog_dev, EV_KEY, BTN_MIDDLE); + input_set_capability(jog_dev, EV_REL, REL_WHEEL); error = input_register_device(jog_dev); if (error)