CTP-Display: fix brightness can not change smooth
authorKe Ai <ke.ai@intel.com>
Wed, 2 May 2012 07:02:36 +0000 (15:02 +0800)
committerbuildbot <buildbot@intel.com>
Mon, 7 May 2012 09:24:53 +0000 (02:24 -0700)
BZ: 29596

we set the PWM_CLK and PWM_PERIOD correctly.

test, it works well.

Change-Id: Ia2032413904a8f330ffae7b6cc531a547883e60a
Signed-off-by: Ke Ai <ke.ai@intel.com>
Reviewed-on: http://android.intel.com:8080/46952
Reviewed-by: Tong, BoX <box.tong@intel.com>
Tested-by: Tong, BoX <box.tong@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/staging/mrst/drv/h8c7_cmd.c
drivers/staging/mrst/drv/h8c7_vid.c

index b5c3174..0875272 100644 (file)
@@ -69,6 +69,7 @@ static u32 h8c7_gamma_g[] = {0x3d3e3be1, 0x33323131, 0x0b070346, 0x110e100d,
        0x3e3b1710, 0x3231313d, 0x07034633, 0x0e100d0b, 0x00171011};
 static u32 h8c7_gamma_b[] = {0x070601e2, 0x1f322a2d, 0x0e0c0540, 0x13121411,
        0x0601180f, 0x322a2d07, 0x0c05401f, 0x1214110e, 0x00180f13};
+static u32 h8c7_enter_set_cabc[] = {0x1e001fc9, 0x0000001e, 0x00003e01};
 
 static u32 h8c7_mcs_clumn_addr[] = {0x0200002a,0xcf};
 static u32 h8c7_mcs_page_addr[] = {0x0400002b,0xff};
@@ -222,6 +223,11 @@ static void mdfld_h8c7_dci_ic_init(struct mdfld_dsi_config *dsi_config, int pipe
        while (time_before_eq(jiffies, wait_timeout))
                cpu_relax();
 
+       mdfld_dsi_send_mcs_long_lp(sender, h8c7_enter_set_cabc, 10, 0);
+       wait_timeout = jiffies + (HZ / 100);
+       while (time_before_eq(jiffies, wait_timeout))
+               cpu_relax();
+
        mdfld_dsi_send_gen_long_lp(sender, h8c7_mcs_protect_on, 4, 0);
        wait_timeout = jiffies + (HZ / 100);
        while (time_before_eq(jiffies, wait_timeout))
@@ -1126,16 +1132,6 @@ int mdfld_dsi_h8c7_cmd_set_brightness(struct mdfld_dsi_config *dsi_config,
        int duty_val = 0;
        unsigned long wait_timeout;
 
-       /*
-        * FIXME: need to check the CABA setting about brightness adjustment
-        * range.
-        */
-
-       if (level < MIN_BRIGHTNESS_LEVEL || level > MAX_BRIGHTNESS_LEVEL) {
-               printk(KERN_ALERT"Invalid brightness level: %d\n", level);
-               return -EINVAL;
-       }
-
        if (!sender) {
                DRM_ERROR("Failed to get DSI packet sender\n");
                return -EINVAL;
index 4ceba9b..96e490b 100644 (file)
@@ -66,6 +66,7 @@ static u32 h8c7_gamma_g[] = {0x3d3e3be1, 0x33323131, 0x0b070346, 0x110e100d,
        0x3e3b1710, 0x3231313d, 0x07034633, 0x0e100d0b, 0x00171011};
 static u32 h8c7_gamma_b[] = {0x070601e2, 0x1f322a2d, 0x0e0c0540, 0x13121411,
        0x0601180f, 0x322a2d07, 0x0c05401f, 0x1214110e, 0x00180f13};
+static u32 h8c7_enter_set_cabc[] = {0x1e001fc9, 0x0000001e, 0x00003e01};
 
 static u32 h8c7_mcs_protect_on[] = {0x000000b9};
 static u32 h8c7_set_address_mode[] = {0x00000036};
@@ -201,6 +202,11 @@ static void mdfld_h8c7_dpi_ic_init(struct mdfld_dsi_config *dsi_config, int pipe
        while (time_before_eq(jiffies, wait_timeout))
                cpu_relax();
 
+       mdfld_dsi_send_mcs_long_lp(sender, h8c7_enter_set_cabc, 10, 0);
+       wait_timeout = jiffies + (HZ / 100);
+       while (time_before_eq(jiffies, wait_timeout))
+               cpu_relax();
+
        /* disable password and wait for 10ms. */
        mdfld_dsi_send_gen_long_lp(sender, h8c7_mcs_protect_on, 4, 0);
        wait_timeout = jiffies + (HZ / 100);
@@ -435,15 +441,6 @@ int mdfld_dsi_h8c7_set_brightness(struct mdfld_dsi_config *dsi_config,
        int duty_val = 0;
        unsigned long wait_timeout;
 
-       /*
-        * FIXME: need to check the CABA setting about brightness adjustment
-        * range.
-        */
-       if (level < MIN_BRIGHTNESS_LEVEL || level > MAX_BRIGHTNESS_LEVEL) {
-               PSB_DEBUG_ENTRY("Invalid brightness level: %d\n", level);
-               return -EINVAL;
-       }
-
        if (!sender) {
                DRM_ERROR("Failed to get DSI packet sender\n");
                return -EINVAL;