Re: [PATCH v2 2/3] ASoC: Intel: Skylake: Add enum control for mic selection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 30, 2017 at 02:44:20PM +0200, Takashi Iwai wrote:
> On Tue, 30 May 2017 14:03:00 +0200,
> Subhransu S. Prusty wrote:
> > 
> > +static int skl_tplg_mic_control_get(struct snd_kcontrol *kcontrol,
> > +		struct snd_ctl_elem_value *ucontrol)
> > +{
> > +	struct snd_soc_dapm_widget *w = snd_soc_dapm_kcontrol_widget(kcontrol);
> > +	struct skl_module_cfg *mconfig = w->priv;
> > +	struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value;
> > +	u32 ch_type = *((u32 *)ec->dobj.private);
> > +
> > +	if (mconfig->dmic_ch_type == ch_type)
> > +		ucontrol->value.integer.value[0] = mconfig->dmic_ch_combo_index;
> > +	else
> > +		ucontrol->value.integer.value[0] = 0;
> 
> Is this enum kctl or not?  If it is, you're accessing to the wrong
> field, as already mentioned.  ucontrol->value.integer.xxx is for
> volumes and switches.

Sent the wrong patches. Fixed it in a different branch. Sorry for
inconvinience. Will resend it.

> 
> Ditto for skl_tplg_mic_control_set().
> 
> > +static const struct snd_soc_tplg_kcontrol_ops skl_tplg_kcontrol_ops[] = {
> > +	{SKL_CONTROL_TYPE_MIC_SELECT, skl_tplg_mic_control_get,
> > +					skl_tplg_mic_control_set},
> > +};
> 
> Better to do in C99 init style.

Sure.

Regards,
Subhransu

> 
> 
> thanks,
> 
> Takashi

-- 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux