summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-05-02 08:08:10 +0000
committerDave Chapman <dave@dchapman.com>2006-05-02 08:08:10 +0000
commitf79d35a25eb47b681d6c3c6f4c8aaba9175ec633 (patch)
tree5cafc44117d583ab15d9b8a9bfda34eef88e637e /firmware
parentb1feebeb2b30ccbcc02af6e965b9408b9af7f8f8 (diff)
downloadrockbox-f79d35a25eb47b681d6c3c6f4c8aaba9175ec633.tar.gz
rockbox-f79d35a25eb47b681d6c3c6f4c8aaba9175ec633.tar.bz2
rockbox-f79d35a25eb47b681d6c3c6f4c8aaba9175ec633.zip
ipods - First implementation of pcf50605_init() function. This enables the power-out in the Dock connector, which may help getting some accessories working - if they don't need to talk to the ipod via the Apple Accessory Protocol. Thanks to julius in IRC for testing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9860 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/pcf50605.c13
-rw-r--r--firmware/drivers/power.c2
-rw-r--r--firmware/export/pcf50605.h1
3 files changed, 15 insertions, 1 deletions
diff --git a/firmware/drivers/pcf50605.c b/firmware/drivers/pcf50605.c
index a8c61b1789..0f71229964 100644
--- a/firmware/drivers/pcf50605.c
+++ b/firmware/drivers/pcf50605.c
@@ -65,6 +65,12 @@
#define PSSC 0x18
#define PWROKM 0x19
#define PWROKS 0x1a
+#define D1REGC1 0x24
+ #define VOUT_3000mV 0xf5
+ #define VOUT_3300mV 0xf8
+#define D2REGC1 0x25
+#define D3REGC1 0x26
+
int pcf50605_read(int address)
{
@@ -101,3 +107,10 @@ void pcf50605_standby_mode(void)
pcf50605_write(OOCC1, GOSTDBY | CHGWAK | EXTONWAK);
}
+void pcf50605_init(void)
+{
+ /* The following values were taken from the ipodlinux kernel source */
+ pcf50605_write(D1REGC1, VOUT_3000mV); /* Unknown */
+ pcf50605_write(D2REGC1, VOUT_3300mV); /* Dock Connector pin 17 */
+ pcf50605_write(D3REGC1, VOUT_3000mV); /* Unknown */
+}
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index 9cc751e41e..c4b9fb5b7d 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -85,7 +85,7 @@ void power_init(void)
#endif
#endif
#elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002
- /* TODO: Implement power_init() */
+ pcf50605_init();
#else
#ifdef HAVE_POWEROFF_ON_PB5
PBCR2 &= ~0x0c00; /* GPIO for PB5 */
diff --git a/firmware/export/pcf50605.h b/firmware/export/pcf50605.h
index 4ea1379e4a..eeb09b4612 100644
--- a/firmware/export/pcf50605.h
+++ b/firmware/export/pcf50605.h
@@ -28,6 +28,7 @@ int pcf50605_write_multiple(int address, const unsigned char* buf, int count);
int pcf50605_a2d_read(int channel);
bool pcf50605_charger_inserted(void);
void pcf50605_standby_mode(void);
+void pcf50605_init(void);
#endif
#endif