[alsa-devel] [PATCH 1/3] ASoC: fsl-sai: add 32 bit word length support
Add 32 bit word length support.
Signed-off-by: Zidan Wang zidan.wang@freescale.com --- sound/soc/fsl/fsl_sai.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h index 0662809..40280ce 100644 --- a/sound/soc/fsl/fsl_sai.h +++ b/sound/soc/fsl/fsl_sai.h @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 Freescale Semiconductor, Inc. + * Copyright 2012-2015 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -13,7 +13,8 @@
#define FSL_SAI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ SNDRV_PCM_FMTBIT_S20_3LE |\ - SNDRV_PCM_FMTBIT_S24_LE) + SNDRV_PCM_FMTBIT_S24_LE |\ + SNDRV_PCM_FMTBIT_S32_LE)
/* SAI Register Map Register */ #define FSL_SAI_TCSR 0x00 /* SAI Transmit Control */
i.MX7d SoC contains SAI module, so add imx7d platform support.
Signed-off-by: Zidan Wang zidan.wang@freescale.com --- sound/soc/fsl/fsl_sai.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 5c737f1..390197e 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -704,6 +704,9 @@ static int fsl_sai_probe(struct platform_device *pdev) if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx6sx-sai")) sai->sai_on_imx = true;
+ if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx7d-sai")) + sai->sai_on_imx = true; + sai->is_lsb_first = of_property_read_bool(np, "lsb-first");
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -802,6 +805,7 @@ static int fsl_sai_probe(struct platform_device *pdev) static const struct of_device_id fsl_sai_ids[] = { { .compatible = "fsl,vf610-sai", }, { .compatible = "fsl,imx6sx-sai", }, + { .compatible = "fsl,imx7d-sai", }, { /* sentinel */ } };
On Fri, Aug 07, 2015 at 02:23:52PM +0800, Zidan Wang wrote:
i.MX7d SoC contains SAI module, so add imx7d platform support.
Signed-off-by: Zidan Wang zidan.wang@freescale.com
sound/soc/fsl/fsl_sai.c | 4 ++++ 1 file changed, 4 insertions(+)
This needs a binding document update too.
On Fri, Aug 07, 2015 at 02:23:52PM +0800, Zidan Wang wrote:
i.MX7d SoC contains SAI module, so add imx7d platform support.
Signed-off-by: Zidan Wang zidan.wang@freescale.com
sound/soc/fsl/fsl_sai.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 5c737f1..390197e 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -704,6 +704,9 @@ static int fsl_sai_probe(struct platform_device *pdev) if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx6sx-sai")) sai->sai_on_imx = true;
- if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx7d-sai"))
sai->sai_on_imx = true;
What's the difference between imx6sx-sai and imx7d-sai?
I think you may put its compatible model in the DT instead of adding a copy in the driver unless the SAI on the imx7d really has something different.
For example: compatible = "fsl,imx6q-ssi", "fsl,imx51-ssi"; /* The driver only has imx51-ssi */
On Fri, Aug 07, 2015 at 12:34:37PM -0700, Nicolin Chen wrote:
On Fri, Aug 07, 2015 at 02:23:52PM +0800, Zidan Wang wrote:
i.MX7d SoC contains SAI module, so add imx7d platform support.
Signed-off-by: Zidan Wang zidan.wang@freescale.com
sound/soc/fsl/fsl_sai.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 5c737f1..390197e 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -704,6 +704,9 @@ static int fsl_sai_probe(struct platform_device *pdev) if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx6sx-sai")) sai->sai_on_imx = true;
- if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx7d-sai"))
sai->sai_on_imx = true;
What's the difference between imx6sx-sai and imx7d-sai?
I think you may put its compatible model in the DT instead of adding a copy in the driver unless the SAI on the imx7d really has something different.
For example: compatible = "fsl,imx6q-ssi", "fsl,imx51-ssi"; /* The driver only has imx51-ssi */
The imx7d-sai is the same as imx6sx-sai, so i should use compatible model "fsl,imx6sx-sai" for imx7d-sai.
Best Regards, Zidan Wang
On Fri, Aug 07, 2015 at 12:34:37PM -0700, Nicolin Chen wrote:
On Fri, Aug 07, 2015 at 02:23:52PM +0800, Zidan Wang wrote:
- if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx7d-sai"))
sai->sai_on_imx = true;
What's the difference between imx6sx-sai and imx7d-sai?
I think you may put its compatible model in the DT instead of adding a copy in the driver unless the SAI on the imx7d really has something different.
For example: compatible = "fsl,imx6q-ssi", "fsl,imx51-ssi"; /* The driver only has imx51-ssi */
It's generally good to have compatibles in the DT even if we believe the hardware is identical since it can happen that differences are found later (either due to new features being added or bugs found) and having the explicit compatibles in DT already means that we only need to update the driver.
i.MX6ul SoC contains SAI module, so add imx6ul platform support.
Signed-off-by: Zidan Wang zidan.wang@freescale.com --- sound/soc/fsl/fsl_sai.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 390197e..229a517 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -701,10 +701,9 @@ static int fsl_sai_probe(struct platform_device *pdev)
sai->pdev = pdev;
- if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx6sx-sai")) - sai->sai_on_imx = true; - - if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx7d-sai")) + if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx6sx-sai") || + of_device_is_compatible(pdev->dev.of_node, "fsl,imx6ul-sai") || + of_device_is_compatible(pdev->dev.of_node, "fsl,imx7d-sai")) sai->sai_on_imx = true;
sai->is_lsb_first = of_property_read_bool(np, "lsb-first"); @@ -805,6 +804,7 @@ static int fsl_sai_probe(struct platform_device *pdev) static const struct of_device_id fsl_sai_ids[] = { { .compatible = "fsl,vf610-sai", }, { .compatible = "fsl,imx6sx-sai", }, + { .compatible = "fsl,imx6ul-sai", }, { .compatible = "fsl,imx7d-sai", }, { /* sentinel */ } };
On Fri, Aug 07, 2015 at 02:23:51PM +0800, Zidan Wang wrote:
Add 32 bit word length support.
I notice that you're adding support for new platforms along with this - does this support depend on the platform? You should also have a note in the commit log explaining that there are no code changes required in the driver except the capability define since it already just writes the width directly to the hardware.
participants (3)
-
Mark Brown
-
Nicolin Chen
-
Zidan Wang