[alsa-devel] [PATCH] ASoC: fsl-asoc-card: Allow to describe master or slave mode

Nicolin Chen nicoleotsuka at gmail.com
Mon Sep 22 08:10:30 CEST 2014


Hi Fabio,

On Mon, Sep 22, 2014 at 01:40:54AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam at freescale.com>
> 
> Provide a mechanism to describe whether the system runs in master or slave mode.
> 
> In order to keep compatibilty with existing dtb's let slave mode be default one.
> 
> Tested on a imx6q-sabresd board in both modes.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
> ---
>  Documentation/devicetree/bindings/sound/fsl-asoc-card.txt |  5 +++++
>  sound/soc/fsl/fsl-asoc-card.c                             | 15 ++++++++++++---
>  2 files changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
> index a96774c..1bbc828 100644
> --- a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
> +++ b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
> @@ -59,6 +59,10 @@ Optional properties:
>    - audio-asrc		: The phandle of ASRC. It can be absent if there's no
>  			  need to add ASRC support via DPCM.
>  
> +  - audio-cpu-mode	: The operating mode for the audio cpu interface.
> +			  "slave" - audio clock comes from the external codec
> +			  "master" -audio clock is generated from the audio cpu
> +

This could be a good idea to move the 'hardcode' into the DT binding
while maintaining the compatibility toward imx-sgtl5000 and imx-wm8962.
But at least, it still needs to separate the bit clock and frame sync
clock. Otherwise, the CBS_CFM and CBM_CFS cases will be expelled, as
AUDMUX part in the driver takes care of them even if they are pretty
rare.

And another question I's wondering myself: If they are really worth
adding. Because we may then need I2S/LEFT_J parsing code too while
we can't eradicate all the hard code such as pll_id and mclk_id. So
since the further compatible of the driver still needs some specific
configurations, why not just leave DAI formats configurations in the
driver as well -- So I didn't expect this driver will be enhanced to
become a Freescale Simple Card.


What do you think about it after seeing my idea.

One more thing: we may figure out a better and more explicit name,
rather than 'cpu-mode', if we decide to add DAI formats information
into DT.

Thank you
Nicolin


More information about the Alsa-devel mailing list