diff options
author | Jouni Hogander <jouni.hogander@nokia.com> | 2009-09-22 19:46:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:49 -0400 |
commit | f9e2bc8d7b8c2d9dd05a6702fce77aca3d4f2320 (patch) | |
tree | 7408e23135eaf4ab9154953dc933e6af6e93daa6 /drivers/video/omap/dispc.c | |
parent | fd0eecbdfbb61076e75d34034cc5cd5ca1321a81 (diff) |
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: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/omap/dispc.c')
-rw-r--r-- | drivers/video/omap/dispc.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c index f1308aa04feb..a85694900e44 100644 --- a/drivers/video/omap/dispc.c +++ b/drivers/video/omap/dispc.c | |||
@@ -858,8 +858,11 @@ EXPORT_SYMBOL(omap_dispc_free_irq); | |||
858 | 858 | ||
859 | static irqreturn_t omap_dispc_irq_handler(int irq, void *dev) | 859 | static irqreturn_t omap_dispc_irq_handler(int irq, void *dev) |
860 | { | 860 | { |
861 | u32 stat = dispc_read_reg(DISPC_IRQSTATUS); | 861 | u32 stat; |
862 | 862 | ||
863 | enable_lcd_clocks(1); | ||
864 | |||
865 | stat = dispc_read_reg(DISPC_IRQSTATUS); | ||
863 | if (stat & DISPC_IRQ_FRAMEMASK) | 866 | if (stat & DISPC_IRQ_FRAMEMASK) |
864 | complete(&dispc.frame_done); | 867 | complete(&dispc.frame_done); |
865 | 868 | ||
@@ -875,6 +878,8 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *dev) | |||
875 | 878 | ||
876 | dispc_write_reg(DISPC_IRQSTATUS, stat); | 879 | dispc_write_reg(DISPC_IRQSTATUS, stat); |
877 | 880 | ||
881 | enable_lcd_clocks(0); | ||
882 | |||
878 | return IRQ_HANDLED; | 883 | return IRQ_HANDLED; |
879 | } | 884 | } |
880 | 885 | ||
@@ -913,18 +918,13 @@ static void put_dss_clocks(void) | |||
913 | 918 | ||
914 | static void enable_lcd_clocks(int enable) | 919 | static void enable_lcd_clocks(int enable) |
915 | { | 920 | { |
916 | if (enable) | 921 | if (enable) { |
922 | clk_enable(dispc.dss_ick); | ||
917 | clk_enable(dispc.dss1_fck); | 923 | clk_enable(dispc.dss1_fck); |
918 | else | 924 | } else { |
919 | clk_disable(dispc.dss1_fck); | 925 | clk_disable(dispc.dss1_fck); |
920 | } | ||
921 | |||
922 | static void enable_interface_clocks(int enable) | ||
923 | { | ||
924 | if (enable) | ||
925 | clk_enable(dispc.dss_ick); | ||
926 | else | ||
927 | clk_disable(dispc.dss_ick); | 926 | clk_disable(dispc.dss_ick); |
927 | } | ||
928 | } | 928 | } |
929 | 929 | ||
930 | static void enable_digit_clocks(int enable) | 930 | static void enable_digit_clocks(int enable) |
@@ -1365,7 +1365,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode, | |||
1365 | if ((r = get_dss_clocks()) < 0) | 1365 | if ((r = get_dss_clocks()) < 0) |
1366 | goto fail0; | 1366 | goto fail0; |
1367 | 1367 | ||
1368 | enable_interface_clocks(1); | ||
1369 | enable_lcd_clocks(1); | 1368 | enable_lcd_clocks(1); |
1370 | 1369 | ||
1371 | #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT | 1370 | #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT |
@@ -1469,7 +1468,6 @@ fail2: | |||
1469 | free_irq(INT_24XX_DSS_IRQ, fbdev); | 1468 | free_irq(INT_24XX_DSS_IRQ, fbdev); |
1470 | fail1: | 1469 | fail1: |
1471 | enable_lcd_clocks(0); | 1470 | enable_lcd_clocks(0); |
1472 | enable_interface_clocks(0); | ||
1473 | put_dss_clocks(); | 1471 | put_dss_clocks(); |
1474 | fail0: | 1472 | fail0: |
1475 | iounmap(dispc.base); | 1473 | iounmap(dispc.base); |
@@ -1487,7 +1485,6 @@ static void omap_dispc_cleanup(void) | |||
1487 | cleanup_fbmem(); | 1485 | cleanup_fbmem(); |
1488 | free_palette_ram(); | 1486 | free_palette_ram(); |
1489 | free_irq(INT_24XX_DSS_IRQ, dispc.fbdev); | 1487 | free_irq(INT_24XX_DSS_IRQ, dispc.fbdev); |
1490 | enable_interface_clocks(0); | ||
1491 | put_dss_clocks(); | 1488 | put_dss_clocks(); |
1492 | iounmap(dispc.base); | 1489 | iounmap(dispc.base); |
1493 | } | 1490 | } |