FS#11604 - IPod Nano2G lcd_sleep implementation

Attached to Project: Rockbox
Opened by Franz-Josef Haider (liar) - Sunday, 05 September 2010, 14:09 GMT
Last edited by Michael Sparmann (TheSeven) - Sunday, 14 November 2010, 15:36 GMT
Task Type Patches
Category LCD
Status Closed
Assigned To No-one
Operating System iPod Nano 2G
Severity Low
Priority Normal
Reported Version Release 3.6
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


this patch implements lcd_sleep for both, type 2 (0) and 7 (1) lcds.

i have no chance to test it on a type 7 lcd but i know it already worked several month ago (please try).
to see what lcd type you have go to:
System->Debug->View HW info

what you should see when you apply this patch is:
when the backlight turns off, the lcd should shut down within 3 seconds.

if you see any glitches when the lcd gets powered on/off please report it.

if the lcd does not power on again, dont worry,
just shut the ipod down(press play for ~5 seconds),
turn it on again(the lcd will work again),
switch to diskmode
and copy a rockbox version without the patch to the ipod.
This task depends upon

Closed by  Michael Sparmann (TheSeven)
Sunday, 14 November 2010, 15:36 GMT
Reason for closing:  Fixed
Additional comments about closing:  Committed in r28591
Comment by Mulenmar Anonymous (mulenmar) - Tuesday, 07 September 2010, 03:56 GMT
For those who wonder, this also works for type 1 (7) LDS176 LCDs.
Comment by Hayden Pearce (St.) - Saturday, 11 September 2010, 11:52 GMT
I can confirm that this works on my Type 2 and Type 7 LCD Nano2Gs

However, there seems to be a visible issue when the display changes from the bootloader splash to the main menu/start screen in the form of a white, fullscreen "flash" now that is only present with this patch in my build.

<wild guess> Presumably when your code takes over the handling of the LCD <wild guess>

It's hardly a deal-breaker...but sometimes the "flash" is a lot more noticeable than others,

Also, I'm wondering if it would be too hard (or at all possible) to add a menu option for this.
It is definitely something I am interested in, but, not something something my GF would be interested in and probably not something I would want to use all the time.
A menu/config option would be a lot more practical in this case IMO.

Comment by Andree Buschmann (Buschel) - Sunday, 26 September 2010, 00:49 GMT
This patch works for me as well (LDS176 type). A suggestion: define HAVE_LCD_SLEEP_SETTING in ipodnano2g.h and there is a setting for the LCD sleep. This has been implemented a while ago.

Before this patch can go into svn I would like to the flash-issue resolved which is very visible during startup and when waking up the LCD. Can you please fix this?

Btw, savings on my nano2g were ~1 mA. A saving of 1 mA equals about 1 hour of runtime for my usecase.

Edit: Minor update to patch (use #define HAVE_LCD_SLEEP_SETTINGS, cluster LCD-defined in config.h).
Comment by Franz-Josef Haider (liar) - Friday, 22 October 2010, 16:29 GMT
avoid white flash during boot by not reseting the lcd chip during boot.
avoid white flash on lcd wakeup by initializing the lcd before enabling the backlight.
avoid white flash on lcd shutdown when Settings->General Settings->Display->LCD Settings->Sleep->Always is enabled by disabling the backlight before shutting the lcd down.
simplify the lcd wakeup routine.

i think that one is ready to commit now
Comment by Michael Sparmann (TheSeven) - Saturday, 23 October 2010, 14:50 GMT
This is still lacking the init values for the third LCD type. They are rare, but they exist. Because the non-init code can handle them the same way, they are also detected as type 1. See norloader or emBIOS loader for details on how to detect and initialize them.
Comment by Franz-Josef Haider (liar) - Tuesday, 26 October 2010, 16:25 GMT
i've added the init values for the third lcd type and ifdefed out my changes in the bootloader build to avoid an increased bootloader binsize.
Comment by Franz-Josef Haider (liar) - Tuesday, 26 October 2010, 21:28 GMT
whoops, the previous one contained another (LCD_SLEEP unrelated) patch
Comment by Franz-Josef Haider (liar) - Friday, 12 November 2010, 23:46 GMT
there was a problem with the bootloader...