Skip to contentSkip to conversation

video: w100fb: Reduce sleep mode battery discharge

PATCH RESEND Florian Tobias Schandinat 1 participant 2 messages Jun 24, 2012 – Jul 8, 2012 1 message not in the archive Framebuffer layer

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Paul,

you should als the relevant mailing list, linux-fbdev (done now)

Quoted 11 lines · Paul Parsons

In 2006 and 2007 the handhelds.org kernel w100fb driver was patched to reduce sleep mode battery discharge. Unfortunately those two patches never migrated to the mainline kernel.

Fortunately the function affected - w100_suspend() - has not changed since; thus those patches still apply cleanly.

Applying those patches to linux-3.4-rc3 running on an HP iPAQ hx4700 reduces the sleep mode battery discharge from approximately 26 mA to approximately 11 mA.

Quoted 5 lines

This patch combines those two patches into a single unified patch.

Cc Matt Reimer <[email protected]>
Cc Philipp Zabel <[email protected]>

Actually it would be good if we had the Signed-offs of the original authors. Oh well, I think if it can't be helped yours should be sufficient.

Quoted 27 lines

---

Many thanks to Matt Reimer for suggesting this.

The seeming demise of handhelds.org has removed any formal patch logs. However the patches can still be viewed online:
2006 patch:
http://paste.lisp.org/display/31700
2007 patch:
http://osdir.com/ml/handhelds.linux.kernel/2007-02/msg00020.html

And the fully patched handhelds.org kernel is still available, e.g.:
http://www.linuxtogo.org/~goxboxlive/htcuniversal/Kernel/linux-2.6.21-hh20.tar.bz2

 drivers/video/w100fb.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/video/w100fb.c +2 -0
index 90a2e30..2f6b2b8 100644
@@ -1567,6 +1567,18 @@ static void w100_suspend(u32 mode)
 		val = readl(remapped_regs + mmPLL_CNTL);
 		val |= 0x00000004;  /* bit2=1 */
 		writel(val, remapped_regs + mmPLL_CNTL);
+
+		writel(0x00000000, remapped_regs + mmLCDD_CNTL1);

drivers/video/w100fb.c static void w100_suspend(u32 mode) · line 1581

Quoted 10 lines
drivers/video/w100fb.c +10 -0
+		writel(0x00000000, remapped_regs + mmLCDD_CNTL2);
+		writel(0x00000000, remapped_regs + mmGENLCD_CNTL1);
+		writel(0x00000000, remapped_regs + mmGENLCD_CNTL2);
+		writel(0x00000000, remapped_regs + mmGENLCD_CNTL3);
+
+		val = readl(remapped_regs + mmMEM_EXT_CNTL);
+		val |= 0xF0000000;
+		val &= ~(0x00000001);
+		writel(val, remapped_regs + mmMEM_EXT_CNTL);
+

If anyone understands what this change does (like for example disabling the LCD controller) a comment would be useful.

drivers/video/w100fb.c static void w100_suspend(u32 mode) · line 1584

Quoted 3 lines
drivers/video/w100fb.c +0 -0
 		writel(0x0000001d, remapped_regs + mmPWRMGT_CNTL);
 	}
 }

If nobody comments on this I will apply it in a few days.

Best regards,

Florian Tobias Schandinat

#2 lore raw
In reply to a message not in the archive
Quoted 11 lines · Paul Parsons

In 2006 and 2007 the handhelds.org kernel w100fb driver was patched to reduce sleep mode battery discharge. Unfortunately those two patches never migrated to the mainline kernel.

Fortunately the function affected - w100_suspend() - has not changed since; thus those patches still apply cleanly.

Applying those patches to linux-3.4-rc3 running on an HP iPAQ hx4700 reduces the sleep mode battery discharge from approximately 26 mA to approximately 11 mA.

Quoted 5 lines

This patch combines those two patches into a single unified patch.

Cc Matt Reimer <[email protected]>
Cc Philipp Zabel <[email protected]>

Applied.

Thanks,

Florian Tobias Schandinat

Quoted 40 lines

---

Many thanks to Matt Reimer for suggesting this.

The seeming demise of handhelds.org has removed any formal patch logs. However the patches can still be viewed online:
2006 patch:
http://paste.lisp.org/display/31700
2007 patch:
http://osdir.com/ml/handhelds.linux.kernel/2007-02/msg00020.html

And the fully patched handhelds.org kernel is still available, e.g.:
http://www.linuxtogo.org/~goxboxlive/htcuniversal/Kernel/linux-2.6.21-hh20.tar.bz2

 drivers/video/w100fb.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/video/w100fb.c +12 -0
index 90a2e30..2f6b2b8 100644
@@ -1567,6 +1567,18 @@ static void w100_suspend(u32 mode)
 		val = readl(remapped_regs + mmPLL_CNTL);
 		val |= 0x00000004;  /* bit2=1 */
 		writel(val, remapped_regs + mmPLL_CNTL);
+
+		writel(0x00000000, remapped_regs + mmLCDD_CNTL1);
+		writel(0x00000000, remapped_regs + mmLCDD_CNTL2);
+		writel(0x00000000, remapped_regs + mmGENLCD_CNTL1);
+		writel(0x00000000, remapped_regs + mmGENLCD_CNTL2);
+		writel(0x00000000, remapped_regs + mmGENLCD_CNTL3);
+
+		val = readl(remapped_regs + mmMEM_EXT_CNTL);
+		val |= 0xF0000000;
+		val &= ~(0x00000001);
+		writel(val, remapped_regs + mmMEM_EXT_CNTL);
+
 		writel(0x0000001d, remapped_regs + mmPWRMGT_CNTL);
 	}
 }