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: fsl: imx-es8328: Switch to using gpiod API

This updates the driver to gpiod API, and removes yet another use of
of_get_named_gpio().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240318200804.181516-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Andy Shevchenko and committed by
Mark Brown
9855f05e 3ca49e7f

+10 -6
+10 -6
sound/soc/fsl/imx-es8328.c
··· 3 3 // Copyright 2012 Freescale Semiconductor, Inc. 4 4 // Copyright 2012 Linaro Ltd. 5 5 6 - #include <linux/gpio.h> 6 + #include <linux/gpio/consumer.h> 7 7 #include <linux/module.h> 8 8 #include <linux/of.h> 9 9 #include <linux/of_platform.h> ··· 23 23 struct snd_soc_card card; 24 24 char codec_dai_name[DAI_NAME_SIZE]; 25 25 char platform_name[DAI_NAME_SIZE]; 26 - int jack_gpio; 26 + struct gpio_desc *jack_gpiod; 27 27 }; 28 28 29 29 static struct snd_soc_jack_gpio headset_jack_gpios[] = { ··· 54 54 struct imx_es8328_data, card); 55 55 int ret = 0; 56 56 57 - /* Headphone jack detection */ 58 - if (gpio_is_valid(data->jack_gpio)) { 57 + if (data->jack_gpiod) { 58 + /* Headphone jack detection */ 59 59 ret = snd_soc_card_jack_new_pins(rtd->card, "Headphone", 60 60 SND_JACK_HEADSET | SND_JACK_BTN_0, 61 61 &headset_jack, ··· 64 64 if (ret) 65 65 return ret; 66 66 67 - headset_jack_gpios[0].gpio = data->jack_gpio; 67 + headset_jack_gpios[0].desc = data->jack_gpiod; 68 68 ret = snd_soc_jack_add_gpios(&headset_jack, 69 69 ARRAY_SIZE(headset_jack_gpios), 70 70 headset_jack_gpios); ··· 174 174 175 175 data->dev = dev; 176 176 177 - data->jack_gpio = of_get_named_gpio(pdev->dev.of_node, "jack-gpio", 0); 177 + data->jack_gpiod = devm_gpiod_get_optional(dev, "jack", GPIOD_IN); 178 + if (IS_ERR(data->jack_gpiod)) { 179 + ret = PTR_ERR(data->jack_gpiod); 180 + goto put_device; 181 + } 178 182 179 183 /* 180 184 * CPU == Platform