Improve the process for GNU tools
[minix3.git] / minix / drivers / power / tps65950 / tps65950.h
blobd410873efe84b3852bc4f3b04e750c2b00a8916d
1 #ifndef __TPS65950_H
2 #define __TPS65950_H
4 /*
5 * The chip is so huge it's split into multiple sub-modules, each with 256
6 * byte register maps on it's own slave addresses. Use ID1, ID2, ... to
7 * specify which sub-module to communicate with. Each slave address can have
8 * registers for one or more peripherals.
9 */
11 /* Slave Address 0x48 (USB) */
12 #define ID1 0
14 /* Slave Address 0x49 (AUDIO_VOICE/GPIO/INTBR/PIH/TEST) */
15 #define ID2 1
17 /* Interface Bit Registers (INTBR) */
19 /* Chip Identifier
21 * When combined to uint32_t, these are the subfields:
22 * [31:28] - Silicon version number
23 * [27:12] - Part code number
24 * [11: 1] - Manufacturer code
25 * [ 0] - Least-significant bit (LSB)
27 #define IDCODE_7_0_REG 0x85
28 #define IDCODE_15_8_REG 0x86
29 #define IDCODE_23_16_REG 0x87
30 #define IDCODE_31_24_REG 0x88
32 #define IDCODE_REV_1_0 0x00009002f
33 #define IDCODE_REV_1_1 0x01009002f
34 #define IDCODE_REV_1_2 0x03009002f
36 /* Write 0x49 to UNLOCK_TEST_REG to unlock reading of IDCODE and DIEID */
37 #define UNLOCK_TEST_REG 0x97
38 #define UNLOCK_TEST_CODE 0x49
41 /* Slave Address 0x4a (BCI/MADC/MAIN_CHARGE/PWM01/LED/PWMAB/KEYPAD) */
42 #define ID3 2
45 /* Slave Address 0x4b (BACKUP_REG/INT/PM_MASTER/SECURED_REG) */
46 #define ID4 3
49 * Real Time Clock
52 #define SECONDS_REG 0x1c
53 #define MINUTES_REG 0x1d
54 #define HOURS_REG 0x1e
55 #define DAYS_REG 0x1f
56 #define MONTHS_REG 0x20
57 #define YEARS_REG 0x21
59 #define RTC_CTRL_REG 0x00000029
60 #define GET_TIME_BIT 6
61 #define STOP_RTC_BIT 0
63 #define RTC_STATUS_REG 0x0000002A
64 #define RUN_BIT 1
66 #define NADDRESSES 4
68 extern endpoint_t bus_endpoint;
69 extern i2c_addr_t addresses[NADDRESSES];
71 #endif /* __TPS65950_H */