From: Evoke Zhang Date: Tue, 11 Dec 2018 10:23:31 +0000 (+0800) Subject: arm: dts: x301 & t309: enable panel unifykey support for tvconfig [1/1] X-Git-Tag: hardkernel-4.9.236-104~1994 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cf49b37b64490fa7f44b5444bb307e584ba9a46;p=platform%2Fkernel%2Flinux-amlogic.git arm: dts: x301 & t309: enable panel unifykey support for tvconfig [1/1] 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 --- diff --git a/arch/arm/boot/dts/amlogic/mesontl1_t309-panel.dtsi b/arch/arm/boot/dts/amlogic/mesontl1_t309-panel.dtsi index 6c90d32..b9fbc12 100644 --- a/arch/arm/boot/dts/amlogic/mesontl1_t309-panel.dtsi +++ b/arch/arm/boot/dts/amlogic/mesontl1_t309-panel.dtsi @@ -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 = < @@ -168,7 +168,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 = < @@ -212,7 +212,7 @@ *(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 = < @@ -254,7 +254,7 @@ *(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 = < @@ -342,7 +342,7 @@ *(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 = < @@ -608,7 +608,7 @@ lcd_extern{ compatible = "amlogic, lcd_extern"; status = "okay"; - key_valid = <0>; + key_valid = <1>; i2c_bus = "i2c_bus_1"; extern_0{ @@ -708,7 +708,7 @@ 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", @@ -784,7 +784,7 @@ 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(%)*/ diff --git a/arch/arm/boot/dts/amlogic/mesontl1_x301-panel.dtsi b/arch/arm/boot/dts/amlogic/mesontl1_x301-panel.dtsi index 28908e9..6bdceda 100644 --- a/arch/arm/boot/dts/amlogic/mesontl1_x301-panel.dtsi +++ b/arch/arm/boot/dts/amlogic/mesontl1_x301-panel.dtsi @@ -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 = < @@ -171,7 +171,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 = < @@ -215,7 +215,7 @@ *(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 = < @@ -257,7 +257,7 @@ *(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 = < @@ -345,7 +345,7 @@ *(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 = < @@ -611,7 +611,7 @@ lcd_extern{ compatible = "amlogic, lcd_extern"; status = "okay"; - key_valid = <0>; + key_valid = <1>; i2c_bus = "i2c_bus_1"; extern_0{ @@ -711,7 +711,7 @@ 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", diff --git a/drivers/amlogic/media/vout/lcd/lcd_clk_config.c b/drivers/amlogic/media/vout/lcd/lcd_clk_config.c index b4fcb6fa..0752873 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_clk_config.c +++ b/drivers/amlogic/media/vout/lcd/lcd_clk_config.c @@ -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; } } diff --git a/drivers/amlogic/media/vout/lcd/lcd_debug.c b/drivers/amlogic/media/vout/lcd/lcd_debug.c index 4d562b7..40e30a8 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_debug.c +++ b/drivers/amlogic/media/vout/lcd/lcd_debug.c @@ -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); diff --git a/drivers/amlogic/media/vout/lcd/lcd_vout.c b/drivers/amlogic/media/vout/lcd/lcd_vout.c index ff3205c..ffff538 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_vout.c +++ b/drivers/amlogic/media/vout/lcd/lcd_vout.c @@ -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;