diff mbox

[2/3] ASoC: fsl_sai: Add imx7d platform support

Message ID f269bace628dd8ebac7c1833b743d4d5e5d528db.1438928571.git.zidan.wang@freescale.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zidan Wang Aug. 7, 2015, 6:23 a.m. UTC
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(+)

Comments

Mark Brown Aug. 7, 2015, 1:18 p.m. UTC | #1
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.
Nicolin Chen Aug. 7, 2015, 7:34 p.m. UTC | #2
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 */
Zidan Wang Aug. 10, 2015, 1:14 a.m. UTC | #3
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
Mark Brown Aug. 11, 2015, 9:38 a.m. UTC | #4
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.
diff mbox

Patch

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 */ }
 };