Commit c53f0166 authored by Angus Ainslie (Purism)'s avatar Angus Ainslie (Purism) Committed by Shawn Guo
Browse files

arm64: dts: librem5-devkit: add the sgtl5000 i2c audio codec



Describe the sgtl5000 of the librem 5 devkit in devicetree.

Signed-off-by: default avatarAngus Ainslie (Purism) <angus@akkea.ca>
Signed-off-by: default avatarMartin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent dde061b8
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
@@ -148,6 +148,34 @@
		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";
@@ -426,6 +454,19 @@
		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>;
@@ -567,6 +608,16 @@
		>;
	};

	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
@@ -742,6 +793,15 @@
	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>;