summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320/sansa-connect/power-sansaconnect.c
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2011-12-04 09:48:10 +0000
committerTomasz Moń <desowin@gmail.com>2011-12-04 09:48:10 +0000
commit2ee9facc11745db8d2b5d8795e24e683c9deee5e (patch)
tree9a965c58ec04550ccf197c86e9272d3580c832ac /firmware/target/arm/tms320dm320/sansa-connect/power-sansaconnect.c
parentde712eebbdbfc1a514ede554ba7d5d7db8ed4478 (diff)
Power management is to be kept in target tree due to being target specific.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31136 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/tms320dm320/sansa-connect/power-sansaconnect.c')
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/power-sansaconnect.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/power-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/power-sansaconnect.c
index bb03e4c0dd..07c80a07c3 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/power-sansaconnect.c
+++ b/firmware/target/arm/tms320dm320/sansa-connect/power-sansaconnect.c
@@ -28,11 +28,35 @@
#include "backlight.h"
#include "backlight-target.h"
#include "avr-sansaconnect.h"
-#include "tps65021.h"
+#include "i2c-dm320.h"
+#include "logf.h"
+
+/* (7-bit) address is 0x48, the LSB is read/write flag */
+#define TPS65021_ADDR (0x48 << 1)
+
+static void tps65021_write_reg(unsigned reg, unsigned value)
+{
+ unsigned char data[2];
+
+ data[0] = reg;
+ data[1] = value;
+
+ if (i2c_write(TPS65021_ADDR, data, 2) != 0)
+ {
+ logf("TPS65021 error reg=0x%x", reg);
+ }
+}
void power_init(void)
{
- tps65021_init();
+ /* PWM mode */
+ tps65021_write_reg(0x04, 0xB2);
+
+ /* Set core voltage to 1.5V */
+ tps65021_write_reg(0x06, 0x1C);
+
+ /* Set LCM (LDO1) to 2.85V, Set CODEC and USB (LDO2) to 1.8V */
+ tps65021_write_reg(0x08, 0x36);
}
void power_off(void)