mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user