summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iriver/h300/pcf50606-h300.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/iriver/h300/pcf50606-h300.c')
-rw-r--r--firmware/target/coldfire/iriver/h300/pcf50606-h300.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/firmware/target/coldfire/iriver/h300/pcf50606-h300.c b/firmware/target/coldfire/iriver/h300/pcf50606-h300.c
new file mode 100644
index 0000000000..c990f5ddcb
--- /dev/null
+++ b/firmware/target/coldfire/iriver/h300/pcf50606-h300.c
@@ -0,0 +1,52 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Linus Nielsen Feltzing
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#include "config.h"
20#include "system.h"
21#include "kernel.h"
22#include "pcf50606.h"
23
24/* These voltages were determined by measuring the output of the PCF50606
25 on a running H300, and verified by disassembling the original firmware */
26static void set_voltages(void)
27{
28 static const unsigned char buf[5] =
29 {
30 0xf4, /* IOREGC = 2.9V, ON in all states */
31 0xef, /* D1REGC = 2.4V, ON in all states */
32 0x18, /* D2REGC = 3.3V, OFF in all states */
33 0xf0, /* D3REGC = 2.5V, ON in all states */
34 0xef, /* LPREGC1 = 2.4V, ON in all states */
35 };
36
37 pcf50606_write_multiple(0x23, buf, 5);
38}
39
40void pcf50606_init(void)
41{
42 pcf50606_i2c_init();
43
44 set_voltages();
45
46 pcf50606_write(0x08, 0x60); /* Wake on USB and charger insertion */
47 pcf50606_write(0x09, 0x05); /* USB and ON key debounce: 14ms */
48 pcf50606_write(0x29, 0x1C); /* Disable the unused MBC module */
49
50 pcf50606_write(0x35, 0x13); /* Backlight PWM = 512Hz 50/50 */
51 pcf50606_write(0x3a, 0x3b); /* PWM output on GPOOD1 */
52}