diff --git a/sound/soc/rockchip/rockchip_multicodecs.c b/sound/soc/rockchip/rockchip_multicodecs.c index d136ff3ffe59..7961b47913d5 100644 --- a/sound/soc/rockchip/rockchip_multicodecs.c +++ b/sound/soc/rockchip/rockchip_multicodecs.c @@ -432,9 +432,16 @@ static int rk_dailink_init(struct snd_soc_pcm_runtime *rtd) mc_data->jack_headset = jack_headset; if (mc_data->codec_hp_det) { - struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; + struct snd_soc_dai *codec_dai; + int i; - snd_soc_component_set_jack(component, jack_headset, NULL); + /* set jack for the first successful one */ + for_each_rtd_codec_dais(rtd, i, codec_dai) { + ret = snd_soc_component_set_jack(codec_dai->component, + jack_headset, NULL); + if (ret >= 0) + break; + } } else { irq = gpiod_to_irq(mc_data->hp_det_gpio); if (irq >= 0) {