lcd: optimize ss_set in power_step [2/2]
authorshaochan.liu <shaochan.liu@amlogic.com>
Fri, 27 Sep 2019 10:04:50 +0000 (18:04 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Thu, 10 Oct 2019 01:21:28 +0000 (18:21 -0700)
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 <shaochan.liu@amlogic.com>
drivers/amlogic/media/vout/lcd/lcd_common.c
drivers/amlogic/media/vout/lcd/lcd_debug.c
drivers/amlogic/media/vout/lcd/lcd_vout.c

index d6db171..76e4e03 100644 (file)
@@ -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;
                }
index 1404533..777612b 100644 (file)
@@ -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",
index 7ced7f6..0b98d6b 100644 (file)
@@ -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;