xref: /linux/drivers/regulator/pv88090-regulator.h (revision c39f2d9db0fd81ea20bb5cce9b3f082ca63753e2)
1*0ae3b061SAxel Lin /* SPDX-License-Identifier: GPL-2.0+ */
2c90456e3SJames Ban /*
3c90456e3SJames Ban  * pv88090-regulator.h - Regulator definitions for PV88090
4c90456e3SJames Ban  * Copyright (C) 2015 Powerventure Semiconductor Ltd.
5c90456e3SJames Ban  */
6c90456e3SJames Ban 
7c90456e3SJames Ban #ifndef __PV88090_REGISTERS_H__
8c90456e3SJames Ban #define __PV88090_REGISTERS_H__
9c90456e3SJames Ban 
10c90456e3SJames Ban /* System Control and Event Registers */
11c90456e3SJames Ban #define	PV88090_REG_EVENT_A			0x03
12c90456e3SJames Ban #define	PV88090_REG_MASK_A			0x06
13c90456e3SJames Ban #define	PV88090_REG_MASK_B			0x07
14c90456e3SJames Ban 
15c90456e3SJames Ban /* Regulator Registers */
16c90456e3SJames Ban #define	PV88090_REG_BUCK1_CONF0			0x18
17c90456e3SJames Ban #define	PV88090_REG_BUCK1_CONF1			0x19
18c90456e3SJames Ban #define	PV88090_REG_BUCK1_CONF2			0x1a
19c90456e3SJames Ban #define	PV88090_REG_BUCK2_CONF0			0x1b
20c90456e3SJames Ban #define	PV88090_REG_BUCK2_CONF1			0x1c
21c90456e3SJames Ban #define	PV88090_REG_BUCK2_CONF2			0x58
22c90456e3SJames Ban #define	PV88090_REG_BUCK3_CONF0			0x1d
23c90456e3SJames Ban #define	PV88090_REG_BUCK3_CONF1			0x1e
24c90456e3SJames Ban #define	PV88090_REG_BUCK3_CONF2			0x5c
25c90456e3SJames Ban 
26c90456e3SJames Ban #define	PV88090_REG_LDO1_CONT			0x1f
27c90456e3SJames Ban #define	PV88090_REG_LDO2_CONT			0x20
28c90456e3SJames Ban #define	PV88090_REG_LDO3_CONT			0x21
29c90456e3SJames Ban #define	PV88090_REG_BUCK_FOLD_RANGE			0x61
30c90456e3SJames Ban 
31c90456e3SJames Ban /* PV88090_REG_EVENT_A (addr=0x03) */
32c90456e3SJames Ban #define	PV88090_E_VDD_FLT				0x01
33c90456e3SJames Ban #define	PV88090_E_OVER_TEMP			0x02
34c90456e3SJames Ban 
35c90456e3SJames Ban /* PV88090_REG_MASK_A (addr=0x06) */
36c90456e3SJames Ban #define	PV88090_M_VDD_FLT				0x01
37c90456e3SJames Ban #define	PV88090_M_OVER_TEMP			0x02
38c90456e3SJames Ban 
39c90456e3SJames Ban /* PV88090_REG_BUCK1_CONF0 (addr=0x18) */
40c90456e3SJames Ban #define	PV88090_BUCK1_EN				0x80
41c90456e3SJames Ban #define PV88090_VBUCK1_MASK			0x7F
42c90456e3SJames Ban /* PV88090_REG_BUCK2_CONF0 (addr=0x1b) */
43c90456e3SJames Ban #define	PV88090_BUCK2_EN				0x80
44c90456e3SJames Ban #define PV88090_VBUCK2_MASK			0x7F
45c90456e3SJames Ban /* PV88090_REG_BUCK3_CONF0 (addr=0x1d) */
46c90456e3SJames Ban #define	PV88090_BUCK3_EN				0x80
47c90456e3SJames Ban #define PV88090_VBUCK3_MASK			0x7F
48c90456e3SJames Ban /* PV88090_REG_LDO1_CONT (addr=0x1f) */
49c90456e3SJames Ban #define	PV88090_LDO1_EN				0x40
50c90456e3SJames Ban #define PV88090_VLDO1_MASK			0x3F
51c90456e3SJames Ban /* PV88090_REG_LDO2_CONT (addr=0x20) */
52c90456e3SJames Ban #define	PV88090_LDO2_EN				0x40
53c90456e3SJames Ban #define PV88090_VLDO2_MASK			0x3F
54c90456e3SJames Ban 
55c90456e3SJames Ban /* PV88090_REG_BUCK1_CONF1 (addr=0x19) */
56c90456e3SJames Ban #define PV88090_BUCK1_ILIM_SHIFT			2
57c90456e3SJames Ban #define PV88090_BUCK1_ILIM_MASK			0x7C
58c90456e3SJames Ban #define PV88090_BUCK1_MODE_MASK			0x03
59c90456e3SJames Ban 
60c90456e3SJames Ban /* PV88090_REG_BUCK2_CONF1 (addr=0x1c) */
61c90456e3SJames Ban #define PV88090_BUCK2_ILIM_SHIFT			2
62c90456e3SJames Ban #define PV88090_BUCK2_ILIM_MASK			0x0C
63c90456e3SJames Ban #define PV88090_BUCK2_MODE_MASK			0x03
64c90456e3SJames Ban 
65c90456e3SJames Ban /* PV88090_REG_BUCK3_CONF1 (addr=0x1e) */
66c90456e3SJames Ban #define PV88090_BUCK3_ILIM_SHIFT			2
67c90456e3SJames Ban #define PV88090_BUCK3_ILIM_MASK			0x0C
68c90456e3SJames Ban #define PV88090_BUCK3_MODE_MASK			0x03
69c90456e3SJames Ban 
70c90456e3SJames Ban #define	PV88090_BUCK_MODE_SLEEP			0x00
71c90456e3SJames Ban #define	PV88090_BUCK_MODE_AUTO			0x01
72c90456e3SJames Ban #define	PV88090_BUCK_MODE_SYNC			0x02
73c90456e3SJames Ban 
74c90456e3SJames Ban /* PV88090_REG_BUCK2_CONF2 (addr=0x58) */
75c90456e3SJames Ban /* PV88090_REG_BUCK3_CONF2 (addr=0x5c) */
76c90456e3SJames Ban #define PV88090_BUCK_VDAC_RANGE_SHIFT			7
77c90456e3SJames Ban #define PV88090_BUCK_VDAC_RANGE_MASK			0x01
78c90456e3SJames Ban 
79c90456e3SJames Ban #define PV88090_BUCK_VDAC_RANGE_1			0x00
80c90456e3SJames Ban #define PV88090_BUCK_VDAC_RANGE_2			0x01
81c90456e3SJames Ban 
82c90456e3SJames Ban /* PV88090_REG_BUCK_FOLD_RANGE (addr=0x61) */
838986a119SEric Jeong #define PV88090_BUCK_VRANGE_GAIN_SHIFT			3
848986a119SEric Jeong #define PV88090_BUCK_VRANGE_GAIN_MASK			0x01
85c90456e3SJames Ban 
868986a119SEric Jeong #define PV88090_BUCK_VRANGE_GAIN_1			0x00
878986a119SEric Jeong #define PV88090_BUCK_VRANGE_GAIN_2			0x01
88c90456e3SJames Ban 
89c90456e3SJames Ban #endif	/* __PV88090_REGISTERS_H__ */
90