ASoC: rt5640: Convert to just use GPIO descriptors
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 17 Aug 2023 14:03:17 +0000 (16:03 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 17 Aug 2023 14:10:10 +0000 (15:10 +0100)
commita9b5f21073c0c687068f17e23385ec43fc643b08
tree39c54f773be77e0a497ba9b6131411d3548da64e
parent17b9f4387ebabb19b871bbe2d06562e48e4e7130
ASoC: rt5640: Convert to just use GPIO descriptors

The RT5640 driver is already using GPIO descriptors for some
stuff, all that is needed is to convert the remaining LDO1
control line to also use descriptors.

Simplify the code using gpiod_get_optional() and drop the
special "of" parsing function: these descriptors need not
come from device tree and it's optional so hey.

Keep some NULL checks around the GPIO operations even though
gpiolib is essentially NULL-tolerant, because by checking
for whether we have a valid GPIO descriptor or not we can
avoid a 400 ms delay which is great.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230817-descriptors-asoc-rt-v2-1-02fa2ca3e5b0@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5640.c
sound/soc/codecs/rt5640.h