summaryrefslogtreecommitdiffstats
path: root/sound/soc/rockchip
diff options
context:
space:
mode:
authorBrian Norris <briannorris@chromium.org>2022-01-15 00:02:09 +0100
committerMark Brown <broonie@kernel.org>2022-01-28 16:59:27 +0100
commit6a8bc4b68ca0c6ef73518b692c00b7e1e010d056 (patch)
tree7a54271ed7170ba28573e43ed35b1fd9544e54ec /sound/soc/rockchip
parentdrm/rockchip: cdn-dp: Support HDMI codec plug-change callback (diff)
downloadlinux-6a8bc4b68ca0c6ef73518b692c00b7e1e010d056.tar.xz
linux-6a8bc4b68ca0c6ef73518b692c00b7e1e010d056.zip
ASoC: rk3399_gru_sound: Wire up DP jack detection
Now that the cdn-dp driver supports plug-change callbacks, let's wire it up. Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://lore.kernel.org/r/20220114150129.v2.3.I3c79b1466c14b02980071221e5b99283cd26ec77@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/rockchip')
-rw-r--r--sound/soc/rockchip/rk3399_gru_sound.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index e2d52d8d0ff9..eeef3ed70037 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -164,6 +164,25 @@ static int rockchip_sound_da7219_hw_params(struct snd_pcm_substream *substream,
return 0;
}
+static struct snd_soc_jack cdn_dp_card_jack;
+
+static int rockchip_sound_cdndp_init(struct snd_soc_pcm_runtime *rtd)
+{
+ struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
+ struct snd_soc_card *card = rtd->card;
+ int ret;
+
+ /* Enable jack detection. */
+ ret = snd_soc_card_jack_new(card, "DP Jack", SND_JACK_LINEOUT,
+ &cdn_dp_card_jack, NULL, 0);
+ if (ret) {
+ dev_err(card->dev, "Can't create DP Jack %d\n", ret);
+ return ret;
+ }
+
+ return snd_soc_component_set_jack(component, &cdn_dp_card_jack, NULL);
+}
+
static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
@@ -315,6 +334,7 @@ static const struct snd_soc_dai_link rockchip_dais[] = {
[DAILINK_CDNDP] = {
.name = "DP",
.stream_name = "DP PCM",
+ .init = rockchip_sound_cdndp_init,
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBS_CFS,
SND_SOC_DAILINK_REG(cdndp),