mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Abstract the PortalPlayer AS3514 handling with an "ascodec" API - inspired by the wmcodec API used with the Wolfson codecs. The intention is to implement this API for the AS3525 and then share code with the Sansa V2 ports.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18940 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
324816f019
commit
42f77d4eb0
15 changed files with 196 additions and 61 deletions
|
|
@ -23,7 +23,7 @@
|
|||
#include "system.h"
|
||||
#include "lcd.h"
|
||||
#include "backlight.h"
|
||||
#include "i2c-pp.h"
|
||||
#include "ascodec.h"
|
||||
#include "as3514.h"
|
||||
|
||||
static unsigned short backlight_brightness = DEFAULT_BRIGHTNESS_SETTING;
|
||||
|
|
@ -46,12 +46,12 @@ void _backlight_on(void)
|
|||
#ifdef HAVE_LCD_ENABLE
|
||||
lcd_enable(true); /* power on lcd + visible display */
|
||||
#endif
|
||||
pp_i2c_send(AS3514_I2C_ADDR, AS3514_DCDC15, backlight_brightness);
|
||||
ascodec_write(AS3514_DCDC15, backlight_brightness);
|
||||
}
|
||||
|
||||
void _backlight_off(void)
|
||||
{
|
||||
pp_i2c_send(AS3514_I2C_ADDR, AS3514_DCDC15, 0x0);
|
||||
ascodec_write(AS3514_DCDC15, 0x0);
|
||||
#ifdef HAVE_LCD_ENABLE
|
||||
lcd_enable(false); /* power off visible display */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ void power_off(void)
|
|||
char byte;
|
||||
|
||||
/* Send shutdown command to PMU */
|
||||
byte = i2c_readbyte(AS3514_I2C_ADDR, AS3514_SYSTEM);
|
||||
byte = ascodec_read(AS3514_SYSTEM);
|
||||
byte &= ~0x1;
|
||||
pp_i2c_send(AS3514_I2C_ADDR, AS3514_SYSTEM, byte);
|
||||
ascodec_write(AS3514_SYSTEM, byte);
|
||||
|
||||
/* Stop interrupts on both cores */
|
||||
disable_interrupt(IRQ_FIQ_STATUS);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue