[alsa-devel] [PATCH v2 2/2] ASoC: add support for Conexant CX2072X CODEC

Takashi Iwai tiwai at suse.de
Wed Apr 12 07:45:20 CEST 2017


On Tue, 11 Apr 2017 15:31:37 +0200,
Takashi Iwai wrote:
> 
> On Wed, 05 Apr 2017 11:07:14 +0200,
> <simon.ho.cnxt at gmail.com> wrote:
> > 
> > --- /dev/null
> > +++ b/sound/soc/codecs/cx2072x.c
> > +/**
> > + * cx2072x_enable_detect - Enable CX2072X jack detection
> > + * @codec : pointer variable to codec having information related to codec
> > + *
> > + */
> > +int cx2072x_enable_detect(struct snd_soc_codec *codec)
> > +{
> .....
> > +}
> > +EXPORT_SYMBOL_GPL(cx2072x_enable_detect);
> > +
> > +/*
> > + * cx2072x_get_jack_state: Return current jack state.
> > + * @codec : pointer variable to codec having information related to codec
> > + *
> > + */
> > +int cx2072x_get_jack_state(struct snd_soc_codec *codec)
> > +{
> ....
> > +}
> > +EXPORT_SYMBOL_GPL(cx2072x_get_jack_state);
> > --- /dev/null
> > +++ b/sound/soc/codecs/cx2072x.h
> ....
> > +enum cx2072x_jack_types {
> > +	CX_JACK_NONE = 0x0000,
> > +	CX_JACK_HEADPHONE = 0x0001,
> > +	CX_JACK_APPLE_HEADSET = 0x0002,
> > +	CX_JACK_NOKIE_HEADSET = 0x0003,
> > +};
> > +
> > +int cx2072x_hs_jack_report(struct snd_soc_codec *codec);
> 
> This function is nowhere defined.  And the new jack functions
> cx2072x_enable_detect() and cx2072x_get_jack_state() are not declared
> here, either.

Also, some DAPM entries are missing / wrong, obviously.


Takashi

---
 sound/soc/codecs/cx2072x.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/cx2072x.c b/sound/soc/codecs/cx2072x.c
index 52fc2d67d9ed..d095b29420b9 100644
--- a/sound/soc/codecs/cx2072x.c
+++ b/sound/soc/codecs/cx2072x.c
@@ -1629,10 +1629,10 @@ static const struct snd_soc_dapm_widget cx2072x_dapm_widgets[] = {
 	/*Capture*/
 	SND_SOC_DAPM_AIF_OUT("Out AIF", "Capture", 0, SND_SOC_NOPM, 0, 0),
 
-	SND_SOC_DAPM_SWITCH("I2S ADC1", SND_SOC_NOPM, 0, 0, &i2sadc1l_ctl),
-	SND_SOC_DAPM_SWITCH("I2S ADC1", SND_SOC_NOPM, 0, 0, &i2sadc1r_ctl),
-	SND_SOC_DAPM_SWITCH("I2S ADC2", SND_SOC_NOPM, 0, 0, &i2sadc2l_ctl),
-	SND_SOC_DAPM_SWITCH("I2S ADC2", SND_SOC_NOPM, 0, 0, &i2sadc2r_ctl),
+	SND_SOC_DAPM_SWITCH("I2S ADC1L", SND_SOC_NOPM, 0, 0, &i2sadc1l_ctl),
+	SND_SOC_DAPM_SWITCH("I2S ADC1R", SND_SOC_NOPM, 0, 0, &i2sadc1r_ctl),
+	SND_SOC_DAPM_SWITCH("I2S ADC2L", SND_SOC_NOPM, 0, 0, &i2sadc2l_ctl),
+	SND_SOC_DAPM_SWITCH("I2S ADC2R", SND_SOC_NOPM, 0, 0, &i2sadc2r_ctl),
 
 	SND_SOC_DAPM_REG(snd_soc_dapm_adc, "ADC1", CX2072X_ADC1_POWER_STATE,
 			 0, 0xFF, 0x00, 0x03),
@@ -1640,6 +1640,7 @@ static const struct snd_soc_dapm_widget cx2072x_dapm_widgets[] = {
 			 0, 0xFF, 0x00, 0x03),
 
 	SND_SOC_DAPM_MUX("ADC1 Mux", SND_SOC_NOPM, 0, 0, &adc1_mux),
+	SND_SOC_DAPM_MUX("ADC2 Mux", SND_SOC_NOPM, 0, 0, &adc2_mux),
 
 	SND_SOC_DAPM_REG(snd_soc_dapm_supply, "PortB Power",
 			 CX2072X_PORTB_POWER_STATE, 0, 0xFFF, 0x00, 0x03),
-- 
2.11.1



More information about the Alsa-devel mailing list