[PATCH v2 1/2] ASoC: rt1015p: move SDB control from trigger to DAPM

Mark Brown broonie at kernel.org
Thu Dec 10 19:19:10 CET 2020


On Fri, Dec 11, 2020 at 12:34:52AM +0800, Tzung-Bi Shih wrote:
> On Thu, Dec 10, 2020 at 11:40 PM Mark Brown <broonie at kernel.org> wrote:

> > Now this is in DAPM it's not in atomic context so it'd be more friendly
> > to use gpiod_set_value_cansleep() so that it'll work even if the GPIO
> > isn't atomic safe.

> Strange, I thought I should get a warning message because of the
> following statement in gpiod_set_value (but it didn't):
> WARN_ON(desc->gdev->chip->can_sleep);

> Also I dumped the value from gpiod_cansleep(rt1015p->sdb), it returned 0.

> Is it safe to call gpiod_set_value_cansleep() even if the GPIO
> controller doesn't support it?  (I guess yes, _cansleep could be just
> an advice)

Yes, absolutely - it's the other way around.  _cansleep() is the caller
saying that they support using a GPIO that might sleep when updating
(eg, one connected over I2C), it works with both GPIOs that might sleep
and GPIOs that are atomic safe.  Without _cansleep() only atomic safe
GPIO controllers can be used.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20201210/e6dd1632/attachment.sig>


More information about the Alsa-devel mailing list