Re: [PATCH v2 12/17] ASoC: sun8i-codec: Protect the clock rate while streams are open

From: Maxime Ripard
Date: Mon Oct 19 2020 - 04:28:13 EST


On Wed, Oct 14, 2020 at 01:19:36AM -0500, Samuel Holland wrote:
> The codec's clock input is shared among all AIFs, and shared with other
> audio-related hardware in the SoC, including I2S and SPDIF controllers.
> To ensure sample rates selected by userspace or by codec2codec DAI links
> are maintained, the clock rate must be protected while it is in use.
>
> Signed-off-by: Samuel Holland <samuel@xxxxxxxxxxxx>
> ---
> sound/soc/sunxi/Kconfig | 1 +
> sound/soc/sunxi/sun8i-codec.c | 29 +++++++++++++++++++++++++++--
> 2 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig
> index 9cd7009cb570..69b9d8515335 100644
> --- a/sound/soc/sunxi/Kconfig
> +++ b/sound/soc/sunxi/Kconfig
> @@ -9,16 +9,17 @@ config SND_SUN4I_CODEC
> help
> Select Y or M to add support for the Codec embedded in the Allwinner
> A10 and affiliated SoCs.
>
> config SND_SUN8I_CODEC
> tristate "Allwinner SUN8I audio codec"
> depends on OF
> depends on MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST
> + select COMMON_CLK

Wouldn't a depends on make more sense here? It's kind of weird to pull
it from a driver when the platform that would run it has no CCF support.

With this changed,
Acked-by: Maxime Ripard <mripard@xxxxxxxxxx>

Maxime

Attachment: signature.asc
Description: PGP signature