From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Zhu Jun <zhujun2@cmss.chinamobile.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: mpr121 - propagate suspend and resume write errors
Date: Sun, 22 Nov 2026 22:34:44 -0800 [thread overview]
Message-ID: <awPeWz0BrERX1YOA@google.com> (raw)
In-Reply-To: <20261112071728.154571-1-zhujun2@cmss.chinamobile.com>
Hi Zhu,
On Thu, Nov 12, 2026 at 03:17:27PM +0800, Zhu Jun wrote:
> The power management callbacks ignore failures when disabling and
> re-enabling the touch electrodes. A failed resume write can leave
> the keyboard disabled while the PM core is told that resume succeeded.
>
> Return the SMBus write result from both callbacks.
How does it improve system behavior in practical terms?
>
> Fixes: 36682b81de32 ("Input: add driver FSL MPR121 capacitive touch sensor")
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
> ---
> drivers/input/keyboard/mpr121_touchkey.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c
> index 06329cf5c749..973fbc5521a8 100644
> --- a/drivers/input/keyboard/mpr121_touchkey.c
> +++ b/drivers/input/keyboard/mpr121_touchkey.c
> @@ -302,9 +302,7 @@ static int mpr_suspend(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
>
> - i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, 0x00);
> -
> - return 0;
> + return i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, 0x00);
> }
>
> static int mpr_resume(struct device *dev)
> @@ -312,10 +310,8 @@ static int mpr_resume(struct device *dev)
> struct i2c_client *client = to_i2c_client(dev);
> struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client);
>
> - i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR,
> + return i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR,
> mpr121->keycount);
> -
> - return 0;
> }
>
> static DEFINE_SIMPLE_DEV_PM_OPS(mpr121_touchkey_pm_ops, mpr_suspend, mpr_resume);
Thanks.
--
Dmitry
prev parent reply other threads:[~2026-11-23 6:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 7:17 [PATCH] Input: mpr121 - propagate suspend and resume write errors Zhu Jun
2026-11-23 6:34 ` Dmitry Torokhov [this message]
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=awPeWz0BrERX1YOA@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zhujun2@cmss.chinamobile.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