U-Boot GTA02: Always enable charger on startup
[u-boot.git] / board / neo1973 / gta02 / pcf50633.c
1
2 #include <common.h>
3 #include <pcf50633.h>
4
5 /* initial register set for PCF50633 in Neo1973 GTA02 devices */
6 const u_int8_t pcf50633_initial_regs[__NUM_PCF50633_REGS] = {
7         /* gap */
8         [PCF50633_REG_INT1M]    = 0x00,
9         [PCF50633_REG_INT2M]    = PCF50633_INT2_EXTON3F |
10                                   PCF50633_INT2_EXTON3R |
11                                   PCF50633_INT2_EXTON2F |
12                                   PCF50633_INT2_EXTON2R,
13         [PCF50633_REG_INT3M]    = PCF50633_INT3_ADCRDY,
14         [PCF50633_REG_INT4M]    = 0x00,
15         [PCF50633_REG_INT5M]    = 0x00,
16
17         [PCF50633_REG_OOCWAKE]  = 0xd3, /* wake from ONKEY,EXTON!,RTC,USB,ADP */
18         [PCF50633_REG_OOCTIM1]  = 0xaa, /* debounce 14ms everything */
19         [PCF50633_REG_OOCTIM2]  = 0x4a,
20         [PCF50633_REG_OOCMODE]  = 0x55,
21         [PCF50633_REG_OOCCTL]   = 0x47,
22
23         [PCF50633_REG_GPIOCTL]  = 0x01, /* only GPIO1 is input */
24         [PCF50633_REG_GPIO2CFG] = 0x00,
25         [PCF50633_REG_GPIO3CFG] = 0x00,
26         [PCF50633_REG_GPOCFG]   = 0x00,
27
28         [PCF50633_REG_SVMCTL]   = 0x08, /* 3.10V SYS voltage thresh. */
29         [PCF50633_REG_BVMCTL]   = 0x02, /* 2.80V BAT voltage thresh. */
30
31         [PCF50633_REG_STBYCTL1] = 0x00,
32         [PCF50633_REG_STBYCTL2] = 0x00,
33
34         [PCF50633_REG_DEBPF1]   = 0xff,
35         [PCF50633_REG_DEBPF2]   = 0xff,
36         [PCF50633_REG_DEBPF2]   = 0x3f,
37
38         [PCF50633_REG_AUTOOUT]  = 0x6b, /* 3.300V */
39         [PCF50633_REG_AUTOENA]  = 0x01, /* always on */
40         [PCF50633_REG_AUTOCTL]  = 0x00, /* automatic up/down operation */
41         [PCF50633_REG_AUTOMXC]  = 0x0a, /* 400mA at startup FIXME */
42
43         [PCF50633_REG_DOWN1OUT] = 0x1b, /* 1.3V (0x1b * .025V + 0.625V) */
44         [PCF50633_REG_DOWN1ENA] = 0x02, /* enabled if GPIO1 = HIGH */
45         [PCF50633_REG_DOWN1CTL] = 0x00, /* no DVM */
46         [PCF50633_REG_DOWN1MXC] = 0x22, /* limit to 510mA at startup */
47
48         [PCF50633_REG_DOWN2OUT] = 0x2f, /* 1.8V (0x2f * .025V + 0.625V) */
49 #ifdef CONFIG_ARCH_GTA02_v1
50         [PCF50633_REG_DOWN2ENA] = 0x02, /* enabled if GPIO1 = HIGH */
51 #else
52         [PCF50633_REG_DOWN2ENA] = 0x01, /* always enabled */
53 #endif
54         [PCF50633_REG_DOWN2CTL] = 0x00, /* no DVM */
55         [PCF50633_REG_DOWN2MXC] = 0x22, /* limit to 510mA at startup */
56
57         [PCF50633_REG_MEMLDOOUT] = 0x00,
58         [PCF50633_REG_MEMLDOENA] = 0x00,
59
60         [PCF50633_REG_LEDOUT]   = 0x2f, /* full backlight power */
61         [PCF50633_REG_LEDENA]   = 0x00, /* disabled */
62         [PCF50633_REG_LEDCTL]   = 0x05, /* ovp enabled, ocp 500mA */
63         [PCF50633_REG_LEDDIM]   = 0x20, /* dimming curve */
64
65         [PCF50633_REG_LDO1OUT]  = 0x18, /* 3.3V (24 * 0.1V + 0.9V) */
66         [PCF50633_REG_LDO1ENA]  = 0x00, /* GSENSOR_3V3, enable later */
67
68         [PCF50633_REG_LDO2OUT]  = 0x18, /* 3.3V (24 * 0.1V + 0.9V) */
69         [PCF50633_REG_LDO2ENA]  = 0x00, /* CODEC_3V3, enable later */
70
71 #ifdef CONFIG_ARCH_GTA02_v1
72         [PCF50633_REG_LDO3OUT]  = 0x15, /* 3.0V (21 * 0.1V + 0.9V) */
73         [PCF50633_REG_LDO3ENA]  = 0x02, /* enabled if GPIO1 = HIGH */
74 #else
75         [PCF50633_REG_LDO3OUT]  = 0x00,
76         [PCF50633_REG_LDO3ENA]  = 0x00,
77 #endif
78
79         [PCF50633_REG_LDO4ENA]  = 0x00,
80
81         [PCF50633_REG_LDO5OUT]  = 0x15, /* 3.0V (21 * 0.1V + 0.9V) */
82         [PCF50633_REG_LDO5ENA]  = 0x00, /* RF_3V, enable later  */
83
84         [PCF50633_REG_LDO6OUT]  = 0x15, /* 3.0V (21 * 0.1V + 0.9V) */
85         [PCF50633_REG_LDO6ENA]  = 0x00, /* LCM_3V, enable later */
86
87         [PCF50633_REG_HCLDOOUT] = 0x18, /* 3.3V (24 * 0.1V + 0.9V) */
88         [PCF50633_REG_HCLDOENA] = 0x00, /* off by default*/
89
90         [PCF50633_REG_DCDCPFM]  = 0x00, /* off by default*/
91
92         [PCF50633_REG_MBCC1]    = 0xe6,
93         [PCF50633_REG_MBCC2]    = 0x28, /* Vbatconid=2.7V, Vmax=4.20V */
94         [PCF50633_REG_MBCC3]    = 0x19, /* 25/255 == 98mA pre-charge */
95         [PCF50633_REG_MBCC4]    = 0xff, /* 255/255 == 1A adapter fast */
96         [PCF50633_REG_MBCC5]    = 0x19, /* 25/255 == 98mA soft-start usb fast */
97         [PCF50633_REG_MBCC6]    = 0x00, /* cutoff current 1/32 * Ichg */
98         [PCF50633_REG_MBCC7]    = 0x00, /* 1.6A max bat curr, USB 100mA */
99         [PCF50633_REG_MBCC8]    = 0x00,
100
101         [PCF50633_REG_BBCCTL]   = 0x19, /* 3V, 200uA, on */
102 };