[alsa-devel] [PATCH 1/4] ASoC: rt286: rt286_mic_detect() uses component

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Fri Oct 21 06:29:09 CEST 2016


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

Intel broadwell is using card->codec_dev_list, but it will be
replaced to component list soon. Then, it will not be able to use
"codec". So, rt286_mic_detect() needs to use component instead of
codec. This patch replace it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 sound/soc/codecs/rt286.c           | 6 +++---
 sound/soc/codecs/rt286.h           | 2 +-
 sound/soc/intel/boards/broadwell.c | 6 +++---
 sound/soc/intel/boards/skl_rt286.c | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index 9c365a7..b76e978 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -305,10 +305,10 @@ static void rt286_jack_detect_work(struct work_struct *work)
 		SND_JACK_MICROPHONE | SND_JACK_HEADPHONE);
 }
 
-int rt286_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack)
+int rt286_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack)
 {
-	struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
-	struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec);
+	struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
+	struct rt286_priv *rt286 = snd_soc_component_get_drvdata(component);
 
 	rt286->jack = jack;
 
diff --git a/sound/soc/codecs/rt286.h b/sound/soc/codecs/rt286.h
index 7130edb..c63d0e7 100644
--- a/sound/soc/codecs/rt286.h
+++ b/sound/soc/codecs/rt286.h
@@ -199,7 +199,7 @@ enum {
 	RT286_AIFS,
 };
 
-int rt286_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack);
+int rt286_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack);
 
 #endif /* __RT286_H__ */
 
diff --git a/sound/soc/intel/boards/broadwell.c b/sound/soc/intel/boards/broadwell.c
index 7486a00..c7ff53c 100644
--- a/sound/soc/intel/boards/broadwell.c
+++ b/sound/soc/intel/boards/broadwell.c
@@ -86,7 +86,7 @@ static int broadwell_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
 	if (ret)
 		return ret;
 
-	rt286_mic_detect(codec, &broadwell_headset);
+	rt286_mic_detect(&codec->component, &broadwell_headset);
 	return 0;
 }
 
@@ -225,7 +225,7 @@ static int broadwell_suspend(struct snd_soc_card *card){
 	list_for_each_entry(codec, &card->codec_dev_list, card_list) {
 		if (!strcmp(codec->component.name, "i2c-INT343A:00")) {
 			dev_dbg(codec->dev, "disabling jack detect before going to suspend.\n");
-			rt286_mic_detect(codec, NULL);
+			rt286_mic_detect(&codec->component, NULL);
 			break;
 		}
 	}
@@ -238,7 +238,7 @@ static int broadwell_resume(struct snd_soc_card *card){
 	list_for_each_entry(codec, &card->codec_dev_list, card_list) {
 		if (!strcmp(codec->component.name, "i2c-INT343A:00")) {
 			dev_dbg(codec->dev, "enabling jack detect for resume.\n");
-			rt286_mic_detect(codec, &broadwell_headset);
+			rt286_mic_detect(&codec->component, &broadwell_headset);
 			break;
 		}
 	}
diff --git a/sound/soc/intel/boards/skl_rt286.c b/sound/soc/intel/boards/skl_rt286.c
index 88c61e8..55b704b 100644
--- a/sound/soc/intel/boards/skl_rt286.c
+++ b/sound/soc/intel/boards/skl_rt286.c
@@ -143,7 +143,7 @@ static int skylake_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
 	if (ret)
 		return ret;
 
-	rt286_mic_detect(codec, &skylake_headset);
+	rt286_mic_detect(&codec->component, &skylake_headset);
 
 	snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
 
-- 
1.9.1



More information about the Alsa-devel mailing list