ASoC: rockchip: multicodecs: update headphone jack

We need to specify a pin description to create a
new soc jack kctl and report to userspace.

Change-Id: I46f665bd4009c0779a5c9cc3f6b9d43123b54883
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
This commit is contained in:
Xing Zheng
2019-06-19 10:31:56 +08:00
committed by Tao Huang
parent 480771a97d
commit 150909a9b3

View File

@@ -48,6 +48,17 @@ struct multicodecs_data {
};
static struct snd_soc_jack mc_hp_jack;
static struct snd_soc_jack_pin mc_hp_jack_pins[] = {
{
/*
* The name of pin must be 'Headphone', it will be combine
* 'Jack' as 'Headphone Jack', then, the ALSA UCM will identify
* it.
*/
.pin = "Headphone",
.mask = SND_JACK_HEADPHONE,
},
};
static int rk_multicodecs_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
@@ -86,9 +97,11 @@ static int rk_dailink_init(struct snd_soc_pcm_runtime *rtd)
struct multicodecs_data *mc_data = snd_soc_card_get_drvdata(rtd->card);
if (mc_data->codec_hp_det) {
snd_soc_card_jack_new(rtd->card, "Headphones",
snd_soc_card_jack_new(rtd->card, "Headphone Jack",
SND_JACK_HEADPHONE,
&mc_hp_jack, NULL, 0);
&mc_hp_jack,
mc_hp_jack_pins,
ARRAY_SIZE(mc_hp_jack_pins));
#ifdef CONFIG_SND_SOC_RK3308
rk3308_codec_set_jack_detect(rtd->codec, &mc_hp_jack);