From 4e8be2ebc5ce9135c7323251dba0e25db22adbdf Mon Sep 17 00:00:00 2001 From: root Date: Fri, 22 Jul 2011 12:25:36 +0800 Subject: [PATCH] A22:modify the backlight interface for charger display --- drivers/video/backlight/aw9364_bl.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/video/backlight/aw9364_bl.c b/drivers/video/backlight/aw9364_bl.c index 4187df158d74..72d23e513caf 100755 --- a/drivers/video/backlight/aw9364_bl.c +++ b/drivers/video/backlight/aw9364_bl.c @@ -51,17 +51,6 @@ static struct backlight_device *g_aw9364_bl; static struct aw9364_backlight_data *g_aw9364_data; #endif -int rk29_backlight_ctrl(int open) -{ - if(open) - gpio_direction_output(g_aw9364_data->pin_en, GPIO_HIGH); - else - gpio_direction_output(g_aw9364_data->pin_en, GPIO_LOW); - mdelay(3); - return 0; -} - - static int aw9364_backlight_set(struct backlight_device *bl, int brightness) { struct aw9364_backlight_data *data = bl_get_data(bl); @@ -95,7 +84,7 @@ static int aw9364_backlight_set(struct backlight_device *bl, int brightness) DBG("%s:current_bl=%d,bl=%d,num_clk_to=%d,num_clk_from=%d,num_clk=%d\n",__FUNCTION__, data->current_brightness,brightness,num_clk_to,num_clk_from,num_clk); - if(num_clk) + if((num_clk) || (brightness < 16)) data->current_brightness = brightness; return 0; @@ -168,6 +157,19 @@ static void aw9364_bl_resume(struct early_suspend *h) } #endif + + +int rk29_backlight_ctrl(int open) +{ + if(open) + g_aw9364_data->suspend_flag = 0; + else + g_aw9364_data->suspend_flag = 1; + + backlight_update_status(g_aw9364_bl); + return 0; +} + static int aw9364_backlight_probe(struct platform_device *pdev) { struct aw9364_backlight_data *data; -- 2.34.1