wm8960: add DAC Slope switch

Charles Keepax ckeepax at opensource.cirrus.com
Mon Dec 7 11:28:05 CET 2020


On Tue, Nov 24, 2020 at 06:23:13PM +0100, Lukas F. Hartmann wrote:
> The WM8960 DAC has a "DAC Slope" switch that can toggle between two
> different output filter curves. This patch adds support for it.
> 
> Signed-off-by: Lukas F. Hartmann <lukas at mntre.com>
> ---
> +static int wm8960_put_dacslope(struct snd_kcontrol *kcontrol,
> +			       struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
> +	struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component);
> +	unsigned int val = ucontrol->value.integer.value[0];
> +
> +	if (val > 1)
> +		return -EINVAL;
> +
> +	wm8960->dacslope = val;
> +
> +	return snd_soc_component_update_bits(component, WM8960_DACCTL1,
> +				   0x2, val<<1);

Is the DAC Slope switch not in DACCTL2?

Thanks,
Charles


More information about the Alsa-devel mailing list