diff mbox

[v3,2/4] ARM: dts: pbab01: enable I2S audio on phyFLEX-i.MX6 boards

Message ID 1410854903-26419-3-git-send-email-d.lavnikevich@sam-solutions.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dmitry Lavnikevich Sept. 16, 2014, 8:08 a.m. UTC
Audio on phyFLEX boards is presented by tlv320aic3007 codec connected
over SSI interface.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
---
 arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi | 103 ++++++++++++++++++++++++++-
 arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi |  15 ++++
 2 files changed, 116 insertions(+), 2 deletions(-)

Comments

Fabio Estevam Oct. 1, 2014, 12:11 p.m. UTC | #1
On Tue, Sep 16, 2014 at 5:08 AM, Dmitry Lavnikevich
<d.lavnikevich@sam-solutions.com> wrote:

> +       regulators {
> +               sound_1v8: regulator@2 {

We usually start counting from @0.

> +                       compatible = "regulator-fixed";
> +                       reg = <2>;
> +                       regulator-name = "i2s-audio-1v8";
> +                       regulator-min-microvolt = <1800000>;
> +                       regulator-max-microvolt = <1800000>;
> +                       regulator-always-on;

No need to have this 'regulator-always-on'

> +               };
> +
> +               sound_3v3: regulator@3 {

,so this one should be @1.

> +                       compatible = "regulator-fixed";
> +                       reg = <3>;
> +                       regulator-name = "i2s-audio-3v3";
> +                       regulator-min-microvolt = <3300000>;
> +                       regulator-max-microvolt = <3300000>;
> +                       regulator-always-on;

No need to have this 'regulator-always-on'

> +&ssi2 {
> +       fsl,mode = "i2s-slave";

Please remove this 'fsl,mode' property. It is ignored by the fsl_ssi driver.
Dmitry Lavnikevich Oct. 1, 2014, 1:40 p.m. UTC | #2
On 01/10/14 15:11, Fabio Estevam wrote:
> On Tue, Sep 16, 2014 at 5:08 AM, Dmitry Lavnikevich
> <d.lavnikevich@sam-solutions.com> wrote:
>
>> +       regulators {
>> +               sound_1v8: regulator@2 {
>
> We usually start counting from @0.
>
...
 >> +               };
 >> +
 >> +               sound_3v3: regulator@3 {
 >
 > ,so this one should be @1.

@0 and @1 are used for "usb_otg_vbus" and "usb_h1_vbus" regulators in 
dts for phyFLEX module (imx6qdl-phytec-pfla02.dtsi) which gets included 
before base board dts (imx6qdl-phytec-pbab01.dtsi)

>> +                       compatible = "regulator-fixed";
>> +                       reg = <2>;
>> +                       regulator-name = "i2s-audio-1v8";
>> +                       regulator-min-microvolt = <1800000>;
>> +                       regulator-max-microvolt = <1800000>;
>> +                       regulator-always-on;
>
> No need to have this 'regulator-always-on'
>
...
>> +                       compatible = "regulator-fixed";
>> +                       reg = <3>;
>> +                       regulator-name = "i2s-audio-3v3";
>> +                       regulator-min-microvolt = <3300000>;
>> +                       regulator-max-microvolt = <3300000>;
>> +                       regulator-always-on;
>
> No need to have this 'regulator-always-on'
>

why is there no need for 'regulator-alweys-on'? I see it in
similar fixed regulator descriptions in imx6qdl-sabrelite.dtsi,
imx6qdl-wandboard.dtsi, imx6qdl-nitrogen6x.dtsi and many other
boards.

>> +&ssi2 {
>> +       fsl,mode = "i2s-slave";
>
> Please remove this 'fsl,mode' property. It is ignored by the fsl_ssi driver.

yes, thanks. It is present in Documentation but now I see that it
was actually removed not that long ago. I will remove this
property with next patchset.
Fabio Estevam Oct. 1, 2014, 1:45 p.m. UTC | #3
On Wed, Oct 1, 2014 at 10:40 AM, Dmitry Lavnikevich
<d.lavnikevich@sam-solutions.com> wrote:

>> No need to have this 'regulator-always-on'
>>
>
> why is there no need for 'regulator-alweys-on'? I see it in

For a regulator that is not GPIO controlled you don't need to pass
'regulator-always-on'.

>
>>> +&ssi2 {
>>> +       fsl,mode = "i2s-slave";
>>
>>
>> Please remove this 'fsl,mode' property. It is ignored by the fsl_ssi
>> driver.
>
>
> yes, thanks. It is present in Documentation but now I see that it
> was actually removed not that long ago. I will remove this
> property with next patchset.

Correct, I recently sent a patch removing it and it is in Mark's tree now:
https://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/?h=topic/fsl-ssi&id=b93427b1c057841602e0fe2005153a6e82f2e658
Dmitry Lavnikevich Oct. 1, 2014, 1:52 p.m. UTC | #4
On 01/10/14 16:45, Fabio Estevam wrote:
> On Wed, Oct 1, 2014 at 10:40 AM, Dmitry Lavnikevich
> <d.lavnikevich@sam-solutions.com> wrote:
>
>>> No need to have this 'regulator-always-on'
>>>
>>
>> why is there no need for 'regulator-alweys-on'? I see it in
>
> For a regulator that is not GPIO controlled you don't need to pass
> 'regulator-always-on'.

Ok, I will remove it also.

I will wait some time for other notes on patches and resend patchset.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
index f1bdcae5b97d..c0369673707b 100644
--- a/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
@@ -9,10 +9,75 @@ 
  * http://www.gnu.org/copyleft/gpl.html
  */
 
+#include <dt-bindings/sound/fsl-imx-audmux.h>
+
 / {
 	chosen {
 		linux,stdout-path = &uart4;
 	};
+
+	regulators {
+		sound_1v8: regulator@2 {
+			compatible = "regulator-fixed";
+			reg = <2>;
+			regulator-name = "i2s-audio-1v8";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-always-on;
+		};
+
+		sound_3v3: regulator@3 {
+			compatible = "regulator-fixed";
+			reg = <3>;
+			regulator-name = "i2s-audio-3v3";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-always-on;
+		};
+	};
+
+	tlv320_mclk: oscillator {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <19200000>;
+		clock-output-names = "tlv320-mclk";
+	};
+
+	sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "imx6-phyflex-tlv320aic3007";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,bitclock-master = <&dailink_master>;
+		simple-audio-card,frame-master = <&dailink_master>;
+		simple-audio-card,widgets =
+			"Microphone", "Mic Jack",
+			"Line", "Line In",
+			"Line", "Line Out",
+			"Speaker", "Speaker",
+			"Headphone", "Headphone Jack";
+		simple-audio-card,routing =
+			"Line Out", "LLOUT",
+			"Line Out", "RLOUT",
+			"Speaker", "SPOP",
+			"Speaker", "SPOM",
+			"Headphone Jack", "HPLOUT",
+			"Headphone Jack", "HPROUT",
+			"MIC3L", "Mic Jack",
+			"MIC3R", "Mic Jack",
+			"Mic Jack", "Mic Bias",
+			"LINE1L", "Line In",
+			"LINE1R", "Line In";
+
+		simple-audio-card,cpu {
+			sound-dai = <&ssi2>;
+		};
+
+		dailink_master: simple-audio-card,codec {
+			sound-dai = <&codec>;
+			clocks = <&tlv320_mclk>;
+		};
+	};
+
 };
 
 &fec {
@@ -27,12 +92,46 @@ 
 	status = "okay";
 };
 
+&ssi2 {
+	fsl,mode = "i2s-slave";
+	status = "okay";
+};
+
+&audmux {
+	status = "okay";
+
+	ssi2 {
+		fsl,audmux-port = <1>;
+		fsl,port-config = <
+			(IMX_AUDMUX_V2_PTCR_TFSDIR |
+			IMX_AUDMUX_V2_PTCR_TFSEL(4) |
+			IMX_AUDMUX_V2_PTCR_TCLKDIR |
+			IMX_AUDMUX_V2_PTCR_TCSEL(4))
+	                IMX_AUDMUX_V2_PDCR_RXDSEL(4)
+		>;
+	};
+	pins5 {
+		fsl,audmux-port = <4>;
+		fsl,port-config = <
+			0x00000000
+			IMX_AUDMUX_V2_PDCR_RXDSEL(1)
+		>;
+	};
+};
+
 &i2c2 {
 	status = "okay";
 
-	tlv320@18 {
-		compatible = "ti,tlv320aic3x";
+	codec: tlv320@18 {
+		compatible = "ti,tlv320aic3007";
+		#sound-dai-cells = <0>;
 		reg = <0x18>;
+		ai3x-micbias-vg = <2>;
+
+		AVDD-supply = <&sound_3v3>;
+		IOVDD-supply = <&sound_3v3>;
+		DRVDD-supply = <&sound_3v3>;
+		DVDD-supply = <&sound_1v8>;
 	};
 
 	stmpe@41 {
diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
index aa2275671d2c..d7f34664e008 100644
--- a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
@@ -58,6 +58,12 @@ 
 	};
 };
 
+&audmux {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_audmux>;
+	status = "disabled";
+};
+
 &ecspi3 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_ecspi3>;
@@ -319,6 +325,15 @@ 
 				MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000
 			>;
 		};
+
+		pinctrl_audmux: audmuxgrp {
+			fsl,pins = <
+				MX6QDL_PAD_DISP0_DAT16__AUD5_TXC	0x130b0
+				MX6QDL_PAD_DISP0_DAT18__AUD5_TXFS	0x130b0
+				MX6QDL_PAD_DISP0_DAT17__AUD5_TXD	0x110b0
+				MX6QDL_PAD_DISP0_DAT19__AUD5_RXD	0x130b0
+			>;
+		};
 	};
 };