[PATCH v0] ASoC: rsnd: core: Check convert rate in rsnd_hw_params

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Dec 2 23:57:04 CET 2020


Hi Mikhail

Thank you for your patch

> +			switch (rsnd_mod_id(src_mod)) {
> +			/*
> +			 * SRC0 can downsample 4, 6 and 8 channel audio up to 4 times.
> +			 * SRC1, SRC3 and SRC4 can downsample 4 channel audio
> +			 * up to 4 times.
> +			 * SRC1, SRC3 and SRC4 can downsample 6 and 8 channel audio
> +			 * no more than twice.
> +			 */
> +			case 1:
> +			case 3:
> +			case 4:
> +				if (channel > 4) {
> +					k_down = 2;
> +					break;
> +				}
> +			case 0:
> +				if (channel > 2)
> +					k_down = 4;
> +				break;
> +
> +			/* Other SRC units do not support more than 2 channels */
> +			default:
> +				if (channel > 2)
> +					return -EINVAL;
> +			}

I think you want to add "fallthrough" between case 1/3/4 and case 0 ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list