* [PATCH] OMAP: DISPC: Fix to disable also interface clocks
@ 2008-07-01 7:12 Jouni Hogander
2008-07-01 9:13 ` Felipe Balbi
2008-07-01 9:37 ` [PATCH 1/1] OMAP: DISPC: Fix to disable also interface clocks. 2nd Jouni Hogander
0 siblings, 2 replies; 8+ messages in thread
From: Jouni Hogander @ 2008-07-01 7:12 UTC (permalink / raw)
To: linux-omap
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.
Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
---
drivers/video/omap/dispc.c | 17 +++++------------
1 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
index 6aff476..ad436f5 100644
--- a/drivers/video/omap/dispc.c
+++ b/drivers/video/omap/dispc.c
@@ -914,18 +914,14 @@ static void put_dss_clocks(void)
static void enable_lcd_clocks(int enable)
{
- if (enable)
+ if (enable) {
+ clk_enable(dispc.dss_ick);
clk_enable(dispc.dss1_fck);
- else
+ }
+ else {
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);
+ }
}
static void enable_digit_clocks(int enable)
@@ -1361,7 +1357,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
if ((r = get_dss_clocks()) < 0)
return r;
- enable_interface_clocks(1);
enable_lcd_clocks(1);
#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
@@ -1465,7 +1460,6 @@ fail2:
free_irq(INT_24XX_DSS_IRQ, fbdev);
fail1:
enable_lcd_clocks(0);
- enable_interface_clocks(0);
put_dss_clocks();
return r;
@@ -1482,7 +1476,6 @@ static void omap_dispc_cleanup(void)
cleanup_fbmem();
free_palette_ram();
free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
- enable_interface_clocks(0);
put_dss_clocks();
}
--
1.5.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] OMAP: DISPC: Fix to disable also interface clocks
2008-07-01 7:12 [PATCH] OMAP: DISPC: Fix to disable also interface clocks Jouni Hogander
@ 2008-07-01 9:13 ` Felipe Balbi
2008-07-01 9:26 ` Högander Jouni
2008-07-01 9:37 ` [PATCH 1/1] OMAP: DISPC: Fix to disable also interface clocks. 2nd Jouni Hogander
1 sibling, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2008-07-01 9:13 UTC (permalink / raw)
To: Jouni Hogander; +Cc: linux-omap
On Tue, Jul 01, 2008 at 10:12:41AM +0300, Jouni Hogander wrote:
> static void enable_lcd_clocks(int enable)
> {
> - if (enable)
> + if (enable) {
> + clk_enable(dispc.dss_ick);
> clk_enable(dispc.dss1_fck);
> - else
> + }
> + else {
should be } else { according to CodingStyle ;-)
--
Best Regards,
Felipe Balbi
me@felipebalbi.com
http://blog.felipebalbi.com
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] OMAP: DISPC: Fix to disable also interface clocks
2008-07-01 9:13 ` Felipe Balbi
@ 2008-07-01 9:26 ` Högander Jouni
0 siblings, 0 replies; 8+ messages in thread
From: Högander Jouni @ 2008-07-01 9:26 UTC (permalink / raw)
To: me; +Cc: linux-omap
"ext Felipe Balbi" <me@felipebalbi.com> writes:
> On Tue, Jul 01, 2008 at 10:12:41AM +0300, Jouni Hogander wrote:
>> static void enable_lcd_clocks(int enable)
>> {
>> - if (enable)
>> + if (enable) {
>> + clk_enable(dispc.dss_ick);
>> clk_enable(dispc.dss1_fck);
>> - else
>> + }
>> + else {
>
> should be } else { according to CodingStyle ;-)
Yes, thanks Felipe. I should have bother to use checkpatch.pl here. I
will send this again.
>
> --
> Best Regards,
>
> Felipe Balbi
> me@felipebalbi.com
> http://blog.felipebalbi.com
>
>
--
Jouni Högander
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/1] OMAP: DISPC: Fix to disable also interface clocks. 2nd.
2008-07-01 7:12 [PATCH] OMAP: DISPC: Fix to disable also interface clocks Jouni Hogander
2008-07-01 9:13 ` Felipe Balbi
@ 2008-07-01 9:37 ` Jouni Hogander
2008-07-03 11:04 ` Tony Lindgren
1 sibling, 1 reply; 8+ messages in thread
From: Jouni Hogander @ 2008-07-01 9:37 UTC (permalink / raw)
To: linux-omap
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.
Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
---
drivers/video/omap/dispc.c | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
index 6aff476..d82588c 100644
--- a/drivers/video/omap/dispc.c
+++ b/drivers/video/omap/dispc.c
@@ -914,18 +914,13 @@ static void put_dss_clocks(void)
static void enable_lcd_clocks(int enable)
{
- if (enable)
+ if (enable) {
+ clk_enable(dispc.dss_ick);
clk_enable(dispc.dss1_fck);
- else
+ } else {
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);
+ }
}
static void enable_digit_clocks(int enable)
@@ -1361,7 +1356,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
if ((r = get_dss_clocks()) < 0)
return r;
- enable_interface_clocks(1);
enable_lcd_clocks(1);
#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
@@ -1465,7 +1459,6 @@ fail2:
free_irq(INT_24XX_DSS_IRQ, fbdev);
fail1:
enable_lcd_clocks(0);
- enable_interface_clocks(0);
put_dss_clocks();
return r;
@@ -1482,7 +1475,6 @@ static void omap_dispc_cleanup(void)
cleanup_fbmem();
free_palette_ram();
free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
- enable_interface_clocks(0);
put_dss_clocks();
}
--
1.5.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 1/1] OMAP: DISPC: Fix to disable also interface clocks. 2nd.
2008-07-01 9:37 ` [PATCH 1/1] OMAP: DISPC: Fix to disable also interface clocks. 2nd Jouni Hogander
@ 2008-07-03 11:04 ` Tony Lindgren
2008-07-03 11:33 ` Tony Lindgren
0 siblings, 1 reply; 8+ messages in thread
From: Tony Lindgren @ 2008-07-03 11:04 UTC (permalink / raw)
To: Jouni Hogander; +Cc: linux-omap
* Jouni Hogander <jouni.hogander@nokia.com> [080701 12:39]:
> 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.
Pushing today.
Tony
>
> Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
> ---
> drivers/video/omap/dispc.c | 16 ++++------------
> 1 files changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
> index 6aff476..d82588c 100644
> --- a/drivers/video/omap/dispc.c
> +++ b/drivers/video/omap/dispc.c
> @@ -914,18 +914,13 @@ static void put_dss_clocks(void)
>
> static void enable_lcd_clocks(int enable)
> {
> - if (enable)
> + if (enable) {
> + clk_enable(dispc.dss_ick);
> clk_enable(dispc.dss1_fck);
> - else
> + } else {
> 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);
> + }
> }
>
> static void enable_digit_clocks(int enable)
> @@ -1361,7 +1356,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
> if ((r = get_dss_clocks()) < 0)
> return r;
>
> - enable_interface_clocks(1);
> enable_lcd_clocks(1);
>
> #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
> @@ -1465,7 +1459,6 @@ fail2:
> free_irq(INT_24XX_DSS_IRQ, fbdev);
> fail1:
> enable_lcd_clocks(0);
> - enable_interface_clocks(0);
> put_dss_clocks();
>
> return r;
> @@ -1482,7 +1475,6 @@ static void omap_dispc_cleanup(void)
> cleanup_fbmem();
> free_palette_ram();
> free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
> - enable_interface_clocks(0);
> put_dss_clocks();
> }
>
> --
> 1.5.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 1/1] OMAP: DISPC: Fix to disable also interface clocks. 2nd.
2008-07-03 11:04 ` Tony Lindgren
@ 2008-07-03 11:33 ` Tony Lindgren
2008-08-15 8:56 ` [PATCH] OMAP: DISPC: Fix to disable also interface clocks Jouni Hogander
0 siblings, 1 reply; 8+ messages in thread
From: Tony Lindgren @ 2008-07-03 11:33 UTC (permalink / raw)
To: Jouni Hogander; +Cc: linux-omap
* Tony Lindgren <tony@atomide.com> [080703 14:03]:
> * Jouni Hogander <jouni.hogander@nokia.com> [080701 12:39]:
> > 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.
>
> Pushing today.
And then reverted, this one seems to break framebuffer at least on 24xx.
>
> Tony
>
> >
> > Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
> > ---
> > drivers/video/omap/dispc.c | 16 ++++------------
> > 1 files changed, 4 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
> > index 6aff476..d82588c 100644
> > --- a/drivers/video/omap/dispc.c
> > +++ b/drivers/video/omap/dispc.c
> > @@ -914,18 +914,13 @@ static void put_dss_clocks(void)
> >
> > static void enable_lcd_clocks(int enable)
> > {
> > - if (enable)
> > + if (enable) {
> > + clk_enable(dispc.dss_ick);
> > clk_enable(dispc.dss1_fck);
> > - else
> > + } else {
> > 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);
> > + }
> > }
> >
> > static void enable_digit_clocks(int enable)
> > @@ -1361,7 +1356,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
> > if ((r = get_dss_clocks()) < 0)
> > return r;
> >
> > - enable_interface_clocks(1);
> > enable_lcd_clocks(1);
> >
> > #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
> > @@ -1465,7 +1459,6 @@ fail2:
> > free_irq(INT_24XX_DSS_IRQ, fbdev);
> > fail1:
> > enable_lcd_clocks(0);
> > - enable_interface_clocks(0);
> > put_dss_clocks();
> >
> > return r;
> > @@ -1482,7 +1475,6 @@ static void omap_dispc_cleanup(void)
> > cleanup_fbmem();
> > free_palette_ram();
> > free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
> > - enable_interface_clocks(0);
> > put_dss_clocks();
> > }
> >
> > --
> > 1.5.5
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH] OMAP: DISPC: Fix to disable also interface clocks.
2008-07-03 11:33 ` Tony Lindgren
@ 2008-08-15 8:56 ` Jouni Hogander
2008-08-20 11:58 ` Tony Lindgren
0 siblings, 1 reply; 8+ messages in thread
From: Jouni Hogander @ 2008-08-15 8:56 UTC (permalink / raw)
To: linux-omap
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>
---
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 3d64314..99bf355 100644
--- a/drivers/video/omap/dispc.c
+++ b/drivers/video/omap/dispc.c
@@ -858,8 +858,11 @@ EXPORT_SYMBOL(omap_dispc_free_irq);
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)
complete(&dispc.frame_done);
@@ -875,6 +878,8 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *dev)
dispc_write_reg(DISPC_IRQSTATUS, stat);
+ enable_lcd_clocks(0);
+
return IRQ_HANDLED;
}
@@ -915,18 +920,13 @@ static void put_dss_clocks(void)
static void enable_lcd_clocks(int enable)
{
- if (enable)
+ if (enable) {
+ clk_enable(dispc.dss_ick);
clk_enable(dispc.dss1_fck);
- else
+ } else {
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);
+ }
}
static void enable_digit_clocks(int enable)
@@ -1362,7 +1362,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
if ((r = get_dss_clocks()) < 0)
return r;
- enable_interface_clocks(1);
enable_lcd_clocks(1);
#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
@@ -1466,7 +1465,6 @@ fail2:
free_irq(INT_24XX_DSS_IRQ, fbdev);
fail1:
enable_lcd_clocks(0);
- enable_interface_clocks(0);
put_dss_clocks();
return r;
@@ -1483,7 +1481,6 @@ static void omap_dispc_cleanup(void)
cleanup_fbmem();
free_palette_ram();
free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
- enable_interface_clocks(0);
put_dss_clocks();
}
--
1.5.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] OMAP: DISPC: Fix to disable also interface clocks.
2008-08-15 8:56 ` [PATCH] OMAP: DISPC: Fix to disable also interface clocks Jouni Hogander
@ 2008-08-20 11:58 ` Tony Lindgren
0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2008-08-20 11:58 UTC (permalink / raw)
To: Jouni Hogander; +Cc: linux-omap
* Jouni Hogander <jouni.hogander@nokia.com> [080815 11:57]:
> 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.
Pushing today. BTW, here we could use the virtual clock to combine
the needed clocks instead of enable_interface_clocks().
Tony
> Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
> ---
> 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 3d64314..99bf355 100644
> --- a/drivers/video/omap/dispc.c
> +++ b/drivers/video/omap/dispc.c
> @@ -858,8 +858,11 @@ EXPORT_SYMBOL(omap_dispc_free_irq);
>
> 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)
> complete(&dispc.frame_done);
>
> @@ -875,6 +878,8 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *dev)
>
> dispc_write_reg(DISPC_IRQSTATUS, stat);
>
> + enable_lcd_clocks(0);
> +
> return IRQ_HANDLED;
> }
>
> @@ -915,18 +920,13 @@ static void put_dss_clocks(void)
>
> static void enable_lcd_clocks(int enable)
> {
> - if (enable)
> + if (enable) {
> + clk_enable(dispc.dss_ick);
> clk_enable(dispc.dss1_fck);
> - else
> + } else {
> 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);
> + }
> }
>
> static void enable_digit_clocks(int enable)
> @@ -1362,7 +1362,6 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
> if ((r = get_dss_clocks()) < 0)
> return r;
>
> - enable_interface_clocks(1);
> enable_lcd_clocks(1);
>
> #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
> @@ -1466,7 +1465,6 @@ fail2:
> free_irq(INT_24XX_DSS_IRQ, fbdev);
> fail1:
> enable_lcd_clocks(0);
> - enable_interface_clocks(0);
> put_dss_clocks();
>
> return r;
> @@ -1483,7 +1481,6 @@ static void omap_dispc_cleanup(void)
> cleanup_fbmem();
> free_palette_ram();
> free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
> - enable_interface_clocks(0);
> put_dss_clocks();
> }
>
> --
> 1.5.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-08-20 11:58 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01 7:12 [PATCH] OMAP: DISPC: Fix to disable also interface clocks Jouni Hogander
2008-07-01 9:13 ` Felipe Balbi
2008-07-01 9:26 ` Högander Jouni
2008-07-01 9:37 ` [PATCH 1/1] OMAP: DISPC: Fix to disable also interface clocks. 2nd Jouni Hogander
2008-07-03 11:04 ` Tony Lindgren
2008-07-03 11:33 ` Tony Lindgren
2008-08-15 8:56 ` [PATCH] OMAP: DISPC: Fix to disable also interface clocks Jouni Hogander
2008-08-20 11:58 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox