public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* omapfb -- panel initialization inflexibility
@ 2005-12-03  3:42 Brian Swetland
  2005-12-05 12:35 ` Imre Deak
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Swetland @ 2005-12-03  3:42 UTC (permalink / raw)
  To: linux-omap-open-source


I have an lcd panel connected to a omap730 based system that *requires*
that MCK, HSYNC, and VSYNC are active when it is powered on.  It will
not initialize correctly otherwise.

I've modified my omapfb driver so that there is a new OMAP_LCDC_*
flag (OMAP_LCDC_PANEL_INIT_AFTER_LCDC) that determines if the
enable hook is called where it is in the existing driver, or if
it is called after omapfb_set_update_mode() returns.

Any objections to this workaround?  Any suggestions for a better
name for the flag?  Is there a better value than 0x200 for the flag?

Thanks,

Brian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: omapfb -- panel initialization inflexibility
  2005-12-03  3:42 omapfb -- panel initialization inflexibility Brian Swetland
@ 2005-12-05 12:35 ` Imre Deak
  2005-12-05 13:49   ` [PATCH] omapfb: panel enable/disable reordering Brian Swetland
  0 siblings, 1 reply; 4+ messages in thread
From: Imre Deak @ 2005-12-05 12:35 UTC (permalink / raw)
  To: ext Brian Swetland; +Cc: linux-omap-open-source

Actually there is no requirement on calling panel->enable() before
omapfb_set_update_mode(), which enables the LCD DMA. It's even possible
to enable / disable the panel while having the LCD DMA active.

So lets simply switch the order of the two calls in omapfb_probe and the
suspend / resume functions. Please send a patch.

--Imre

On Fri, 2005-12-02 at 19:42 -0800, ext Brian Swetland wrote:
> I have an lcd panel connected to a omap730 based system that *requires*
> that MCK, HSYNC, and VSYNC are active when it is powered on.  It will
> not initialize correctly otherwise.
> 
> I've modified my omapfb driver so that there is a new OMAP_LCDC_*
> flag (OMAP_LCDC_PANEL_INIT_AFTER_LCDC) that determines if the
> enable hook is called where it is in the existing driver, or if
> it is called after omapfb_set_update_mode() returns.
> 
> Any objections to this workaround?  Any suggestions for a better
> name for the flag?  Is there a better value than 0x200 for the flag?
> 
> Thanks,
> 
> Brian
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] omapfb: panel enable/disable reordering
  2005-12-05 12:35 ` Imre Deak
@ 2005-12-05 13:49   ` Brian Swetland
  2005-12-20 12:15     ` Juha Yrjölä
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Swetland @ 2005-12-05 13:49 UTC (permalink / raw)
  To: Imre Deak; +Cc: linux-omap-open-source

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

[Imre Deak <imre.deak@nokia.com>]
> Actually there is no requirement on calling panel->enable() before
> omapfb_set_update_mode(), which enables the LCD DMA. It's even possible
> to enable / disable the panel while having the LCD DMA active.
> 
> So lets simply switch the order of the two calls in omapfb_probe and the
> suspend / resume functions. Please send a patch.

Sounds fine to me.

Here's such a patch.

Brian

[-- Attachment #2: omapfb-init-order.patch --]
[-- Type: text/plain, Size: 1860 bytes --]

diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 2c4098d..0eefec5 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -349,9 +349,9 @@ static int omapfb_blank(int blank, struc
 	switch (blank) {
 	case VESA_NO_BLANKING:
 		if (fbdev->state == OMAPFB_SUSPENDED) {
-			fbdev->panel->enable();
 			if (fbdev->ctrl->resume)
 				fbdev->ctrl->resume();
+			fbdev->panel->enable();
 			fbdev->state = OMAPFB_ACTIVE;
 			if (fbdev->ctrl->get_update_mode() ==
 					OMAPFB_MANUAL_UPDATE)
@@ -360,9 +360,9 @@ static int omapfb_blank(int blank, struc
 		break;
 	case VESA_POWERDOWN:
 		if (fbdev->state == OMAPFB_ACTIVE) {
+			fbdev->panel->disable();
 			if (fbdev->ctrl->suspend)
 				fbdev->ctrl->suspend();
-			fbdev->panel->disable();
 			fbdev->state = OMAPFB_SUSPENDED;
 		}
 		break;
@@ -1108,11 +1108,12 @@ static void omapfb_free_resources(struct
 	switch (state) {
 	case OMAPFB_ACTIVE:
 		unregister_framebuffer(fbdev->fb_info);
-	case 6:
+	case 7:
 		omapfb_unregister_sysfs(fbdev);
-		omapfb_set_update_mode(fbdev, OMAPFB_UPDATE_DISABLED);
-	case 5:
+	case 6:
 		fbdev->panel->disable();
+	case 5:
+		omapfb_set_update_mode(fbdev, OMAPFB_UPDATE_DISABLED);
 	case 4:
 		fbinfo_cleanup(fbdev);
 	case 3:
@@ -1296,11 +1297,6 @@ static int omapfb_probe(struct platform_
 	omap_set_dma_priority(OMAP_DMA_PORT_EMIFF, 15);
 #endif
 
-	r = fbdev->panel->enable();
-	if (r)
-		goto cleanup;
-	init_state++;
-
 	r = ctrl_change_mode(fbdev);
 	if (r) {
 		pr_err("mode setting failed\n");
@@ -1311,6 +1307,12 @@ static int omapfb_probe(struct platform_
 
 	omapfb_set_update_mode(fbdev, manual_update ?
 				   OMAPFB_MANUAL_UPDATE : OMAPFB_AUTO_UPDATE);
+	init_state++;
+
+	r = fbdev->panel->enable();
+	if (r)
+		goto cleanup;
+	init_state++;
 
 	r = omapfb_register_sysfs(fbdev);
 	if (r)

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] omapfb: panel enable/disable reordering
  2005-12-05 13:49   ` [PATCH] omapfb: panel enable/disable reordering Brian Swetland
@ 2005-12-20 12:15     ` Juha Yrjölä
  0 siblings, 0 replies; 4+ messages in thread
From: Juha Yrjölä @ 2005-12-20 12:15 UTC (permalink / raw)
  To: imre.deak; +Cc: linux-omap-open-source

On Tue, 2005-12-20 at 13:56 +0200, ext Brian Swetland wrote:

> > Actually there is no requirement on calling panel->enable() before
> > omapfb_set_update_mode(), which enables the LCD DMA. It's even possible
> > to enable / disable the panel while having the LCD DMA active.
> > 
> > So lets simply switch the order of the two calls in omapfb_probe and the
> > suspend / resume functions. Please send a patch.
> 
> Sounds fine to me.
> 
> Here's such a patch.

Thanks, applied.

Cheers,
Juha

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-12-20 12:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-03  3:42 omapfb -- panel initialization inflexibility Brian Swetland
2005-12-05 12:35 ` Imre Deak
2005-12-05 13:49   ` [PATCH] omapfb: panel enable/disable reordering Brian Swetland
2005-12-20 12:15     ` Juha Yrjölä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox