diff mbox series

[3/3] Input: axp20x-pek - Enable wakeup for all AXP variants

Message ID 20200113032032.38709-3-samuel@sholland.org (mailing list archive)
State New, archived
Headers show
Series [1/3] Input: axp20x-pek - Remove unique wakeup event handling | expand

Commit Message

Samuel Holland Jan. 13, 2020, 3:20 a.m. UTC
There are many devices, including several mobile battery-powered
devices, using other AXP variants as their PMIC. Enable them to use
the power key as a wakeup source.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 drivers/input/misc/axp20x-pek.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Hans de Goede Jan. 13, 2020, 10:48 a.m. UTC | #1
Hi,

On 13-01-2020 04:20, Samuel Holland wrote:
> There are many devices, including several mobile battery-powered
> devices, using other AXP variants as their PMIC. Enable them to use
> the power key as a wakeup source.
> 
> Signed-off-by: Samuel Holland <samuel@sholland.org>


Patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans

> ---
>   drivers/input/misc/axp20x-pek.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
> index 38cd4a4aeb65..b910c1798e4e 100644
> --- a/drivers/input/misc/axp20x-pek.c
> +++ b/drivers/input/misc/axp20x-pek.c
> @@ -279,8 +279,7 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,
>   		return error;
>   	}
>   
> -	if (axp20x_pek->axp20x->variant == AXP288_ID)
> -		device_init_wakeup(&pdev->dev, true);
> +	device_init_wakeup(&pdev->dev, true);
>   
>   	return 0;
>   }
>
Dmitry Torokhov Jan. 13, 2020, 9:26 p.m. UTC | #2
Hi Samuel,

On Sun, Jan 12, 2020 at 09:20:32PM -0600, Samuel Holland wrote:
> There are many devices, including several mobile battery-powered
> devices, using other AXP variants as their PMIC. Enable them to use
> the power key as a wakeup source.

Are these X86 or ARM devices? If anything, I'd prefer individual drivers
not declare themselves as wakeup sources unconditionally. With devic
etree we have standard "wakeup-source" property, but I am not quite sure
what's the latest on X86...

Thanks.
Hans de Goede Jan. 14, 2020, 9:07 a.m. UTC | #3
Hi,

On 13-01-2020 22:26, Dmitry Torokhov wrote:
> Hi Samuel,
> 
> On Sun, Jan 12, 2020 at 09:20:32PM -0600, Samuel Holland wrote:
>> There are many devices, including several mobile battery-powered
>> devices, using other AXP variants as their PMIC. Enable them to use
>> the power key as a wakeup source.
> 
> Are these X86 or ARM devices? If anything, I'd prefer individual drivers
> not declare themselves as wakeup sources unconditionally. With devic
> etree we have standard "wakeup-source" property, but I am not quite sure
> what's the latest on X86...

The AXP288 variant is X86, the other PMIC models are for ARM
(to the best of my knowledge).

Regards,

Hans
Samuel Holland Jan. 15, 2020, 4:45 a.m. UTC | #4
Hi,

On 1/14/20 3:07 AM, Hans de Goede wrote:
> Hi,
> 
> On 13-01-2020 22:26, Dmitry Torokhov wrote:
>> Hi Samuel,
>>
>> On Sun, Jan 12, 2020 at 09:20:32PM -0600, Samuel Holland wrote:
>>> There are many devices, including several mobile battery-powered
>>> devices, using other AXP variants as their PMIC. Enable them to use
>>> the power key as a wakeup source.
>>
>> Are these X86 or ARM devices? If anything, I'd prefer individual drivers
>> not declare themselves as wakeup sources unconditionally. With devic
>> etree we have standard "wakeup-source" property, but I am not quite sure
>> what's the latest on X86...

Currently wakeup is unconditional. After patch 2, even though it's enabled by
default, the wakeup source can be disabled by userspace:

-		enable_irq_wake(axp20x_pek->irq_dbr);
+		device_init_wakeup(&pdev->dev, true);

This is a platform driver for an MFD cell. It does not have its own device tree
node.

(I see a lot of drivers in drivers/input/misc that generate KEY_POWER, and zero
of them reference "wakeup-source". It's a driver for a power button. Being a
wakeup source is half the purpose of its existence.)

> The AXP288 variant is X86, the other PMIC models are for ARM
> (to the best of my knowledge).

That's also my understanding.

> Regards,
> 
> Hans

Regards,
Samuel
diff mbox series

Patch

diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
index 38cd4a4aeb65..b910c1798e4e 100644
--- a/drivers/input/misc/axp20x-pek.c
+++ b/drivers/input/misc/axp20x-pek.c
@@ -279,8 +279,7 @@  static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,
 		return error;
 	}
 
-	if (axp20x_pek->axp20x->variant == AXP288_ID)
-		device_init_wakeup(&pdev->dev, true);
+	device_init_wakeup(&pdev->dev, true);
 
 	return 0;
 }