From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Stefan Eichenberger <eichest@gmail.com>
Cc: nick@shmanahar.org, robh@kernel.org,
krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
claudiu.beznea@tuxon.dev, linus.walleij@linaro.org,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Stefan Eichenberger <stefan.eichenberger@toradex.com>
Subject: Re: [PATCH v4 4/4] Input: atmel_mxt_ts - add support for poweroff-sleep
Date: Wed, 19 Jun 2024 18:12:45 -0700 [thread overview]
Message-ID: <ZnOCDaetFnsg09if@google.com> (raw)
In-Reply-To: <20240417090527.15357-5-eichest@gmail.com>
Hi Stefan,
On Wed, Apr 17, 2024 at 11:05:27AM +0200, Stefan Eichenberger wrote:
> From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
>
> Add support for poweroff-sleep to the Atmel maXTouch driver. This allows
> us to power off the input device entirely and only power it on when it
> is opened. This will also automatically power it off when we suspend the
> system.
>
> Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> ---
> drivers/input/touchscreen/atmel_mxt_ts.c | 71 +++++++++++++++++++-----
> 1 file changed, 57 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 7c807d1f1f9b..f92808be3f5b 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -317,6 +317,7 @@ struct mxt_data {
> struct gpio_desc *reset_gpio;
> struct gpio_desc *wake_gpio;
> bool use_retrigen_workaround;
> + bool poweroff_sleep;
Why is this separate from "enum mxt_suspend_mode suspend_mode"? Can we
make MXT_SUSPEND_POWEROFF and use it in mxt_start() and others? It still
can be driven by the "atmel,poweroff-sleep" device property.
>
> /* Cached parameters from object table */
> u16 T5_address;
> @@ -2277,6 +2278,19 @@ static void mxt_config_cb(const struct firmware *cfg, void *ctx)
> release_firmware(cfg);
> }
>
> +static int mxt_initialize_after_resume(struct mxt_data *data)
> +{
> + const struct firmware *fw;
> +
> + mxt_acquire_irq(data);
> +
> + firmware_request_nowarn(&fw, MXT_CFG_NAME, &data->client->dev);
> +
> + mxt_config_cb(fw, data);
Is this really required? As far as I know all maXTouch controllers have
NVRAM for their configs and should not lose configuration even if power
is cut off. In fact, the whole automatic request of firmware/config upon
probe I think was a mistake and I would like to get rid of it. In fact,
on Chrome OS the version of the driver in use does not do that and
instead relies on userspace to check if firmware update is needed.
If this is actually required you need to add error handling.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2024-06-20 1:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 9:05 [PATCH v4 0/4] Add a property to turn off the max touch controller if not used Stefan Eichenberger
2024-04-17 9:05 ` [PATCH v4 1/4] Input: atmel_mxt_ts - add power off and power on functions Stefan Eichenberger
2024-06-20 15:37 ` Dmitry Torokhov
2024-06-21 14:38 ` Stefan Eichenberger
2024-07-09 4:55 ` Dmitry Torokhov
2024-04-17 9:05 ` [PATCH v4 2/4] Input: atmel_mxt_ts - move calls to register the input device to separate function Stefan Eichenberger
2024-04-17 9:05 ` [PATCH v4 3/4] dt-bindings: input: atmel,maxtouch: add poweroff-sleep property Stefan Eichenberger
2024-04-17 9:05 ` [PATCH v4 4/4] Input: atmel_mxt_ts - add support for poweroff-sleep Stefan Eichenberger
2024-06-20 1:12 ` Dmitry Torokhov [this message]
2024-06-21 14:31 ` Stefan Eichenberger
2024-04-17 11:12 ` [PATCH v4 0/4] Add a property to turn off the max touch controller if not used Joao Paulo Goncalves
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=ZnOCDaetFnsg09if@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eichest@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nick@shmanahar.org \
--cc=nicolas.ferre@microchip.com \
--cc=robh@kernel.org \
--cc=stefan.eichenberger@toradex.com \
/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;
as well as URLs for NNTP newsgroup(s).