summaryrefslogtreecommitdiff
path: root/sound/soc/samsung
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@gmail.com>2022-04-08 13:11:14 +0900
committerMark Brown <broonie@kernel.org>2022-04-14 17:37:21 +0100
commit19aed2d6cdb72a7c92909832b9480d9cadebeef9 (patch)
tree405c75c54a6dc39655717c69f80734734b459d43 /sound/soc/samsung
parent5947b2726beb61fe7911580f239222ec9c4f6967 (diff)
ASoC: soc-card: Create jack kcontrol without pins
snd_soc_card_jack_new() allowed to create jack kcontrol without pins, but did not create kcontrols. The jack would not have kcontrols if pins were not going to be added. This renames the old snd_soc_card_jack_new() to snd_soc_card_jack_new_pins() for use when pins are provided or will be added later. The new snd_soc_card_jack_new() appropriately creates a jack for use without pins and adds a kcontrol. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r--sound/soc/samsung/aries_wm8994.c4
-rw-r--r--sound/soc/samsung/h1940_uda1380.c3
-rw-r--r--sound/soc/samsung/littlemill.c2
-rw-r--r--sound/soc/samsung/lowland.c9
-rw-r--r--sound/soc/samsung/midas_wm1811.c2
-rw-r--r--sound/soc/samsung/rx1950_uda1380.c3
-rw-r--r--sound/soc/samsung/smartq_wm8987.c8
-rw-r--r--sound/soc/samsung/speyside.c10
-rw-r--r--sound/soc/samsung/tobermory.c8
9 files changed, 27 insertions, 22 deletions
diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c
index 5265e546b124..5b5fc66885e1 100644
--- a/sound/soc/samsung/aries_wm8994.c
+++ b/sound/soc/samsung/aries_wm8994.c
@@ -343,7 +343,7 @@ static int aries_late_probe(struct snd_soc_card *card)
struct aries_wm8994_data *priv = snd_soc_card_get_drvdata(card);
int ret, irq;
- ret = snd_soc_card_jack_new(card, "Dock", SND_JACK_LINEOUT,
+ ret = snd_soc_card_jack_new_pins(card, "Dock", SND_JACK_LINEOUT,
&aries_dock, dock_pins, ARRAY_SIZE(dock_pins));
if (ret)
return ret;
@@ -361,7 +361,7 @@ static int aries_late_probe(struct snd_soc_card *card)
else
snd_soc_jack_report(&aries_dock, 0, SND_JACK_LINEOUT);
- ret = snd_soc_card_jack_new(card, "Headset",
+ ret = snd_soc_card_jack_new_pins(card, "Headset",
SND_JACK_HEADSET | SND_JACK_BTN_0,
&aries_headset,
jack_pins, ARRAY_SIZE(jack_pins));
diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c
index c994e67d1eaf..907266aee839 100644
--- a/sound/soc/samsung/h1940_uda1380.c
+++ b/sound/soc/samsung/h1940_uda1380.c
@@ -151,7 +151,8 @@ static const struct snd_soc_dapm_route audio_map[] = {
static int h1940_uda1380_init(struct snd_soc_pcm_runtime *rtd)
{
- snd_soc_card_jack_new(rtd->card, "Headphone Jack", SND_JACK_HEADPHONE,
+ snd_soc_card_jack_new_pins(rtd->card, "Headphone Jack",
+ SND_JACK_HEADPHONE,
&hp_jack, hp_jack_pins, ARRAY_SIZE(hp_jack_pins));
snd_soc_jack_add_gpios(&hp_jack, ARRAY_SIZE(hp_jack_gpios),
diff --git a/sound/soc/samsung/littlemill.c b/sound/soc/samsung/littlemill.c
index 26c42892c059..411e25cec591 100644
--- a/sound/soc/samsung/littlemill.c
+++ b/sound/soc/samsung/littlemill.c
@@ -285,7 +285,7 @@ static int littlemill_late_probe(struct snd_soc_card *card)
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
SND_JACK_BTN_2 | SND_JACK_BTN_3 |
SND_JACK_BTN_4 | SND_JACK_BTN_5,
- &littlemill_headset, NULL, 0);
+ &littlemill_headset);
if (ret)
return ret;
diff --git a/sound/soc/samsung/lowland.c b/sound/soc/samsung/lowland.c
index 8e4579fdcd7b..b44f5e92224f 100644
--- a/sound/soc/samsung/lowland.c
+++ b/sound/soc/samsung/lowland.c
@@ -51,10 +51,11 @@ static int lowland_wm5100_init(struct snd_soc_pcm_runtime *rtd)
return ret;
}
- ret = snd_soc_card_jack_new(rtd->card, "Headset", SND_JACK_LINEOUT |
- SND_JACK_HEADSET | SND_JACK_BTN_0,
- &lowland_headset, lowland_headset_pins,
- ARRAY_SIZE(lowland_headset_pins));
+ ret = snd_soc_card_jack_new_pins(rtd->card, "Headset",
+ SND_JACK_LINEOUT | SND_JACK_HEADSET |
+ SND_JACK_BTN_0,
+ &lowland_headset, lowland_headset_pins,
+ ARRAY_SIZE(lowland_headset_pins));
if (ret)
return ret;
diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c
index 5e9dc18687cc..6931b9a45b3e 100644
--- a/sound/soc/samsung/midas_wm1811.c
+++ b/sound/soc/samsung/midas_wm1811.c
@@ -309,7 +309,7 @@ static int midas_late_probe(struct snd_soc_card *card)
SND_JACK_HEADSET | SND_JACK_MECHANICAL |
SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 |
SND_JACK_BTN_3 | SND_JACK_BTN_4 | SND_JACK_BTN_5,
- &priv->headset_jack, NULL, 0);
+ &priv->headset_jack);
if (ret)
return ret;
diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c
index 6ea1c8cc9167..ff3acc94a454 100644
--- a/sound/soc/samsung/rx1950_uda1380.c
+++ b/sound/soc/samsung/rx1950_uda1380.c
@@ -201,7 +201,8 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream,
static int rx1950_uda1380_init(struct snd_soc_pcm_runtime *rtd)
{
- snd_soc_card_jack_new(rtd->card, "Headphone Jack", SND_JACK_HEADPHONE,
+ snd_soc_card_jack_new_pins(rtd->card, "Headphone Jack",
+ SND_JACK_HEADPHONE,
&hp_jack, hp_jack_pins, ARRAY_SIZE(hp_jack_pins));
snd_soc_jack_add_gpios(&hp_jack, ARRAY_SIZE(hp_jack_gpios),
diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c
index cee39ad16667..29bf917242fe 100644
--- a/sound/soc/samsung/smartq_wm8987.c
+++ b/sound/soc/samsung/smartq_wm8987.c
@@ -139,10 +139,10 @@ static int smartq_wm8987_init(struct snd_soc_pcm_runtime *rtd)
snd_soc_dapm_nc_pin(dapm, "ROUT1");
/* Headphone jack detection */
- err = snd_soc_card_jack_new(rtd->card, "Headphone Jack",
- SND_JACK_HEADPHONE, &smartq_jack,
- smartq_jack_pins,
- ARRAY_SIZE(smartq_jack_pins));
+ err = snd_soc_card_jack_new_pins(rtd->card, "Headphone Jack",
+ SND_JACK_HEADPHONE, &smartq_jack,
+ smartq_jack_pins,
+ ARRAY_SIZE(smartq_jack_pins));
if (err)
return err;
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c
index 1ae1a5aae72f..69d7b0115b38 100644
--- a/sound/soc/samsung/speyside.c
+++ b/sound/soc/samsung/speyside.c
@@ -156,10 +156,12 @@ static int speyside_wm8996_init(struct snd_soc_pcm_runtime *rtd)
pr_err("Failed to request HP_SEL GPIO: %d\n", ret);
gpio_direction_output(WM8996_HPSEL_GPIO, speyside_jack_polarity);
- ret = snd_soc_card_jack_new(rtd->card, "Headset", SND_JACK_LINEOUT |
- SND_JACK_HEADSET | SND_JACK_BTN_0,
- &speyside_headset, speyside_headset_pins,
- ARRAY_SIZE(speyside_headset_pins));
+ ret = snd_soc_card_jack_new_pins(rtd->card, "Headset",
+ SND_JACK_LINEOUT | SND_JACK_HEADSET |
+ SND_JACK_BTN_0,
+ &speyside_headset,
+ speyside_headset_pins,
+ ARRAY_SIZE(speyside_headset_pins));
if (ret)
return ret;
diff --git a/sound/soc/samsung/tobermory.c b/sound/soc/samsung/tobermory.c
index 4a56abfc243e..9287a1d0eef1 100644
--- a/sound/soc/samsung/tobermory.c
+++ b/sound/soc/samsung/tobermory.c
@@ -189,10 +189,10 @@ static int tobermory_late_probe(struct snd_soc_card *card)
if (ret < 0)
return ret;
- ret = snd_soc_card_jack_new(card, "Headset", SND_JACK_HEADSET |
- SND_JACK_BTN_0, &tobermory_headset,
- tobermory_headset_pins,
- ARRAY_SIZE(tobermory_headset_pins));
+ ret = snd_soc_card_jack_new_pins(card, "Headset", SND_JACK_HEADSET |
+ SND_JACK_BTN_0, &tobermory_headset,
+ tobermory_headset_pins,
+ ARRAY_SIZE(tobermory_headset_pins));
if (ret)
return ret;