cec: cec bringup for tm2 [1/1]
authorYong Qin <yong.qin@amlogic.com>
Wed, 10 Apr 2019 08:37:54 +0000 (16:37 +0800)
committerYong Qin <yong.qin@amlogic.com>
Fri, 12 Apr 2019 06:18:26 +0000 (14:18 +0800)
PD#SWPL-6945

Problem:
bringup for tm2

Solution:
add chip support and modify dts

Verify:
tm2

Change-Id: I718c3b81912a3555e19866f96d392bfb09d27384
Signed-off-by: Yong Qin <yong.qin@amlogic.com>
12 files changed:
arch/arm/boot/dts/amlogic/tm2_pxp.dts
arch/arm/boot/dts/amlogic/tm2_t962e2_ab311.dts
arch/arm/boot/dts/amlogic/tm2_t962e2_ab319.dts
arch/arm/boot/dts/amlogic/tm2_t962x3_ab301.dts
arch/arm/boot/dts/amlogic/tm2_t962x3_ab309.dts
arch/arm64/boot/dts/amlogic/tm2_pxp.dts
arch/arm64/boot/dts/amlogic/tm2_t962e2_ab311.dts
arch/arm64/boot/dts/amlogic/tm2_t962e2_ab319.dts
arch/arm64/boot/dts/amlogic/tm2_t962x3_ab301.dts
arch/arm64/boot/dts/amlogic/tm2_t962x3_ab309.dts
drivers/amlogic/cec/hdmi_ao_cec.c
drivers/amlogic/cec/hdmi_ao_cec.h

index e114cfb2022b0038e2b651d6e4a1dfa07fdeea3e..af0a6c74bbb7a025bbfe2408356cbbfa7737496e 100644 (file)
        };
 
        aocec: aocec {
-               compatible = "amlogic, aocec-tl1";
+               compatible = "amlogic, aocec-tm2";
                /*device_name = "aocec";*/
                status = "okay";
                vendor_name = "Amlogic"; /* Max Chars: 8         */
                 * http://standards.ieee.org/develop/regauth/oui/oui.txt
                 */
                vendor_id = <0x000000>;
-               product_desc = "TL1"; /* Max Chars: 16    */
+               product_desc = "TM2"; /* Max Chars: 16    */
                cec_osd_string = "AML_TV"; /* Max Chars: 14    */
                port_num = <3>;
                ee_cec;
+               /*cec_sel = <2>;*/
+               output = <1>;   /*output port number*/
                arc_port_mask = <0x2>;
                interrupts = <0 205 1
                                        0 199 1>;
index 86f9a7e0b63d3c12bed8b7f16827c21aaf068e80..be5525c8d3498b294dff4903770b006101011231 100644 (file)
        };
 
        aocec: aocec {
-               compatible = "amlogic, aocec-tl1";
+               compatible = "amlogic, aocec-tm2";
                /*device_name = "aocec";*/
                status = "okay";
                vendor_name = "Amlogic"; /* Max Chars: 8         */
                 * http://standards.ieee.org/develop/regauth/oui/oui.txt
                 */
                vendor_id = <0x000000>;
-               product_desc = "TL1"; /* Max Chars: 16    */
+               product_desc = "TM2"; /* Max Chars: 16    */
                cec_osd_string = "AML_TV"; /* Max Chars: 14    */
                port_num = <3>;
                ee_cec;
+               /*cec_sel = <2>;*/
+               output = <1>;   /*output port number*/
                arc_port_mask = <0x2>;
                interrupts = <0 205 1
                                        0 199 1>;
index 2737e4433a0c504858f514b6da97b2da9b55d4a2..cef956ea935c8603a085022fb9b108b3f90a1597 100644 (file)
        };
 
        aocec: aocec {
-               compatible = "amlogic, aocec-tl1";
+               compatible = "amlogic, aocec-tm2";
                /*device_name = "aocec";*/
                status = "okay";
                vendor_name = "Amlogic"; /* Max Chars: 8         */
                 * http://standards.ieee.org/develop/regauth/oui/oui.txt
                 */
                vendor_id = <0x000000>;
-               product_desc = "TL1"; /* Max Chars: 16    */
+               product_desc = "TM2"; /* Max Chars: 16    */
                cec_osd_string = "AML_TV"; /* Max Chars: 14    */
                port_num = <3>;
                ee_cec;
+               /*cec_sel = <2>;*/
+               output = <1>;   /*output port number*/
                arc_port_mask = <0x2>;
                interrupts = <0 205 1
                                        0 199 1>;
index 14810b25da3efde45fdad3c3c036068bc3d1770e..9317aab57b051997f3a67a9c24c6f7fb1dc53557 100644 (file)
        };
 
        aocec: aocec {
-               compatible = "amlogic, aocec-tl1";
+               compatible = "amlogic, aocec-tm2";
                /*device_name = "aocec";*/
                status = "okay";
                vendor_name = "Amlogic"; /* Max Chars: 8         */
                 * http://standards.ieee.org/develop/regauth/oui/oui.txt
                 */
                vendor_id = <0x000000>;
-               product_desc = "TL1"; /* Max Chars: 16    */
+               product_desc = "TM2"; /* Max Chars: 16    */
                cec_osd_string = "AML_TV"; /* Max Chars: 14    */
                port_num = <3>;
                ee_cec;
+               /*cec_sel = <2>;*/
                arc_port_mask = <0x2>;
+               output = <1>;   /*output port number*/
                interrupts = <0 205 1
                                        0 199 1>;
                interrupt-names = "hdmi_aocecb","hdmi_aocec";
index f3241507a4fe3d3d9c14c6cc89c331305a4d0647..06c9db02dcedce18eafcaae1b5ded504f9a9c93b 100644 (file)
        };
 
        aocec: aocec {
-               compatible = "amlogic, aocec-tl1";
+               compatible = "amlogic, aocec-tm2";
                /*device_name = "aocec";*/
                status = "okay";
                vendor_name = "Amlogic"; /* Max Chars: 8         */
                 * http://standards.ieee.org/develop/regauth/oui/oui.txt
                 */
                vendor_id = <0x000000>;
-               product_desc = "TL1"; /* Max Chars: 16    */
+               product_desc = "TM2"; /* Max Chars: 16    */
                cec_osd_string = "AML_TV"; /* Max Chars: 14    */
                port_num = <3>;
                ee_cec;
+               /*cec_sel = <2>;*/
                arc_port_mask = <0x2>;
+               output = <1>;   /*output port number*/
                interrupts = <0 205 1
                                        0 199 1>;
                interrupt-names = "hdmi_aocecb","hdmi_aocec";
index 03464aeea87dd739ad453f6d33ca8be045dff231..3b51644a3d4994a1f979858e9c2f47a19996b775 100644 (file)
        };
 
        aocec: aocec {
-               compatible = "amlogic, aocec-tl1";
+               compatible = "amlogic, aocec-tm2";
                /*device_name = "aocec";*/
                status = "okay";
                vendor_name = "Amlogic"; /* Max Chars: 8         */
                 * http://standards.ieee.org/develop/regauth/oui/oui.txt
                 */
                vendor_id = <0x000000>;
-               product_desc = "TL1"; /* Max Chars: 16    */
+               product_desc = "TM2"; /* Max Chars: 16    */
                cec_osd_string = "AML_TV"; /* Max Chars: 14    */
                port_num = <3>;
                ee_cec;
+               /*cec_sel = <2>;*/
+               output = <1>;   /*output port number*/
                arc_port_mask = <0x2>;
                interrupts = <0 205 1
                                        0 199 1>;
index f44b119efd85ae35e1807f44c531c4a7e94f634c..fac27b09dd6ca961fe7e7794108008925d2b766b 100644 (file)
        };
 
        aocec: aocec {
-               compatible = "amlogic, aocec-tl1";
+               compatible = "amlogic, aocec-tm2";
                /*device_name = "aocec";*/
                status = "okay";
                vendor_name = "Amlogic"; /* Max Chars: 8         */
                 * http://standards.ieee.org/develop/regauth/oui/oui.txt
                 */
                vendor_id = <0x000000>;
-               product_desc = "TL1"; /* Max Chars: 16    */
+               product_desc = "TM2"; /* Max Chars: 16    */
                cec_osd_string = "AML_TV"; /* Max Chars: 14    */
                port_num = <3>;
                ee_cec;
+               /*cec_sel = <2>;*/
+               output = <1>;   /*output port number*/
                arc_port_mask = <0x2>;
                interrupts = <0 205 1
                                        0 199 1>;
index 0aba9cab1afca2211c03876fcb78ffb321d7de86..759181fe174bbc5844053440b845553c21ba9e59 100644 (file)
        };
 
        aocec: aocec {
-               compatible = "amlogic, aocec-tl1";
+               compatible = "amlogic, aocec-tm2";
                /*device_name = "aocec";*/
                status = "okay";
                vendor_name = "Amlogic"; /* Max Chars: 8         */
                 * http://standards.ieee.org/develop/regauth/oui/oui.txt
                 */
                vendor_id = <0x000000>;
-               product_desc = "TL1"; /* Max Chars: 16    */
+               product_desc = "TM2"; /* Max Chars: 16    */
                cec_osd_string = "AML_TV"; /* Max Chars: 14    */
                port_num = <3>;
                ee_cec;
+               /*cec_sel = <2>;*/
+               output = <1>;   /*output port number*/
                arc_port_mask = <0x2>;
                interrupts = <0 205 1
                                        0 199 1>;
index 3e0a50d0591b8e9418378a076ac53247f3edd2d1..6270a8c17a11b0c3395982b6d5f8a34c409a9993 100644 (file)
        };
 
        aocec: aocec {
-               compatible = "amlogic, aocec-tl1";
+               compatible = "amlogic, aocec-tm2";
                /*device_name = "aocec";*/
                status = "okay";
                vendor_name = "Amlogic"; /* Max Chars: 8         */
                 * http://standards.ieee.org/develop/regauth/oui/oui.txt
                 */
                vendor_id = <0x000000>;
-               product_desc = "TL1"; /* Max Chars: 16    */
+               product_desc = "TM2"; /* Max Chars: 16    */
                cec_osd_string = "AML_TV"; /* Max Chars: 14    */
                port_num = <3>;
                ee_cec;
+               /*cec_sel = <2>;*/
+               output = <1>;   /*output port number*/
                arc_port_mask = <0x2>;
                interrupts = <0 205 1
                                        0 199 1>;
index f29033d609c0779db38584409a4aec59e096672c..7d0e00c4b70c7e31b79f2b41d2b4e870e85fd997 100644 (file)
        };
 
        aocec: aocec {
-               compatible = "amlogic, aocec-tl1";
+               compatible = "amlogic, aocec-tm2";
                /*device_name = "aocec";*/
                status = "okay";
                vendor_name = "Amlogic"; /* Max Chars: 8         */
                 * http://standards.ieee.org/develop/regauth/oui/oui.txt
                 */
                vendor_id = <0x000000>;
-               product_desc = "TL1"; /* Max Chars: 16    */
+               product_desc = "TM2"; /* Max Chars: 16    */
                cec_osd_string = "AML_TV"; /* Max Chars: 14    */
                port_num = <3>;
                ee_cec;
+               /*cec_sel = <2>;*/
                arc_port_mask = <0x2>;
+               output = <1>;   /*output port number*/
                interrupts = <0 205 1
                                        0 199 1>;
                interrupt-names = "hdmi_aocecb","hdmi_aocec";
index 02a543a4559fee6da699990dcc465a544231427e..20891eefc007cfd54b6e97a25a16917ab45fd82b 100644 (file)
@@ -82,6 +82,7 @@ struct cec_platform_data_s {
        bool ee_to_ao;/*ee cec hw module mv to ao;ao cec delete*/
        bool ceca_sts_reg;/*add new internal status register*/
        enum cecbver cecb_ver;/* detail discription ref enum cecbver */
+       enum cecaver ceca_ver;
 };
 
 
@@ -1179,6 +1180,13 @@ void cec_enable_arc_pin(bool enable)
 {
        unsigned int data;
 
+       if (is_meson_sm1_cpu() ||
+                       cpu_after_eq(MESON_CPU_MAJOR_ID_TM2)) {
+               /*sm1 and tm2 later, audio module handle this*/
+
+               return;
+       }
+
        if (cec_dev->plat_data->cecb_ver >= CECB_VER_2) {
                data = rd_reg_hhi(HHI_HDMIRX_ARC_CNTL);
                /* enable bit 1:1 bit 0: 0*/
@@ -3108,6 +3116,7 @@ static const struct cec_platform_data_s cec_g12a_data = {
        .line_bit = 3,
        .ee_to_ao = 1,
        .ceca_sts_reg = 0,
+       .ceca_ver = CECA_VER_0,
        .cecb_ver = CECB_VER_1,
 };
 
@@ -3116,6 +3125,7 @@ static const struct cec_platform_data_s cec_txl_data = {
        .line_bit = 7,
        .ee_to_ao = 0,
        .ceca_sts_reg = 0,
+       .ceca_ver = CECA_VER_0,
        .cecb_ver = CECB_VER_0,
 };
 
@@ -3124,6 +3134,7 @@ static const struct cec_platform_data_s cec_tl1_data = {
        .line_bit = 10,
        .ee_to_ao = 1,
        .ceca_sts_reg = 1,
+       .ceca_ver = CECA_VER_0,
        .cecb_ver = CECB_VER_2,
 };
 
@@ -3132,6 +3143,16 @@ static const struct cec_platform_data_s cec_sm1_data = {
        .line_bit = 3,
        .ee_to_ao = 1,
        .ceca_sts_reg = 1,
+       .ceca_ver = CECA_VER_1,
+       .cecb_ver = CECB_VER_2,
+};
+
+static const struct cec_platform_data_s cec_tm2_data = {
+       .line_reg = 0,
+       .line_bit = 3,
+       .ee_to_ao = 1,
+       .ceca_sts_reg = 1,
+       .ceca_ver = CECA_VER_1,
        .cecb_ver = CECB_VER_2,
 };
 
@@ -3160,6 +3181,10 @@ static const struct of_device_id aml_cec_dt_match[] = {
                .compatible = "amlogic, aocec-sm1",
                .data = &cec_sm1_data,
        },
+       {
+               .compatible = "amlogic, aocec-tm2",
+               .data = &cec_tm2_data,
+       },
        {}
 };
 #endif
index 7d0228706822db18cde829a8f480335d12726685..5613c5cf66f36b219dbcaee166881df903a149f8 100644 (file)
 #define CEC_PHY_PORT_NUM               4
 #define HR_DELAY(n)            (ktime_set(0, n * 1000 * 1000))
 
+enum cecaver {
+       /*first version*/
+       CECA_VER_0 = 0,
+
+       /*support multi logical address*/
+       CECA_VER_1 = 1,
+};
+
 enum cecbver {
        /*first version*/
        CECB_VER_0 = 0,