lcd_extern: add tl050fhv02ct driver
authorWeiming Liu <weiming.liu@amlogic.com>
Tue, 20 Mar 2018 05:21:00 +0000 (13:21 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Tue, 27 Mar 2018 01:35:16 +0000 (17:35 -0800)
PD#162533: lcd_extern: add tl050fhv02ct driver

Change-Id: Ie046eb45542327b77ad3897785ecd99378b689fd
Signed-off-by: Weiming Liu <weiming.liu@amlogic.com>
13 files changed:
MAINTAINERS
arch/arm64/boot/dts/amlogic/mesonaxg_s400-panel.dtsi
arch/arm64/boot/dts/amlogic/mesong12a_skt-panel.dtsi
arch/arm64/configs/meson64_defconfig
drivers/amlogic/media/vout/lcd/lcd_extern/Kconfig
drivers/amlogic/media/vout/lcd/lcd_extern/Makefile
drivers/amlogic/media/vout/lcd/lcd_extern/lcd_extern.c
drivers/amlogic/media/vout/lcd/lcd_extern/lcd_extern.h
drivers/amlogic/media/vout/lcd/lcd_extern/mipi_TL050FHV02CT.c [new file with mode: 0644]
drivers/amlogic/media/vout/lcd/lcd_extern/mipi_TV070WSM.c
drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c
drivers/amlogic/media/vout/lcd/lcd_tablet/mipi_dsi_util.c
drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c

index ff85110..9817d92 100644 (file)
@@ -14398,7 +14398,11 @@ AMLOGIC TAS5756 DRIVER FIX
 M:     Renjun Xu <renjun.xu@amlogic.com>
 F:     sound/soc/codecs/amlogic/tas575x.c
 
-
 AMLOGIC G12A buildroot dts
 M:     wenbiao zhang <wenbiao.zhang@amlogic.com>
 F:     arch/arm64/boot/dts/amlogic/g12a_s905d2_u200_buildroot.dts
+
+AMLOGIC ADD LCD_EXTERN TL050FHV02CT DRIVER
+M:     Weiming Liu <weiming.liu@amlogic.com>
+F:     drivers/amlogic/media/vout/lcd/lcd_extern/mipi_TL050FHV02CT.c
+
index d4fd0f6..ea76d4b 100644 (file)
                                1 /*clk_lp_continuous(0=stop,1=continue)*/
                                0>; /*phy_stop_wait(0=auto,1=standard,2=slow)*/
                                /* dsi_init: data_type, num, data... */
-                       dsi_init_on = <0xff 0xff>; /* ending flag */
+                       dsi_init_on = <
+                               0xf0 3 0 1 30 /* reset high, delay 30ms */
+                               0xf0 3 0 0 10 /* reset low, delay 10ms */
+                               0xf0 3 0 1 30 /* reset high, delay 30ms */
+                               0xff 100   /* delay */
+                               0xff 0xff>; /* ending flag */
                        dsi_init_off = <0xff 0xff>; /* ending flag */
                                /* extern_init: 0xff for invalid */
-                       extern_init = <2>;
+                       extern_init = <1>;
                                /* power step: type,index,value,delay(ms) */
                        power_on_step = <0 0 0 20
                                        2 0 0 0
                        dsi_init_on = <0xff 0xff>; /* ending flag */
                        dsi_init_off = <0xff 0xff>; /* ending flag */
                                /* extern_init: 0xff for invalid */
-                       extern_init = <3>;
+                       extern_init = <2>;
                                /* power step: type,index,value,delay(ms) */
                        power_on_step = <0 0 1 20
                                        0 0 0 10
                        dsi_init_on = <0xff 0xff>; /* ending flag */
                        dsi_init_off = <0xff 0xff>; /* ending flag */
                                /* extern_init: 0xff for invalid */
-                       extern_init = <4>;
+                       extern_init = <3>;
                                /* power step: type,index,value,delay(ms) */
                        power_on_step = <0 0 1 20
                                        0 0 0 10
 
                extern_1{
                        index = <1>;
-                       extern_name = "mipi_KD080D13";
-                       status = "disabled";
+                       extern_name = "mipi_TV070WSM";
+                       status = "okay";
                        type = <2>; /* 0=i2c, 1=spi, 2=mipi */
                };
 
                extern_2{
                        index = <2>;
-                       extern_name = "mipi_TV070WSM";
+                       extern_name = "mipi_ST7701";
                        status = "okay";
                        type = <2>; /* 0=i2c, 1=spi, 2=mipi */
                };
 
                extern_3{
                        index = <3>;
-                       extern_name = "mipi_ST7701";
-                       status = "okay";
-                       type = <2>; /* 0=i2c, 1=spi, 2=mipi */
-               };
-
-               extern_4{
-                       index = <4>;
                        extern_name = "mipi_P070ACB";
                        status = "okay";
                        type = <2>; /* 0=i2c, 1=spi, 2=mipi */
index c86911b..d7d6897 100644 (file)
                                1 /*clk_lp_continuous(0=stop,1=continue)*/
                                0>; /*phy_stop_wait(0=auto,1=standard,2=slow)*/
                                /* dsi_init: data_type, num, data... */
-                       dsi_init_on = <0xff 0xff>; /* ending flag */
+                       dsi_init_on = <
+                               0xf0 3 0 1 30 /* reset high, delay 30ms */
+                               0xf0 3 0 0 10 /* reset low, delay 10ms */
+                               0xf0 3 0 1 30 /* reset high, delay 30ms */
+                               0xff 100   /* delay */
+                               0xff 0xff>; /* ending flag */
                        dsi_init_off = <0xff 0xff>; /* ending flag */
                                /* extern_init: 0xff for invalid */
                        extern_init = <1>;
                                        0xff 0 0 0>;
                        backlight_index = <0>;
                };
+
+               lcd_3{
+                       model_name = "TL050FHV02CT";
+                       interface = "mipi";
+                       basic_setting = <1080 1920 /*h_active, v_active*/
+                               1125 2200 /*h_period, v_period*/
+                               8 /*lcd_bits*/
+                               65 119>; /*screen_widht, screen_height*/
+                       lcd_timing = <5 30 0 /*hs_width,hs_bp,hs_pol*/
+                               88 148 0>; /*vs_width,vs_bp,vs_pol*/
+                       clk_attr = <0 /*fr_adj_type(0=clock,1=htotal,2=vtotal)*/
+                               0 /*clk_ss_level*/
+                               1 /*clk_auto_generate*/
+                               148500000>; /*pixel_clk(unit in Hz)*/
+                       mipi_attr = <4 /*lane_num*/
+                               900 /*bit_rate_max(MHz)*/
+                               0 /*factor(*100, default 0 for auto)*/
+                               1 /*operation_mode_init(0=video, 1=command)*/
+                               0 /*operation_mode_display(0=video, 1=command)*/
+                               2 /*
+                                  *video_mode_type
+                                  *(0=sync_pulse,1=sync_event,2=burst)
+                                  */
+                               1 /*clk_lp_continuous(0=stop,1=continue)*/
+                               0>; /*phy_stop_wait(0=auto,1=standard,2=slow)*/
+                               /* dsi_init: data_type, num, data... */
+                       dsi_init_on = <0xff 0xff>; /* ending flag */
+                       dsi_init_off = <0xff 0xff>; /* ending flag */
+                               /* extern_init: 0xff for invalid */
+                       extern_init = <3>;
+                               /* power step: type,index,value,delay(ms) */
+                       power_on_step = <
+                                       0 1 0 200
+                                       0 0 1 20
+                                       0 0 0 10
+                                       0 0 1 20
+                                       2 0 0 0
+                                       0xff 0 0 0>;
+                       power_off_step = <
+                                       2 0 0 0
+                                       0 0 0 20
+                                       0 1 1 100
+                                       0xff 0 0 0>;
+                       backlight_index = <0>;
+               };
+
+               lcd_4{
+                       model_name = "TL070WSH27";
+                       interface = "mipi";
+                       basic_setting = <1024 600 /*h_active, v_active*/
+                               1250 630 /*h_period, v_period*/
+                               8 /*lcd_bits*/
+                               154 86>; /*screen_widht, screen_height*/
+                       lcd_timing = <80 100 0 /*hs_width, hs_bp, hs_pol*/
+                               5 20 0>; /*vs_width, vs_bp, vs_pol*/
+                       clk_attr = <0 /*fr_adj_type(0=clk, 1=htotal, 2=vtotal)*/
+                               0 /*clk_ss_level */
+                               1 /*clk_auto_generate*/
+                               47250000>; /*pixel_clk(unit in Hz)*/
+                       mipi_attr = <4 /*lane_num*/
+                               300 /*bit_rate_max(MHz)*/
+                               0 /*factor(*100, default 0 for auto)*/
+                               1 /*operation_mode_init(0=video, 1=command)*/
+                               0 /*operation_mode_display(0=video, 1=command)*/
+                               2 /*
+                                  *video_mode_type
+                                  *(0=sync_pulse,1=sync_event,2=burst)
+                                  */
+                               1 /*clk_lp_continuous(0=stop,1=continue)*/
+                               0>; /*phy_stop_wait(0=auto,1=standard,2=slow)*/
+
+                       /* dsi_init: data_type, num, data... */
+                       dsi_init_on = <0x05 1 0x11
+                                       0xff 20     /*delay(ms)*/
+                                       0x05 1 0x29
+                                       0xff 20     /*delay(ms)*/
+                                       0xff 0xff>; /*ending*/
+                       dsi_init_off = <0x05 1 0x28
+                                       0xff 10     /*delay(ms)*/
+                                       0x05 1 0x10
+                                       0xff 10     /*delay(ms)*/
+                                       0xff 0xff>; /*ending*/
+                       extern_init = <0xff>; /*0xff for invalid*/
+
+                       /* power step: type, index, value, delay(ms) */
+                       power_on_step = <
+                               0 1 0 100
+                               0 0 0 10
+                               0 0 1 20
+                               2 0 0 0
+                               0xff 0 0 0>; /*ending*/
+                       power_off_step = <
+                               2 0 0 50
+                               0 0 0 10
+                               0 1 1 100
+                               0xff 0 0 0>; /*ending*/
+                       backlight_index = <0>;
+               };
        };
 
        lcd_extern{
                        status = "okay";
                        type = <2>; /* 0=i2c, 1=spi, 2=mipi */
                };
+
+               extern_3{
+                       index = <3>;
+                       extern_name = "mipi_TL050FHV02CT";
+                       status = "okay";
+                       type = <2>; /* 0=i2c, 1=spi, 2=mipi */
+               };
        };
 
        backlight{
index c0a4173..d3a1700 100644 (file)
@@ -271,10 +271,9 @@ CONFIG_AMLOGIC_LCD=y
 CONFIG_AMLOGIC_LCD_TV=y
 CONFIG_AMLOGIC_LCD_TABLET=y
 CONFIG_AMLOGIC_LCD_EXTERN=y
-CONFIG_AMLOGIC_LCD_EXTERN_MIPI_KD080D13=y
 CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TV070WSM=y
-CONFIG_AMLOGIC_LCD_EXTERN_MIPI_ST7701=y
 CONFIG_AMLOGIC_LCD_EXTERN_MIPI_P070ACB=y
+CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TL050FHV02CT=y
 CONFIG_AMLOGIC_BACKLIGHT=y
 CONFIG_AMLOGIC_BL_EXTERN=y
 CONFIG_AMLOGIC_BL_EXTERN_I2C_LP8556=y
index 6c4413a..7c22f7a 100644 (file)
@@ -103,4 +103,14 @@ config AMLOGIC_LCD_EXTERN_MIPI_P070ACB
                Amlogic LCD external mipi_P070ACB init driver support
                Once the power on, according to the timing requirements,
                through the mipi interface to write data to the LCD,
+               make its initialization
+
+config AMLOGIC_LCD_EXTERN_MIPI_TL050FHV02CT
+       bool "lcd external mipi TL050FHV02CT init driver"
+       default n
+       depends on AMLOGIC_LCD_EXTERN
+       help
+               Amlogic LCD external mipi_TL050FHV02CT init driver support
+               Once the power on, according to the timing requirements,
+               through the mipi interface to write data to the LCD,
                make its initialization
\ No newline at end of file
index 3fc0828..7afcc32 100644 (file)
@@ -6,3 +6,4 @@ obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_KD080D13)          += mipi_KD080D13.o
 obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TV070WSM)         += mipi_TV070WSM.o
 obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_ST7701)           += mipi_ST7701.o
 obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_P070ACB)          += mipi_P070ACB.o
+obj-$(CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TL050FHV02CT)             += mipi_TL050FHV02CT.o
index c09dfa8..65a6d2f 100644 (file)
@@ -1132,6 +1132,10 @@ static int lcd_extern_add_mipi(struct aml_lcd_extern_driver_s *ext_drv)
 #ifdef CONFIG_AMLOGIC_LCD_EXTERN_MIPI_P070ACB
                ret = aml_lcd_extern_mipi_p070acb_probe(ext_drv);
 #endif
+       } else if (strcmp(ext_drv->config.name, "mipi_TL050FHV02CT") == 0) {
+#ifdef CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TL050FHV02CT
+               ret = aml_lcd_extern_mipi_tl050fhv02ct_probe(ext_drv);
+#endif
        } else {
                EXTERR("invalid driver name: %s\n", ext_drv->config.name);
                ret = -1;
index 390f7fe..b0f2387 100644 (file)
@@ -81,6 +81,10 @@ extern int aml_lcd_extern_mipi_st7701_probe(
 extern int aml_lcd_extern_mipi_p070acb_probe(
        struct aml_lcd_extern_driver_s *ext_drv);
 #endif
+#ifdef CONFIG_AMLOGIC_LCD_EXTERN_MIPI_TL050FHV02CT
+extern int aml_lcd_extern_mipi_tl050fhv02ct_probe(
+       struct aml_lcd_extern_driver_s *ext_drv);
+#endif
 
 #endif
 
diff --git a/drivers/amlogic/media/vout/lcd/lcd_extern/mipi_TL050FHV02CT.c b/drivers/amlogic/media/vout/lcd/lcd_extern/mipi_TL050FHV02CT.c
new file mode 100644 (file)
index 0000000..3cf4f5d
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * drivers/amlogic/media/vout/lcd/lcd_extern/mipi_TL050FHV02CT.c
+ *
+ * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/i2c.h>
+#include <linux/amlogic/i2c-amlogic.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/amlogic/media/vout/lcd/lcd_extern.h>
+#include "lcd_extern.h"
+
+#define LCD_EXTERN_NAME                        "mipi_TL050FHV02CT"
+
+/* ******************** mipi command ********************
+ * format:  data_type, num, data....
+ * special: data_type=0xff, num<0xff means delay ms, num=0xff means ending.
+ */
+static unsigned char mipi_init_on_table[] = {
+       0x29, 6, 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x03,
+       0x29, 10, 0x90, 0x03, 0x14, 0x09, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
+       0x29, 10, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x29, 12, 0x92, 0x40, 0x0B, 0x0C, 0x0D, 0x0E, 0x00, 0x38, 0x00, 0x10,
+                       0x03, 0x04,
+       0x29, 9, 0x94, 0x00, 0x08, 0x0B, 0x03, 0xD2, 0x03, 0xD3, 0x0C,
+       0x29, 17, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x29, 3, 0x99, 0x00, 0x00,
+       0x29, 12, 0x9A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+                       0x00, 0x00,
+       0x29, 7, 0x9B, 0x01, 0x38, 0x00, 0x00, 0x00, 0x00,
+       0x29, 3, 0x9C, 0x00, 0x00,
+       0x29, 9, 0x9D, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00,
+       0x29, 3, 0x9E, 0x00, 0x00,
+       0x29, 11, 0xA0, 0x9F, 0x1F, 0x08, 0x1F, 0x0A, 0x1F, 0x00, 0x1F, 0x14,
+                       0x1F,
+       0x29, 11, 0xA1, 0x15, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+                       0x1F,
+       0x29, 11, 0xA2, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+                       0x1F,
+       0x29, 11, 0xA4, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+                       0x1F,
+       0x29, 11, 0xA5, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+                       0x15,
+       0x29, 11, 0xA6, 0x1F, 0x14, 0x1F, 0x01, 0x1F, 0x0B, 0x1F, 0x09, 0x1F,
+                       0x1F,
+       0x29, 11, 0xA7, 0x1F, 0x1F, 0x0B, 0x1F, 0x09, 0x1F, 0x01, 0x1F, 0x15,
+                       0x1F,
+       0x29, 11, 0xA8, 0x14, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+                       0x1F,
+       0x29, 11, 0xA9, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+                       0x1F,
+       0x29, 11, 0xAB, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+                       0x1F,
+       0x29, 11, 0xAC, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+                       0x14,
+       0x29, 11, 0xAD, 0x1F, 0x15, 0x1F, 0x00, 0x1F, 0x08, 0x1F, 0x0A, 0x1F,
+                       0x1F,
+       0x29, 6, 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x00,
+       0x29, 4, 0xBC, 0x00, 0x00, 0x00,
+       0x29, 5, 0xB8, 0x01, 0xAF, 0x8F, 0x8F,
+       0x29, 6, 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x01,
+       0x29, 17, 0xD1, 0x00, 0x00, 0x00, 0x09, 0x00, 0x1F, 0x00, 0x30, 0x00,
+                       0x3F, 0x00, 0x5D, 0x00, 0x79, 0x00, 0xA7,
+       0x29, 17, 0xD2, 0x00, 0xCF, 0x01, 0x12, 0x01, 0x49, 0x01, 0xA1, 0x01,
+                       0xEB, 0x01, 0xED, 0x02, 0x2F, 0x02, 0x74,
+       0x29, 17, 0xD3, 0x02, 0x9F, 0x02, 0xD5, 0x02, 0xFB, 0x03, 0x2C, 0x03,
+                       0x4B, 0x03, 0x73, 0x03, 0x8C, 0x03, 0xA5,
+       0x29, 5, 0xD4, 0x03, 0xC5, 0x03, 0xFF,
+       0x29, 17, 0xD5, 0x00, 0x00, 0x00, 0x09, 0x00, 0x1F, 0x00, 0x30, 0x00,
+                       0x3F, 0x00, 0x5D, 0x00, 0x79, 0x00, 0xA7,
+       0x29, 17, 0xD6, 0x00, 0xCF, 0x01, 0x12, 0x01, 0x49, 0x01, 0xA1, 0x01,
+                       0xEB, 0x01, 0xED, 0x02, 0x2F, 0x02, 0x74,
+       0x29, 17, 0xD7, 0x02, 0x9F, 0x02, 0xD5, 0x02, 0xFB, 0x03, 0x2C, 0x03,
+                       0x4B, 0x03, 0x73, 0x03, 0x8C, 0x03, 0xA5,
+       0x29, 5, 0xD8, 0x03, 0xC5, 0x03, 0xFF,
+       0x29, 17, 0xD9, 0x00, 0x00, 0x00, 0x09, 0x00, 0x1F, 0x00, 0x30, 0x00,
+                       0x3F, 0x00, 0x5D, 0x00, 0x79, 0x00, 0xA7,
+       0x29, 17, 0xDD, 0x00, 0xCF, 0x01, 0x12, 0x01, 0x49, 0x01, 0xA1, 0x01,
+                       0xEB, 0x01, 0xED, 0x02, 0x2F, 0x02, 0x74,
+       0x29, 17, 0xDE, 0x02, 0x9F, 0x02, 0xD5, 0x02, 0xFB, 0x03, 0x2C, 0x03,
+                       0x4B, 0x03, 0x73, 0x03, 0x8C, 0x03, 0xA5,
+       0x29, 5, 0xDF, 0x03, 0xC5, 0x03, 0xFF,
+       0x29, 17, 0xE0, 0x00, 0x00, 0x00, 0x09, 0x00, 0x1F, 0x00, 0x30, 0x00,
+                       0x3F, 0x00, 0x5D, 0x00, 0x79, 0x00, 0xA7,
+       0x29, 17, 0xE1, 0x00, 0xCF, 0x01, 0x12, 0x01, 0x49, 0x01, 0xA1, 0x01,
+                       0xEB, 0x01, 0xED, 0x02, 0x2F, 0x02, 0x74,
+       0x29, 17, 0xE2, 0x02, 0x9F, 0x02, 0xD5, 0x02, 0xFB, 0x03, 0x2C, 0x03,
+                       0x4B, 0x03, 0x73, 0x03, 0x8C, 0x03, 0xA5,
+       0x29, 5, 0xE3, 0x03, 0xC5, 0x03, 0xFF,
+       0x29, 17, 0xE4, 0x00, 0x00, 0x00, 0x09, 0x00, 0x1F, 0x00, 0x30, 0x00,
+                       0x3F, 0x00, 0x5D, 0x00, 0x79, 0x00, 0xA7,
+       0x29, 17, 0xE5, 0x00, 0xCF, 0x01, 0x12, 0x01, 0x49, 0x01, 0xA1, 0x01,
+                       0xEB, 0x01, 0xED, 0x02, 0x2F, 0x02, 0x74,
+       0x29, 17, 0xE6, 0x02, 0x9F, 0x02, 0xD5, 0x02, 0xFB, 0x03, 0x2C, 0x03,
+                       0x4B, 0x03, 0x73, 0x03, 0x8C, 0x03, 0xA5,
+       0x29, 5, 0xE7, 0x03, 0xC5, 0x03, 0xFF,
+       0x29, 17, 0xE8, 0x00, 0x00, 0x00, 0x09, 0x00, 0x1F, 0x00, 0x30, 0x00,
+                       0x3F, 0x00, 0x5D, 0x00, 0x79, 0x00, 0xA7,
+       0x29, 17, 0xE9, 0x00, 0xCF, 0x01, 0x12, 0x01, 0x49, 0x01, 0xA1, 0x01,
+                       0xEB, 0x01, 0xED, 0x02, 0x2F, 0x02, 0x74,
+       0x29, 17, 0xEA, 0x02, 0x9F, 0x02, 0xD5, 0x02, 0xFB, 0x03, 0x2C, 0x03,
+                       0x4B, 0x03, 0x73, 0x03, 0x8C, 0x03, 0xA5,
+       0x29, 5, 0xEB, 0x03, 0xC5, 0x03, 0xFF,
+       0x29, 4, 0xB0, 0x05, 0x05, 0x05,
+       0x29, 4, 0xB1, 0x05, 0x05, 0x05,
+       0x29, 4, 0xB3, 0x10, 0x10, 0x10,
+       0x29, 4, 0xB4, 0x06, 0x06, 0x06,
+       0x29, 4, 0xB6, 0x44, 0x44, 0x44,
+       0x29, 4, 0xB7, 0x34, 0x34, 0x34,
+       0x29, 4, 0xB8, 0x34, 0x34, 0x34,
+       0x29, 4, 0xB9, 0x24, 0x24, 0x24,
+       0x29, 4, 0xBA, 0x24, 0x24, 0x24,
+       0x29, 4, 0xBC, 0x00, 0x70, 0x00,
+       0x29, 4, 0xBD, 0x00, 0x70, 0x00,
+       0x23, 2, 0xBE, 0x50,
+       0x23, 2, 0x35, 0x00,
+       0x13, 1, 0x11,
+       0xff, 200,
+       0x13, 1, 0x29,
+       0xff, 200,
+       0xFF, 0xFF,   /* ending flag */
+};
+
+static unsigned char mipi_init_off_table[] = {
+       0x05, 1, 0x28, /* display off */
+       0xff, 10,      /* delay 10ms */
+       0x05, 1, 0x10, /* sleep in */
+       0xff, 150,      /* delay 150ms */
+       0xff, 0xff,   /* ending flag */
+};
+
+static int lcd_extern_driver_update(struct aml_lcd_extern_driver_s *ext_drv)
+{
+       int ret = 0;
+
+       if (ext_drv) {
+               ext_drv->config.table_init_on  = &mipi_init_on_table[0];
+               ext_drv->config.table_init_off = &mipi_init_off_table[0];
+       } else {
+               EXTERR("%s driver is null\n", LCD_EXTERN_NAME);
+               ret = -1;
+       }
+
+       return ret;
+}
+
+int aml_lcd_extern_mipi_tl050fhv02ct_probe(
+       struct aml_lcd_extern_driver_s *ext_drv)
+{
+       int ret = 0;
+
+       ret = lcd_extern_driver_update(ext_drv);
+
+       if (lcd_debug_print_flag)
+               EXTPR("%s: %d\n", __func__, ret);
+       return ret;
+}
+
index d2cebcd..c15558c 100644 (file)
  *             data0=gpio_index, data1=gpio_value, data2=delay.
  */
 static unsigned char mipi_init_on_table[] = {
-       0xf0, 3, 0, 1, 30, /* reset high, delay 30ms */
-       0xf0, 3, 0, 0, 10, /* reset low, delay 10ms */
-       0xf0, 3, 0, 1, 30, /* reset high, delay 30ms */
-       0xff, 100,   /* delay */
        0x15, 2, 0x62, 0x01,
        0x39, 5, 0xff, 0xaa, 0x55, 0x25, 0x01,
        0x15, 2, 0xfc, 0x08,
index d2811ac..4b36cf7 100644 (file)
@@ -660,7 +660,6 @@ static int lcd_config_load_from_dts(struct lcd_config_s *pconf,
        }
        ret = of_property_read_u32_array(child, "range_setting", &para[0], 6);
        if (ret) {
-               LCDPR("failed to get range_setting\n");
                pconf->lcd_basic.h_period_min = pconf->lcd_basic.h_period;
                pconf->lcd_basic.h_period_max = pconf->lcd_basic.h_period;
                pconf->lcd_basic.v_period_min = pconf->lcd_basic.v_period;
index 19dca14..12cb30f 100644 (file)
@@ -123,6 +123,17 @@ static void mipi_dsi_init_table_print(struct dsi_config_s *dconf, int on_off)
                                pr_info("  0x%02x,%d,\n",
                                        dsi_table[i], dsi_table[i+1]);
                        }
+               } else if (dsi_table[i] == 0xf0) {
+                       n = (DSI_CMD_SIZE_INDEX + 1) +
+                               dsi_table[i+DSI_CMD_SIZE_INDEX];
+                       pr_info("  ");
+                       for (j = 0; j < n; j++) {
+                               if (j == 0)
+                                       pr_info("0x%02x,", dsi_table[i+j]);
+                               else
+                                       pr_info("%d,", dsi_table[i+j]);
+                       }
+                       pr_info("\n");
                } else if ((dsi_table[i] & 0xf) == 0x0) {
                        pr_info("dsi_init_%s wrong data_type: 0x%02x\n",
                                on_off ? "on" : "off", dsi_table[i]);
@@ -1704,6 +1715,11 @@ static void mipi_dsi_link_on(struct lcd_config_s *pconf)
        if (dconf->check_en)
                mipi_dsi_check_state(dconf, dconf->check_reg, dconf->check_cnt);
 
+       if (dconf->dsi_init_on) {
+               dsi_write_cmd(dconf->dsi_init_on);
+               LCDPR("dsi init on\n");
+       }
+
 #ifdef CONFIG_AMLOGIC_LCD_EXTERN
        if (dconf->extern_init < LCD_EXTERN_INDEX_INVALID) {
                lcd_ext = aml_lcd_extern_get_driver(dconf->extern_init);
@@ -1711,22 +1727,14 @@ static void mipi_dsi_link_on(struct lcd_config_s *pconf)
                        LCDPR("no lcd_extern driver\n");
                } else {
                        if (lcd_ext->config.table_init_on) {
-                               dsi_write_cmd(
-                                       lcd_ext->config.table_init_on);
+                               dsi_write_cmd(lcd_ext->config.table_init_on);
                                LCDPR("[extern]%s dsi init on\n",
                                        lcd_ext->config.name);
-                               goto mipi_dsi_link_disp;
                        }
                }
        }
 #endif
 
-       if (dconf->dsi_init_on) {
-               dsi_write_cmd(dconf->dsi_init_on);
-               LCDPR("dsi init on\n");
-       }
-
-mipi_dsi_link_disp:
        if (op_mode_disp != op_mode_init) {
                set_mipi_dsi_host(MIPI_DSI_VIRTUAL_CHAN_ID,
                        0, /* Chroma sub sample, only for
index 695e3e4..3f6c253 100644 (file)
@@ -792,7 +792,7 @@ static int lcd_config_load_from_dts(struct lcd_config_s *pconf,
        }
        ret = of_property_read_u32_array(child, "range_setting", &para[0], 6);
        if (ret) {
-               LCDERR("failed to get range_setting\n");
+               LCDERR("no range_setting\n");
                pconf->lcd_basic.h_period_min = pconf->lcd_basic.h_period;
                pconf->lcd_basic.h_period_max = pconf->lcd_basic.h_period;
                pconf->lcd_basic.v_period_min = pconf->lcd_basic.v_period;