mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
Patch FS#5712 by Michael Sevakis - X5 Backlight brightness improvement/fix
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10322 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8bb4bab54b
commit
f18f9a8061
6 changed files with 32 additions and 19 deletions
|
|
@ -25,14 +25,13 @@
|
|||
void __backlight_on(void)
|
||||
{
|
||||
int level = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
pcf50606_write(0x38, 0x30); /* Backlight ON */
|
||||
pcf50606_write(0x38, 0xb0); /* Backlight ON, GPO1INV=1, GPO1ACT=011 */
|
||||
set_irq_level(level);
|
||||
}
|
||||
|
||||
void __backlight_off(void)
|
||||
{
|
||||
int level = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
pcf50606_write(0x38, 0x70); /* Backlight OFF */
|
||||
pcf50606_write(0x38, 0x80); /* Backlight OFF, GPO1INV=1, GPO1ACT=000 */
|
||||
set_irq_level(level);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -169,6 +169,12 @@ void pcf50606_init(void)
|
|||
pcf50606_write(0x39, 0x00); /* GPOOD0 = green led OFF */
|
||||
pcf50606_write(0x3a, 0x00); /* GPOOD1 = red led OFF */
|
||||
|
||||
pcf50606_write(0x35, 0xf1); /* Backlight PWM = 7kHz 8/16 */
|
||||
pcf50606_write(0x38, 0x30); /* Backlight ON */
|
||||
/* D305A datasheet says PWM clock frequency should be 400Hz - 2000Hz so
|
||||
* I changed it from 7kHz to 512Hz. The lower frequency looks the same.
|
||||
* GPO1 is also inverted so that display brightness increases with PWM
|
||||
* setting which also lets the X5 share the H300's
|
||||
* set_backlight_brightness code.
|
||||
*/
|
||||
pcf50606_write(0x35, 0x11); /* Backlight PWM = 512Hz, 8/16, Active */
|
||||
pcf50606_write(0x38, 0xb0); /* Backlight ON, GPO1INV=1, GPO1ACT=011 */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue