mbox series

[v4,0/5] Enable wm8524 on i.MX8MQ-EVK

Message ID 20190227063737.24445-1-daniel.baluta@nxp.com
Headers show
Series Enable wm8524 on i.MX8MQ-EVK | expand

Message

Daniel Baluta Feb. 27, 2019, 6:38 a.m. UTC
On i.MX8MQ-EVK we can start the party using the wm8524 codec
which gets it's data through the SAI2 interface.

In order to make it work this patch series enables the SDMA nodes,
sets the correct pinctrl configuration and uses the simple card
machine driver to put everything together.

Changes since v3:
	- use "arm64: dts: imx8mq-evk" prefix for patches specific to 8MQ-EVK
	- squash together patches for setting up SAI (previous 3/5 and 4/5)
	- add back and document "fsl, imx8mq-sdma" compatbile string

Changes since v2:
        - s/QM/MQ after Chris comments

Changes since v1:
        - added cover letter
        - remove "fsl,imx8mq-sdma" compatible for sdma.

Daniel Baluta (5):
  arm64: dts: imx8mq: Add SDMA nodes
  bindings: fsl-imx-sdma: Document fsl,imx8mq-sdma compatbile string
  arm64: dts: imx8mq: Add SAI2 node
  arm64: dts: imx8mq-evk: Enable SAI2 node
  arm64: dts: imx8mq-evk: Enable wm8524 codec

 .../devicetree/bindings/dma/fsl-imx-sdma.txt  |  1 +
 arch/arm64/boot/dts/freescale/imx8mq-evk.dts  | 48 +++++++++++++++++++
 arch/arm64/boot/dts/freescale/imx8mq.dtsi     | 38 +++++++++++++++
 3 files changed, 87 insertions(+)

Comments

Fabio Estevam Feb. 28, 2019, 6:29 p.m. UTC | #1
On Wed, Feb 27, 2019 at 3:38 AM Daniel Baluta <daniel.baluta@nxp.com> wrote:
>
> SDMA1 is part of AIPS-3 region and SDMA2 is part
> of AIPS-1 region.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> [initial submit in i.MX internal tree]
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> [adaptation for linux-next]

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Fabio Estevam Feb. 28, 2019, 6:31 p.m. UTC | #2
On Wed, Feb 27, 2019 at 3:38 AM Daniel Baluta <daniel.baluta@nxp.com> wrote:

> +                       sai2: sai@308b0000 {
> +                               #sound-dai-cells = <0>;
> +                               compatible = "fsl,imx8mq-sai",
> +                                            "fsl,imx6sx-sai";
> +                               reg = <0x308b0000 0x10000>;
> +                               interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
> +                               clocks = <&clk IMX8MQ_CLK_SAI2_IPG>,
> +                                        <&clk IMX8MQ_CLK_DUMMY>,
> +                                        <&clk IMX8MQ_CLK_SAI2_ROOT>,
> +                                        <&clk IMX8MQ_CLK_DUMMY>, <&clk IMX8MQ_CLK_DUMMY>;
> +                               clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";

mclk0 is not a valid entry as per the binding doc.
Fabio Estevam Feb. 28, 2019, 6:40 p.m. UTC | #3
On Wed, Feb 27, 2019 at 3:38 AM Daniel Baluta <daniel.baluta@nxp.com> wrote:

> +
> +       wm8524: audio-codec-0 {

This -0 is not needed as we have a single codec on this board.

> +               #sound-dai-cells = <0>;
> +               compatible = "wlf,wm8524";
> +               clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
> +               clock-names = "mclk";

The clocks and clock-names properties can be removed, right?

I don't see them defined in the binding doc and the codec driver does
not call clk_get(), so there is a mismatch.

Also, I still think this one and the previous patch could be made into
a single patch that adds audio support for the board.
Daniel Baluta March 1, 2019, 12:25 p.m. UTC | #4
On Thu, Feb 28, 2019 at 8:49 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> On Wed, Feb 27, 2019 at 3:38 AM Daniel Baluta <daniel.baluta@nxp.com> wrote:
>
> > +                       sai2: sai@308b0000 {
> > +                               #sound-dai-cells = <0>;
> > +                               compatible = "fsl,imx8mq-sai",
> > +                                            "fsl,imx6sx-sai";
> > +                               reg = <0x308b0000 0x10000>;
> > +                               interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
> > +                               clocks = <&clk IMX8MQ_CLK_SAI2_IPG>,
> > +                                        <&clk IMX8MQ_CLK_DUMMY>,
> > +                                        <&clk IMX8MQ_CLK_SAI2_ROOT>,
> > +                                        <&clk IMX8MQ_CLK_DUMMY>, <&clk IMX8MQ_CLK_DUMMY>;
> > +                               clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
>
> mclk0 is not a valid entry as per the binding doc.

Indeed, will fix in next version. mclk0 is valid in our internal tree
because fsl_sai.c supports it.
Will remove mclk0 for now and re-add it when I will upstream the SAI patch.

Thanks Fabio for review!
Daniel Baluta March 1, 2019, 3:53 p.m. UTC | #5
On Thu, Feb 28, 2019 at 11:09 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> On Wed, Feb 27, 2019 at 3:38 AM Daniel Baluta <daniel.baluta@nxp.com> wrote:
>
> > +
> > +       wm8524: audio-codec-0 {
>
> This -0 is not needed as we have a single codec on this board.

Ok, will fix.

>
> > +               #sound-dai-cells = <0>;
> > +               compatible = "wlf,wm8524";
> > +               clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
> > +               clock-names = "mclk";
>
> The clocks and clock-names properties can be removed, right?
>
> I don't see them defined in the binding doc and the codec driver does
> not call clk_get(), so there is a mismatch.

They are used by simple-card.c machine driver.

asoc_simple_card_parse_clk
-> /* Parse dai->sysclk come from "clocks = <&xxx>" */
clk = devm_get_clk_from_child(dev, node, NULL);

>
> Also, I still think this one and the previous patch could be made into
> a single patch that adds audio support for the board.

Ok.
Fabio Estevam March 8, 2019, 10:32 a.m. UTC | #6
Hi Daniel,

On Fri, Mar 1, 2019 at 12:53 PM Daniel Baluta <daniel.baluta@gmail.com> wrote:

> They are used by simple-card.c machine driver.
>
> asoc_simple_card_parse_clk
> -> /* Parse dai->sysclk come from "clocks = <&xxx>" */
> clk = devm_get_clk_from_child(dev, node, NULL);

The simple-card looks for the "clocks" properties inside the
simple-card node, not inside the codec node, right?
Daniel Baluta March 8, 2019, 11:52 a.m. UTC | #7
On Fri, Mar 8, 2019 at 12:32 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Daniel,
>
> On Fri, Mar 1, 2019 at 12:53 PM Daniel Baluta <daniel.baluta@gmail.com> wrote:
>
> > They are used by simple-card.c machine driver.
> >
> > asoc_simple_card_parse_clk
> > -> /* Parse dai->sysclk come from "clocks = <&xxx>" */
> > clk = devm_get_clk_from_child(dev, node, NULL);
>
> The simple-card looks for the "clocks" properties inside the
> simple-card node, not inside the codec node, right?

I see your point now.

Indeed, "clocks" properties is the one inside simple-card.

   sound-wm8524 {
               compatible = "simple-audio-card";
               link_codec: simple-audio-card,codec {
                       sound-dai = <&wm8524>;
                       clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;

Will remove them from  wm8524: audio-codec node because
they are useless there.

thanks,
Daniel.