From b8d02950d8c50611c2784c7a40e0b3003acf8d49 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Thu, 18 Jul 2024 09:38:11 +0800
Subject: [PATCH] Patch:IGKBoard-IMX8MP: Add HDMI support

---
 kernel/patches/igkboard-imx8mp/linux-imx-lf-6.1.36-2.1.0.patch |  129 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 123 insertions(+), 6 deletions(-)

diff --git a/kernel/patches/igkboard-imx8mp/linux-imx-lf-6.1.36-2.1.0.patch b/kernel/patches/igkboard-imx8mp/linux-imx-lf-6.1.36-2.1.0.patch
index 9a930f9..35f779b 100644
--- a/kernel/patches/igkboard-imx8mp/linux-imx-lf-6.1.36-2.1.0.patch
+++ b/kernel/patches/igkboard-imx8mp/linux-imx-lf-6.1.36-2.1.0.patch
@@ -10,10 +10,10 @@
 +dtb-$(CONFIG_ARCH_MXC) += igkboard-imx8mp.dtb
 diff --git a/arch/arm64/boot/dts/freescale/igkboard-imx8mp.dts b/arch/arm64/boot/dts/freescale/igkboard-imx8mp.dts
 new file mode 100644
-index 000000000..8ce653b69
+index 000000000..016d92023
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/igkboard-imx8mp.dts
-@@ -0,0 +1,712 @@
+@@ -0,0 +1,829 @@
 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 +/* 
 + * Device Tree Source for LingYun IGKBoard(IoT Gateway Kits Board) - imx8mp
@@ -105,6 +105,25 @@
 +            gpios = <&gpio5 27 GPIO_ACTIVE_LOW>;
 +            linux,code = <BTN_4>;
 +        };
++    };
++
++    sound-wm8960 {
++        compatible = "fsl,imx-audio-wm8960";
++        model = "wm8960-audio";
++        audio-cpu = <&sai3>;
++        audio-codec = <&codec>;
++        audio-asrc = <&easrc>;
++        //hp-det-gpio = <&gpio4 29 0>;
++        audio-routing =
++            "Headphone Jack", "HP_L",
++            "Headphone Jack", "HP_R",
++            "Ext Spk", "SPK_LP",
++            "Ext Spk", "SPK_LN",
++            "Ext Spk", "SPK_RP",
++            "Ext Spk", "SPK_RN",
++            "LINPUT1", "Mic Jack",
++            "LINPUT3", "Mic Jack",
++            "Mic Jack", "MICB";
 +    };
 +};
 +
@@ -272,10 +291,12 @@
 +    pinctrl-0 = <&pinctrl_i2c2>;
 +    status = "okay";
 +
-+    rtc1208@6f {
-+        compatible = "isil,isl1208";
-+        reg = <0x6f>;
-+        status = "okay";
++    codec: wm8960@1a {
++        compatible = "wlf,wm8960";
++        reg = <0x1a>;
++        clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>;
++        clock-names = "mclk";
++        wlf,shared-lrclk;
 +    };
 +
 +    ms1112@4a {
@@ -299,11 +320,81 @@
 +                ti,mode = <1>;
 +        };
 +    };
++
++    rtc1208@6f {
++        compatible = "isil,isl1208";
++        reg = <0x6f>;
++        status = "okay";
++    };
++};
++
++/*+------------------------+
++  |   WM8960 Audio Codec   |
++  +------------------------+*/
++
++&sai3 {
++    pinctrl-names = "default";
++    pinctrl-0 = <&pinctrl_sai3>;
++    assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
++    assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
++    assigned-clock-rates = <12288000>;
++    clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_IPG>, <&clk IMX8MP_CLK_DUMMY>,
++         <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
++         <&clk IMX8MP_CLK_DUMMY>;
++    clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
++    fsl,sai-mclk-direction-output;
++    status = "okay";
++};
++
++&easrc {
++    fsl,asrc-rate  = <48000>;
++    status = "okay";
++};
++
++&xcvr {
++    #sound-dai-cells = <0>;
++    status = "okay";
++};
++
++&sdma2 {
++    status = "okay";
++};
++
++/*+------------------------+
++  |      HDMI Display      |
++  +------------------------+*/
++
++&irqsteer_hdmi {
++    status = "okay";
++};
++
++&hdmi_blk_ctrl {
++    status = "okay";
++};
++
++&hdmi_pavi {
++    status = "okay";
++};
++
++&hdmi {
++    status = "okay";
++};
++
++&hdmiphy {
++    status = "okay";
++};
++
++&lcdif3 {
++    status = "okay";
++
++    thres-low  = <1 2>;     /* (FIFO * 1 / 2) */
++    thres-high = <3 4>;     /* (FIFO * 3 / 4) */
 +};
 +
 +/*+------------------------+
 +  |  CAN/RS485 interface   |
 +  +------------------------+*/
++
 +/* RS485 */
 +&uart3 {
 +    pinctrl-names = "default";
@@ -490,6 +581,21 @@
 +
 +&iomuxc {
 +    pinctrl-names = "default";
++    pinctrl-0 = <&pinctrl_hog>;
++
++    pinctrl_hog: hoggrp {
++        fsl,pins = <
++            MX8MP_IOMUXC_HDMI_DDC_SCL__HDMIMIX_HDMI_SCL                 0x400001c2
++            MX8MP_IOMUXC_HDMI_DDC_SDA__HDMIMIX_HDMI_SDA                 0x400001c2
++            MX8MP_IOMUXC_HDMI_HPD__HDMIMIX_HDMI_HPD                     0x40000010
++            MX8MP_IOMUXC_HDMI_CEC__HDMIMIX_HDMI_CEC                     0x40000010
++            /*
++             * M.2 pin20 & pin21 need to be set to 11 for 88W9098 to select the
++             * default Reference Clock Frequency
++             */
++            MX8MP_IOMUXC_SD1_DATA7__GPIO2_IO09                          0x1c4
++        >;
++    };
 +
 +    pinctrl_wdog: wdoggrp {
 +        fsl,pins = <
@@ -592,6 +698,17 @@
 +        >;
 +    };
 +
++    pinctrl_sai3: sai3grp {
++        fsl,pins = <
++            MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC               0xd6
++            MX8MP_IOMUXC_SAI3_TXC__AUDIOMIX_SAI3_TX_BCLK                0xd6
++            MX8MP_IOMUXC_SAI3_RXD__AUDIOMIX_SAI3_RX_DATA00              0xd6
++            MX8MP_IOMUXC_SAI3_TXD__AUDIOMIX_SAI3_TX_DATA00              0xd6
++            MX8MP_IOMUXC_SAI3_MCLK__AUDIOMIX_SAI3_MCLK                  0xd6
++            MX8MP_IOMUXC_SAI3_RXC__GPIO4_IO29                           0xd6
++        >;
++    };
++
 +    pinctrl_pmic: pmicirq {
 +        fsl,pins = <
 +            MX8MP_IOMUXC_GPIO1_IO03__GPIO1_IO03                         0x41

--
Gitblit v1.9.1