1
0
Fork 0
forked from len0rd/rockbox

as3514/as3543 fixes

- Enable end of charge monitoring once, it doesn't need to be disabled
- Acknowledge the first (wrong) end of charge interrupt on charger enable
  (this had been broken in r25299)
- Centralize reads to ENRD* registers and cache the results when needed
    - on PP it is not needed because reads are atomic, we only check for
      end of charge when the charging, and for charger presence when
      discharging

as3525v2 (using as3543) specifics
- I got the datasheet today from AMS, thanks to them for being so fast
  and not require me to sign tons of papers!
- USB detection now works on as3525v2 using the as3543. Clip+ won't
  reboot to OF yet, it needs mkamsboot support first (usbstack disabled)
- Charging should work, the CHARGER register is at a different place, it
  is an extended PMU register -> use ascodec_read/write_charger() to
  access it
- real interrupts are not used yet for ENRD, we get thousands of
  interrupts per second, apparently only limited by the i2c clock.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26116 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-05-17 20:53:25 +00:00
parent 2ed7745dde
commit 88c55d7290
10 changed files with 156 additions and 106 deletions

View file

@ -108,7 +108,8 @@
#endif
#if defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200) \
|| defined(SANSA_CLIP) || defined(SANSA_FUZE) || defined(SANSA_C200V2)
|| (CONFIG_CPU == AS3525 && defined(CONFIG_CHARGING)) \
|| CONFIG_CPU == AS3525v2
#include "ascodec.h"
#include "as3514.h"
#endif
@ -1656,8 +1657,8 @@ static bool view_battery(void)
lcd_puts(0, line++, "T Battery: ?");
}
#elif defined(SANSA_E200) || defined(SANSA_C200) || defined(SANSA_CLIP) || \
defined(SANSA_FUZE) || defined (SANSA_C200V2)
#elif defined(SANSA_E200) || defined(SANSA_C200) || CONFIG_CPU == AS3525 || \
CONFIG_CPU == AS3525v2
const int first = CHARGE_STATE_DISABLED;
static const char * const chrgstate_strings[] =
{
@ -1678,8 +1679,7 @@ static bool view_battery(void)
lcd_putsf(0, 4, "State: %s",
str ? str : "<unknown>");
lcd_putsf(0, 5, "CHARGER: %02X",
ascodec_read(AS3514_CHARGER));
lcd_putsf(0, 5, "CHARGER: %02X", ascodec_read_charger());
#elif defined(IPOD_NANO2G)
y = pmu_read_battery_voltage();
lcd_putsf(17, 1, "RAW: %d.%03d V", y / 1000, y % 1000);