[alsa-devel] [PATCH] hda: Added mono mux mixer for some STAC92HD7XXX family codecs

Takashi Iwai tiwai at suse.de
Mon Jan 21 15:59:58 CET 2008


At Mon, 21 Jan 2008 09:45:02 -0500,
Matthew Ranostay wrote:
> 
> Takashi Iwai wrote:
> > At Mon, 21 Jan 2008 08:58:52 -0500,
> > Matthew Ranostay wrote:
> >> Takashi Iwai wrote:
> >>> At Fri, 18 Jan 2008 16:44:42 -0500,
> >>> Matthew Ranostay wrote:
> >>>> Some 92HD7XXX family codecs have a mono mux, added support for selecting the input path to the mono out.
> >>>>
> >>>> Signed-off-by: Matthew Ranostay <mranostay at embeddedalley.com>
> >>> Could you fix the coding-style issues reported by checkpatch.pl?
> >> Ok, fixed the 80-character lines it complained about, although I left the 'declaration in if statement' since
> >> the code block below it does the same style.
> > 
> > Well, apprently you didn't run checkpatch.pl to the new patch? ;)
> > 
> > ERROR: do not use assignment in if condition (+		if ((err = stac92xx_auto_create_mono_output_ctls(codec)) < 0))
> > #224: FILE: pci/hda/patch_sigmatel.c:2609:
> > +		if ((err = stac92xx_auto_create_mono_output_ctls(codec)) < 0)
> > 
> Ok fixed this line and the DMIC block below it. Hopefully this the last time I have to submit this :)

Thanks, but right now I found another thing...

> @@ -2318,6 +2362,35 @@ static int stac92xx_auto_create_hp_ctls(
>  	return 0;
>  }
>  
> +/* labels for mono mux outputs */
> +static const char *stac92xx_mono_labels[3] = {
> +	"DAC0", "DAC1", "Mixer"
> +};
> +
> +/* create mono mux for mono out on capable codecs */
> +static int stac92xx_auto_create_mono_output_ctls(struct hda_codec *codec)
> +{
> +	struct sigmatel_spec *spec = codec->spec;
> +	struct hda_input_mux *mono_mux = &spec->private_mono_mux;
> +	int i, num_cons;
> +	hda_nid_t con_lst[HDA_MAX_NUM_INPUTS];
> +
> +	num_cons = snd_hda_get_connections(codec,
> +				spec->mono_nid,
> +				con_lst,
> +				HDA_MAX_NUM_INPUTS);
> +	if (!num_cons)
> +		return -EINVAL;
> +
> +	for (i = 0; i < num_cons; i++) {
> +		mono_mux->items[mono_mux->num_items].label =
> +					stac92xx_mono_labels[i];

num_cons could be over 3.  Better to add a check here.


Takashi


More information about the Alsa-devel mailing list