public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: tas5086: use sleeping variants of gpiod API
@ 2024-08-20  1:13 Dmitry Torokhov
  2024-08-20 14:19 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Torokhov @ 2024-08-20  1:13 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Jaroslav Kysela, Linus Walleij, linux-sound,
	linux-kernel

The driver does not access reset GPIO in atomic contexts so it is usable
with GPIOs that may sleep during access. Switch to using
gpiod_set_value_cansleep().

Also the reset GPIO is configured as output at the time it is acquired,
there is no need to use gpiod_direction_output() when executing reset
sequence.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 sound/soc/codecs/tas5086.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
index 4bc1fdd232bb..b97c0e885713 100644
--- a/sound/soc/codecs/tas5086.c
+++ b/sound/soc/codecs/tas5086.c
@@ -463,9 +463,9 @@ static void tas5086_reset(struct tas5086_private *priv)
 {
 	if (priv->reset) {
 		/* Reset codec - minimum assertion time is 400ns */
-		gpiod_direction_output(priv->reset, 1);
+		gpiod_set_value_cansleep(priv->reset, 1);
 		udelay(1);
-		gpiod_set_value(priv->reset, 0);
+		gpiod_set_value_cansleep(priv->reset, 0);
 
 		/* Codec needs ~15ms to wake up */
 		msleep(15);
@@ -866,9 +866,10 @@ static void tas5086_remove(struct snd_soc_component *component)
 {
 	struct tas5086_private *priv = snd_soc_component_get_drvdata(component);
 
-	if (priv->reset)
+	if (priv->reset) {
 		/* Set codec to the reset state */
-		gpiod_set_value(priv->reset, 1);
+		gpiod_set_value_cansleep(priv->reset, 1);
+	}
 
 	regulator_bulk_disable(ARRAY_SIZE(priv->supplies), priv->supplies);
 };
-- 
2.46.0.184.g6999bdac58-goog


-- 
Dmitry

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: tas5086: use sleeping variants of gpiod API
  2024-08-20  1:13 [PATCH] ASoC: tas5086: use sleeping variants of gpiod API Dmitry Torokhov
@ 2024-08-20 14:19 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2024-08-20 14:19 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Liam Girdwood, Jaroslav Kysela, Linus Walleij, linux-sound,
	linux-kernel

On Mon, 19 Aug 2024 18:13:47 -0700, Dmitry Torokhov wrote:
> The driver does not access reset GPIO in atomic contexts so it is usable
> with GPIOs that may sleep during access. Switch to using
> gpiod_set_value_cansleep().
> 
> Also the reset GPIO is configured as output at the time it is acquired,
> there is no need to use gpiod_direction_output() when executing reset
> sequence.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: tas5086: use sleeping variants of gpiod API
      commit: 5f83ee4b1f0c04a8b4125daab8918606df3dc035

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-20 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20  1:13 [PATCH] ASoC: tas5086: use sleeping variants of gpiod API Dmitry Torokhov
2024-08-20 14:19 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox