1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* Copyright (C) 2020 Gateworks Corporation */
7 #define MP6416_REGULATOR_DRIVER "mp5416_regulator"
14 MP5416_VSET_SW1 = 0x04,
15 MP5416_VSET_SW2 = 0x05,
16 MP5416_VSET_SW3 = 0x06,
17 MP5416_VSET_SW4 = 0x07,
18 MP5416_VSET_LDO2 = 0x08,
19 MP5416_VSET_LDO3 = 0x09,
20 MP5416_VSET_LDO4 = 0x0a,
21 MP5416_VSET_LDO5 = 0x0b,
22 MP5416_STATUS1 = 0x0d,
23 MP5416_STATUS2 = 0x0e,
24 MP5416_STATUS3 = 0x0f,
26 MP5416_NUM_OF_REGS = 0x12,
29 #define MP5416_VSET_EN BIT(7)
30 #define MP5416_VSET_SW1_GVAL(x) ((((x) & 0x7f) * 12500) + 600000)
31 #define MP5416_VSET_SW2_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
32 #define MP5416_VSET_SW3_GVAL(x) ((((x) & 0x7f) * 12500) + 600000)
33 #define MP5416_VSET_SW4_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
34 #define MP5416_VSET_LDO_GVAL(x) ((((x) & 0x7f) * 25000) + 800000)
35 #define MP5416_VSET_LDO_SVAL(x) ((((x) & 0x7f) * 25000) + 800000)
36 #define MP5416_VSET_SW1_SVAL(x) (((x) - 600000) / 12500)
37 #define MP5416_VSET_SW2_SVAL(x) (((x) - 800000) / 25000)
38 #define MP5416_VSET_SW3_SVAL(x) (((x) - 600000) / 12500)
39 #define MP5416_VSET_SW4_SVAL(x) (((x) - 800000) / 25000)