[alsa-devel] [PATCH v3] ASoC: Add support for cs42l73 codec
Vinod Koul
vinod.koul at linux.intel.com
Fri Oct 7 13:07:16 CEST 2011
On Fri, 2011-10-07 at 11:34 +0100, Mark Brown wrote:
> On Thu, Oct 06, 2011 at 07:15:22PM +0000, Austin, Brian wrote:
> > On Oct 6, 2011, at 1:57 PM, Mark Brown wrote:
> > > On Thu, Oct 06, 2011 at 11:19:05AM -0500, Brian Austin wrote:
>
> > >> + {"DAC1 Mixer", "Headphone Switch", "XSPIN"},
>
> > >> + {"DAC1 Mixer", "Headphone Switch", "ASPIN"},
>
> > >> + {"DAC1 Mixer", "Headphone Switch", "VSPIN"},
>
> > > This all looks totally wrong and I'm surprised the driver loads without
> > > errors. There's two issues:
>
> > > - All the controls here are for the input to the DAC mixers but their
> > > names are for physical outputs. I'd expect the switches to name
> > > inputs (for example, "DAC1 Mixer VSPIN Switch"). What's actually
> > > going on here?
>
> > > - You've got three copies of each of the controls for each mixer - I'm
> > > surprsied this loads without the core complaining that it can't
> > > create controls with duplicate names.
>
> > This works fine on my setup with a beagleboard.
>
> I'm frankly astonished. What are these controls called?
>
> > There are 3 routes for the HP/LO/SPK/SPKLO/EAR. What I am trying to accomplish is the following.
> > Allow a stream from any serial port to go to any output.
>
> That's perfectly reasonable but what you've written doesn't seem to do
> that. The DAPM routes are in the form:
>
> { destination, control, source }
>
> so what the above example says is that audio is routed from XSPIN to
> DAC1 if the DAC1 Headphone switch is turned on.
See below:
+static const struct snd_kcontrol_new dac1_output_mixer[] = {
+ SOC_DAPM_SINGLE("Headphone Switch", CS42L73_PWRCTL3, 0, 1, 1),
+ SOC_DAPM_SINGLE("LineOut Switch", CS42L73_PWRCTL3, 1, 1, 1),
+};
+
+static const struct snd_kcontrol_new dac2_output_mixer[] = {
+ SOC_DAPM_SINGLE("Speakerphone Switch", CS42L73_PWRCTL3, 2, 1,
1),
+ SOC_DAPM_SINGLE("Speakerphone LineOut Switch", CS42L73_PWRCTL3,
+ 4, 1, 1),
+ SOC_DAPM_SINGLE("EarSpeaker Switch", CS42L73_PWRCTL3, 3, 1, 1),
+};
+
I think naming should be slightly better :)
--
~Vinod
More information about the Alsa-devel
mailing list