diff mbox series

[1/2] ASoC: fsl_mqs: add DT binding documentation

Message ID cff8bff1e8d3334fa308ddfcec266a5284e3c858.1568169346.git.shengjiu.wang@nxp.com
State New
Headers show
Series [1/2] ASoC: fsl_mqs: add DT binding documentation | expand

Commit Message

Shengjiu Wang Sept. 11, 2019, 2:42 p.m. UTC
Add the DT binding documentation for NXP MQS driver

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>

---
 .../devicetree/bindings/sound/fsl,mqs.txt     | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,mqs.txt

-- 
2.21.0

Comments

Christophe Leroy Sept. 11, 2019, 6:31 a.m. UTC | #1
Hi Shengjiu,

Your mail is dated in the future, its time is 16:42 (GMT+2) whereas it 
is still the morning.

Please fix your clock or timezone for future mails.

Thanks
Christophe

Le 11/09/2019 à 16:42, Shengjiu Wang a écrit :
> Add the DT binding documentation for NXP MQS driver

> 

> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>

> ---

>   .../devicetree/bindings/sound/fsl,mqs.txt     | 20 +++++++++++++++++++

>   1 file changed, 20 insertions(+)

>   create mode 100644 Documentation/devicetree/bindings/sound/fsl,mqs.txt

> 

> diff --git a/Documentation/devicetree/bindings/sound/fsl,mqs.txt b/Documentation/devicetree/bindings/sound/fsl,mqs.txt

> new file mode 100644

> index 000000000000..a1dbe181204a

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/sound/fsl,mqs.txt

> @@ -0,0 +1,20 @@

> +fsl,mqs audio CODEC

> +

> +Required properties:

> +

> +  - compatible : Must contain one of "fsl,imx6sx-mqs", "fsl,codec-mqs"

> +		"fsl,imx8qm-mqs", "fsl,imx8qxp-mqs".

> +  - clocks : A list of phandles + clock-specifiers, one for each entry in

> +	     clock-names

> +  - clock-names : Must contain "mclk"

> +  - gpr : The gpr node.

> +

> +Example:

> +

> +mqs: mqs {

> +	compatible = "fsl,imx6sx-mqs";

> +	gpr = <&gpr>;

> +	clocks = <&clks IMX6SX_CLK_SAI1>;

> +	clock-names = "mclk";

> +	status = "disabled";

> +};

>
Mark Brown Sept. 11, 2019, 10:03 a.m. UTC | #2
On Wed, Sep 11, 2019 at 10:42:38AM -0400, Shengjiu Wang wrote:

> +  - gpr : The gpr node.


What is a gpr node?
Mark Brown Sept. 11, 2019, 10:12 a.m. UTC | #3
On Wed, Sep 11, 2019 at 10:42:39AM -0400, Shengjiu Wang wrote:

This looks good, a few minor comments below but nothing major -
it's mostly nits with the DT binding.

> --- /dev/null

> +++ b/sound/soc/fsl/fsl_mqs.c

> @@ -0,0 +1,336 @@

> +// SPDX-License-Identifier: GPL-2.0

> +/*

> + * ALSA SoC IMX MQS driver

> + *

> + * Copyright (C) 2014-2019 Freescale Semiconductor, Inc.

> + *


Please make the entire comment block a C++ comment so things look
neater.

> +	/* On i.MX6sx the MQS control register is in GPR domain

> +	 * But in i.MX8QM/i.MX8QXP the control register is moved

> +	 * to its own domain.

> +	 */

> +	if (of_device_is_compatible(np, "fsl,imx8qm-mqs"))

> +		mqs_priv->use_gpr = false;

> +	else

> +		mqs_priv->use_gpr = true;


The GPR was listed as a required property in the binding document
but it is only needed here so the binding document should say
"required if compatible is...".

> +	} else {

> +		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

> +		regs = devm_ioremap_resource(&pdev->dev, res);

> +		if (IS_ERR(regs))


You can use devm_platform_ioremap_resource() here.

> +		mqs_priv->ipg = devm_clk_get(&pdev->dev, "core");

> +		if (IS_ERR(mqs_priv->ipg)) {

> +			dev_err(&pdev->dev, "failed to get the clock: %ld\n",

> +				PTR_ERR(mqs_priv->ipg));

> +			goto out;

> +		}


The core clock wasn't listed in the bindings document.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/fsl,mqs.txt b/Documentation/devicetree/bindings/sound/fsl,mqs.txt
new file mode 100644
index 000000000000..a1dbe181204a
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/fsl,mqs.txt
@@ -0,0 +1,20 @@ 
+fsl,mqs audio CODEC
+
+Required properties:
+
+  - compatible : Must contain one of "fsl,imx6sx-mqs", "fsl,codec-mqs"
+		"fsl,imx8qm-mqs", "fsl,imx8qxp-mqs".
+  - clocks : A list of phandles + clock-specifiers, one for each entry in
+	     clock-names
+  - clock-names : Must contain "mclk"
+  - gpr : The gpr node.
+
+Example:
+
+mqs: mqs {
+	compatible = "fsl,imx6sx-mqs";
+	gpr = <&gpr>;
+	clocks = <&clks IMX6SX_CLK_SAI1>;
+	clock-names = "mclk";
+	status = "disabled";
+};