Re: [PATCH] ASoC: max9867: shutdown codec when changing filter type

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

 



On Wed, Aug 26, 2020 at 01:39:04PM +0200, Pavel Dobias wrote:
> Changing filter type without disabling codec results in filter
> malfunction. Disable codec when changing filter type.

> +static int max9867_filter_set(struct snd_kcontrol *kcontrol,
> +			      struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
> +	struct max9867_priv *max9867 = snd_soc_component_get_drvdata(component);
> +	unsigned int mode = ucontrol->value.enumerated.item[0];
> +
> +	if (mode > 1)
> +		return -EINVAL;
> +
> +	/* shutdown codec before switching filter mode */
> +	regmap_update_bits(max9867->regmap, MAX9867_PWRMAN,
> +		MAX9867_PWRMAN_SHDN, 0);

This probably needs to return -EBUSY if the audio path is up - obviously
shutting the CODEC down is going to glitch the audio pretty badly.  It
should probably also check to see if the value is actually being changed
so we avoid a fairly expensive operation for noop changes.

Attachment: signature.asc
Description: PGP signature


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

  Powered by Linux