Speaker output turns off when screen blank is activated.

Ewan Meadows ewan.meadows at gmail.com
Tue Jun 23 14:09:20 CEST 2009

Hi there,

Just thought I'd drop a line on how I've been getting along.  I've
been looking at writing a device driver for the DSerial and to help me
get into it, I've been looking at the bug whereas the Speaker output
gets turned off when the screen blank activates.

Ludo noticed that the header file in
linux-2.6.x/include/asm/arch/power.h is wrong:

#define POWER_CR       (*(volatile u16*)0x04000304)

#define POWER_LCD_TOP    (1<<0)
#define POWER_2D         (1<<1)
#define POWER_MATRIX     (1<<2)
#define POWER_3D_CORE    (1<<3)
#define POWER_LCD_BOTTOM (1<<8)
#define POWER_2D_SUB     (1<<9)
#define POWER_SWAP_LCDS  (1<<15)


According to gbatek, POWER_LCD_BOTTOM doesn't exist and POWER_LCD_TOP
should just be POWER_LCD.  POWER_LCD turns off the two screens but
also unfortunately turns off the Speaker output.

To correctly turn off the backlight requires some communication with
the power management chip on the ARM7 SPI bus.  I am unsure on how to
do this in the ndsfb.c driver, I think the best way would be to write
a standalone power management driver and then use the kernel power
management to blank the screen in ndsfb.c.  Thoughts/Suggestions?

Another thing I noticed was this in linux-2.6.x/drivers/video/ndsfb.c:

if (blank_mode) {
                POWER_CR &= ~(POWER_LCD_TOP | POWER_LCD_TOP);
} else {
               POWER_CR |= (POWER_2D | POWER_2D_SUB | POWER_LCD_TOP |
        return 0;

Ludo thinks that this can be condensed down to this:

if (blank_mode) {
                POWER_CR &= ~(POWER_LCD_TOP); \\Blank
} else {
               POWER_CR |= (POWER_LCD_TOP); \\Unblank
        return 0;

I have found that powering down the 2D cores can cause the system to
hang and I've tested the above code and it works (although as before
it will turn the speakers off).  Can anyone point out why they would
OR it twice in the original code?

Anyway, just wanted to prove that DSLinux dev isn't quite dead yet!



More information about the dslinux-devel mailing list