All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] atmel_lcdfb: LCDC startup fix
@ 2007-11-23 15:12 ` Nicolas Ferre
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Ferre @ 2007-11-23 15:12 UTC (permalink / raw)
  To: Antonino A. Daplas, linux-fbdev-devel
  Cc: Anti Sullin, Patrice Vilchez, Andrew Victor, Linux Kernel list

From: Anti Sullin <anti.sullin@artecdesign.ee>

This patch adds an additional loop, that delays turning off the DMA 
until the LCDC core has been turned off. This prevents the picture 
to be shifted some random length when the kernel re-initializes
the LCDC.

Signed-off-by: Anti Sullin <anti.sullin@artecdesign.ee>
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
---

Without this patch, the LCDC keeps running for some small time 
after the PWRCON:LCD_PWR has been cleared ; the FIFO suffers 
an underrun and on re-starting the LCDC the FIFO data 
stays shifted.
This behavior has been seen and fixed on AT91SAM9261-EK and 
two custom AT91SAM9261 boards, all of them having different 
LCD panels.

Thanks a lot to Anti Sullin for submitting this patch (long 
time ago).

--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -268,6 +268,10 @@
 	/* Turn off the LCD controller and the DMA controller */
 	lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET);
 
+	/* Wait for the LCDC core to become idle */
+	while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY)
+		msleep(10);
+
 	lcdc_writel(sinfo, ATMEL_LCDC_DMACON, 0);
 
 	if (info->var.bits_per_pixel == 1)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

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

* [PATCH] atmel_lcdfb: LCDC startup fix
@ 2007-11-23 15:12 ` Nicolas Ferre
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Ferre @ 2007-11-23 15:12 UTC (permalink / raw)
  To: Antonino A. Daplas, linux-fbdev-devel
  Cc: Andrew Victor, Patrice Vilchez, Haavard Skinnemoen, Anti Sullin,
	Linux Kernel list

From: Anti Sullin <anti.sullin@artecdesign.ee>

This patch adds an additional loop, that delays turning off the DMA 
until the LCDC core has been turned off. This prevents the picture 
to be shifted some random length when the kernel re-initializes
the LCDC.

Signed-off-by: Anti Sullin <anti.sullin@artecdesign.ee>
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
---

Without this patch, the LCDC keeps running for some small time 
after the PWRCON:LCD_PWR has been cleared ; the FIFO suffers 
an underrun and on re-starting the LCDC the FIFO data 
stays shifted.
This behavior has been seen and fixed on AT91SAM9261-EK and 
two custom AT91SAM9261 boards, all of them having different 
LCD panels.

Thanks a lot to Anti Sullin for submitting this patch (long 
time ago).

--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -268,6 +268,10 @@
 	/* Turn off the LCD controller and the DMA controller */
 	lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET);
 
+	/* Wait for the LCDC core to become idle */
+	while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY)
+		msleep(10);
+
 	lcdc_writel(sinfo, ATMEL_LCDC_DMACON, 0);
 
 	if (info->var.bits_per_pixel == 1)

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

end of thread, other threads:[~2007-11-23 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-23 15:12 [PATCH] atmel_lcdfb: LCDC startup fix Nicolas Ferre
2007-11-23 15:12 ` Nicolas Ferre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.