From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Shengjiu Wang <shengjiu.wang@nxp.com>
Cc: david.rhodes@cirrus.com, rf@opensource.cirrus.com,
lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
tiwai@suse.com, linux-sound@vger.kernel.org,
patches@opensource.cirrus.com, linux-kernel@vger.kernel.org,
shengjiu.wang@gmail.com
Subject: Re: [PATCH] ASoC: cs42xx8: Move reset operation to runtime resume
Date: Tue, 17 Jun 2025 10:01:09 +0100 [thread overview]
Message-ID: <aFEu1dsFNSSN8vKo@opensource.cirrus.com> (raw)
In-Reply-To: <20250617074334.3229001-1-shengjiu.wang@nxp.com>
On Tue, Jun 17, 2025 at 03:43:34PM +0800, Shengjiu Wang wrote:
> When codec is in idle state, the runtime suspend is executed, if codec
> has been reset and user wants to use i2ctransfer command to get the
> codec registers, i2c access will fail.
>
> Move reset operation to the runtime resume stage to avoid such issues.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> ---
> sound/soc/codecs/cs42xx8.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c
> index 6a925f3f7137..be215cd2a714 100644
> --- a/sound/soc/codecs/cs42xx8.c
> +++ b/sound/soc/codecs/cs42xx8.c
> @@ -617,6 +617,7 @@ static int cs42xx8_runtime_resume(struct device *dev)
> return ret;
> }
>
> + gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 1);
> gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 0);
>
> ret = regulator_bulk_enable(ARRAY_SIZE(cs42xx8->supplies),
> @@ -658,8 +659,6 @@ static int cs42xx8_runtime_suspend(struct device *dev)
> regulator_bulk_disable(ARRAY_SIZE(cs42xx8->supplies),
> cs42xx8->supplies);
>
> - gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 1);
> -
This makes no sense the line before this is disabling all the
supplies. This code is parking the chip in a turned off state
and it is better for it to be in reset for that. If you want to
access the chip directly from user-space during runtime suspend
you need to runtime resume it first, I believe that can be done
through sysfs.
Thanks,
Charles
prev parent reply other threads:[~2025-06-17 9:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 7:43 [PATCH] ASoC: cs42xx8: Move reset operation to runtime resume Shengjiu Wang
2025-06-17 9:01 ` Charles Keepax [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=aFEu1dsFNSSN8vKo@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=david.rhodes@cirrus.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=rf@opensource.cirrus.com \
--cc=shengjiu.wang@gmail.com \
--cc=shengjiu.wang@nxp.com \
--cc=tiwai@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.