Re: [PATCH v1 1/2] dt-bindings: input: atmel,maxtouch: add poweroff-in-suspend property
From: Stefan Eichenberger
Date: Fri Dec 08 2023 - 08:11:30 EST
Hi Krzysztof and Linux,
On Fri, Dec 08, 2023 at 01:54:21PM +0100, Linus Walleij wrote:
> On Thu, Dec 7, 2023 at 12:13 PM Stefan Eichenberger <eichest@xxxxxxxxx> wrote:
>
> > From: Stefan Eichenberger <stefan.eichenberger@xxxxxxxxxxx>
> >
> > Add a new property to indicate that the device should be powered off in
> > suspend mode.
> >
> > Signed-off-by: Stefan Eichenberger <stefan.eichenberger@xxxxxxxxxxx>
> (...)
> > + atmel,poweroff-in-suspend:
> > + description: |
> > + When this property is set, all supplies are turned off when the system is
> > + going to suspend.
> > + type: boolean
> wakeup-source:
> type: boolean
>
> As Krzysztof says it seems you are describing an operating system feature.
>
> I can't help but wonder: shouldn't that pretty much be the default behaviour
> if wakeup-source is *not* specified?
>
> I.e. the property kind of describes !wakeup-source.
The maxtouch controller has a deep sleep mode which is currently used
without powering down vdd and vdda. However, because we have a shared
regulator which powers other peripherals that we want to shut down in
suspend we need a way to power down vdd and vdda. However, I agree this
is not really a feature of the device. The feature would basically be
the internal deep sleep mode. I didn't want to change the default
behaviour of the driver, so I added this property but maybe I could
change it to:
atmel,deep-sleep:
description: |
Use the maxtouch deep-sleep mode instead of powering down vdd and
vdda.
Or to not change the default behaviour:
atmel,no-deep-sleep:
description: |
Do not use the maxtouch deep-sleep mode but power down vdd and vdda
in suspend.
As I understand the datasheet even if the maxtouch is using its deep
sleep mode it does not act as a wakeup source. It is just faster in
waking up because it can keep the configuration in memory.
Regards,
Stefan