summaryrefslogtreecommitdiff
path: root/sound/soc/ti/omap-twl4030.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2023-10-02 18:17:47 +0300
committerMark Brown <broonie@kernel.org>2023-10-02 18:17:47 +0300
commita9b696c851c226b8fa89faeb56e581a8f077924b (patch)
tree94c4145dd2477545598db562d8a5dbc0a9529eba /sound/soc/ti/omap-twl4030.c
parent4c556d1ea5a771a91f946964d931b4974a6b917e (diff)
parent67ebde42034ec8d199ec7877efed4bd08eb0c5e0 (diff)
downloadlinux-a9b696c851c226b8fa89faeb56e581a8f077924b.tar.xz
GPIO descriptors for TI ASoC codecs
Merge series from Linus Walleij <linus.walleij@linaro.org>: This cleans up and rewrites the GPIO usage in the TI ASoC components to use GPIO descriptors exclusively. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- Linus Walleij (5): ASoC: ti: Convert N810 ASoC to GPIO descriptors ASoC: ti: Convert RX51 to use exclusively GPIO descriptors ASoC: ti: Convert TWL4030 to use GPIO descriptors ASoC: ti: Convert Pandora ASoC to GPIO descriptors ASoC: ti: osk5912: Drop unused include arch/arm/mach-omap2/board-n8x0.c | 10 +++++ arch/arm/mach-omap2/pdata-quirks.c | 10 +++++ include/linux/platform_data/omap-twl4030.h | 3 -- sound/soc/ti/n810.c | 31 ++++++++------- sound/soc/ti/omap-twl4030.c | 20 ++++------ sound/soc/ti/omap3pandora.c | 63 +++++++++++------------------- sound/soc/ti/osk5912.c | 1 - sound/soc/ti/rx51.c | 19 ++------- 8 files changed, 72 insertions(+), 85 deletions(-) --- base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d change-id: 20230922-descriptors-asoc-ti-a852eff479ed Best regards, -- Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'sound/soc/ti/omap-twl4030.c')
-rw-r--r--sound/soc/ti/omap-twl4030.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/sound/soc/ti/omap-twl4030.c b/sound/soc/ti/omap-twl4030.c
index a3ad1a2df1c7..a402d66e4f4d 100644
--- a/sound/soc/ti/omap-twl4030.c
+++ b/sound/soc/ti/omap-twl4030.c
@@ -20,8 +20,6 @@
#include <linux/platform_data/omap-twl4030.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/gpio.h>
-#include <linux/of_gpio.h>
#include <sound/core.h>
#include <sound/pcm.h>
@@ -31,7 +29,6 @@
#include "omap-mcbsp.h"
struct omap_twl4030 {
- int jack_detect; /* board can detect jack events */
struct snd_soc_jack hs_jack;
};
@@ -130,7 +127,7 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
/* Headset jack detection gpios */
static struct snd_soc_jack_gpio hs_jack_gpios[] = {
{
- .name = "hsdet-gpio",
+ .name = "ti,jack-det",
.report = SND_JACK_HEADSET,
.debounce_time = 200,
},
@@ -151,9 +148,13 @@ static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
struct omap_twl4030 *priv = snd_soc_card_get_drvdata(card);
int ret = 0;
- /* Headset jack detection only if it is supported */
- if (priv->jack_detect > 0) {
- hs_jack_gpios[0].gpio = priv->jack_detect;
+ /*
+ * This is a bit of a hack, but the GPIO is optional so we
+ * only want to add the jack detection if the GPIO is there.
+ */
+ if (of_property_present(card->dev->of_node, "ti,jack-det-gpio")) {
+ hs_jack_gpios[0].gpiod_dev = card->dev;
+ hs_jack_gpios[0].idx = 0;
ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack",
SND_JACK_HEADSET,
@@ -279,9 +280,6 @@ static int omap_twl4030_probe(struct platform_device *pdev)
omap_twl4030_dai_links[1].platforms->of_node = dai_node;
}
- priv->jack_detect = of_get_named_gpio(node,
- "ti,jack-det-gpio", 0);
-
/* Optional: audio routing can be provided */
prop = of_find_property(node, "ti,audio-routing", NULL);
if (prop) {
@@ -302,8 +300,6 @@ static int omap_twl4030_probe(struct platform_device *pdev)
if (!pdata->voice_connected)
card->num_links = 1;
-
- priv->jack_detect = pdata->jack_detect;
} else {
dev_err(&pdev->dev, "Missing pdata\n");
return -ENODEV;