Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: tas5086: use sleeping variants of gpiod API

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>
Link: https://patch.msgid.link/ZsPty8oNMQk4YTl1@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dmitry Torokhov and committed by
Mark Brown
5f83ee4b e6c1d906

+5 -4
+5 -4
sound/soc/codecs/tas5086.c
··· 463 463 { 464 464 if (priv->reset) { 465 465 /* Reset codec - minimum assertion time is 400ns */ 466 - gpiod_direction_output(priv->reset, 1); 466 + gpiod_set_value_cansleep(priv->reset, 1); 467 467 udelay(1); 468 - gpiod_set_value(priv->reset, 0); 468 + gpiod_set_value_cansleep(priv->reset, 0); 469 469 470 470 /* Codec needs ~15ms to wake up */ 471 471 msleep(15); ··· 866 866 { 867 867 struct tas5086_private *priv = snd_soc_component_get_drvdata(component); 868 868 869 - if (priv->reset) 869 + if (priv->reset) { 870 870 /* Set codec to the reset state */ 871 - gpiod_set_value(priv->reset, 1); 871 + gpiod_set_value_cansleep(priv->reset, 1); 872 + } 872 873 873 874 regulator_bulk_disable(ARRAY_SIZE(priv->supplies), priv->supplies); 874 875 };