1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2016 Freescale Semiconductor, Inc.
4 * Hou Zhiqiang <Zhiqiang.Hou@freescale.com>
10 #include <power/pmic.h>
12 #define MC34VR500_I2C_ADDR 0x08
15 #define MC34VR500_REGULATOR_DRIVER "mc34vr500_regulator"
19 MC34VR500_DEVICEID = 0x00,
21 MC34VR500_SILICONREVID = 0x03,
30 MC34VR500_INTSTAT4 = 0x11,
34 MC34VR500_PWRCTL = 0x1B,
36 MC34VR500_SW1VOLT = 0x2E,
47 MC34VR500_SW3VOLT = 0x3C,
53 MC34VR500_SW4VOLT = 0x4A,
59 MC34VR500_REFOUTCRTRL = 0x6A,
61 MC34VR500_LDO1CTL = 0x6D,
67 MC34VR500_PAGE_REGISTER = 0x7F,
70 MC34VR500_SW1_VOLT = 0xA8,
74 MC34VR500_SW2_VOLT = 0xAC,
78 MC34VR500_SW3_VOLT = 0xB0,
82 MC34VR500_SW4_VOLT = 0xB8,
86 MC34VR500_REFOUT_SEQ = 0xC4,
88 MC34VR500_LDO1_VOLT = 0xCC,
91 MC34VR500_LDO2_VOLT = 0xD0,
94 MC34VR500_LDO3_VOLT = 0xD4,
97 MC34VR500_LDO4_VOLT = 0xD8,
100 MC34VR500_LDO5_VOLT = 0xDC,
103 MC34VR500_PU_CONFIG1 = 0xE0,
105 MC34VR500_TBB_POR = 0xE4,
107 MC34VR500_PWRGD_EN = 0xE8,
109 MC34VR500_NUM_OF_REGS,
112 /* Registor offset based on SWxVOLT register */
113 #define MC34VR500_VOLT_OFFSET 0
114 #define MC34VR500_STBY_OFFSET 1
115 #define MC34VR500_OFF_OFFSET 2
116 #define MC34VR500_MODE_OFFSET 3
117 #define MC34VR500_CONF_OFFSET 4
119 #define SW_MODE_MASK 0xf
120 #define SW_MODE_SHIFT 0
122 #define LDO_VOL_MASK 0xf
123 #define LDO_EN (1 << 4)
124 #define LDO_MODE_SHIFT 4
125 #define LDO_MODE_MASK (1 << 4)
126 #define LDO_MODE_OFF 0
127 #define LDO_MODE_ON 1
129 #define REFOUTEN (1 << 4)
132 * Regulator Mode Control
134 * OFF: The regulator is switched off and the output voltage is discharged.
135 * PFM: In this mode, the regulator is always in PFM mode, which is useful
136 * at light loads for optimized efficiency.
137 * PWM: In this mode, the regulator is always in PWM mode operation
138 * regardless of load conditions.
139 * APS: In this mode, the regulator moves automatically between pulse
140 * skipping mode and PWM mode depending on load conditions.
143 * Normal Mode | Standby Mode | value
171 int mc34vr500_get_sw_volt(uint8_t sw);
172 int mc34vr500_set_sw_volt(uint8_t sw, int sw_volt);
173 int power_mc34vr500_init(unsigned char bus);
174 #endif /* __MC34VR500_PMIC_H_ */