diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-05-17 20:53:25 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-05-17 20:53:25 +0000 |
commit | 88c55d7290b7c360075557c40fdf65ceeeaf0c4b (patch) | |
tree | 29cf685626bf8c01bb64ed9456850f62e4a57d7d /firmware/target/arm/as3525/usb-as3525.c | |
parent | 2ed7745ddefc084ca7030d48b251882e94fa2f9c (diff) | |
download | rockbox-88c55d7290b7c360075557c40fdf65ceeeaf0c4b.tar.gz rockbox-88c55d7290b7c360075557c40fdf65ceeeaf0c4b.zip |
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
Diffstat (limited to 'firmware/target/arm/as3525/usb-as3525.c')
-rw-r--r-- | firmware/target/arm/as3525/usb-as3525.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/firmware/target/arm/as3525/usb-as3525.c b/firmware/target/arm/as3525/usb-as3525.c index 74bfc17364..be62752033 100644 --- a/firmware/target/arm/as3525/usb-as3525.c +++ b/firmware/target/arm/as3525/usb-as3525.c | |||
@@ -29,13 +29,7 @@ | |||
29 | #include "power.h" | 29 | #include "power.h" |
30 | #include "as3525.h" | 30 | #include "as3525.h" |
31 | 31 | ||
32 | #if CONFIG_CPU == AS3525 | ||
33 | static int usb_status = USB_EXTRACTED; | 32 | static int usb_status = USB_EXTRACTED; |
34 | #else | ||
35 | #if defined(SANSA_CLIPV2) | ||
36 | #define USB_DETECT_PIN 6 | ||
37 | #endif | ||
38 | #endif | ||
39 | 33 | ||
40 | void usb_enable(bool on) | 34 | void usb_enable(bool on) |
41 | { | 35 | { |
@@ -51,12 +45,8 @@ void usb_enable(bool on) | |||
51 | 45 | ||
52 | void usb_init_device(void) | 46 | void usb_init_device(void) |
53 | { | 47 | { |
54 | #ifdef USB_DETECT_PIN | ||
55 | GPIOA_DIR &= ~(1 << USB_DETECT_PIN); /* set as input */ | ||
56 | #endif | ||
57 | } | 48 | } |
58 | 49 | ||
59 | #if CONFIG_CPU == AS3525 | ||
60 | void usb_insert_int(void) | 50 | void usb_insert_int(void) |
61 | { | 51 | { |
62 | usb_status = USB_INSERTED; | 52 | usb_status = USB_INSERTED; |
@@ -71,14 +61,3 @@ int usb_detect(void) | |||
71 | { | 61 | { |
72 | return usb_status; | 62 | return usb_status; |
73 | } | 63 | } |
74 | #else | ||
75 | int usb_detect(void) | ||
76 | { | ||
77 | #ifdef USB_DETECT_PIN | ||
78 | if (GPIOA_PIN( USB_DETECT_PIN )) | ||
79 | return USB_INSERTED; | ||
80 | else | ||
81 | #endif | ||
82 | return USB_EXTRACTED; | ||
83 | } | ||
84 | #endif | ||