From 575325f04c08253871b6a064207b64696cbf3b61 Mon Sep 17 00:00:00 2001 From: "shaochan.liu" Date: Fri, 27 Sep 2019 18:04:50 +0800 Subject: [PATCH] lcd: optimize ss_set in power_step [2/2] PD#TV-10240 Problem: need optimize ss_set in power_step Solution: optimize ss_set in power_step Verify: t962x2-x301 Change-Id: I435e5659cbc7225cc957d2fa233c5dee70f894a2 Signed-off-by: shaochan.liu --- drivers/amlogic/media/vout/lcd/lcd_common.c | 12 ++++++++++-- drivers/amlogic/media/vout/lcd/lcd_debug.c | 1 + drivers/amlogic/media/vout/lcd/lcd_vout.c | 14 +------------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/amlogic/media/vout/lcd/lcd_common.c b/drivers/amlogic/media/vout/lcd/lcd_common.c index d6db171..76e4e03 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_common.c +++ b/drivers/amlogic/media/vout/lcd/lcd_common.c @@ -408,7 +408,7 @@ int lcd_power_load_from_dts(struct lcd_config_s *pconf, unsigned int para[5]; unsigned int val; struct lcd_power_ctrl_s *lcd_power = pconf->lcd_power; - int i, j; + int i, j, temp; unsigned int index; if (lcd_debug_print_flag) @@ -457,6 +457,10 @@ int lcd_power_load_from_dts(struct lcd_config_s *pconf, case LCD_POWER_TYPE_EXTERN: pconf->extern_index = index; break; + case LCD_POWER_TYPE_CLK_SS: + temp = pconf->lcd_power->power_on_step[i].value; + pconf->lcd_timing.ss_level |= temp << 8; + break; default: break; } @@ -544,7 +548,7 @@ int lcd_power_load_from_dts(struct lcd_config_s *pconf, int lcd_power_load_from_unifykey(struct lcd_config_s *pconf, unsigned char *buf, int key_len, int len) { - int i, j; + int i, j, temp; unsigned char *p; unsigned int index; int ret; @@ -585,6 +589,10 @@ int lcd_power_load_from_unifykey(struct lcd_config_s *pconf, case LCD_POWER_TYPE_EXTERN: pconf->extern_index = index; break; + case LCD_POWER_TYPE_CLK_SS: + temp = pconf->lcd_power->power_on_step[i].value; + pconf->lcd_timing.ss_level |= temp << 8; + break; default: break; } diff --git a/drivers/amlogic/media/vout/lcd/lcd_debug.c b/drivers/amlogic/media/vout/lcd/lcd_debug.c index 1404533..777612b 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_debug.c +++ b/drivers/amlogic/media/vout/lcd/lcd_debug.c @@ -232,6 +232,7 @@ static int lcd_power_step_print(struct lcd_config_s *pconf, int status, case LCD_POWER_TYPE_CPU: case LCD_POWER_TYPE_PMU: case LCD_POWER_TYPE_WAIT_GPIO: + case LCD_POWER_TYPE_CLK_SS: n = lcd_debug_info_len(len + offset); len += snprintf((buf+len), n, "%d: type=%d, index=%d, value=%d, delay=%d\n", diff --git a/drivers/amlogic/media/vout/lcd/lcd_vout.c b/drivers/amlogic/media/vout/lcd/lcd_vout.c index 7ced7f6..0b98d6b 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_vout.c +++ b/drivers/amlogic/media/vout/lcd/lcd_vout.c @@ -274,9 +274,8 @@ static void lcd_power_ctrl(int status) #ifdef CONFIG_AMLOGIC_LCD_EXTERN struct aml_lcd_extern_driver_s *ext_drv; #endif - unsigned int i, index, wait, temp; + unsigned int i, index, wait; int value = -1; - int ret = 0; LCDPR("%s: %d\n", __func__, status); i = 0; @@ -343,17 +342,6 @@ static void lcd_power_ctrl(int status) LCDERR("wait_gpio %d timeout!\n", value); break; case LCD_POWER_TYPE_CLK_SS: - temp = lcd_driver->lcd_config->lcd_timing.ss_level; - value = (power_step->value) & 0xff; - ret = lcd_set_ss(0xff, - (value >> LCD_CLK_SS_BIT_FREQ) & 0xf, - (value >> LCD_CLK_SS_BIT_MODE) & 0xf); - if (ret == 0) { - temp &= ~(0xff << 8); - temp |= (value << 8); - lcd_driver->lcd_config->lcd_timing.ss_level = - temp; - } break; default: break; -- 2.7.4