]>
Commit | Line | Data |
---|---|---|
813c7372 | 1 | /* |
2 | * (C) Copyright 2015 Vishnu Patekar <[email protected]> | |
3 | * | |
4 | * X-Powers AXP818 Power Management IC driver | |
5 | * | |
6 | * SPDX-License-Identifier: GPL-2.0+ | |
7 | */ | |
8 | ||
9 | #define AXP818_CHIP_ID 0x03 | |
10 | ||
11 | #define AXP818_OUTPUT_CTRL1 0x10 | |
12 | #define AXP818_OUTPUT_CTRL1_DCDC1_EN (1 << 0) | |
13 | #define AXP818_OUTPUT_CTRL1_DCDC2_EN (1 << 1) | |
14 | #define AXP818_OUTPUT_CTRL1_DCDC3_EN (1 << 2) | |
15 | #define AXP818_OUTPUT_CTRL1_DCDC4_EN (1 << 3) | |
16 | #define AXP818_OUTPUT_CTRL1_DCDC5_EN (1 << 4) | |
17 | #define AXP818_OUTPUT_CTRL1_DCDC6_EN (1 << 5) | |
18 | #define AXP818_OUTPUT_CTRL1_DCDC7_EN (1 << 6) | |
19 | #define AXP818_OUTPUT_CTRL2 0x12 | |
20 | #define AXP818_OUTPUT_CTRL2_ELDO1_EN (1 << 0) | |
21 | #define AXP818_OUTPUT_CTRL2_ELDO2_EN (1 << 1) | |
22 | #define AXP818_OUTPUT_CTRL2_ELDO3_EN (1 << 2) | |
23 | #define AXP818_OUTPUT_CTRL2_DLDO1_EN (1 << 3) | |
24 | #define AXP818_OUTPUT_CTRL2_DLDO2_EN (1 << 4) | |
25 | #define AXP818_OUTPUT_CTRL2_DLDO3_EN (1 << 5) | |
26 | #define AXP818_OUTPUT_CTRL2_DLDO4_EN (1 << 6) | |
15278ccb | 27 | #define AXP818_OUTPUT_CTRL2_SW_EN (1 << 7) |
813c7372 | 28 | #define AXP818_OUTPUT_CTRL3 0x13 |
29 | #define AXP818_OUTPUT_CTRL3_FLDO1_EN (1 << 2) | |
30 | #define AXP818_OUTPUT_CTRL3_FLDO2_EN (1 << 3) | |
31 | #define AXP818_OUTPUT_CTRL3_FLDO3_EN (1 << 4) | |
32 | #define AXP818_OUTPUT_CTRL3_ALDO1_EN (1 << 5) | |
33 | #define AXP818_OUTPUT_CTRL3_ALDO2_EN (1 << 6) | |
34 | #define AXP818_OUTPUT_CTRL3_ALDO3_EN (1 << 7) | |
35 | ||
813c7372 | 36 | #define AXP818_DLDO1_CTRL 0x15 |
37 | #define AXP818_DLDO2_CTRL 0x16 | |
38 | #define AXP818_DLDO3_CTRL 0x17 | |
39 | #define AXP818_DLDO4_CTRL 0x18 | |
40 | #define AXP818_ELDO1_CTRL 0x19 | |
41 | #define AXP818_ELDO2_CTRL 0x1a | |
42 | #define AXP818_ELDO3_CTRL 0x1b | |
813c7372 | 43 | #define AXP818_FLDO1_CTRL 0x1c |
44 | #define AXP818_FLDO2_3_CTRL 0x1d | |
38491d9c | 45 | #define AXP818_FLDO2_3_CTRL_FLDO3_VOL (1 << 4) |
813c7372 | 46 | #define AXP818_DCDC1_CTRL 0x20 |
47 | #define AXP818_DCDC2_CTRL 0x21 | |
48 | #define AXP818_DCDC3_CTRL 0x22 | |
49 | #define AXP818_DCDC4_CTRL 0x23 | |
50 | #define AXP818_DCDC5_CTRL 0x24 | |
51 | #define AXP818_DCDC6_CTRL 0x25 | |
52 | #define AXP818_DCDC7_CTRL 0x26 | |
53 | ||
54 | #define AXP818_ALDO1_CTRL 0x28 | |
55 | #define AXP818_ALDO2_CTRL 0x29 | |
56 | #define AXP818_ALDO3_CTRL 0x2a | |
57 | ||
813c7372 | 58 | /* For axp_gpio.c */ |
59 | #define AXP_POWER_STATUS 0x00 | |
b25b7ad1 CYT |
60 | #define AXP_POWER_STATUS_VBUS_PRESENT (1 << 5) |
61 | #define AXP_VBUS_IPSOUT 0x30 | |
62 | #define AXP_VBUS_IPSOUT_DRIVEBUS (1 << 2) | |
63 | #define AXP_MISC_CTRL 0x8f | |
64 | #define AXP_MISC_CTRL_N_VBUSEN_FUNC (1 << 4) | |
813c7372 | 65 | #define AXP_GPIO0_CTRL 0x90 |
66 | #define AXP_GPIO1_CTRL 0x92 | |
67 | #define AXP_GPIO_CTRL_OUTPUT_LOW 0x00 /* Drive pin low */ | |
68 | #define AXP_GPIO_CTRL_OUTPUT_HIGH 0x01 /* Drive pin high */ | |
69 | #define AXP_GPIO_CTRL_INPUT 0x02 /* Input */ | |
70 | #define AXP_GPIO_STATE 0x94 | |
71 | #define AXP_GPIO_STATE_OFFSET 0 |