diff options
Diffstat (limited to 'firmware/drivers/pcf50605.c')
-rw-r--r-- | firmware/drivers/pcf50605.c | 70 |
1 files changed, 12 insertions, 58 deletions
diff --git a/firmware/drivers/pcf50605.c b/firmware/drivers/pcf50605.c index afa0a5ca11..7d88e46aa2 100644 --- a/firmware/drivers/pcf50605.c +++ b/firmware/drivers/pcf50605.c | |||
@@ -29,54 +29,7 @@ | |||
29 | #include "i2c-pp.h" | 29 | #include "i2c-pp.h" |
30 | #endif | 30 | #endif |
31 | #include "rtc.h" | 31 | #include "rtc.h" |
32 | 32 | #include "pcf5060x.h" | |
33 | #define OOCS 0x01 | ||
34 | #define INT1 0x02 | ||
35 | #define INT2 0x03 | ||
36 | #define INT3 0x04 | ||
37 | #define INT1M 0x05 | ||
38 | #define INT2M 0x06 | ||
39 | #define INT3M 0x07 | ||
40 | #define OOCC1 0x08 | ||
41 | #define GOSTDBY 0x1 | ||
42 | #define TOTRST (0x1 << 1) | ||
43 | #define CLK32ON (0x1 << 2) | ||
44 | #define WDTRST (0x1 << 3) | ||
45 | #define RTCWAK (0x1 << 4) | ||
46 | #define CHGWAK (0x1 << 5) | ||
47 | #define EXTONWAK (0x01 << 6) | ||
48 | #define OOCC2 0x09 | ||
49 | #define RTCSC 0x0a | ||
50 | #define RTCMN 0x0b | ||
51 | #define RTCHR 0x0c | ||
52 | #define RTCWD 0x0d | ||
53 | #define RTCDT 0x0e | ||
54 | #define RTCMT 0x0f | ||
55 | #define RTCYR 0x10 | ||
56 | #define RTCSCA 0x11 | ||
57 | #define RTCMNA 0x12 | ||
58 | #define RTCHRA 0x13 | ||
59 | #define RTCWDA 0x14 | ||
60 | #define RTCDTA 0x15 | ||
61 | #define RTCMTA 0x16 | ||
62 | #define RTCYRA 0x17 | ||
63 | #define PSSC 0x18 | ||
64 | #define PWROKM 0x19 | ||
65 | #define PWROKS 0x1a | ||
66 | #define DCDC1 0x1b | ||
67 | #define DCDC2 0x1c | ||
68 | #define DCDC3 0x1d | ||
69 | #define DCDC4 0x1e | ||
70 | #define DCDEC1 0x1f | ||
71 | #define DCDEC2 0x20 | ||
72 | #define DCUDC1 0x21 | ||
73 | #define DCUDC2 0x22 | ||
74 | #define IOREGC 0x23 | ||
75 | #define D1REGC1 0x24 | ||
76 | #define D2REGC1 0x25 | ||
77 | #define D3REGC1 0x26 | ||
78 | #define LPREG1C 0x27 | ||
79 | |||
80 | 33 | ||
81 | unsigned char pcf50605_wakeup_flags = 0; | 34 | unsigned char pcf50605_wakeup_flags = 0; |
82 | 35 | ||
@@ -117,7 +70,8 @@ int pcf50605_write_multiple(int address, const unsigned char* buf, int count) | |||
117 | power on your iPod again. */ | 70 | power on your iPod again. */ |
118 | void pcf50605_standby_mode(void) | 71 | void pcf50605_standby_mode(void) |
119 | { | 72 | { |
120 | pcf50605_write(OOCC1, GOSTDBY | CHGWAK | EXTONWAK | pcf50605_wakeup_flags); | 73 | pcf50605_write(PCF5060X_OOCC1, |
74 | GOSTDBY | CHGWAK | EXTONWAK | pcf50605_wakeup_flags); | ||
121 | } | 75 | } |
122 | 76 | ||
123 | void pcf50605_init(void) | 77 | void pcf50605_init(void) |
@@ -125,27 +79,27 @@ void pcf50605_init(void) | |||
125 | #if defined (IPOD_VIDEO) | 79 | #if defined (IPOD_VIDEO) |
126 | /* I/O and GPO voltage supply (default: 0xf8 = 3.3V ON) */ | 80 | /* I/O and GPO voltage supply (default: 0xf8 = 3.3V ON) */ |
127 | /* ECO not allowed regarding data sheet */ | 81 | /* ECO not allowed regarding data sheet */ |
128 | pcf50605_write(IOREGC, 0xf8); /* 3.3V ON */ | 82 | pcf50605_write(PCF5060X_IOREGC, 0xf8); /* 3.3V ON */ |
129 | 83 | ||
130 | /* core voltage supply (default DCDC1/DCDC2: 0xec = 1.2V ON) */ | 84 | /* core voltage supply (default DCDC1/DCDC2: 0xec = 1.2V ON) */ |
131 | /* ECO not stable, assumed due to less precision of voltage in ECO mode */ | 85 | /* ECO not stable, assumed due to less precision of voltage in ECO mode */ |
132 | pcf50605_write(DCDC1, 0xec); /* 1.2V ON */ | 86 | pcf50605_write(PCF5060X_DCDC1, 0xec); /* 1.2V ON */ |
133 | pcf50605_write(DCDC2, 0x0c); /* OFF */ | 87 | pcf50605_write(PCF5060X_DCDC2, 0x0c); /* OFF */ |
134 | 88 | ||
135 | /* unknown (default: 0xe3 = 1.8V ON) */ | 89 | /* unknown (default: 0xe3 = 1.8V ON) */ |
136 | pcf50605_write(DCUDC1, 0xe3); /* 1.8V ON */ | 90 | pcf50605_write(PCF5060X_DCUDC1, 0xe3); /* 1.8V ON */ |
137 | 91 | ||
138 | /* WM8758 voltage supply (default: 0xf5 = 3.0V ON) */ | 92 | /* WM8758 voltage supply (default: 0xf5 = 3.0V ON) */ |
139 | /* ECO not allowed as max. current of 5mA is not sufficient */ | 93 | /* ECO not allowed as max. current of 5mA is not sufficient */ |
140 | pcf50605_write(D1REGC1, 0xf0); /* 2.5V ON */ | 94 | pcf50605_write(PCF5060X_D1REGC1, 0xf0); /* 2.5V ON */ |
141 | 95 | ||
142 | /* LCD voltage supply (default: 0xf5 = 3.0V ON) */ | 96 | /* LCD voltage supply (default: 0xf5 = 3.0V ON) */ |
143 | pcf50605_write(D3REGC1, 0xf1); /* 2.6V ON */ | 97 | pcf50605_write(PCF5060X_D3REGC1, 0xf1); /* 2.6V ON */ |
144 | #else | 98 | #else |
145 | /* keep initialization from svn for other iPods */ | 99 | /* keep initialization from svn for other iPods */ |
146 | pcf50605_write(D1REGC1, 0xf5); /* 3.0V ON */ | 100 | pcf50605_write(PCF5060X_D1REGC1, 0xf5); /* 3.0V ON */ |
147 | pcf50605_write(D3REGC1, 0xf5); /* 3.0V ON */ | 101 | pcf50605_write(PCF5060X_D3REGC1, 0xf5); /* 3.0V ON */ |
148 | #endif | 102 | #endif |
149 | /* Dock Connector pin 17 (default: OFF) */ | 103 | /* Dock Connector pin 17 (default: OFF) */ |
150 | pcf50605_write(D2REGC1, 0xf8); /* 3.3V ON */ | 104 | pcf50605_write(PCF5060X_D2REGC1, 0xf8); /* 3.3V ON */ |
151 | } | 105 | } |