2014-10-29 13:47:30

by Dmitry Lavnikevich

[permalink] [raw]
Subject: [PATCH v5 0/3] Add Phytec pbab01 audio support

By mistake previous patchset versions was sent as in-reply-to to
previous patchset versions, so they may have been lost among other
mails.

One of pathces was already applied by Mark Brown, here is 3 patches
implementing audio support on Phytec phyFLEX-i.MX6 boards.

This patchset version only renames audio card name to
OnboardTLV320AIC3007 (on request from Phytec).

Patches are based on branch for-next of
git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git


2014-10-29 13:47:32

by Dmitry Lavnikevich

[permalink] [raw]
Subject: [PATCH v5 3/3] ARM: imx_v6_v7_defconfig: enable tlv320aic3x audio codec by default

Used on Phytec PBAB01 board.

Signed-off-by: Dmitry Lavnikevich <[email protected]>
---
arch/arm/configs/imx_v6_v7_defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 8fca6e276b69..cac07d67b933 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -210,6 +210,7 @@ CONFIG_SND_SOC_IMX_WM8962=y
CONFIG_SND_SOC_IMX_SGTL5000=y
CONFIG_SND_SOC_IMX_SPDIF=y
CONFIG_SND_SOC_IMX_MC13783=y
+CONFIG_SND_SOC_TLV320AIC3X=y
CONFIG_SND_SIMPLE_CARD=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
--
2.1.2

2014-10-29 13:47:29

by Dmitry Lavnikevich

[permalink] [raw]
Subject: [PATCH v5 2/3] ARM: dts: pbab01: enable I2S audio on phyFLEX-i.MX6 boards

Audio on phyFLEX boards is presented by tlv320aic3007 codec connected
over SSI interface.

Signed-off-by: Dmitry Lavnikevich <[email protected]>
---
arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi | 100 ++++++++++++++++++++++++++-
arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi | 15 ++++
2 files changed, 113 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
index f1bdcae5b97d..cb8f1b6ec083 100644
--- a/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
@@ -9,10 +9,73 @@
* 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>;
+ };
+
+ sound_3v3: regulator@3 {
+ compatible = "regulator-fixed";
+ reg = <3>;
+ regulator-name = "i2s-audio-3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ };
+ };
+
+ 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 = "OnboardTLV320AIC3007";
+ 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 +90,45 @@
status = "okay";
};

+&ssi2 {
+ 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
+ >;
+ };
};
};

--
2.1.2

2014-10-29 13:47:28

by Dmitry Lavnikevich

[permalink] [raw]
Subject: [PATCH v5 1/3] ARM: dts: pbab01: move i2c pins and frequency configuration into pfla02

Since pins and frequency are specific to module (pfla02), not base board
(pbab02), it is better to be initialized in corresponding dts file.

This patch fixes i2c2, i2c3 pin configuration which caused messages:

imx6q-pinctrl 20e0000.iomuxc: no groups defined in /soc/aips-bus@02000000/iomuxc@020e0000/i2c2grp
imx6q-pinctrl 20e0000.iomuxc: no groups defined in /soc/aips-bus@02000000/iomuxc@020e0000/i2c3grp
imx6q-pinctrl 20e0000.iomuxc: unable to find group for node i2c2grp
imx6q-pinctrl 20e0000.iomuxc: unable to find group for node i2c3grp

Signed-off-by: Dmitry Lavnikevich <[email protected]>
---
arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi | 22 ----------------------
arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi | 26 ++++++++++++++++++++++++++
2 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
index 584721264121..f1bdcae5b97d 100644
--- a/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
@@ -28,9 +28,6 @@
};

&i2c2 {
- pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_i2c2>;
- clock-frequency = <100000>;
status = "okay";

tlv320@18 {
@@ -55,9 +52,6 @@
};

&i2c3 {
- pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_i2c3>;
- clock-frequency = <100000>;
status = "okay";
};

@@ -84,19 +78,3 @@
&usdhc3 {
status = "okay";
};
-
-&iomuxc {
- pinctrl_i2c2: i2c2grp {
- fsl,pins = <
- MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
- MX6QDL_PAD_EIM_D16__I2C2_SDA 0x4001b8b1
- >;
- };
-
- pinctrl_i2c3: i2c3grp {
- fsl,pins = <
- MX6QDL_PAD_EIM_D17__I2C3_SCL 0x4001b8b1
- MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
- >;
- };
-};
diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
index 0e50bb0a6b94..aa2275671d2c 100644
--- a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
@@ -162,6 +162,18 @@
};
};

+&i2c2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c2>;
+ clock-frequency = <100000>;
+};
+
+&i2c3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c3>;
+ clock-frequency = <100000>;
+};
+
&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog>;
@@ -235,6 +247,20 @@
>;
};

+ pinctrl_i2c2: i2c2grp {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
+ MX6QDL_PAD_EIM_D16__I2C2_SDA 0x4001b8b1
+ >;
+ };
+
+ pinctrl_i2c3: i2c3grp {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_D17__I2C3_SCL 0x4001b8b1
+ MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
+ >;
+ };
+
pinctrl_uart3: uart3grp {
fsl,pins = <
MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
--
2.1.2

2014-10-29 13:53:18

by Fabio Estevam

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH v5 0/3] Add Phytec pbab01 audio support

On Wed, Oct 29, 2014 at 11:47 AM, Dmitry Lavnikevich
<[email protected]> wrote:
> By mistake previous patchset versions was sent as in-reply-to to
> previous patchset versions, so they may have been lost among other
> mails.
>
> One of pathces was already applied by Mark Brown, here is 3 patches
> implementing audio support on Phytec phyFLEX-i.MX6 boards.
>
> This patchset version only renames audio card name to
> OnboardTLV320AIC3007 (on request from Phytec).
>
> Patches are based on branch for-next of
> git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git

Adding Shawn's email from Linaro.

2014-11-03 06:14:25

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH v5 2/3] ARM: dts: pbab01: enable I2S audio on phyFLEX-i.MX6 boards

On Wed, Oct 29, 2014 at 04:47:03PM +0300, Dmitry Lavnikevich wrote:
> Audio on phyFLEX boards is presented by tlv320aic3007 codec connected
> over SSI interface.
>
> Signed-off-by: Dmitry Lavnikevich <[email protected]>
> ---
> arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi | 100 ++++++++++++++++++++++++++-
> arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi | 15 ++++
> 2 files changed, 113 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
> index f1bdcae5b97d..cb8f1b6ec083 100644
> --- a/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-phytec-pbab01.dtsi
> @@ -9,10 +9,73 @@
> * 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>;
> + };
> +
> + sound_3v3: regulator@3 {
> + compatible = "regulator-fixed";
> + reg = <3>;
> + regulator-name = "i2s-audio-3v3";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + };
> + };
> +
> + 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 = "OnboardTLV320AIC3007";
> + 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 +90,45 @@
> status = "okay";
> };
>
> +&ssi2 {
> + status = "okay";
> +};
> +
> +&audmux {

Please sort the nodes alphabetically in label name.

> + 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 {

Have a new line between nodes.

> + 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";

Both compatible strings are documented in
Documentation/devicetree/bindings/sound/tlv320aic3x.txt. But I hope
this change will not cause any DT compatible issues.

> + #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 {

Please sort the pinctrl entries alphabetically.

Shawn

> + 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
> + >;
> + };
> };
> };
>
> --
> 2.1.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2014-11-04 11:41:16

by Dmitry Lavnikevich

[permalink] [raw]
Subject: Re: [PATCH v5 2/3] ARM: dts: pbab01: enable I2S audio on phyFLEX-i.MX6 boards


> On 3Nov, 2014, at 09:14, Shawn Guo <[email protected]> wrote:
> On Wed, Oct 29, 2014 at 04:47:03PM +0300, Dmitry Lavnikevich wrote:
>> + 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";
>
> Both compatible strings are documented in
> Documentation/devicetree/bindings/sound/tlv320aic3x.txt. But I hope
> this change will not cause any DT compatible issues.

This change is needed because unlike other tlv320aic3x-codecs tlv320aic3007 has D-class amplifier which is controlled by set of registers that in case of 3x-codecs control mono output.

I will correct patches according to other notes and soon will resend patchset.-