2 * Copyright 2016 Freescale Semiconductor, Inc.
3 * Hou Zhiqiang <Zhiqiang.Hou@freescale.com>
5 * SPDX-License-Identifier: GPL-2.0+
11 #include <power/pmic.h>
13 #define MC34VR500_I2C_ADDR 0x08
16 #define MC34VR500_REGULATOR_DRIVER "mc34vr500_regulator"
20 MC34VR500_DEVICEID = 0x00,
22 MC34VR500_SILICONREVID = 0x03,
31 MC34VR500_INTSTAT4 = 0x11,
35 MC34VR500_PWRCTL = 0x1B,
37 MC34VR500_SW1VOLT = 0x2E,
48 MC34VR500_SW3VOLT = 0x3C,
54 MC34VR500_SW4VOLT = 0x4A,
60 MC34VR500_REFOUTCRTRL = 0x6A,
62 MC34VR500_LDO1CTL = 0x6D,
68 MC34VR500_PAGE_REGISTER = 0x7F,
71 MC34VR500_SW1_VOLT = 0xA8,
75 MC34VR500_SW2_VOLT = 0xAC,
79 MC34VR500_SW3_VOLT = 0xB0,
83 MC34VR500_SW4_VOLT = 0xB8,
87 MC34VR500_REFOUT_SEQ = 0xC4,
89 MC34VR500_LDO1_VOLT = 0xCC,
92 MC34VR500_LDO2_VOLT = 0xD0,
95 MC34VR500_LDO3_VOLT = 0xD4,
98 MC34VR500_LDO4_VOLT = 0xD8,
101 MC34VR500_LDO5_VOLT = 0xDC,
104 MC34VR500_PU_CONFIG1 = 0xE0,
106 MC34VR500_TBB_POR = 0xE4,
108 MC34VR500_PWRGD_EN = 0xE8,
110 MC34VR500_NUM_OF_REGS,
113 /* Registor offset based on SWxVOLT register */
114 #define MC34VR500_VOLT_OFFSET 0
115 #define MC34VR500_STBY_OFFSET 1
116 #define MC34VR500_OFF_OFFSET 2
117 #define MC34VR500_MODE_OFFSET 3
118 #define MC34VR500_CONF_OFFSET 4
120 #define SW_MODE_MASK 0xf
121 #define SW_MODE_SHIFT 0
123 #define LDO_VOL_MASK 0xf
124 #define LDO_EN (1 << 4)
125 #define LDO_MODE_SHIFT 4
126 #define LDO_MODE_MASK (1 << 4)
127 #define LDO_MODE_OFF 0
128 #define LDO_MODE_ON 1
130 #define REFOUTEN (1 << 4)
133 * Regulator Mode Control
135 * OFF: The regulator is switched off and the output voltage is discharged.
136 * PFM: In this mode, the regulator is always in PFM mode, which is useful
137 * at light loads for optimized efficiency.
138 * PWM: In this mode, the regulator is always in PWM mode operation
139 * regardless of load conditions.
140 * APS: In this mode, the regulator moves automatically between pulse
141 * skipping mode and PWM mode depending on load conditions.
144 * Normal Mode | Standby Mode | value
172 int mc34vr500_get_sw_volt(uint8_t sw);
173 int mc34vr500_set_sw_volt(uint8_t sw, int sw_volt);
174 int power_mc34vr500_init(unsigned char bus);
175 #endif /* __MC34VR500_PMIC_H_ */