arm: dts: x301 & t309: enable panel unifykey support for tvconfig [1/1]
authorEvoke Zhang <evoke.zhang@amlogic.com>
Tue, 11 Dec 2018 10:23:31 +0000 (18:23 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 18 Dec 2018 10:39:39 +0000 (02:39 -0800)
PD#SWPL-2761

Problem:
not support tvconfig yet

Solution:
1.enable key_valid in panel dtsi
2.enable fr_auto_policy in panel dtsi
3.enable clk ss for lvds and vbyone in panel dtsi
4.also fix some coverity errors

Verify:
x301

Change-Id: I00dd5ff621cfbc3f100bbe6045a35c8f917ade29
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
arch/arm/boot/dts/amlogic/mesontl1_t309-panel.dtsi
arch/arm/boot/dts/amlogic/mesontl1_x301-panel.dtsi
drivers/amlogic/media/vout/lcd/lcd_clk_config.c
drivers/amlogic/media/vout/lcd/lcd_debug.c
drivers/amlogic/media/vout/lcd/lcd_vout.c

index 6c90d32..b9fbc12 100644 (file)
@@ -20,8 +20,8 @@
                compatible = "amlogic, lcd-tl1";
                status = "okay";
                mode = "tv";
-               fr_auto_policy = <0>; /* 0=disable, 1=60/50hz, 2=60/50/48hz */
-               key_valid = <0>;
+               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
                        &clkc CLKID_TCON
@@ -79,7 +79,7 @@
                                   *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
                                   * 4=hdmi_mode)
                                   */
-                               0 /*clk_ss_level*/
+                               6 /*clk_ss_level*/
                                1 /*clk_auto_generate*/
                                0>; /*pixel_clk(unit in Hz)*/
                        lvds_attr = <
                                   *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
                                   * 4=hdmi_mode)
                                   */
-                               0 /*clk_ss_level*/
+                               6 /*clk_ss_level*/
                                1 /*clk_auto_generate*/
                                0>; /*pixel_clk(unit in Hz)*/
                        lvds_attr = <
                                   *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
                                   * 4=hdmi_mode)
                                   */
-                               0 /*clk_ss_level*/
+                               1 /*clk_ss_level*/
                                1 /*clk_auto_generate*/
                                0>; /*pixel_clk(unit in Hz)*/
                        vbyone_attr = <
                                   *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
                                   * 4=hdmi_mode)
                                   */
-                               0 /*clk_ss_level*/
+                               1 /*clk_ss_level*/
                                1 /*clk_auto_generate*/
                                0>; /*pixel_clk(unit in Hz)*/
                        vbyone_attr = <
                                   *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
                                   * 4=hdmi_mode)
                                   */
-                               0 /*clk_ss_level*/
+                               1 /*clk_ss_level*/
                                1 /*clk_auto_generate*/
                                0>; /*pixel_clk(unit in Hz)*/
                        vbyone_attr = <
        lcd_extern{
                compatible = "amlogic, lcd_extern";
                status = "okay";
-               key_valid = <0>;
+               key_valid = <1>;
                i2c_bus = "i2c_bus_1";
 
                extern_0{
        backlight{
                compatible = "amlogic, backlight-tl1";
                status = "okay";
-               key_valid = <0>;
+               key_valid = <1>;
                pinctrl-names = "pwm_on","pwm_vs_on",
                                "pwm_combo_0_1_on",
                                "pwm_combo_0_vs_1_on",
                                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_port = "PWM_C","PWM_D";
                        bl_pwm_combo_attr = <1 /*pwm0 method*/
                                180 /*pwm0 freq(pwm:Hz, pwm_vs:multiple of vs)*/
                                100 25 /*pwm0 duty_max(%), duty_min(%)*/
index 28908e9..6bdceda 100644 (file)
@@ -20,8 +20,8 @@
                compatible = "amlogic, lcd-tl1";
                status = "okay";
                mode = "tv";
-               fr_auto_policy = <0>; /* 0=disable, 1=60/50hz, 2=60/50/48hz */
-               key_valid = <0>;
+               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
                        &clkc CLKID_TCON
@@ -82,7 +82,7 @@
                                   *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
                                   * 4=hdmi_mode)
                                   */
-                               0 /*clk_ss_level*/
+                               6 /*clk_ss_level*/
                                1 /*clk_auto_generate*/
                                0>; /*pixel_clk(unit in Hz)*/
                        lvds_attr = <
                                   *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
                                   * 4=hdmi_mode)
                                   */
-                               0 /*clk_ss_level*/
+                               6 /*clk_ss_level*/
                                1 /*clk_auto_generate*/
                                0>; /*pixel_clk(unit in Hz)*/
                        lvds_attr = <
                                   *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
                                   * 4=hdmi_mode)
                                   */
-                               0 /*clk_ss_level*/
+                               1 /*clk_ss_level*/
                                1 /*clk_auto_generate*/
                                0>; /*pixel_clk(unit in Hz)*/
                        vbyone_attr = <
                                   *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
                                   * 4=hdmi_mode)
                                   */
-                               0 /*clk_ss_level*/
+                               1 /*clk_ss_level*/
                                1 /*clk_auto_generate*/
                                0>; /*pixel_clk(unit in Hz)*/
                        vbyone_attr = <
                                   *(0=clk, 1=htotal, 2=vtotal, 3=auto_range,
                                   * 4=hdmi_mode)
                                   */
-                               0 /*clk_ss_level*/
+                               1 /*clk_ss_level*/
                                1 /*clk_auto_generate*/
                                0>; /*pixel_clk(unit in Hz)*/
                        vbyone_attr = <
        lcd_extern{
                compatible = "amlogic, lcd_extern";
                status = "okay";
-               key_valid = <0>;
+               key_valid = <1>;
                i2c_bus = "i2c_bus_1";
 
                extern_0{
        backlight{
                compatible = "amlogic, backlight-tl1";
                status = "okay";
-               key_valid = <0>;
+               key_valid = <1>;
                pinctrl-names = "pwm_on","pwm_vs_on",
                                "pwm_combo_0_1_on",
                                "pwm_combo_0_vs_1_on",
index b4fcb6f..0752873 100644 (file)
@@ -2327,21 +2327,24 @@ int lcd_set_ss(unsigned int level, unsigned int freq, unsigned int mode)
        if (level < 0xff) {
                if (level >= clk_conf.data->ss_level_max) {
                        LCDERR("%s: ss_level %d is out of support (max %d)\n",
-                               __func__, level, clk_conf.data->ss_level_max);
+                               __func__, level,
+                               (clk_conf.data->ss_level_max - 1));
                        goto lcd_set_ss_end;
                }
        }
        if (freq < 0xff) {
                if (freq >= clk_conf.data->ss_freq_max) {
                        LCDERR("%s: ss_freq %d is out of support (max %d)\n",
-                               __func__, freq, clk_conf.data->ss_freq_max);
+                               __func__, freq,
+                               (clk_conf.data->ss_freq_max - 1));
                        goto lcd_set_ss_end;
                }
        }
        if (mode < 0xff) {
-               if (mode >= clk_conf.data->ss_freq_max) {
+               if (mode >= clk_conf.data->ss_mode_max) {
                        LCDERR("%s: ss_mode %d is out of support (max %d)\n",
-                               __func__, mode, clk_conf.data->ss_mode_max);
+                               __func__, mode,
+                               (clk_conf.data->ss_mode_max - 1));
                        goto lcd_set_ss_end;
                }
        }
index 4d562b7..40e30a8 100644 (file)
@@ -2299,7 +2299,7 @@ static ssize_t lcd_debug_ss_store(struct class *class,
        temp = lcd_drv->lcd_config->lcd_timing.ss_level;
        switch (buf[0]) {
        case 'l':
-               ret = sscanf(buf, "level %x", &value);
+               ret = sscanf(buf, "level %d", &value);
                if (ret == 1) {
                        value &= 0xff;
                        ret = lcd_set_ss(value, 0xff, 0xff);
@@ -2314,7 +2314,7 @@ static ssize_t lcd_debug_ss_store(struct class *class,
                }
                break;
        case 'f':
-               ret = sscanf(buf, "freq %x", &value);
+               ret = sscanf(buf, "freq %d", &value);
                if (ret == 1) {
                        value &= 0xf;
                        ret = lcd_set_ss(0xff, value, 0xff);
@@ -2329,7 +2329,7 @@ static ssize_t lcd_debug_ss_store(struct class *class,
                }
                break;
        case 'm':
-               ret = sscanf(buf, "mode %x", &value);
+               ret = sscanf(buf, "mode %d", &value);
                if (ret == 1) {
                        value &= 0xf;
                        ret = lcd_set_ss(0xff, 0xff, value);
index ff3205c..ffff538 100644 (file)
@@ -290,7 +290,7 @@ static void lcd_power_ctrl(int status)
                        break;
                case LCD_POWER_TYPE_SIGNAL:
                        if (status)
-                               ret = lcd_driver->driver_init();
+                               lcd_driver->driver_init();
                        else
                                lcd_driver->driver_disable();
                        break;