diff mbox series

[v4,5/5] arm64: dts: imx8mq-evk: Enable wm8524 codec

Message ID 20190227063737.24445-6-daniel.baluta@nxp.com (mailing list archive)
State New, archived
Headers show
Series Enable wm8524 on i.MX8MQ-EVK | expand

Commit Message

Daniel Baluta Feb. 27, 2019, 6:38 a.m. UTC
This uses simple-audio-card machine driver adding 1 CPU DAI
and 1 Codec DAI.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)

Comments

Fabio Estevam Feb. 28, 2019, 6:40 p.m. UTC | #1
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, 3:53 p.m. UTC | #2
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 | #3
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 | #4
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.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
index 58de4a3d6029..77f590c13ee0 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
@@ -31,6 +31,35 @@ 
 		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 	};
+
+	wm8524: audio-codec-0 {
+		#sound-dai-cells = <0>;
+		compatible = "wlf,wm8524";
+		clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
+		clock-names = "mclk";
+		wlf,mute-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
+	};
+
+	sound-wm8524 {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "wm8524-audio";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,frame-master = <&cpudai>;
+		simple-audio-card,bitclock-master = <&cpudai>;
+		simple-audio-card,widgets =
+			"Line", "Left Line Out Jack",
+			"Line", "Right Line Out Jack";
+		simple-audio-card,routing =
+			"Left Line Out Jack", "LINEVOUTL",
+			"Right Line Out Jack", "LINEVOUTR";
+		cpudai: simple-audio-card,cpu {
+			sound-dai = <&sai2>;
+		};
+		link_codec: simple-audio-card,codec {
+			sound-dai = <&wm8524>;
+			clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
+		};
+	};
 };
 
 &fec1 {