All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Guo <shawnguo@kernel.org>
To: Luca Ceresoli <luca.ceresoli@bootlin.com>
Cc: devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] arm64: dts: imx8mp-msc-sm2s: Add sound card
Date: Sat, 27 May 2023 21:21:49 +0800	[thread overview]
Message-ID: <20230527132149.GD560301@dragon> (raw)
In-Reply-To: <20230525104755.286282-1-luca.ceresoli@bootlin.com>

On Thu, May 25, 2023 at 12:47:55PM +0200, Luca Ceresoli wrote:
> The MSC SM2-MB-EP1 carrier board for the SM2S-IMX8PLUS SMARC module has an
> NXP SGTL5000 audio codec connected to I2S-0 (sai2).
> 
> This requires to:
> 
>  * add the power supplies (always on)
>  * enable sai2 with pinmuxes
>  * reparent the CLKOUT1 clock that feeds the codec SYS_MCLK to
>    IMX8MP_CLK_24M in order it to generate an accurate 24 MHz rate
> 
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> 
> ---
> 
> Changed in v2:
> 
>  - switch to simple-audio-card
>  - fix typo in commit message
>  - no underscores in node names
>  - rename "sgtl5000-sound" node to "sound"
> ---
>  .../dts/freescale/imx8mp-msc-sm2s-ep1.dts     | 70 +++++++++++++++++++
>  1 file changed, 70 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts b/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts
> index 470ff8e31e32..cd651e1e3262 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts
> @@ -14,6 +14,67 @@ / {
>  	compatible = "avnet,sm2s-imx8mp-14N0600E-ep1",
>  		     "avnet,sm2s-imx8mp-14N0600E", "avnet,sm2s-imx8mp",
>  		     "fsl,imx8mp";
> +
> +	reg_vcc_3v3_audio: 3v3-audio-regulator {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VCC_3V3_AUD";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	reg_vcc_1v8_audio: 1v8-audio-regulator {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VCC_1V8_AUD";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	sound {
> +		compatible = "simple-audio-card";
> +		simple-audio-card,name = "sgtl5000-audio";
> +		simple-audio-card,format = "i2s";
> +		simple-audio-card,frame-master = <&codec_dai>;
> +		simple-audio-card,bitclock-master = <&codec_dai>;
> +
> +		simple-audio-card,cpu {
> +			sound-dai = <&sai2>;
> +		};
> +
> +		codec_dai: simple-audio-card,codec {
> +			sound-dai = <&sgtl5000>;
> +		};
> +	};
> +};
> +
> +&i2c1 {
> +	sgtl5000: sgtl5000@a {

audio-codec for node name.

Shawn

> +		compatible = "fsl,sgtl5000";
> +		reg = <0x0a>;
> +
> +		assigned-clocks = <&clk IMX8MP_CLK_CLKOUT1_SEL>;
> +		assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
> +		assigned-clock-rates = <24000000>;
> +		clocks = <&clk IMX8MP_CLK_CLKOUT1>;
> +		clock-names = "mclk";
> +		#sound-dai-cells = <0>;
> +
> +		VDDA-supply  = <&reg_vcc_3v3_audio>;
> +		VDDD-supply  = <&reg_vcc_1v8_audio>;
> +		VDDIO-supply = <&reg_vcc_1v8_audio>;
> +	};
> +};
> +
> +/* I2S-0 = sai2 */
> +&sai2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_sai2>;
> +
> +	assigned-clocks = <&clk IMX8MP_CLK_SAI2>;
> +	assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
> +	assigned-clock-rates = <12288000>;
> +
> +	fsl,sai-mclk-direction-output;
> +	status = "okay";
>  };
>  
>  &flexcan1 {
> @@ -32,6 +93,15 @@ &iomuxc {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pinctrl_smarc_gpio>;
>  
> +	pinctrl_sai2: sai2grp {
> +		fsl,pins = <
> +			MX8MP_IOMUXC_SAI2_TXFS__AUDIOMIX_SAI2_TX_SYNC   0xd6
> +			MX8MP_IOMUXC_SAI2_TXC__AUDIOMIX_SAI2_TX_BCLK    0xd6
> +			MX8MP_IOMUXC_SAI2_RXD0__AUDIOMIX_SAI2_RX_DATA00 0xd6
> +			MX8MP_IOMUXC_SAI2_TXD0__AUDIOMIX_SAI2_TX_DATA00 0xd6
> +		>;
> +	};
> +
>  	pinctrl_smarc_gpio: smarcgpiosgrp {
>  		fsl,pins =
>  			<MX8MP_IOMUXC_GPIO1_IO11__GPIO1_IO11	0x19>, /* GPIO0 */
> 
> base-commit: efdde75fee54667153a5fa236907b55452fddbfa
> -- 
> 2.34.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Shawn Guo <shawnguo@kernel.org>
To: Luca Ceresoli <luca.ceresoli@bootlin.com>
Cc: devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] arm64: dts: imx8mp-msc-sm2s: Add sound card
Date: Sat, 27 May 2023 21:21:49 +0800	[thread overview]
Message-ID: <20230527132149.GD560301@dragon> (raw)
In-Reply-To: <20230525104755.286282-1-luca.ceresoli@bootlin.com>

On Thu, May 25, 2023 at 12:47:55PM +0200, Luca Ceresoli wrote:
> The MSC SM2-MB-EP1 carrier board for the SM2S-IMX8PLUS SMARC module has an
> NXP SGTL5000 audio codec connected to I2S-0 (sai2).
> 
> This requires to:
> 
>  * add the power supplies (always on)
>  * enable sai2 with pinmuxes
>  * reparent the CLKOUT1 clock that feeds the codec SYS_MCLK to
>    IMX8MP_CLK_24M in order it to generate an accurate 24 MHz rate
> 
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> 
> ---
> 
> Changed in v2:
> 
>  - switch to simple-audio-card
>  - fix typo in commit message
>  - no underscores in node names
>  - rename "sgtl5000-sound" node to "sound"
> ---
>  .../dts/freescale/imx8mp-msc-sm2s-ep1.dts     | 70 +++++++++++++++++++
>  1 file changed, 70 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts b/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts
> index 470ff8e31e32..cd651e1e3262 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mp-msc-sm2s-ep1.dts
> @@ -14,6 +14,67 @@ / {
>  	compatible = "avnet,sm2s-imx8mp-14N0600E-ep1",
>  		     "avnet,sm2s-imx8mp-14N0600E", "avnet,sm2s-imx8mp",
>  		     "fsl,imx8mp";
> +
> +	reg_vcc_3v3_audio: 3v3-audio-regulator {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VCC_3V3_AUD";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +	};
> +
> +	reg_vcc_1v8_audio: 1v8-audio-regulator {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VCC_1V8_AUD";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +	};
> +
> +	sound {
> +		compatible = "simple-audio-card";
> +		simple-audio-card,name = "sgtl5000-audio";
> +		simple-audio-card,format = "i2s";
> +		simple-audio-card,frame-master = <&codec_dai>;
> +		simple-audio-card,bitclock-master = <&codec_dai>;
> +
> +		simple-audio-card,cpu {
> +			sound-dai = <&sai2>;
> +		};
> +
> +		codec_dai: simple-audio-card,codec {
> +			sound-dai = <&sgtl5000>;
> +		};
> +	};
> +};
> +
> +&i2c1 {
> +	sgtl5000: sgtl5000@a {

audio-codec for node name.

Shawn

> +		compatible = "fsl,sgtl5000";
> +		reg = <0x0a>;
> +
> +		assigned-clocks = <&clk IMX8MP_CLK_CLKOUT1_SEL>;
> +		assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
> +		assigned-clock-rates = <24000000>;
> +		clocks = <&clk IMX8MP_CLK_CLKOUT1>;
> +		clock-names = "mclk";
> +		#sound-dai-cells = <0>;
> +
> +		VDDA-supply  = <&reg_vcc_3v3_audio>;
> +		VDDD-supply  = <&reg_vcc_1v8_audio>;
> +		VDDIO-supply = <&reg_vcc_1v8_audio>;
> +	};
> +};
> +
> +/* I2S-0 = sai2 */
> +&sai2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_sai2>;
> +
> +	assigned-clocks = <&clk IMX8MP_CLK_SAI2>;
> +	assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
> +	assigned-clock-rates = <12288000>;
> +
> +	fsl,sai-mclk-direction-output;
> +	status = "okay";
>  };
>  
>  &flexcan1 {
> @@ -32,6 +93,15 @@ &iomuxc {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pinctrl_smarc_gpio>;
>  
> +	pinctrl_sai2: sai2grp {
> +		fsl,pins = <
> +			MX8MP_IOMUXC_SAI2_TXFS__AUDIOMIX_SAI2_TX_SYNC   0xd6
> +			MX8MP_IOMUXC_SAI2_TXC__AUDIOMIX_SAI2_TX_BCLK    0xd6
> +			MX8MP_IOMUXC_SAI2_RXD0__AUDIOMIX_SAI2_RX_DATA00 0xd6
> +			MX8MP_IOMUXC_SAI2_TXD0__AUDIOMIX_SAI2_TX_DATA00 0xd6
> +		>;
> +	};
> +
>  	pinctrl_smarc_gpio: smarcgpiosgrp {
>  		fsl,pins =
>  			<MX8MP_IOMUXC_GPIO1_IO11__GPIO1_IO11	0x19>, /* GPIO0 */
> 
> base-commit: efdde75fee54667153a5fa236907b55452fddbfa
> -- 
> 2.34.1
> 

  reply	other threads:[~2023-05-27 13:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 10:47 [PATCH v2] arm64: dts: imx8mp-msc-sm2s: Add sound card Luca Ceresoli
2023-05-25 10:47 ` Luca Ceresoli
2023-05-27 13:21 ` Shawn Guo [this message]
2023-05-27 13:21   ` Shawn Guo

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=20230527132149.GD560301@dragon \
    --to=shawnguo@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.