From: 黄涛 Date: Fri, 12 Aug 2011 03:41:22 +0000 (+0800) Subject: backlight: aw9364: faster resume X-Git-Tag: firefly_0821_release~9772^2~20^2~7^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=058329f6a231ef4932df8c6acddfdb4bfc318d66;p=firefly-linux-kernel-4.4.55.git backlight: aw9364: faster resume --- diff --git a/drivers/video/backlight/aw9364_bl.c b/drivers/video/backlight/aw9364_bl.c index 72d23e513caf..ed011bdd8bf1 100755 --- a/drivers/video/backlight/aw9364_bl.c +++ b/drivers/video/backlight/aw9364_bl.c @@ -97,8 +97,12 @@ static int aw9364_backlight_update_status(struct backlight_device *bl) int brightness = bl->props.brightness; - if(g_aw9364_data->suspend_flag == 1) + if(g_aw9364_data->suspend_flag == 1) { brightness = 0; + g_aw9364_data->suspend_flag = 2; + } else if (g_aw9364_data->suspend_flag > 1) { + return 0; + } if (g_aw9364_data->shutdown_flag == 1) brightness = 0; @@ -152,6 +156,11 @@ static void aw9364_bl_resume(struct early_suspend *h) aw9364_data = container_of(h, struct aw9364_backlight_data, early_suspend); aw9364_data->suspend_flag = 0; + struct backlight_device *bl = g_aw9364_bl; + int brightness = bl->props.brightness; + bl->props.brightness = brightness >> 1; + backlight_update_status(bl); + bl->props.brightness = brightness; schedule_delayed_work(&aw9364_data->work, msecs_to_jiffies(0)); } @@ -205,7 +214,7 @@ static int aw9364_backlight_probe(struct platform_device *pdev) platform_set_drvdata(pdev, bl); #ifdef CONFIG_HAS_EARLYSUSPEND - data->early_suspend.level = ~0x0; + data->early_suspend.level = EARLY_SUSPEND_LEVEL_STOP_DRAWING - 1; data->early_suspend.suspend = aw9364_bl_suspend; data->early_suspend.resume = aw9364_bl_resume; register_early_suspend(&data->early_suspend);