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

Mark Brown broonie at kernel.org
Wed Aug 26 18:52:14 CEST 2020


On Wed, Aug 26, 2020 at 05:07:24PM +0200, Pavel Dobias wrote:

> +	/* don't allow change if component active */
> +	if (snd_soc_component_active(component)) {
> +		return -EBUSY;
> +	}

AFAICT the filter only applies to the DAC/ADC but this is checking if
the component is in use at all and there's bypass paths - we should only
restrict this when the DAC and ADC are in use.

> +
> +	if (mode > 1)
> +		return -EINVAL;
> +	mode = mode ? MAX9867_CODECFLTR_MODE : 0;

Please write normal conditional statements to improve readability.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20200826/0bfe7630/attachment.sig>


More information about the Alsa-devel mailing list