lcd: meson: add support for txl
authorEvoke Zhang <evoke.zhang@amlogic.com>
Tue, 26 Jun 2018 05:56:12 +0000 (13:56 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Wed, 18 Jul 2018 09:48:16 +0000 (02:48 -0700)
PD#168480: lcd: meson: add support for txl

Change-Id: I8bf458282886f162e4777def4a74f661a0f9f4c0
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
MAINTAINERS
arch/arm64/boot/dts/amlogic/mesontxl_p321-panel.dtsi [new file with mode: 0644]
drivers/amlogic/media/vout/backlight/aml_bl.c
drivers/amlogic/media/vout/lcd/lcd_clk_config.c
drivers/amlogic/media/vout/lcd/lcd_clk_config.h
drivers/amlogic/media/vout/lcd/lcd_common.h
drivers/amlogic/media/vout/lcd/lcd_tv/lcd_drv.c
drivers/amlogic/media/vout/lcd/lcd_vout.c
include/linux/amlogic/media/vout/lcd/aml_bl.h
include/linux/amlogic/media/vout/lcd/lcd_vout.h

index 78bf3a6..ed88657 100644 (file)
@@ -14530,3 +14530,7 @@ AMLOGIC TXL PINCTRL DRIVER
 M:     Xingyu Chen <xingyu.chen@amlogic.com>
 F:     drivers/amlogic/pinctrl/pinctrl-meson-txl.c
 F:     include/dt-bindings/gpio/meson-txl-gpio.h
+
+AMLOGIC TXL PANEL DRIVER
+M:     evoke zhang <evoke.zhang@amlogic.com>
+F:     arch/arm64/boot/dts/amlogic/mesontxl_p321-panel.dtsi
diff --git a/arch/arm64/boot/dts/amlogic/mesontxl_p321-panel.dtsi b/arch/arm64/boot/dts/amlogic/mesontxl_p321-panel.dtsi
new file mode 100644 (file)
index 0000000..722f865
--- /dev/null
@@ -0,0 +1,589 @@
+/*
+ * arch/arm64/boot/dts/amlogic/mesontxl_p321-panel.dtsi
+ *
+ * Copyright (C) 2016 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.
+ *
+ */
+
+/ {
+       lcd {
+               compatible = "amlogic, lcd-txl";
+               dev_name = "lcd";
+               mode = "tv";
+               status = "okay";
+               fr_auto_policy = <1>; /* 0=disable, 1=60/50hz, 2=60/50/48hz */
+               key_valid = <1>;
+               clocks = <&clkc CLKID_VCLK2_ENCL
+                       &clkc CLKID_VCLK2_VENCL>;
+               clock-names = "encl_top_gate",
+                       "encl_int_gate";
+               reg = <0x0 0xc8834400 0x0 0x100>;
+               interrupts = <0 3 1
+                       0 78 1>;
+               interrupt-names = "vsync","vbyone";
+               pinctrl-names = "vbyone";
+               pinctrl-0 = <&lcd_vbyone_pins>;
+               pinctrl_version = <2>; /* for uboot */
+
+               /* power type:(0=cpu_gpio, 2=signal, 3=extern, 0xff=ending) */
+               /* power index:(gpios_index, or extern_index, 0xff=invalid) */
+               /* power value:(0=output low, 1=output high, 2=input) */
+               /* power delay:(unit in ms) */
+               lcd_cpu-gpios = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH
+                       &gpio GPIOH_6 GPIO_ACTIVE_HIGH
+                       &gpio GPIOH_4 GPIO_ACTIVE_HIGH
+                       &gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
+               lcd_cpu_gpio_names = "GPIOH_7","GPIOH_6",
+                       "GPIOH_6","GPIOH_5";
+
+               lvds_0{
+                       model_name = "1080p-vfreq";
+                       interface = "lvds"; /*lcd_interface(lvds, vbyone)*/
+                       basic_setting = <
+                               1920 1080 /*h_active, v_active*/
+                               2200 1125 /*h_period, v_period*/
+                               8      /*lcd_bits */
+                               16 9>; /*screen_widht, screen_height*/
+                       range_setting = <
+                               2060 2650  /*h_period_min,max*/
+                               1100 1480  /*v_period_min,max*/
+                               120000000 160000000>; /*pclk_min,max*/
+                       lcd_timing = <
+                               44 148 0  /*hs_width, hs_bp, hs_pol*/
+                               5  30 0>; /*vs_width, vs_bp, vs_pol*/
+                       clk_attr = <
+                               2 /*fr_adj_type
+                                  *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
+                                  * 4=hdmi_mode)
+                                  */
+                               3 /*clk_ss_level*/
+                               1 /*clk_auto_generate*/
+                               0>; /*pixel_clk(unit in Hz)*/
+                       lvds_attr = <
+                               1  /*lvds_repack*/
+                               1  /*dual_port*/
+                               0  /*pn_swap*/
+                               0  /*port_swap*/
+                               0>; /*lane_reverse*/
+                       phy_attr=<
+                               3 0   /*vswing_level, preem_level*/
+                               0 0>; /*clk vswing_level, preem_level*/
+
+                       /* power step: type, index, value, delay(ms) */
+                       power_on_step = <
+                               0 0 1 20  /*panel power on*/
+                               2 0 0 0   /*signal enable*/
+                               0xff 0 0 0>; /*ending*/
+                       power_off_step = <
+                               2 0 0 10  /*signal disable*/
+                               0 0 0 100 /*panel power off*/
+                               0xff 0 0 0>; /*ending*/
+                       backlight_index = <0>;
+               };
+               lvds_1{
+                       model_name = "1080p-hfreq_hdmi";
+                       interface = "lvds"; /*lcd_interface(lvds, vbyone)*/
+                       basic_setting = <
+                               1920 1080 /*h_active, v_active*/
+                               2200 1125 /*h_period, v_period*/
+                               8      /*lcd_bits*/
+                               16 9>; /*screen_widht, screen_height*/
+                       range_setting = <
+                               2080 2720 /*h_period min, max*/
+                               1100 1380 /*v_period min, max*/
+                               133940000 156000000>; /*pclk_min, max*/
+                       lcd_timing = <
+                               44 148 0   /*hs_width, hs_bp, hs_pol*/
+                               5  30  0>; /*vs_width, vs_bp, vs_pol*/
+                       clk_attr = <
+                               4 /*fr_adj_type
+                                  *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
+                                  * 4=hdmi_mode)
+                                  */
+                               0 /*clk_ss_level */
+                               1 /*clk_auto_generate*/
+                               0>; /*pixel_clk(unit in Hz)*/
+                       lvds_attr = <
+                               1 /*lvds_repack*/
+                               1 /*dual_port*/
+                               0 /*pn_swap*/
+                               0 /*port_swap*/
+                               0>; /*lane_reverse*/
+                       phy_attr=<
+                               3 0   /*vswing_level, preem_level*/
+                               0 0>; /*clk vswing_level, preem_level*/
+
+                       /* power step: type, index, value, delay(ms) */
+                       power_on_step = <
+                               0 0 1 20  /*panel power on*/
+                               2 0 0 0   /*signal enable*/
+                               0xff 0 0 0>; /*ending*/
+                       power_off_step = <
+                               2 0 0 10  /*signal disable*/
+                               0 0 0 100 /*panel power off*/
+                               0xff 0 0 0>; /*ending*/
+                       backlight_index = <0>;
+               };
+               lvds_2{
+                       model_name = "768p-vfreq";
+                       interface = "lvds"; /*lcd_interface(lvds, vbyone)*/
+                       basic_setting = <
+                               1366 768 /*h_active, v_active*/
+                               1560 806 /*h_period, v_period*/
+                               8      /*lcd_bits*/
+                               16 9>; /*screen_widht, screen_height*/
+                       range_setting = <
+                               1460 2000 /*h_period_min, max */
+                               784 1015  /*v_period_min, max */
+                               50000000 85000000>; /*pclk_min, max*/
+                       lcd_timing = <
+                               56 64 0   /*hs_width, hs_bp, hs_pol*/
+                               3  28 0>; /*vs_width, vs_bp, vs_pol*/
+                       clk_attr = <
+                               2 /*fr_adj_type
+                                  *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
+                                  * 4=hdmi_mode)
+                                  */
+                               3 /*clk_ss_level*/
+                               1 /*clk_auto_generate*/
+                               0>; /*pixel_clk(unit in Hz)*/
+                       lvds_attr = <
+                               1  /*lvds_repack*/
+                               0  /*dual_port*/
+                               0  /*pn_swap*/
+                               0  /*port_swap*/
+                               0>; /*lane_reverse*/
+                       phy_attr=<
+                               3 0   /*vswing_level, preem_level*/
+                               0 0>; /*clk vswing_level, preem_level*/
+
+                       /* power step: type, index, value, delay(ms) */
+                       power_on_step = <
+                               0 0 1 20  /*panel power on*/
+                               2 0 0 0   /*signal enable*/
+                               0xff 0 0 0>; /*ending*/
+                       power_off_step = <
+                               2 0 0 10  /*signal disable*/
+                               0 0 0 100 /*panel power off*/
+                               0xff 0 0 0>; /*ending*/
+                       backlight_index = <0>;
+               };
+               vbyone_0{
+                       model_name = "ref_2region";
+                       interface = "vbyone"; /*lcd_interface(lvds, vbyone)*/
+                       basic_setting = <
+                               3840 2160 /*h_active, v_active*/
+                               4400 2250 /*h_period, v_period*/
+                               10     /*lcd_bits */
+                               16 9>; /*screen_widht, screen_height*/
+                       range_setting = <
+                               4240 4800 /*h_period_min, max*/
+                               2200 2760 /*v_period_min, max*/
+                               480000000 624000000>; /*pclk_min, max*/
+                       lcd_timing = <
+                               33 477 0  /*hs_width, hs_bp, hs_pol*/
+                               6  65 0>; /*vs_width, vs_bp, vs_pol*/
+                       clk_attr = <
+                               2 /*fr_adj_type
+                                  *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
+                                  * 4=hdmi_mode)
+                                  */
+                               1 /*clk_ss_level*/
+                               1 /*clk_auto_generate*/
+                               0>; /*pixel_clk(unit in Hz)*/
+                       vbyone_attr = <
+                               8 /*lane_count*/
+                               2 /*region_num*/
+                               4 /*byte_mode*/
+                               4>; /*color_fmt*/
+                       vbyone_intr_enable = <
+                               1 /*vbyone_intr_enable */
+                               3>; /*vbyone_vsync_intr_enable*/
+                       phy_attr=<3 0>; /* vswing_level, preem_level */
+
+                       /* power step: type, index, value, delay(ms) */
+                       power_on_step = <0 0 1 20 /*panel power on*/
+                                       2 0 0 10  /*signal enable*/
+                                       0xff 0 0 0>; /*ending*/
+                       power_off_step = <2 0 0 10 /*signal disable*/
+                                       0 0 0 100  /*panel power off*/
+                                       0xff 0 0 0>; /*ending*/
+                       backlight_index = <3>;
+               };
+               vbyone_1{
+                       model_name = "ref_1region";
+                       interface = "vbyone"; /*lcd_interface(lvds, vbyone)*/
+                       basic_setting = <
+                               3840 2160 /*h_active, v_active*/
+                               4400 2250 /*h_period, v_period*/
+                               10     /*lcd_bits*/
+                               16 9>; /*screen_widht, screen_height*/
+                       range_setting = <
+                               4240 4800 /*h_period_min, max*/
+                               2200 2790 /*v_period_min, max*/
+                               552000000 632000000>; /*pclk_min,max*/
+                       lcd_timing = <
+                               33 477 0   /*hs_width, hs_bp, hs_pol*/
+                               6  65  0>; /*vs_width, vs_bp, vs_pol*/
+                       clk_attr = <
+                               2 /*fr_adj_type
+                                  *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
+                                  * 4=hdmi_mode)
+                                  */
+                               1 /*clk_ss_level*/
+                               1 /*clk_auto_generate*/
+                               0>; /*pixel_clk(unit in Hz)*/
+                       vbyone_attr = <
+                               8 /*lane_count*/
+                               1 /*region_num*/
+                               4 /*byte_mode*/
+                               4>; /*color_fmt*/
+                       vbyone_intr_enable = <
+                               1   /*vbyone_intr_enable*/
+                               3>; /*vbyone_vsync_intr_enable*/
+                       phy_attr=<3 0>; /*vswing_level, preem_level*/
+
+                       /* power step: type, index, value, delay(ms) */
+                       power_on_step = <
+                               0 0 1 20 /*panel power on*/
+                               2 0 0 10 /*signal enable*/
+                               0xff 0 0 0>; /*ending*/
+                       power_off_step = <
+                               2 0 0 10  /*signal disable*/
+                               0 0 0 100 /*panel power off*/
+                               0xff 0 0 0>; /*ending*/
+                       backlight_index = <3>;
+               };
+               vbyone_2{
+                       model_name = "ref_2region_hdmi";
+                       interface = "vbyone"; /*lcd_interface(lvds, vbyone)*/
+                       basic_setting = <
+                               3840 2160 /*h_active, v_active*/
+                               4400 2250 /*h_period, v_period*/
+                               10     /*lcd_bits*/
+                               16 9>; /*screen_widht, screen_height*/
+                       range_setting = <
+                               4240 4800 /*h_period_min, max*/
+                               2200 2760 /*v_period_min, max*/
+                               480000000 624000000>; /*v_period_min, max*/
+                       lcd_timing = <
+                               33 477 0 /*hs_width, hs_bp, hs_pol*/
+                               6 65 0>; /*vs_width, vs_bp, vs_pol*/
+                       clk_attr = <
+                               4 /*fr_adj_type
+                                  *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
+                                  * 4=hdmi_mode)
+                                  */
+                               0 /*clk_ss_level*/
+                               1 /*clk_auto_generate*/
+                               0>; /*pixel_clk(unit in Hz)*/
+                       vbyone_attr = <
+                               8 /*lane_count*/
+                               2 /*region_num*/
+                               4 /*byte_mode*/
+                               4>; /*color_fmt*/
+                       vbyone_intr_enable = <
+                               1   /*vbyone_intr_enable*/
+                               3>; /*vbyone_vsync_intr_enable*/
+                       phy_attr=<3 0>; /*vswing_level, preem_level*/
+
+                       /* power step: type, index, value, delay(ms) */
+                       power_on_step = <
+                               0 0 1 20 /*panel power on*/
+                               2 0 0 10 /*signal enable*/
+                               0xff 0 0 0>; /*ending*/
+                       power_off_step = <
+                               2 0 0 10  /*signal disable*/
+                               0 0 0 100 /*panel power off*/
+                               0xff 0 0 0>; /*ending*/
+                       backlight_index = <3>;
+               };
+               vbyone_3{
+                       model_name = "BOE_HV550QU2";
+                       interface = "vbyone"; /*lcd_interface(lvds, vbyone)*/
+                       basic_setting = <
+                               3840 2160 /*h_active, v_active*/
+                               4400 2250 /*h_period, v_period*/
+                               10     /*lcd_bits*/
+                               16 9>; /*screen_widht, screen_height*/
+                       range_setting = <
+                               4240 4800 /*h_period_min, max*/
+                               2200 2760 /*v_period_min, max*/
+                               560000000 624000000>; /*pclk_min, max*/
+                       lcd_timing = <
+                               33 477 1   /*hs_width, hs_bp, hs_pol*/
+                               6  65  0>; /*vs_width, vs_bp, vs_pol*/
+                       clk_attr = <
+                               2 /*fr_adj_type
+                                  *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
+                                  * 4=hdmi_mode)
+                                  */
+                               1 /*clk_ss_level*/
+                               1 /*clk_auto_generate*/
+                               0>; /*pixel_clk(unit in Hz)*/
+                       vbyone_attr = <
+                               8 /*lane_count*/
+                               2 /*region_num*/
+                               4 /*byte_mode*/
+                               4>; /*color_fmt*/
+                       vbyone_intr_enable = <
+                               1   /*vbyone_intr_enable*/
+                               3>; /*vbyone_vsync_intr_enable*/
+                       phy_attr=<3 0>; /*vswing_level, preem_level*/
+
+                       /* power step: type, index, value, delay(ms) */
+                       power_on_step = <
+                               0 0 1 20 /*panel power on*/
+                               0 1 0 10 /*3d_disable*/
+                               2 0 0 10 /*signal enable*/
+                               0xff 0 0 0>; /*ending*/
+                       power_off_step = <
+                               2 0 0 10 /*signal disable*/
+                               0 1 2 0  /*3d_disable*/
+                               0 0 0 100 /*panel power off*/
+                               0xff 0 0 0>; /*ending*/
+                       backlight_index = <3>;
+               };
+               vbyone_4{
+                       model_name = "BOE_HV550QU2_1region";
+                       interface = "vbyone"; /*lcd_interface(lvds, vbyone)*/
+                       basic_setting = <
+                               3840 2160 /*h_active, v_active*/
+                               4400 2250 /*h_period, v_period*/
+                               10     /*lcd_bits*/
+                               16 9>; /*screen_widht, screen_height*/
+                       range_setting = <
+                               4240 4800 /*h_period_min,max*/
+                               2200 2760 /*v_period_min,max*/
+                               560000000 624000000>; /*pclk_min, max*/
+                       lcd_timing = <
+                               33 477 1 /*hs_width, hs_bp, hs_pol*/
+                               6 65 0>; /*vs_width, vs_bp, vs_pol*/
+                       clk_attr = <
+                               2 /*fr_adj_type
+                                  *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
+                                  * 4=hdmi_mode)
+                                  */
+                               1 /*clk_ss_level*/
+                               1 /*clk_auto_generate*/
+                               0>; /*pixel_clk(unit in Hz)*/
+                       vbyone_attr = <
+                               8 /*lane_count*/
+                               1 /*region_num*/
+                               4 /*byte_mode*/
+                               4>; /*color_fmt*/
+                       vbyone_intr_enable = <
+                               1   /*vbyone_intr_enable*/
+                               3>; /*vbyone_vsync_intr_enable*/
+                       phy_attr=<3 0>; /*vswing_level, preem_level*/
+
+                       /* power step: type, index, value, delay(ms) */
+                       power_on_step = <
+                               0 0 1 20 /*panel power on*/
+                               0 1 0 10 /*3d_disable*/
+                               2 0 0 10 /*signal enable*/
+                               0xff 0 0 0>; /*ending*/
+                       power_off_step = <
+                               2 0 0 10 /*signal disable*/
+                               0 1 2 0  /*3d_disable*/
+                               0 0 0 100 /*panel power off*/
+                               0xff 0 0 0>; /*ending*/
+                       backlight_index = <3>;
+               };
+       }; /* end of lcd */
+
+       lcd_extern{
+               compatible = "amlogic, lcd_extern";
+               dev_name = "lcd_extern";
+               status = "okay";
+               key_valid = <1>;
+               i2c_bus = "i2c_bus_c";
+               /*pinctrl-names="extern_pins";*/
+               /*pinctrl_names_uboot = "i2c_c";*/ /* i2c_a, i2c_b, i2c_c */
+               /*pinctrl-0=<&i2c_c_master>;*/
+               /*extern-gpios = <&gpio GPIOH_2 1*/
+                               /*&gpio GPIOH_3 1>;*/
+               /*extern_gpio_names = "GPIOH_2","GPIOH_3";*/
+               /*i2c_gpio_off = <0 0 1 0>; */
+               /* I2C_SCK_gpio_index, I2C_SCK_gpio_off,
+                * I2C_SDA_gpio_index, I2C_SCK_gpio_off
+                */
+
+               extern_0{
+                       index = <0>;
+                       extern_name = "ext_default";
+                       status = "disabled";
+                       type = <0>; /*0=i2c, 1=spi, 2=mipi*/
+                       i2c_address = <0x1c>; /*7bit i2c_addr*/
+                       i2c_second_address = <0xff>;
+                       cmd_size = <0xff>; /*dynamic cmd_size*/
+
+                       /* init on/off:
+                        *  fixed cmd_size: (type, value..., delay);
+                        *                  cmd_size include all data.
+                        *  dynamic cmd_size: (type, cmd_size, value..., delay);
+                        *                    cmd_size include value+delay.
+                        */
+                       /* type: 0x00=cmd(bit[3:0]=1 for second_addr),
+                        *       0xf0=gpio, 0xff=ending
+                        */
+                       /* value: i2c or spi cmd, or gpio index & level,
+                        * fill 0x0 for no use
+                        */
+                       /* delay: unit ms */
+                       init_on = <
+                               0x00 8 0x20 0x01 0x02 0x00 0x40 0xFF 0x00 0
+                               0x00 8 0x80 0x02 0x00 0x40 0x62 0x51 0x73 0
+                               0x00 8 0x61 0x06 0x00 0x00 0x00 0x00 0x00 0
+                               0x00 8 0xC1 0x05 0x0F 0x00 0x08 0x70 0x00 0
+                               0x00 8 0x13 0x01 0x00 0x00 0x00 0x00 0x00 0
+                               0x00 8 0x3D 0x02 0x01 0x00 0x00 0x00 0x00 0
+                               0x00 8 0xED 0x0D 0x01 0x00 0x00 0x00 0x00 0
+                               0x00 8 0x23 0x02 0x00 0x00 0x00 0x00 0x00 10
+                               0xff 0>; /*ending*/
+                       init_off = <0xff 0>; /*ending*/
+               };
+               extern_1{
+                       index = <1>;
+                       extern_name = "i2c_T5800Q";
+                       status = "disabled";
+                       type = <0>; /* 0=i2c, 1=spi, 2=mipi */
+                       i2c_address = <0x1c>; /* 7bit i2c address */
+                       cmd_size = <9>;
+               };
+       };
+
+       backlight{
+               compatible = "amlogic, backlight-txl";
+               dev_name = "backlight";
+               status = "okay";
+               key_valid = <1>;
+               pinctrl-names = "pwm_on","pwm_vs_on",
+                               "pwm_combo_0_1_on",
+                               "pwm_combo_0_vs_1_on",
+                               "pwm_combo_0_1_vs_on";
+               pinctrl-0 = <&pwm_b_z6_pins>;
+               pinctrl-1 = <&pwm_vs_z6_pins>;
+               pinctrl-2 = <&pwm_b_z6_pins &pwm_c_z7_pins>;
+               pinctrl-3 = <&pwm_vs_z6_pins &pwm_c_z7_pins>;
+               pinctrl-4 = <&pwm_b_z6_pins &pwm_vs_z7_pins>;
+               pinctrl_version = <2>; /* for uboot */
+               bl_pwm_config = <&bl_pwm_conf>;
+
+               /* pwm port: PWM_A, PWM_B, PWM_C, PWM_D, PWM_E, PWM_F, PWM_VS*/
+               /* power index:(point gpios_index, 0xff=invalid) */
+               /* power value:(0=output low, 1=output high, 2=input) */
+               /* power delay:(unit in ms) */
+               bl-gpios = <&gpio GPIOZ_2 GPIO_ACTIVE_HIGH
+                       &gpio GPIOZ_6 GPIO_ACTIVE_HIGH
+                       &gpio GPIOZ_7 GPIO_ACTIVE_HIGH>;
+               bl_gpio_names = "GPIOZ_2","GPIOZ_6","GPIOZ_7";
+
+               backlight_0{
+                       index = <0>;
+                       bl_name = "backlight_pwm";
+                       bl_level_default_uboot_kernel = <100 100>;
+                       bl_level_attr = <255 10 /*max, min*/
+                               128 128>; /*mid, mid_mapping*/
+                       bl_ctrl_method = <1>; /*1=pwm,2=pwm_combo*/
+                       bl_power_attr = <0 /*en_gpio_index*/
+                               1 0 /*on_value, off_value*/
+                               200 200>; /*on_delay(ms), off_delay(ms)*/
+                       bl_pwm_port = "PWM_B";
+                       bl_pwm_attr = <1 /*pwm_method(0=negative, 1=positvie)*/
+                               180 /*pwm_freq(pwm:Hz, pwm_vs:multiple of vs)*/
+                               100 25>; /*duty_max(%), duty_min(%)*/
+                       bl_pwm_power = <1 0 /*pwm_gpio_index, pwm_gpio_off*/
+                               10 10>; /*pwm_on_delay(ms), pwm_off_delay(ms)*/
+                       bl_pwm_en_sequence_reverse = <0>; /* 1 for reverse */
+               };
+               backlight_1{
+                       index = <1>;
+                       bl_name = "backlight_pwm_vs";
+                       bl_level_default_uboot_kernel = <100 100>;
+                       bl_level_attr = <255 10 /*max, min*/
+                               128 128>; /*mid, mid_mapping*/
+                       bl_ctrl_method = <1>; /*1=pwm,2=pwm_combo*/
+                       bl_power_attr = <0  /*en_gpio_index*/
+                               1 0 /*on_value, off_value*/
+                               200 200>; /* on_delay(ms), off_delay(ms)*/
+                       bl_pwm_port = "PWM_VS";
+                       bl_pwm_attr = <1 /*pwm_method(0=negative, 1=positvie)*/
+                               2 /*pwm_freq(pwm:Hz, pwm_vs:multiple of vs)*/
+                               100 25>; /*duty_max(%), duty_min(%)*/
+                       bl_pwm_power = <1 0 /*pwm_gpio_index, pwm_gpio_off*/
+                               10 10>; /*pwm_on_delay(ms), pwm_off_delay(ms)*/
+                       bl_pwm_en_sequence_reverse = <0>; /* 1 for reverse */
+               };
+               backlight_2{
+                       index = <2>;
+                       bl_name = "backlight_pwm_combo";
+                       bl_level_default_uboot_kernel = <100 100>;
+                       bl_level_attr = <255 10 /*max, min*/
+                               128 128>; /*mid, mid_mapping*/
+                       bl_ctrl_method = <2>; /*1=pwm,2=pwm_combo*/
+                       bl_power_attr = <0 /*en_gpio_index*/
+                               1 0 /*on_value, off_value*/
+                               200 200>; /* on_delay(ms), off_delay(ms)*/
+                       bl_pwm_combo_level_mapping = <255 100 /*pwm_0 range*/
+                               100 10>; /*pwm_1 range*/
+                       bl_pwm_combo_port = "PWM_B","PWM_C";
+                       bl_pwm_combo_attr = <1 /*pwm0 method*/
+                               180 /*pwm0 freq(pwm:Hz, pwm_vs:multiple of vs)*/
+                               100 25 /*pwm0 duty_max(%), duty_min(%)*/
+                               1 /*pwm1 method*/
+                               18000 /*pwm1 freq(pwm:Hz, pwm_vs:multi of vs)*/
+                               100 20>; /*pwm1 duty_max(%), duty_min(%)*/
+                       bl_pwm_combo_power = <1 0 /*pwm0 gpio_index, gpio_off*/
+                               2 0 /*pwm1 gpio_index, gpio_off*/
+                               10 10>; /*pwm_on_delay(ms), pwm_off_delay(ms)*/
+                       bl_pwm_en_sequence_reverse = <0>; /* 1 for reverse */
+               };
+               backlight_3{
+                       index = <3>;
+                       bl_name = "backlight_pwm_combo";
+                       bl_level_default_uboot_kernel = <31 100>;
+                       bl_level_attr = <255 10 /*max, min*/
+                               128 128>; /*mid, mid_mapping*/
+                       bl_ctrl_method = <2>; /*1=pwm,2=pwm_combo*/
+                       bl_power_attr = <0 /*en_gpio_index*/
+                               1 0  /*on_value, off_value*/
+                               410 110>; /*on_delay(ms), off_delay(ms)*/
+                       bl_pwm_combo_level_mapping = <255 10 /*pwm_0 range*/
+                               0 0>; /*pwm_1 range*/
+                       bl_pwm_combo_port = "PWM_B","PWM_C";
+                       bl_pwm_combo_attr = <1 /*pwm0 method*/
+                               180 /*pwm0 freq(pwm:Hz, pwm_vs:multiple of vs)*/
+                               100 25 /*pwm0 duty_max(%), duty_min(%)*/
+                               1 /*pwm1 method*/
+                               18000 /*pwm1 freq(pwm:Hz, pwm_vs:multi of vs)*/
+                               80 80>; /*pwm1 duty_max(%), duty_min(%)*/
+                       bl_pwm_combo_power = <1 0 /*pwm0 gpio_index, gpio_off*/
+                               2 0 /*pwm1 gpio_index, gpio_off*/
+                               10 10>; /*pwm_on_delay(ms), pwm_off_delay(ms)*/
+                       bl_pwm_en_sequence_reverse = <0>; /* 1 for reverse */
+               };
+       };
+
+       bl_pwm_conf:bl_pwm_conf{
+               pwm_channel_0 {
+                       pwm_port_index = <1>;
+                       pwms = <&pwm_ab MESON_PWM_1 30040 0>;
+               };
+               pwm_channel_1 {
+                       pwm_port_index = <2>;
+                       pwms = <&pwm_cd MESON_PWM_0 30040 0>;
+               };
+       };
+
+}; /* end of / */
index 45087ac..b966ade 100644 (file)
@@ -143,7 +143,7 @@ static char *bl_method_type_to_str(int type)
        return str;
 }
 
-static unsigned int pwm_reg_gxtvbb[6] = {
+static unsigned int pwm_reg_txl[6] = {
        PWM_PWM_A,
        PWM_PWM_B,
        PWM_PWM_C,
@@ -2011,7 +2011,7 @@ static int aml_bl_pwm_channel_register(struct bl_config_s *bconf,
                        bl_drv->dev, child, NULL);
                if (IS_ERR_OR_NULL(bl_pwm->pwm_data.pwm)) {
                        ret = PTR_ERR(bl_pwm->pwm_data.pwm);
-                       BLERR("unable to request bl_pwm\n");
+                       BLERR("unable to request bl_pwm(%d)\n", index0);
                        return ret;
                }
                bl_pwm->pwm_data.meson = to_meson_pwm(
@@ -2967,19 +2967,25 @@ static int aml_bl_resume(struct platform_device *pdev)
 static struct bl_data_s bl_data_gxtvbb = {
        .chip_type = BL_CHIP_GXTVBB,
        .chip_name = "gxtvbb",
-       .pwm_reg = pwm_reg_gxtvbb,
+       .pwm_reg = pwm_reg_txl,
 };
 
 static struct bl_data_s bl_data_gxl = {
        .chip_type = BL_CHIP_GXL,
        .chip_name = "gxl",
-       .pwm_reg = pwm_reg_gxtvbb,
+       .pwm_reg = pwm_reg_txl,
 };
 
 static struct bl_data_s bl_data_gxm = {
        .chip_type = BL_CHIP_GXM,
        .chip_name = "gxm",
-       .pwm_reg = pwm_reg_gxtvbb,
+       .pwm_reg = pwm_reg_txl,
+};
+
+static struct bl_data_s bl_data_txl = {
+       .chip_type = BL_CHIP_TXL,
+       .chip_name = "txl",
+       .pwm_reg = pwm_reg_txl,
 };
 
 static struct bl_data_s bl_data_txlx = {
@@ -3020,6 +3026,10 @@ static const struct of_device_id bl_dt_match_table[] = {
                .data = &bl_data_gxm,
        },
        {
+               .compatible = "amlogic, backlight-txl",
+               .data = &bl_data_txl,
+       },
+       {
                .compatible = "amlogic, backlight-txlx",
                .data = &bl_data_txlx,
        },
index ef7645a..1b2a57a 100644 (file)
@@ -94,6 +94,7 @@ static struct lcd_clk_config_s clk_conf = { /* unit: kHz */
        .fout = 0,
 
        /* pll parameters */
+       .pll_mode = 0, /* txl */
        .od_fb = 0,
        .pll_m = 0,
        .pll_n = 0,
@@ -358,6 +359,25 @@ static void lcd_clk_config_chip_init(void)
                cConf->div_out_fmax = CRT_VID_CLK_IN_MAX_GXM;
                cConf->xd_out_fmax = ENCL_CLK_IN_MAX_GXM;
                break;
+       case LCD_CHIP_TXL:
+               cConf->od_fb = PLL_FRAC_OD_FB_TXL;
+               cConf->ss_level_max = SS_LEVEL_MAX_TXL;
+               cConf->pll_m_max = PLL_M_MAX_TXL;
+               cConf->pll_m_min = PLL_M_MIN_TXL;
+               cConf->pll_n_max = PLL_N_MAX_TXL;
+               cConf->pll_n_min = PLL_N_MIN_TXL;
+               cConf->pll_frac_range = PLL_FRAC_RANGE_TXL;
+               cConf->pll_od_sel_max = PLL_OD_SEL_MAX_TXL;
+               cConf->pll_ref_fmax = PLL_FREF_MAX_TXL;
+               cConf->pll_ref_fmin = PLL_FREF_MIN_TXL;
+               cConf->pll_vco_fmax = PLL_VCO_MAX_TXL;
+               cConf->pll_vco_fmin = PLL_VCO_MIN_TXL;
+               cConf->pll_out_fmax = CLK_DIV_IN_MAX_TXL;
+               cConf->pll_out_fmin = cConf->pll_vco_fmin / 16;
+               cConf->div_in_fmax = CLK_DIV_IN_MAX_TXL;
+               cConf->div_out_fmax = CRT_VID_CLK_IN_MAX_TXL;
+               cConf->xd_out_fmax = ENCL_CLK_IN_MAX_TXL;
+               break;
        case LCD_CHIP_TXLX:
                cConf->od_fb = PLL_FRAC_OD_FB_TXLX;
                cConf->ss_level_max = SS_LEVEL_MAX_TXLX;
@@ -2109,6 +2129,7 @@ void lcd_clk_generate_parameter(struct lcd_config_s *pconf)
                break;
        case LCD_CHIP_GXL:
        case LCD_CHIP_GXM:
+       case LCD_CHIP_TXL:
        case LCD_CHIP_TXLX:
                lcd_clk_generate_txl(pconf);
                break;
@@ -2142,6 +2163,9 @@ char *lcd_get_spread_spectrum(void)
        case LCD_CHIP_GXTVBB:
                ss_str = lcd_pll_ss_table_gxtvbb[ss_level];
                break;
+       case LCD_CHIP_TXL:
+               ss_str = lcd_pll_ss_table_txl[ss_level];
+               break;
        case LCD_CHIP_TXLX:
                ss_str = lcd_pll_ss_table_txlx[ss_level];
                break;
@@ -2170,6 +2194,9 @@ void lcd_set_spread_spectrum(void)
        case LCD_CHIP_GXTVBB:
                lcd_set_pll_ss_gxtvbb(&clk_conf);
                break;
+       case LCD_CHIP_TXL:
+               lcd_set_pll_ss_txl(&clk_conf);
+               break;
        case LCD_CHIP_TXLX:
                lcd_set_pll_ss_txlx(&clk_conf);
                break;
@@ -2204,6 +2231,7 @@ void lcd_pll_reset(void)
                break;
        case LCD_CHIP_GXL:
        case LCD_CHIP_GXM:
+       case LCD_CHIP_TXL:
        case LCD_CHIP_TXLX:
                lcd_pll_reset_txl();
                break;
@@ -2240,6 +2268,7 @@ void lcd_clk_update(struct lcd_config_s *pconf)
                break;
        case LCD_CHIP_GXL:
        case LCD_CHIP_GXM:
+       case LCD_CHIP_TXL:
        case LCD_CHIP_TXLX:
                lcd_pll_frac_generate_txl(pconf);
                lcd_update_pll_frac_txl(&clk_conf);
@@ -2283,6 +2312,7 @@ void lcd_clk_set(struct lcd_config_s *pconf)
                break;
        case LCD_CHIP_GXL:
        case LCD_CHIP_GXM:
+       case LCD_CHIP_TXL:
                lcd_set_pll_txl(&clk_conf);
                lcd_set_vid_pll_div(&clk_conf);
                break;
@@ -2334,6 +2364,7 @@ void lcd_clk_disable(void)
                break;
        case LCD_CHIP_GXL:
        case LCD_CHIP_GXM:
+       case LCD_CHIP_TXL:
        case LCD_CHIP_TXLX:
                /* disable hdmi_pll: 0x10c8[30] */
                lcd_hiu_setb(HHI_HDMI_PLL_CNTL, 0, LCD_PLL_EN_TXL, 1);
index 10a1f89..8724af3 100644 (file)
@@ -31,7 +31,7 @@ struct lcd_clk_config_s { /* unit: kHz */
        unsigned int fout;
 
        /* pll parameters */
-       unsigned int pll_mode;
+       unsigned int pll_mode; /* txl */
        unsigned int od_fb;
        unsigned int pll_m;
        unsigned int pll_n;
@@ -43,8 +43,6 @@ struct lcd_clk_config_s { /* unit: kHz */
        unsigned int pll_frac;
        unsigned int pll_fout;
        unsigned int ss_level;
-       /*unsigned int edp_div0;*/
-       /*unsigned int edp_div1;*/
        unsigned int div_sel;
        unsigned int xd;
 
index 92411f6..e3545c6 100644 (file)
@@ -28,7 +28,8 @@
 /* 20180226: g12a support */
 /* 20180425: tvconfig suuport */
 /* 20180620: fix coverity errors */
-#define LCD_DRV_VERSION    "20180620"
+/* 20180626: txl suuport */
+#define LCD_DRV_VERSION    "20180626"
 
 #define VPP_OUT_SATURATE            (1 << 0)
 
index f4c976b..c36bd92 100644 (file)
@@ -680,14 +680,9 @@ static void lcd_vbyone_interrupt_init(struct aml_lcd_drv_s *lcd_drv)
        struct vbyone_config_s *vx1_conf;
 
        vx1_conf = lcd_drv->lcd_config->lcd_control.vbyone_config;
+
        /* release sw filter ctrl in uboot */
-       switch (lcd_drv->data->chip_type) {
-       case LCD_CHIP_TXLX:
-               lcd_vcbus_setb(VBO_INSGN_CTRL, 0, 0, 1);
-               break;
-       default:
-               break;
-       }
+       lcd_vcbus_setb(VBO_INSGN_CTRL, 0, 0, 1);
 
        /* set hold in FSM_ACQ */
        if (vx1_conf->vsync_intr_en == 3)
index 860c2d5..96364e7 100644 (file)
@@ -942,6 +942,12 @@ static struct lcd_data_s lcd_data_gxm = {
        .reg_map_table = &lcd_reg_gxb[0],
 };
 
+static struct lcd_data_s lcd_data_txl = {
+       .chip_type = LCD_CHIP_TXL,
+       .chip_name = "txl",
+       .reg_map_table = &lcd_reg_gxb[0],
+};
+
 static struct lcd_data_s lcd_data_txlx = {
        .chip_type = LCD_CHIP_TXLX,
        .chip_name = "txlx",
@@ -980,6 +986,10 @@ static const struct of_device_id lcd_dt_match_table[] = {
                .data = &lcd_data_gxm,
        },
        {
+               .compatible = "amlogic, lcd-txl",
+               .data = &lcd_data_txl,
+       },
+       {
                .compatible = "amlogic, lcd-txlx",
                .data = &lcd_data_txlx,
        },
index f6b0d9c..a83f80e 100644 (file)
@@ -45,6 +45,7 @@ enum bl_chip_type_e {
        BL_CHIP_GXTVBB,
        BL_CHIP_GXL,
        BL_CHIP_GXM,
+       BL_CHIP_TXL,
        BL_CHIP_TXLX,
        BL_CHIP_AXG,
        BL_CHIP_G12A,
index d868980..86cb36e 100644 (file)
@@ -78,10 +78,11 @@ enum lcd_chip_e {
        LCD_CHIP_GXTVBB = 0,
        LCD_CHIP_GXL,   /* 1 */
        LCD_CHIP_GXM,   /* 2 */
-       LCD_CHIP_TXLX,  /* 3 */
-       LCD_CHIP_AXG,   /* 4 */
-       LCD_CHIP_G12A,  /* 5 */
-       LCD_CHIP_G12B,  /* 6 */
+       LCD_CHIP_TXL,   /* 3 */
+       LCD_CHIP_TXLX,  /* 4 */
+       LCD_CHIP_AXG,   /* 5 */
+       LCD_CHIP_G12A,  /* 6 */
+       LCD_CHIP_G12B,  /* 7 */
        LCD_CHIP_MAX,
 };