From: tianyu.lan@intel.com
To: tianyu.lan@intel.com, lenb@kernel.org, rjw@sisk.pl,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] ACPI/Button: Using input_set_capability() to mark device's event capability
Date: Thu, 12 Sep 2013 03:32:03 -0400 [thread overview]
Message-ID: <1378971125-8896-2-git-send-email-tianyu.lan@intel.com> (raw)
In-Reply-To: <1378971125-8896-1-git-send-email-tianyu.lan@intel.com>
From: Lan Tianyu <tianyu.lan@intel.com>
Input layer provides input_set_capability() to set input device's event
related bits. This patch is to use it to replace origin code.
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
drivers/acpi/button.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index a557738..c971929 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -383,18 +383,15 @@ static int acpi_button_add(struct acpi_device *device)
switch (button->type) {
case ACPI_BUTTON_TYPE_POWER:
- input->evbit[0] = BIT_MASK(EV_KEY);
- set_bit(KEY_POWER, input->keybit);
+ input_set_capability(input, EV_KEY, KEY_POWER);
break;
case ACPI_BUTTON_TYPE_SLEEP:
- input->evbit[0] = BIT_MASK(EV_KEY);
- set_bit(KEY_SLEEP, input->keybit);
+ input_set_capability(input, EV_KEY, KEY_SLEEP);
break;
case ACPI_BUTTON_TYPE_LID:
- input->evbit[0] = BIT_MASK(EV_SW);
- set_bit(SW_LID, input->swbit);
+ input_set_capability(input, EV_SW, SW_LID);
break;
}
--
1.8.2.1
next prev parent reply other threads:[~2013-09-12 7:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-12 7:32 [PATCH 0/3] ACPI: EC/Button drivers clean up and correct gpe's sysfs attribute tianyu.lan
2013-09-12 7:32 ` tianyu.lan [this message]
2013-09-12 7:32 ` [PATCH 2/3] ACPI/EC: Convert all printk to dynamic debug function tianyu.lan
2013-09-12 7:32 ` [PATCH 3/3] ACPI/Sys: make gpe's sysfs attribute only accept correct value tianyu.lan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378971125-8896-2-git-send-email-tianyu.lan@intel.com \
--to=tianyu.lan@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®