On Wed, May 15, 2024 at 03:54:09PM +0200, Elinor Montmasson wrote: > Add an optional DT clock "cpu_sysclk" to get the CPU DAI system-clock > frequency when using the generic codec. > It is set for both Tx and Rx. > The way the frequency value is used is up to the CPU DAI driver > implementation. > + struct clk *cpu_sysclk = clk_get(&pdev->dev, "cpu_sysclk"); > + if (!IS_ERR(cpu_sysclk)) { > + priv->cpu_priv.sysclk_freq[TX] = clk_get_rate(cpu_sysclk); > + priv->cpu_priv.sysclk_freq[RX] = priv->cpu_priv.sysclk_freq[TX]; > + clk_put(cpu_sysclk); > + } I don't really understand the goal here - this is just reading whatever frequency happens to be set in the hardware when the driver starts up which if nothing else seems rather fragile?
Attachment:
signature.asc
Description: PGP signature
- Follow-Ups:
- Re: [PATCHv4 7/9] ASoC: fsl-asoc-card: add DT clock "cpu_sysclk" with generic codec
- From: Elinor Montmasson
- Re: [PATCHv4 7/9] ASoC: fsl-asoc-card: add DT clock "cpu_sysclk" with generic codec
- References:
- Prev by Date: Re: [PATCHv4 9/9] ASoC: dt-bindings: fsl-asoc-card: add compatible for generic codec
- Next by Date: Re: [PATCHv4 8/9] ASoC: fsl-asoc-card: add DT property "cpu-system-clock-direction-out"
- Previous by thread: [PATCHv4 7/9] ASoC: fsl-asoc-card: add DT clock "cpu_sysclk" with generic codec
- Next by thread: Re: [PATCHv4 7/9] ASoC: fsl-asoc-card: add DT clock "cpu_sysclk" with generic codec
- Index(es):