arm64: dts: librem5-devkit: add the sgtl5000 i2c audio codec
authorAngus Ainslie (Purism) <angus@akkea.ca>
Thu, 27 Feb 2020 13:17:27 +0000 (14:17 +0100)
committerShawn Guo <shawnguo@kernel.org>
Wed, 11 Mar 2020 07:59:03 +0000 (15:59 +0800)
Describe the sgtl5000 of the librem 5 devkit in devicetree.

Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts

index bab039500f2b5fd79c60e63ead67084e6fb2583b..c829e457954040b2cd185bed0749a828b1658dfb 100644 (file)
                regulator-always-on;
        };
 
+       sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "sgtl5000";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,widgets =
+                       "Microphone", "Microphone Jack",
+                       "Headphone", "Headphone Jack",
+                       "Speaker", "Speaker Ext",
+                       "Line", "Line In Jack";
+               simple-audio-card,routing =
+                       "MIC_IN", "Microphone Jack",
+                       "Microphone Jack", "Mic Bias",
+                       "LINE_IN", "Line In Jack",
+                       "Headphone Jack", "HP_OUT",
+                       "Speaker Ext", "LINE_OUT";
+
+               simple-audio-card,cpu {
+                       sound-dai = <&sai2>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&sgtl5000>;
+                       clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
+                       frame-master;
+                       bitclock-master;
+               };
+       };
+
        vibrator {
                compatible = "gpio-vibrator";
                pinctrl-names = "default";
                vddio-supply = <&reg_3v3_p>;
        };
 
+       sgtl5000: audio-codec@a {
+               compatible = "fsl,sgtl5000";
+               clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
+               assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
+               assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
+               assigned-clock-rates = <24576000>;
+               #sound-dai-cells = <0>;
+               reg = <0x0a>;
+               VDDD-supply = <&reg_1v8_p>;
+               VDDIO-supply = <&reg_3v3_p>;
+               VDDA-supply = <&reg_3v3_p>;
+       };
+
        touchscreen@5d {
                compatible = "goodix,gt5688";
                reg = <0x5d>;
                >;
        };
 
+       pinctrl_sai2: sai2grp {
+               fsl,pins = <
+                       MX8MQ_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC     0xd6
+                       MX8MQ_IOMUXC_SAI2_TXC_SAI2_TX_BCLK      0xd6
+                       MX8MQ_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0    0xd6
+                       MX8MQ_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0    0xd6
+                       MX8MQ_IOMUXC_SAI2_MCLK_SAI2_MCLK        0xd6
+               >;
+       };
+
        pinctrl_typec: typecgrp {
                fsl,pins = <
                        MX8MQ_IOMUXC_NAND_DATA06_GPIO3_IO12             0x16
        status = "okay";
 };
 
+&sai2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_sai2>;
+       assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
+       assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
+       assigned-clock-rates = <24576000>;
+       status = "okay";
+};
+
 &uart1 { /* console */
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart1>;