Commit f9e2bc8d authored by Jouni Hogander's avatar Jouni Hogander Committed by Linus Torvalds

omapfb: dispc: disable iface clocks along with func clocks

Leaving interface clocks enabled causes dss pwrdm to stay in active state
when mpu is in active state.  This fix puts dss to sleep state when it is
not needed.

Earlier version broke framebuffer on 24xx.  This is fixed by enabling
clocks before trying to access DISPC_IRQSTATUS register.
Signed-off-by: default avatarJouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarImre Deak <imre.deak@nokia.com>
Acked-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fd0eecbd
...@@ -858,8 +858,11 @@ EXPORT_SYMBOL(omap_dispc_free_irq); ...@@ -858,8 +858,11 @@ EXPORT_SYMBOL(omap_dispc_free_irq);
static irqreturn_t omap_dispc_irq_handler(int irq, void *dev) static irqreturn_t omap_dispc_irq_handler(int irq, void *dev)
{ {
u32 stat = dispc_read_reg(DISPC_IRQSTATUS); u32 stat;
enable_lcd_clocks(1);
stat = dispc_read_reg(DISPC_IRQSTATUS);
if (stat & DISPC_IRQ_FRAMEMASK) if (stat & DISPC_IRQ_FRAMEMASK)
complete(&dispc.frame_done); complete(&dispc.frame_done);
...@@ -875,6 +878,8 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *dev) ...@@ -875,6 +878,8 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *dev)
dispc_write_reg(DISPC_IRQSTATUS, stat); dispc_write_reg(DISPC_IRQSTATUS, stat);
enable_lcd_clocks(0);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -913,18 +918,13 @@ static void put_dss_clocks(void) ...@@ -913,18 +918,13 @@ static void put_dss_clocks(void)
static void enable_lcd_clocks(int enable) static void enable_lcd_clocks(int enable)
{ {
if (enable) if (enable) {
clk_enable(dispc.dss_ick);
clk_enable(dispc.dss1_fck); clk_enable(dispc.dss1_fck);
else } else {
clk_disable(dispc.dss1_fck); clk_disable(dispc.dss1_fck);
}
static void enable_interface_clocks(int enable)
{
if (enable)
clk_enable(dispc.dss_ick);
else
clk_disable(dispc.dss_ick); clk_disable(dispc.dss_ick);
}
} }
static void enable_digit_clocks(int enable) static void enable_digit_clocks(int enable)
...@@ -1365,7 +1365,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode, ...@@ -1365,7 +1365,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
if ((r = get_dss_clocks()) < 0) if ((r = get_dss_clocks()) < 0)
goto fail0; goto fail0;
enable_interface_clocks(1);
enable_lcd_clocks(1); enable_lcd_clocks(1);
#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
...@@ -1469,7 +1468,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode, ...@@ -1469,7 +1468,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
free_irq(INT_24XX_DSS_IRQ, fbdev); free_irq(INT_24XX_DSS_IRQ, fbdev);
fail1: fail1:
enable_lcd_clocks(0); enable_lcd_clocks(0);
enable_interface_clocks(0);
put_dss_clocks(); put_dss_clocks();
fail0: fail0:
iounmap(dispc.base); iounmap(dispc.base);
...@@ -1487,7 +1485,6 @@ static void omap_dispc_cleanup(void) ...@@ -1487,7 +1485,6 @@ static void omap_dispc_cleanup(void)
cleanup_fbmem(); cleanup_fbmem();
free_palette_ram(); free_palette_ram();
free_irq(INT_24XX_DSS_IRQ, dispc.fbdev); free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
enable_interface_clocks(0);
put_dss_clocks(); put_dss_clocks();
iounmap(dispc.base); iounmap(dispc.base);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment