diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/ipod/powermgmt-ipod-pcf.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/firmware/target/arm/ipod/powermgmt-ipod-pcf.c b/firmware/target/arm/ipod/powermgmt-ipod-pcf.c index aaf4fabf52..2f97c298be 100644 --- a/firmware/target/arm/ipod/powermgmt-ipod-pcf.c +++ b/firmware/target/arm/ipod/powermgmt-ipod-pcf.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include "config.h" | 21 | #include "config.h" |
22 | #include "adc.h" | 22 | #include "adc.h" |
23 | #include "powermgmt.h" | 23 | #include "powermgmt.h" |
24 | #include "pcf5060x.h" | ||
25 | #include "pcf50605.h" | ||
24 | 26 | ||
25 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | 27 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = |
26 | { | 28 | { |
@@ -88,3 +90,20 @@ unsigned int battery_adc_voltage(void) | |||
88 | { | 90 | { |
89 | return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; | 91 | return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; |
90 | } | 92 | } |
93 | |||
94 | #ifdef HAVE_ACCESSORY_SUPPLY | ||
95 | void accessory_supply_set(bool enable) | ||
96 | { | ||
97 | if (enable) | ||
98 | { | ||
99 | /* Accessory voltage supply */ | ||
100 | pcf50605_write(PCF5060X_D2REGC1, 0xf8); /* 3.3V ON */ | ||
101 | } | ||
102 | else | ||
103 | { | ||
104 | /* Accessory voltage supply */ | ||
105 | pcf50605_write(PCF5060X_D2REGC1, 0x18); /* OFF */ | ||
106 | } | ||
107 | |||
108 | } | ||
109 | #endif | ||