4 #define PAGE(n) (n << 7)
6 VRPCCFG = PAGE(1) | 30,
7 VRPCDEV = PAGE(0) | 30,
8 VRPCMSK = PAGE(1) | 31,
9 VRPCMSKABB = PAGE(1) | 29,
10 VRPCSTS = PAGE(0) | 31,
11 /* Monitoring ADC Registers */
12 MADCTRL = PAGE(0) | 13,
13 MADCSTAT = PAGE(0) | 24,
14 VBATREG = PAGE(0) | 15,
15 VCHGREG = PAGE(0) | 16,
16 ICHGREG = PAGE(0) | 17,
17 VBKPREG = PAGE(0) | 18,
18 ADIN1REG = PAGE(0) | 19,
19 ADIN2REG = PAGE(0) | 20,
20 ADIN3REG = PAGE(0) | 21,
21 ADIN4REG = PAGE(0) | 22,
22 /* Clock Generator Registers */
26 TAPCTRL = PAGE(1) | 19,
27 TAPREG = PAGE(1) | 20,
28 /* Automatic Frequency Control (AFC) Registers */
29 AUXAFC1 = PAGE(0) | 7,
30 AUXAFC2 = PAGE(0) | 8,
31 AFCCTLADD = PAGE(1) | 21,
32 AFCOUT = PAGE(1) | 22,
33 /* Automatic Power Control (APC) Registers */
34 APCDEL1 = PAGE(0) | 2,
35 APCDEL2 = PAGE(1) | 26,
37 APCRAM = PAGE(0) | 10,
38 APCOFF = PAGE(0) | 11,
39 APCOUT = PAGE(1) | 12,
40 /* Auxiliary DAC Control Register */
41 AUXDAC = PAGE(0) | 12,
42 /* SimCard Control Register */
43 VRPCSIM = PAGE(1) | 23,
44 /* LED Driver Register */
45 AUXLED = PAGE(1) | 24,
46 /* Battery Charger Interface (BCI) Registers */
47 CHGREG = PAGE(0) | 25,
48 BCICTL1 = PAGE(0) | 28,
49 BCICTL2 = PAGE(0) | 29,
50 BCICONF = PAGE(1) | 13,
51 /* Interrupt and Bus Control (IBIC) Registers */
52 ITMASK = PAGE(0) | 28,
53 ITSTATREG = PAGE(0) | 27, /* both pages! */
54 PAGEREG = PAGE(0) | 1, /* both pages! */
55 /* Baseband Codec (BBC) Registers */
56 BULIOFF = PAGE(1) | 2,
57 BULQOFF = PAGE(1) | 3,
58 BULIDAC = PAGE(1) | 5,
59 BULQDAC = PAGE(1) | 4,
60 BULGCAL = PAGE(1) | 14,
61 BULDATA1 = PAGE(0) | 3, /* 16 words */
63 /* Voiceband Codec (VBC) Registers */
64 VBCTRL1 = PAGE(1) | 8,
65 VBCTRL2 = PAGE(1) | 11,
67 VBUCTRL = PAGE(1) | 7,
68 VBDCTRL = PAGE(0) | 6,
70 #define BULDATA2 BULDATA1
73 TOGBR2_KEEPR = (1 << 0), /* Clear KEEPON bit */
74 TOGBR2_KEEPS = (1 << 1), /* Set KEEPON bit */
75 TOGBR2_ACTR = (1 << 2), /* Dectivate MCLK */
76 TOGBR2_ACTS = (1 << 3), /* Activate MCLK */
77 TOGBR2_IBUFPTR1 = (1 << 4), /* Initialize pointer of burst buffer 1 */
78 TOGBR2_IBUFPTR2 = (1 << 5), /* Initialize pointer of burst buffer 2 */
79 TOGBR2_IAPCPTR = (1 << 6), /* Initialize pointer of APC RAM */
90 void twl3025_init(void);
91 void twl3025_reg_write(uint8_t reg, uint16_t data);
92 uint16_t twl3025_reg_read(uint8_t reg);
94 void twl3025_power_off(void);
96 void twl3025_clk13m(int enable);
98 void twl3025_unit_enable(enum twl3025_unit unit, int on);
100 enum twl3025_tsp_bits {
110 /* Enqueue a TSP signal change via the TPU */
111 void twl3025_tsp_write(uint8_t data);
113 /* Enqueue a series of TSP commands in the TPU to (de)activate the downlink path */
114 void twl3025_downlink(int on, int16_t at);
116 /* Update the AFC DAC value */
117 void twl3025_afc_set(int16_t val);
119 /* Get the AFC DAC value */
120 int16_t twl3025_afc_get(void);
122 /* Get the AFC DAC output value */
123 uint8_t twl3025_afcout_get(void);
125 /* Force a certain static AFC DAC output value */
126 void twl3025_afcout_set(uint8_t val);