* [Update PATCH] ACPI/Button: Fix enable Button GPEs twice
@ 2013-12-06 8:32 Lan Tianyu
2013-12-06 8:59 ` Aaron Lu
0 siblings, 1 reply; 2+ messages in thread
From: Lan Tianyu @ 2013-12-06 8:32 UTC (permalink / raw)
To: lenb, rjw; +Cc: Lan Tianyu, linux-acpi, linux-kernel
Button GPEs have been enabled in the acpi_wake_device_init() during
boot and Button driver enables these GPEs second time. This causes
disabling these gpes via sysfs interface requires twice "echo disable
> /sys/firmware/acpi/interrupts/gpeXXX". This patch is to remove
related code in the Button driver.
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
Update:
fix a typo, sorry for noise.
drivers/acpi/button.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 9e3a6cb..6643f2d 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -406,15 +406,9 @@ static int acpi_button_add(struct acpi_device *device)
lid_device = device;
}
- if (device->wakeup.flags.valid) {
- /* Button's GPE is run-wake GPE */
- acpi_enable_gpe(device->wakeup.gpe_device,
- device->wakeup.gpe_number);
- if (!device_may_wakeup(&device->dev)) {
- device_set_wakeup_enable(&device->dev, true);
- button->wakeup_enabled = true;
- }
- }
+ /* Button GPEs have been enabled in the acpi_wakeup_device_list()*/
+ if (device->wakeup.flags.valid)
+ button->wakeup_enabled = true;
printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device));
return 0;
--
1.8.2.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Update PATCH] ACPI/Button: Fix enable Button GPEs twice
2013-12-06 8:32 [Update PATCH] ACPI/Button: Fix enable Button GPEs twice Lan Tianyu
@ 2013-12-06 8:59 ` Aaron Lu
0 siblings, 0 replies; 2+ messages in thread
From: Aaron Lu @ 2013-12-06 8:59 UTC (permalink / raw)
To: Lan Tianyu, lenb, rjw; +Cc: linux-acpi, linux-kernel
On 12/06/2013 04:32 PM, Lan Tianyu wrote:
> Button GPEs have been enabled in the acpi_wake_device_init() during
> boot and Button driver enables these GPEs second time. This causes
> disabling these gpes via sysfs interface requires twice "echo disable
>> /sys/firmware/acpi/interrupts/gpeXXX". This patch is to remove
> related code in the Button driver.
>
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
> ---
> Update:
> fix a typo, sorry for noise.
>
> drivers/acpi/button.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
> index 9e3a6cb..6643f2d 100644
> --- a/drivers/acpi/button.c
> +++ b/drivers/acpi/button.c
> @@ -406,15 +406,9 @@ static int acpi_button_add(struct acpi_device *device)
> lid_device = device;
> }
>
> - if (device->wakeup.flags.valid) {
> - /* Button's GPE is run-wake GPE */
> - acpi_enable_gpe(device->wakeup.gpe_device,
> - device->wakeup.gpe_number);
> - if (!device_may_wakeup(&device->dev)) {
> - device_set_wakeup_enable(&device->dev, true);
> - button->wakeup_enabled = true;
> - }
> - }
> + /* Button GPEs have been enabled in the acpi_wakeup_device_list()*/
> + if (device->wakeup.flags.valid)
> + button->wakeup_enabled = true;
It doesn't seem we need this wakeup_enabled flag anymore, since we want
button/lid's GPE to be always enabled no matter if button driver is in
use or not and we have already taken care of this in
acpi_wakeup_device_init function, we can drop it from button driver.
Thanks,
Aaron
>
> printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device));
> return 0;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-06 8:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-06 8:32 [Update PATCH] ACPI/Button: Fix enable Button GPEs twice Lan Tianyu
2013-12-06 8:59 ` Aaron Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).