From d4a0d116b123a0b88b790b39694bb5c352c67d7f Mon Sep 17 00:00:00 2001 From: zyw Date: Thu, 17 Feb 2011 15:03:27 +0800 Subject: [PATCH] optimize fb shutdown for clk --- drivers/video/rk29_fb.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/video/rk29_fb.c b/drivers/video/rk29_fb.c index d2ebb1f8fbfe..ab312261cb0e 100644 --- a/drivers/video/rk29_fb.c +++ b/drivers/video/rk29_fb.c @@ -2414,6 +2414,8 @@ static int rk29fb_remove(struct platform_device *pdev) // cpufreq_unregister_notifier(&inf->freq_transition, CPUFREQ_TRANSITION_NOTIFIER); #endif + msleep(100); + if (inf->clk) { clk_disable(inf->clk); @@ -2439,14 +2441,19 @@ static void rk29fb_shutdown(struct platform_device *pdev) mdelay(300); //printk("----------------------------rk29fb_shutdown----------------------------\n"); set_lcd_pin(pdev, 0); - if (inf->dclk) + if (inf->clk) { - clk_disable(inf->dclk); - } - if (inf->clk) + clk_disable(inf->clk); + clk_put(inf->clk); + inf->clk = NULL; + } + if (inf->dclk) { - clk_disable(inf->clk); - } + clk_disable(inf->dclk); + clk_put(inf->dclk); + inf->dclk = NULL; + } + } static struct platform_driver rk29fb_driver = { -- 2.34.1