summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2008-04-20 18:28:25 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2008-04-20 18:28:25 +0000
commit850a11250a8c5b6825b080ff843f30fd68cb71f6 (patch)
treed236674a20fccc8002edeafa30d210b5c972327d /firmware/target
parentcea07eb2a4ddb72d084c7085192521613004a997 (diff)
downloadrockbox-850a11250a8c5b6825b080ff843f30fd68cb71f6.tar.gz
rockbox-850a11250a8c5b6825b080ff843f30fd68cb71f6.zip
Adding new setting to System Settings <Accessory Power Supply -- off by default). This setting can be used to enable/disable the power supply for accessories. With this commit implemented for iPods with PCF50605 power controller.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17193 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/ipod/powermgmt-ipod-pcf.c19
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
25const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = 27const 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
95void 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