Re: [PATCH] atmel_lcdfb: fix usage of wrong registers in suspend/resume

From
Hubert Feurstein <hidden>
Date
2011-06-06 13:24:09
Reply to
Hubert Feurstein, 2011-06-06
Or it must be this way:
---
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 4484c72..c2ceae4 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -1085,7 +1085,7 @@ static int atmel_lcdfb_suspend(struct
platform_device *pdev, pm_message_t mesg)
 	 */
 	lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL);

-	sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
+	sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_CTR);
 	lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
 	if (sinfo->atmel_lcdfb_power_control)
 		sinfo->atmel_lcdfb_power_control(0);
--
So which solution was originally intended?

Best regards
Hubert

2011/6/6 Hubert Feurstein [off-list ref]:
quoted hunk ↗ jump to hunk
I assume the intention was to set the contrast value to 0 and not
the contrast control register (in atmel_lcdfb_suspend). And in
atmel_lcdfb_resume the contrast value should be restored.

Signed-off-by: Hubert Feurstein <redacted>
Cc: Nicolas Ferre <redacted>
Cc: Jean-Christophe PLAGNIOL-VILLARD <redacted>
---
 drivers/video/atmel_lcdfb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 4484c72..2ed7ec1 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -1086,7 +1086,7 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
       lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL);

       sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
-       lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
+       lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, 0);
       if (sinfo->atmel_lcdfb_power_control)
               sinfo->atmel_lcdfb_power_control(0);
@@ -1105,7 +1105,7 @@ static int atmel_lcdfb_resume(struct platform_device *pdev)
       atmel_lcdfb_start(sinfo);
       if (sinfo->atmel_lcdfb_power_control)
               sinfo->atmel_lcdfb_power_control(1);
-       lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon);
+       lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, sinfo->saved_lcdcon);

       /* Enable FIFO & DMA errors */
       lcdc_writel(sinfo, ATMEL_LCDC_IER, ATMEL_LCDC_UFLWI
--
1.7.1
Thread (6 messages) 6 messages, 4 authors, last reply 2012-01-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help