summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5640.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2023-08-17 17:03:17 +0300
committerMark Brown <broonie@kernel.org>2023-08-17 17:10:10 +0300
commita9b5f21073c0c687068f17e23385ec43fc643b08 (patch)
tree39c54f773be77e0a497ba9b6131411d3548da64e /sound/soc/codecs/rt5640.h
parent17b9f4387ebabb19b871bbe2d06562e48e4e7130 (diff)
downloadlinux-a9b5f21073c0c687068f17e23385ec43fc643b08.tar.xz
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>
Diffstat (limited to 'sound/soc/codecs/rt5640.h')
-rw-r--r--sound/soc/codecs/rt5640.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h
index 9847a1ae01f4..94b9a502f7f9 100644
--- a/sound/soc/codecs/rt5640.h
+++ b/sound/soc/codecs/rt5640.h
@@ -2138,7 +2138,7 @@ struct rt5640_priv {
struct regmap *regmap;
struct clk *mclk;
- int ldo1_en; /* GPIO for LDO1_EN */
+ struct gpio_desc *ldo1_en; /* GPIO for LDO1_EN */
int irq;
int jd_gpio_irq;
int sysclk;