diff options
Diffstat (limited to 'firmware/target/arm/as3525/power-as3525.c')
-rw-r--r-- | firmware/target/arm/as3525/power-as3525.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/target/arm/as3525/power-as3525.c b/firmware/target/arm/as3525/power-as3525.c index 53b95e354d..13330aa465 100644 --- a/firmware/target/arm/as3525/power-as3525.c +++ b/firmware/target/arm/as3525/power-as3525.c | |||
@@ -20,13 +20,14 @@ | |||
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #include "config.h" | 22 | #include "config.h" |
23 | #include "as3525-codec.h" | 23 | #include "ascodec-target.h" |
24 | #include "as3514.h" | ||
24 | #include <stdbool.h> | 25 | #include <stdbool.h> |
25 | 26 | ||
26 | void power_off(void) | 27 | void power_off(void) |
27 | { | 28 | { |
28 | /* clear bit 0 of system register */ | 29 | /* clear bit 0 of system register */ |
29 | ascodec_write(0x20, ascodec_read(0x20) & ~1); | 30 | ascodec_write(AS3514_SYSTEM, ascodec_read(AS3514_SYSTEM) & ~1); |
30 | 31 | ||
31 | /* TODO : turn off peripherals properly ? */ | 32 | /* TODO : turn off peripherals properly ? */ |
32 | 33 | ||
@@ -40,7 +41,7 @@ void power_init(void) | |||
40 | #if CONFIG_CHARGING | 41 | #if CONFIG_CHARGING |
41 | bool charger_inserted(void) | 42 | bool charger_inserted(void) |
42 | { | 43 | { |
43 | if(ascodec_read(0x25) & (1<<5)) | 44 | if(ascodec_read(AS3514_IRQ_ENRD0) & (1<<5)) |
44 | return true; | 45 | return true; |
45 | else | 46 | else |
46 | return false; | 47 | return false; |