linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Nicolin Chen <b42378@freescale.com>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"swarren@wwwdotorg.org" <swarren@wwwdotorg.org>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"timur@tabi.org" <timur@tabi.org>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	"tomasz.figa@gmail.com" <tomasz.figa@gmail.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"R65777@freescale.com" <R65777@freescale.com>,
	"shawn.guo@linaro.org" <shawn.guo@linaro.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver
Date: Mon, 19 Aug 2013 10:18:09 +0100	[thread overview]
Message-ID: <20130819091809.GD3719@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <43416f3617951161b6e779277b4719438f844e49.1376901081.git.b42378@freescale.com>

On Mon, Aug 19, 2013 at 09:35:21AM +0100, Nicolin Chen wrote:
> This patch implements a device-tree-only CPU DAI driver for Freescale
> S/PDIF controller that supports stereo playback and record feature.
> 
> Signed-off-by: Nicolin Chen <b42378@freescale.com>
> ---
>  .../devicetree/bindings/sound/fsl,spdif.txt        |   56 +
>  sound/soc/fsl/Kconfig                              |    3 +
>  sound/soc/fsl/Makefile                             |    2 +
>  sound/soc/fsl/fsl_spdif.c                          | 1277 ++++++++++++++++++++
>  sound/soc/fsl/fsl_spdif.h                          |  224 ++++
>  5 files changed, 1562 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/sound/fsl,spdif.txt
>  create mode 100644 sound/soc/fsl/fsl_spdif.c
>  create mode 100644 sound/soc/fsl/fsl_spdif.h
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl,spdif.txt b/Documentation/devicetree/bindings/sound/fsl,spdif.txt
> new file mode 100644
> index 0000000..e9caf1c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/fsl,spdif.txt
> @@ -0,0 +1,56 @@
> +Freescale Sony/Philips Digital Interface Format (S/PDIF) Controller
> +
> +The Freescale S/PDIF audio block is a stereo transceiver that allows the
> +processor to receive and transmit digital audio via an coaxial cable or
> +a fibre cable.
> +
> +Required properties:
> +
> +  - compatible : Compatible list, contains "fsl,<chip>-spdif".

What are valid values for <chip>? The binding should mention this. There
are bindings that don't, but they need to be fixed. Undocumented ABIs
are a bad idea.

> +
> +  - reg : Offset and length of the register set for the device.
> +
> +  - interrupts : Contains spdif interrupt.

Is that the only interrupt the device generates?

> +
> +  - dmas : Generic dma devicetree binding as described in
> +  Documentation/devicetree/bindings/dma/dma.txt.
> +
> +  - dma-names : Two dmas have to be defined, "tx" and "rx".
> +
> +  - clocks : Contains an entry for each entry in clock-names.
> +
> +  - clock-names : Includes the following entries:
> +       name            description

I don't think you need this line, it's obvious enough without it.

> +       "core"          The core clock of spdif controller
> +       "rxtx<0-7>"     Clock source list for tx and rx clock.
> +                       This clock list should be identical to
> +                       the source list connecting to the spdif
> +                       clock mux in "SPDIF Transceiver Clock
> +                       Diagram" of SoC reference manual. It
> +                       can also be referred to TxClk_Source
> +                       bit of register SPDIF_STC.

Could you elaborate on the last sentence? I'm not sure exactly what you
meant.

> +
> +Example:
> +
> +spdif: spdif@02004000 {
> +       compatible = "fsl,imx6q-spdif",
> +               "fsl,imx35-spdif";

Is "fsl,imx35-spdif" necessary in the list, or is it not the case all
"fsl,<chip>-spdif" variants are compatible with it?

That should be mentioned along with the list of valid compatible
strings.

> +       reg = <0x02004000 0x4000>;
> +       interrupts = <0 52 0x04>;
> +       dmas = <&sdma 14 18 0>,
> +              <&sdma 15 18 0>;
> +       dma-names = "rx", "tx";
> +
> +       clocks = <&clks 197>, <&clks 3>,
> +              <&clks 197>, <&clks 107>,
> +              <&clks 0>, <&clks 118>,
> +              <&clks 62>, <&clks 139>,
> +              <&clks 0>;
> +       clock-names = "core", "rxtx0",
> +               "rxtx1", "rxtx2",
> +               "rxtx3", "rxtx4",
> +               "rxtx5", "rxtx6",
> +               "rxtx7";
> +
> +       status = "okay";
> +};

[...]

> +static int spdif_clk_set_rate(struct clk *clk, unsigned long rate)
> +{
> +       unsigned long rate_actual;
> +
> +       rate_actual = clk_round_rate(clk, rate);
> +       clk_set_rate(clk, rate_actual);
> +
> +       return 0;
> +}

Can't clk_set_rate fail?

[...]

> +       /* Select clock source for rx/tx clock */
> +       spdif_priv->rxclk = devm_clk_get(&pdev->dev, "rxtx1");
> +       if (IS_ERR(spdif_priv->rxclk)) {
> +               dev_err(&pdev->dev, "no rxtx1 property in devicetree\n");

Saying "no rxtx1 clock in devicetree" would be clearer.

[...]

> +static const struct of_device_id fsl_spdif_dt_ids[] = {
> +       { .compatible = "fsl,imx35-spdif", },
> +       {}
> +};

So "fsl,imx35-spdif" *must* be in the compatible list. The binding
should mention this.

Thanks,
Mark.

  reply	other threads:[~2013-08-19  9:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19  8:35 [PATCH v7 0/2] Add freescale S/PDIF CPU DAI and machine drivers Nicolin Chen
2013-08-19  8:35 ` [PATCH v7 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver Nicolin Chen
2013-08-19  9:18   ` Mark Rutland [this message]
2013-08-19  9:34     ` Nicolin Chen
2013-08-19  9:54       ` Mark Rutland
2013-08-19 10:13         ` Nicolin Chen
2013-08-19 11:13           ` Mark Rutland
2013-08-19 11:34             ` Nicolin Chen
2013-08-20  8:47               ` Mark Rutland
2013-08-20  5:19         ` Shawn Guo
2013-08-20  8:54           ` Mark Rutland
2013-08-20 16:28           ` Stephen Warren
2013-08-19  8:35 ` [PATCH v7 2/2] ASoC: fsl: Add S/PDIF machine driver Nicolin Chen
2013-08-19  9:24   ` Mark Rutland
2013-08-19  9:50     ` Nicolin Chen
2013-08-19 10:01       ` Mark Rutland
2013-08-19 10:21         ` Nicolin Chen
2013-08-19 11:15           ` Mark Rutland
2013-08-19 10:27         ` Philipp Zabel
2013-08-19 10:52         ` Mark Brown
2013-08-19 11:31           ` Mark Rutland
2013-08-19 11:45             ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130819091809.GD3719@e106331-lin.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=R65777@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=b42378@freescale.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rob.herring@calxeda.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    --cc=swarren@wwwdotorg.org \
    --cc=timur@tabi.org \
    --cc=tomasz.figa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).