summaryrefslogtreecommitdiff
path: root/include/power
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2019-10-30 14:21:52 +0800
committerIru Cai <mytbk920423@gmail.com>2019-10-30 14:48:38 +0800
commitae51f41d14f548d494ac41e0d21137c5a4c3f59c (patch)
tree6ddb9d1aaa7bd5bad5bbf8497edc2e08ff208d79 /include/power
downloaduext4-ae51f41d14f548d494ac41e0d21137c5a4c3f59c.tar.xz
import the U-Boot code and make it compile
Diffstat (limited to 'include/power')
-rw-r--r--include/power/act8846_pmic.h36
-rw-r--r--include/power/as3722.h30
-rw-r--r--include/power/battery.h21
-rw-r--r--include/power/bd71837.h103
-rw-r--r--include/power/fg_battery_cell_params.h73
-rw-r--r--include/power/hi6553_pmic.h78
-rw-r--r--include/power/lp873x.h19
-rw-r--r--include/power/lp87565.h12
-rw-r--r--include/power/ltc3676_pmic.h50
-rw-r--r--include/power/max17042_fg.h57
-rw-r--r--include/power/max77686_pmic.h227
-rw-r--r--include/power/max77693_fg.h48
-rw-r--r--include/power/max77693_muic.h73
-rw-r--r--include/power/max77693_pmic.h40
-rw-r--r--include/power/max77696_pmic.h59
-rw-r--r--include/power/max8997_muic.h44
-rw-r--r--include/power/max8997_pmic.h196
-rw-r--r--include/power/max8998_pmic.h71
-rw-r--r--include/power/mc34vr500_pmic.h174
-rw-r--r--include/power/palmas.h26
-rw-r--r--include/power/pfuze100_pmic.h258
-rw-r--r--include/power/pfuze3000_pmic.h82
-rw-r--r--include/power/pmic.h330
-rw-r--r--include/power/power_chrg.h26
-rw-r--r--include/power/regulator.h465
-rw-r--r--include/power/rk8xx_pmic.h194
-rw-r--r--include/power/rn5t567_pmic.h112
-rw-r--r--include/power/s2mps11.h164
-rw-r--r--include/power/s5m8767.h84
-rw-r--r--include/power/sandbox_pmic.h144
-rw-r--r--include/power/stpmic1.h111
-rw-r--r--include/power/tps62362.h28
-rw-r--r--include/power/tps65090.h55
-rw-r--r--include/power/tps65217.h89
-rw-r--r--include/power/tps65218.h82
-rw-r--r--include/power/tps65910.h78
-rw-r--r--include/power/tps65910_pmic.h129
37 files changed, 3868 insertions, 0 deletions
diff --git a/include/power/act8846_pmic.h b/include/power/act8846_pmic.h
new file mode 100644
index 0000000..acd0fd6
--- /dev/null
+++ b/include/power/act8846_pmic.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2015 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+
+#ifndef _PMIC_ACT8846_H_
+#define _PMIC_ACT8846_H_
+
+#include <asm/gpio.h>
+
+#define ACT8846_NUM_OF_REGS 12
+
+#define BUCK_VOL_MASK 0x3f
+#define LDO_VOL_MASK 0x3f
+
+#define BUCK_EN_MASK 0x80
+#define LDO_EN_MASK 0x80
+
+#define VOL_MIN_IDX 0x00
+#define VOL_MAX_IDX 0x3f
+
+struct act8846_reg_table {
+ char *name;
+ char reg_ctl;
+ char reg_vol;
+};
+
+struct pmic_act8846 {
+ struct pmic *pmic;
+ int node; /*device tree node*/
+ struct gpio_desc pwr_hold;
+ struct udevice *dev;
+};
+
+#endif
diff --git a/include/power/as3722.h b/include/power/as3722.h
new file mode 100644
index 0000000..2782857
--- /dev/null
+++ b/include/power/as3722.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2014 NVIDIA Corporation
+ */
+
+#ifndef __POWER_AS3722_H__
+#define __POWER_AS3722_H__
+
+#define AS3722_GPIO_OUTPUT_VDDH (1 << 0)
+#define AS3722_GPIO_INVERT (1 << 1)
+
+#define AS3722_DEVICE_ID 0x0c
+#define AS3722_SD_VOLTAGE(n) (0x00 + (n))
+#define AS3722_LDO_VOLTAGE(n) (0x10 + (n))
+#define AS3722_SD_CONTROL 0x4d
+#define AS3722_LDO_CONTROL0 0x4e
+#define AS3722_LDO_CONTROL1 0x4f
+#define AS3722_ASIC_ID1 0x90
+#define AS3722_ASIC_ID2 0x91
+
+#define AS3722_GPIO_CONTROL(n) (0x08 + (n))
+#define AS3722_GPIO_SIGNAL_OUT 0x20
+#define AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDH (1 << 0)
+#define AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDL (7 << 0)
+#define AS3722_GPIO_CONTROL_INVERT (1 << 7)
+
+int as3722_sd_set_voltage(struct udevice *dev, unsigned int sd, u8 value);
+int as3722_ldo_set_voltage(struct udevice *dev, unsigned int ldo, u8 value);
+
+#endif /* __POWER_AS3722_H__ */
diff --git a/include/power/battery.h b/include/power/battery.h
new file mode 100644
index 0000000..1e3d59d
--- /dev/null
+++ b/include/power/battery.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Lukasz Majewski <l.majewski@samsung.com>
+ */
+
+#ifndef __POWER_BATTERY_H_
+#define __POWER_BATTERY_H_
+
+struct battery {
+ unsigned int version;
+ unsigned int state_of_chrg;
+ unsigned int time_to_empty;
+ unsigned int capacity;
+ unsigned int voltage_uV;
+
+ unsigned int state;
+};
+
+int power_bat_init(unsigned char bus);
+#endif /* __POWER_BATTERY_H_ */
diff --git a/include/power/bd71837.h b/include/power/bd71837.h
new file mode 100644
index 0000000..75e07e1
--- /dev/null
+++ b/include/power/bd71837.h
@@ -0,0 +1,103 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* Copyright (C) 2018 ROHM Semiconductors */
+
+#ifndef BD718XX_H_
+#define BD718XX_H_
+
+#define BD718XX_REGULATOR_DRIVER "bd718x7_regulator"
+
+enum {
+ ROHM_CHIP_TYPE_BD71837 = 0,
+ ROHM_CHIP_TYPE_BD71847,
+ ROHM_CHIP_TYPE_BD70528,
+ ROHM_CHIP_TYPE_AMOUNT
+};
+
+enum {
+ BD718XX_REV = 0x00,
+ BD718XX_SWRESET = 0x01,
+ BD718XX_I2C_DEV = 0x02,
+ BD718XX_PWRCTRL0 = 0x03,
+ BD718XX_PWRCTRL1 = 0x04,
+ BD718XX_BUCK1_CTRL = 0x05,
+ BD718XX_BUCK2_CTRL = 0x06,
+ BD71837_BUCK3_CTRL = 0x07,
+ BD71837_BUCK4_CTRL = 0x08,
+ BD718XX_1ST_NODVS_BUCK_CTRL = 0x09,
+ BD718XX_2ND_NODVS_BUCK_CTRL = 0x0a,
+ BD718XX_3RD_NODVS_BUCK_CTRL = 0x0b,
+ BD718XX_4TH_NODVS_BUCK_CTRL = 0x0c,
+ BD718XX_BUCK1_VOLT_RUN = 0x0d,
+ BD718XX_BUCK1_VOLT_IDLE = 0x0e,
+ BD718XX_BUCK1_VOLT_SUSP = 0x0f,
+ BD718XX_BUCK2_VOLT_RUN = 0x10,
+ BD718XX_BUCK2_VOLT_IDLE = 0x11,
+ BD71837_BUCK3_VOLT_RUN = 0x12,
+ BD71837_BUCK4_VOLT_RUN = 0x13,
+ BD718XX_1ST_NODVS_BUCK_VOLT = 0x14,
+ BD718XX_2ND_NODVS_BUCK_VOLT = 0x15,
+ BD718XX_3RD_NODVS_BUCK_VOLT = 0x16,
+ BD718XX_4TH_NODVS_BUCK_VOLT = 0x17,
+ BD718XX_LDO1_VOLT = 0x18,
+ BD718XX_LDO2_VOLT = 0x19,
+ BD718XX_LDO3_VOLT = 0x1a,
+ BD718XX_LDO4_VOLT = 0x1b,
+ BD718XX_LDO5_VOLT = 0x1c,
+ BD718XX_LDO6_VOLT = 0x1d,
+ BD71837_LDO7_VOLT = 0x1e,
+ BD718XX_TRANS_COND0 = 0x1f,
+ BD718XX_TRANS_COND1 = 0x20,
+ BD718XX_VRFAULTEN = 0x21,
+ BD718XX_MVRFLTMASK0 = 0x22,
+ BD718XX_MVRFLTMASK1 = 0x23,
+ BD718XX_MVRFLTMASK2 = 0x24,
+ BD718XX_RCVCFG = 0x25,
+ BD718XX_RCVNUM = 0x26,
+ BD718XX_PWRONCONFIG0 = 0x27,
+ BD718XX_PWRONCONFIG1 = 0x28,
+ BD718XX_RESETSRC = 0x29,
+ BD718XX_MIRQ = 0x2a,
+ BD718XX_IRQ = 0x2b,
+ BD718XX_IN_MON = 0x2c,
+ BD718XX_POW_STATE = 0x2d,
+ BD718XX_OUT32K = 0x2e,
+ BD718XX_REGLOCK = 0x2f,
+ BD718XX_MUXSW_EN = 0x30,
+ BD718XX_REG_OTPVER = 0xff,
+ BD718XX_MAX_REGISTER = 0x100,
+};
+
+#define BD718XX_REGLOCK_PWRSEQ 0x1
+#define BD718XX_REGLOCK_VREG 0x10
+
+#define BD718XX_BUCK_EN 0x01
+#define BD718XX_LDO_EN 0x40
+#define BD718XX_BUCK_SEL 0x02
+#define BD718XX_LDO_SEL 0x80
+
+#define DVS_BUCK_RUN_MASK 0x3f
+#define BD718XX_1ST_NODVS_BUCK_MASK 0x07
+#define BD718XX_3RD_NODVS_BUCK_MASK 0x07
+#define BD718XX_4TH_NODVS_BUCK_MASK 0x3f
+
+#define BD71847_BUCK3_MASK 0x07
+#define BD71847_BUCK3_RANGE_MASK 0xc0
+#define BD71847_BUCK4_MASK 0x03
+#define BD71847_BUCK4_RANGE_MASK 0x40
+
+#define BD71837_BUCK5_RANGE_MASK 0x80
+#define BD71837_BUCK6_MASK 0x03
+
+#define BD718XX_LDO1_MASK 0x03
+#define BD718XX_LDO1_RANGE_MASK 0x20
+#define BD718XX_LDO2_MASK 0x20
+#define BD718XX_LDO3_MASK 0x0f
+#define BD718XX_LDO4_MASK 0x0f
+#define BD718XX_LDO6_MASK 0x0f
+
+#define BD71837_LDO5_MASK 0x0f
+#define BD71847_LDO5_MASK 0x0f
+#define BD71847_LDO5_RANGE_MASK 0x20
+#define BD71837_LDO7_MASK 0x0f
+
+#endif
diff --git a/include/power/fg_battery_cell_params.h b/include/power/fg_battery_cell_params.h
new file mode 100644
index 0000000..b8c895b
--- /dev/null
+++ b/include/power/fg_battery_cell_params.h
@@ -0,0 +1,73 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Lukasz Majewski <l.majewski@samsung.com>
+ */
+
+#ifndef __FG_BATTERY_CELL_PARAMS_H_
+#define __FG_BATTERY_CELL_PARAMS_H_
+
+#if defined(CONFIG_POWER_FG_MAX17042) && defined(CONFIG_TRATS)
+
+/* Cell characteristics - Exynos4 TRATS development board */
+/* Shall be written to addr 0x80h */
+u16 cell_character0[16] = {
+ 0xA2A0,
+ 0xB6E0,
+ 0xB850,
+ 0xBAD0,
+ 0xBB20,
+ 0xBB70,
+ 0xBBC0,
+ 0xBC20,
+ 0xBC80,
+ 0xBCE0,
+ 0xBD80,
+ 0xBE20,
+ 0xC090,
+ 0xC420,
+ 0xC910,
+ 0xD070
+};
+
+/* Shall be written to addr 0x90h */
+u16 cell_character1[16] = {
+ 0x0090,
+ 0x1A50,
+ 0x02F0,
+ 0x2060,
+ 0x2060,
+ 0x2E60,
+ 0x26A0,
+ 0x2DB0,
+ 0x2DB0,
+ 0x1870,
+ 0x2A20,
+ 0x16F0,
+ 0x08F0,
+ 0x0D40,
+ 0x08C0,
+ 0x08C0
+};
+
+/* Shall be written to addr 0xA0h */
+u16 cell_character2[16] = {
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100,
+ 0x0100
+};
+#endif
+#endif /* __FG_BATTERY_CELL_PARAMS_H_ */
diff --git a/include/power/hi6553_pmic.h b/include/power/hi6553_pmic.h
new file mode 100644
index 0000000..d0abe20
--- /dev/null
+++ b/include/power/hi6553_pmic.h
@@ -0,0 +1,78 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2015 Linaro
+ * Peter Griffin <peter.griffin@linaro.org>
+ */
+
+#ifndef __HI6553_PMIC_H__
+#define __HI6553_PMIC_H__
+
+/* Registers */
+enum {
+ HI6553_VERSION_REG = 0x000,
+ HI6553_ENABLE2_LDO1_8 = 0x029,
+ HI6553_DISABLE2_LDO1_8,
+ HI6553_ONOFF_STATUS2_LDO1_8,
+ HI6553_ENABLE3_LDO9_16,
+ HI6553_DISABLE3_LDO9_16,
+ HI6553_ONOFF_STATUS3_LDO9_16,
+
+ HI6553_DISABLE6_XO_CLK = 0x036,
+ HI6553_PERI_EN_MARK = 0x040,
+ HI6553_BUCK2_REG1 = 0x04a,
+ HI6553_BUCK2_REG5 = 0x04e,
+ HI6553_BUCK2_REG6,
+
+ HI6553_BUCK3_REG3 = 0x054,
+ HI6553_BUCK3_REG5 = 0x056,
+ HI6553_BUCK3_REG6,
+ HI6553_BUCK4_REG2 = 0x05b,
+ HI6553_BUCK4_REG5 = 0x05e,
+ HI6553_BUCK4_REG6,
+
+ HI6553_CLK_TOP0 = 0x063,
+ HI6553_CLK_TOP3 = 0x066,
+ HI6553_CLK_TOP4,
+ HI6553_VSET_BUCK2_ADJ = 0x06d,
+ HI6553_VSET_BUCK3_ADJ,
+ HI6553_LDO7_REG_ADJ = 0x078,
+ HI6553_LDO10_REG_ADJ = 0x07b,
+ HI6553_LDO19_REG_ADJ = 0x084,
+ HI6553_LDO20_REG_ADJ,
+ HI6553_DR_LED_CTRL = 0x098,
+ HI6553_DR_OUT_CTRL,
+ HI6553_DR3_ISET,
+ HI6553_DR3_START_DEL,
+ HI6553_DR4_ISET,
+ HI6553_DR4_START_DEL,
+ HI6553_DR345_TIM_CONF0 = 0x0a0,
+ HI6553_NP_REG_ADJ1 = 0x0be,
+ HI6553_NP_REG_CHG = 0x0c0,
+ HI6553_BUCK01_CTRL2 = 0x0d9,
+ HI6553_BUCK0_CTRL1 = 0x0dd,
+ HI6553_BUCK0_CTRL5 = 0x0e1,
+ HI6553_BUCK0_CTRL7 = 0x0e3,
+ HI6553_BUCK1_CTRL1 = 0x0e8,
+ HI6553_BUCK1_CTRL5 = 0x0ec,
+ HI6553_BUCK1_CTRL7 = 0x0ef,
+ HI6553_CLK19M2_600_586_EN = 0x0fe,
+};
+
+#define HI6553_DISABLE6_XO_CLK_BB (1 << 0)
+#define HI6553_DISABLE6_XO_CLK_CONN (1 << 1)
+#define HI6553_DISABLE6_XO_CLK_NFC (1 << 2)
+#define HI6553_DISABLE6_XO_CLK_RF1 (1 << 3)
+#define HI6553_DISABLE6_XO_CLK_RF2 (1 << 4)
+
+#define HI6553_LED_START_DELAY_TIME 0x00
+#define HI6553_LED_ELEC_VALUE 0x07
+#define HI6553_LED_LIGHT_TIME 0xf0
+#define HI6553_LED_GREEN_ENABLE (1 << 1)
+#define HI6553_LED_OUT_CTRL 0x00
+
+#define HI6553_PMU_V300 0x30
+#define HI6553_PMU_V310 0x31
+
+int power_hi6553_init(u8 *base);
+
+#endif /* __HI6553_PMIC_H__ */
diff --git a/include/power/lp873x.h b/include/power/lp873x.h
new file mode 100644
index 0000000..e0c0711
--- /dev/null
+++ b/include/power/lp873x.h
@@ -0,0 +1,19 @@
+#define LP8732 0x0
+#define LP8733 0x1
+
+#define LP873X_LDO_NUM 2
+#define LP873X_BUCK_NUM 2
+
+/* Drivers name */
+#define LP873X_LDO_DRIVER "lp873x_ldo"
+#define LP873X_BUCK_DRIVER "lp873x_buck"
+
+#define LP873X_BUCK_VOLT_MASK 0xFF
+#define LP873X_BUCK_VOLT_MAX_HEX 0xFF
+#define LP873X_BUCK_VOLT_MAX 3360000
+#define LP873X_BUCK_MODE_MASK 0x1
+
+#define LP873X_LDO_VOLT_MASK 0x1F
+#define LP873X_LDO_VOLT_MAX_HEX 0x19
+#define LP873X_LDO_VOLT_MAX 3300000
+#define LP873X_LDO_MODE_MASK 0x1
diff --git a/include/power/lp87565.h b/include/power/lp87565.h
new file mode 100644
index 0000000..5160f5d
--- /dev/null
+++ b/include/power/lp87565.h
@@ -0,0 +1,12 @@
+#define LP87565 0x0
+#define LP87565_Q1 0x1
+
+#define LP87565_BUCK_NUM 6
+
+/* Drivers name */
+#define LP87565_BUCK_DRIVER "lp87565_buck"
+
+#define LP87565_BUCK_VOLT_MASK 0xFF
+#define LP87565_BUCK_VOLT_MAX_HEX 0xFF
+#define LP87565_BUCK_VOLT_MAX 3360000
+#define LP87565_BUCK_MODE_MASK 0x80
diff --git a/include/power/ltc3676_pmic.h b/include/power/ltc3676_pmic.h
new file mode 100644
index 0000000..36c7971
--- /dev/null
+++ b/include/power/ltc3676_pmic.h
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2014 Gateworks Corporation
+ * Tim Harvey <tharvey@gateworks.com>
+ */
+
+#ifndef __LTC3676_PMIC_H_
+#define __LTC3676_PMIC_H_
+
+/* LTC3676 registers */
+enum {
+ LTC3676_BUCK1 = 0x01,
+ LTC3676_BUCK2 = 0x02,
+ LTC3676_BUCK3 = 0x03,
+ LTC3676_BUCK4 = 0x04,
+ LTC3676_LDOA = 0x05,
+ LTC3676_LDOB = 0x06,
+ LTC3676_SQD1 = 0x07,
+ LTC3676_SQD2 = 0x08,
+ LTC3676_CNTRL = 0x09,
+ LTC3676_DVB1A = 0x0A,
+ LTC3676_DVB1B = 0x0B,
+ LTC3676_DVB2A = 0x0C,
+ LTC3676_DVB2B = 0x0D,
+ LTC3676_DVB3A = 0x0E,
+ LTC3676_DVB3B = 0x0F,
+ LTC3676_DVB4A = 0x10,
+ LTC3676_DVB4B = 0x11,
+ LTC3676_MSKIRQ = 0x12,
+ LTC3676_MSKPG = 0x13,
+ LTC3676_USER = 0x14,
+ LTC3676_HRST = 0x1E,
+ LTC3676_CLIRQ = 0x1F,
+ LTC3676_IRQSTAT = 0x15,
+ LTC3676_PGSTATL = 0x16,
+ LTC3676_PGSTATR = 0x17,
+ LTC3676_NUM_OF_REGS = 0x20,
+};
+
+/*
+ * SW Configuration
+ */
+
+#define LTC3676_DVB_MASK 0x1f
+#define LTC3676_PGOOD_MASK (1<<5)
+#define LTC3676_REF_SELA (0<<5)
+#define LTC3676_REF_SELB (1<<5)
+
+int power_ltc3676_init(unsigned char bus);
+#endif
diff --git a/include/power/max17042_fg.h b/include/power/max17042_fg.h
new file mode 100644
index 0000000..ec8377d
--- /dev/null
+++ b/include/power/max17042_fg.h
@@ -0,0 +1,57 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Lukasz Majewski <l.majewski@samsung.com>
+ */
+
+#ifndef __MAX17042_FG_H_
+#define __MAX17042_FG_H_
+
+/* MAX 17042 registers */
+enum {
+ MAX17042_STATUS = 0x00,
+ MAX17042_SOCREP = 0x06,
+ MAX17042_VCELL = 0x09,
+ MAX17042_CURRENT = 0x0A,
+ MAX17042_AVG_CURRENT = 0x0B,
+ MAX17042_SOCMIX = 0x0D,
+ MAX17042_SOCAV = 0x0E,
+ MAX17042_DESIGN_CAP = 0x18,
+ MAX17042_AVG_VCELL = 0x19,
+ MAX17042_CONFIG = 0x1D,
+ MAX17042_VERSION = 0x21,
+ MAX17042_LEARNCFG = 0x28,
+ MAX17042_FILTERCFG = 0x29,
+ MAX17042_RELAXCFG = 0x2A,
+ MAX17042_MISCCFG = 0x2B,
+ MAX17042_CGAIN = 0x2E,
+ MAX17042_COFF = 0x2F,
+ MAX17042_RCOMP0 = 0x38,
+ MAX17042_TEMPCO = 0x39,
+ MAX17042_FSTAT = 0x3D,
+ MAX17042_MLOCKReg1 = 0x62,
+ MAX17042_MLOCKReg2 = 0x63,
+ MAX17042_MODEL1 = 0x80,
+ MAX17042_MODEL2 = 0x90,
+ MAX17042_MODEL3 = 0xA0,
+ MAX17042_VFOCV = 0xFB,
+ MAX17042_VFSOC = 0xFF,
+
+ FG_NUM_OF_REGS = 0x100,
+};
+
+#define RCOMP0 0x0060
+#define TempCo 0x1015
+
+
+#define MAX17042_POR (1 << 1)
+
+#define MODEL_UNLOCK1 0x0059
+#define MODEL_UNLOCK2 0x00c4
+#define MODEL_LOCK1 0x0000
+#define MODEL_LOCK2 0x0000
+
+#define MAX17042_I2C_ADDR (0x6C >> 1)
+
+int power_fg_init(unsigned char bus);
+#endif /* __MAX17042_FG_H_ */
diff --git a/include/power/max77686_pmic.h b/include/power/max77686_pmic.h
new file mode 100644
index 0000000..82fe350
--- /dev/null
+++ b/include/power/max77686_pmic.h
@@ -0,0 +1,227 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Rajeshwari Shinde <rajeshwari.s@samsung.com>
+ */
+
+#ifndef __MAX77686_H_
+#define __MAX77686_H_
+
+#include <power/pmic.h>
+
+enum {
+ MAX77686_REG_PMIC_ID = 0x0,
+ MAX77686_REG_PMIC_INTSRC,
+ MAX77686_REG_PMIC_INT1,
+ MAX77686_REG_PMIC_INT2,
+ MAX77686_REG_PMIC_INT1MSK,
+ MAX77686_REG_PMIC_INT2MSK,
+
+ MAX77686_REG_PMIC_STATUS1,
+ MAX77686_REG_PMIC_STATUS2,
+
+ MAX77686_REG_PMIC_PWRON,
+ MAX77686_REG_PMIC_ONOFFDELAY,
+ MAX77686_REG_PMIC_MRSTB,
+
+ MAX77686_REG_PMIC_BUCK1CRTL = 0x10,
+ MAX77686_REG_PMIC_BUCK1OUT,
+ MAX77686_REG_PMIC_BUCK2CTRL1,
+ MAX77686_REG_PMIC_BUCK234FREQ,
+ MAX77686_REG_PMIC_BUCK2DVS1,
+ MAX77686_REG_PMIC_BUCK2DVS2,
+ MAX77686_REG_PMIC_BUCK2DVS3,
+ MAX77686_REG_PMIC_BUCK2DVS4,
+ MAX77686_REG_PMIC_BUCK2DVS5,
+ MAX77686_REG_PMIC_BUCK2DVS6,
+ MAX77686_REG_PMIC_BUCK2DVS7,
+ MAX77686_REG_PMIC_BUCK2DVS8,
+ MAX77686_REG_PMIC_BUCK3CTRL,
+ MAX77686_REG_PMIC_BUCK3DVS1 = 0x1e,
+ MAX77686_REG_PMIC_BUCK3DVS2,
+ MAX77686_REG_PMIC_BUCK3DVS3,
+ MAX77686_REG_PMIC_BUCK3DVS4,
+ MAX77686_REG_PMIC_BUCK3DVS5,
+ MAX77686_REG_PMIC_BUCK3DVS6,
+ MAX77686_REG_PMIC_BUCK3DVS7,
+ MAX77686_REG_PMIC_BUCK3DVS8,
+ MAX77686_REG_PMIC_BUCK4CTRL1,
+ MAX77686_REG_PMIC_BUCK4DVS1 = 0x28,
+ MAX77686_REG_PMIC_BUCK4DVS2,
+ MAX77686_REG_PMIC_BUCK4DVS3,
+ MAX77686_REG_PMIC_BUCK4DVS4,
+ MAX77686_REG_PMIC_BUCK4DVS5,
+ MAX77686_REG_PMIC_BUCK4DVS6,
+ MAX77686_REG_PMIC_BUCK4DVS7,
+ MAX77686_REG_PMIC_BUCK4DVS8,
+ MAX77686_REG_PMIC_BUCK5CTRL,
+ MAX77686_REG_PMIC_BUCK5OUT,
+ MAX77686_REG_PMIC_BUCK6CRTL,
+ MAX77686_REG_PMIC_BUCK6OUT,
+ MAX77686_REG_PMIC_BUCK7CRTL,
+ MAX77686_REG_PMIC_BUCK7OUT,
+ MAX77686_REG_PMIC_BUCK8CRTL,
+ MAX77686_REG_PMIC_BUCK8OUT,
+ MAX77686_REG_PMIC_BUCK9CRTL,
+ MAX77686_REG_PMIC_BUCK9OUT,
+
+ MAX77686_REG_PMIC_LDO1CTRL1 = 0x40,
+ MAX77686_REG_PMIC_LDO2CTRL1,
+ MAX77686_REG_PMIC_LDO3CTRL1,
+ MAX77686_REG_PMIC_LDO4CTRL1,
+ MAX77686_REG_PMIC_LDO5CTRL1,
+ MAX77686_REG_PMIC_LDO6CTRL1,
+ MAX77686_REG_PMIC_LDO7CTRL1,
+ MAX77686_REG_PMIC_LDO8CTRL1,
+ MAX77686_REG_PMIC_LDO9CTRL1,
+ MAX77686_REG_PMIC_LDO10CTRL1,
+ MAX77686_REG_PMIC_LDO11CTRL1,
+ MAX77686_REG_PMIC_LDO12CTRL1,
+ MAX77686_REG_PMIC_LDO13CTRL1,
+ MAX77686_REG_PMIC_LDO14CTRL1,
+ MAX77686_REG_PMIC_LDO15CTRL1,
+ MAX77686_REG_PMIC_LDO16CTRL1,
+ MAX77686_REG_PMIC_LDO17CTRL1,
+ MAX77686_REG_PMIC_LDO18CTRL1,
+ MAX77686_REG_PMIC_LDO19CTRL1,
+ MAX77686_REG_PMIC_LDO20CTRL1,
+ MAX77686_REG_PMIC_LDO21CTRL1,
+ MAX77686_REG_PMIC_LDO22CTRL1,
+ MAX77686_REG_PMIC_LDO23CTRL1,
+ MAX77686_REG_PMIC_LDO24CTRL1,
+ MAX77686_REG_PMIC_LDO25CTRL1,
+ MAX77686_REG_PMIC_LDO26CTRL1,
+ MAX77686_REG_PMIC_LDO1CTRL2,
+ MAX77686_REG_PMIC_LDO2CTRL2,
+ MAX77686_REG_PMIC_LDO3CTRL2,
+ MAX77686_REG_PMIC_LDO4CTRL2,
+ MAX77686_REG_PMIC_LDO5CTRL2,
+ MAX77686_REG_PMIC_LDO6CTRL2,
+ MAX77686_REG_PMIC_LDO7CTRL2,
+ MAX77686_REG_PMIC_LDO8CTRL2,
+ MAX77686_REG_PMIC_LDO9CTRL2,
+ MAX77686_REG_PMIC_LDO10CTRL2,
+ MAX77686_REG_PMIC_LDO11CTRL2,
+ MAX77686_REG_PMIC_LDO12CTRL2,
+ MAX77686_REG_PMIC_LDO13CTRL2,
+ MAX77686_REG_PMIC_LDO14CTRL2,
+ MAX77686_REG_PMIC_LDO15CTRL2,
+ MAX77686_REG_PMIC_LDO16CTRL2,
+ MAX77686_REG_PMIC_LDO17CTRL2,
+ MAX77686_REG_PMIC_LDO18CTRL2,
+ MAX77686_REG_PMIC_LDO19CTRL2,
+ MAX77686_REG_PMIC_LDO20CTRL2,
+ MAX77686_REG_PMIC_LDO21CTRL2,
+ MAX77686_REG_PMIC_LDO22CTRL2,
+ MAX77686_REG_PMIC_LDO23CTRL2,
+ MAX77686_REG_PMIC_LDO24CTRL2,
+ MAX77686_REG_PMIC_LDO25CTRL2,
+ MAX77686_REG_PMIC_LDO26CTRL2,
+
+ MAX77686_REG_PMIC_BBAT = 0x7e,
+ MAX77686_REG_PMIC_32KHZ,
+
+ MAX77686_NUM_OF_REGS,
+};
+
+/* I2C device address for pmic max77686 */
+#define MAX77686_I2C_ADDR (0x12 >> 1)
+#define MAX77686_LDO_NUM 26
+#define MAX77686_BUCK_NUM 9
+
+/* Drivers name */
+#define MAX77686_LDO_DRIVER "max77686_ldo"
+#define MAX77686_BUCK_DRIVER "max77686_buck"
+
+enum {
+ REG_DISABLE = 0,
+ REG_ENABLE
+};
+
+enum {
+ LDO_OFF = 0,
+ LDO_ON,
+
+ DIS_LDO = (0x00 << 6),
+ EN_LDO = (0x3 << 6),
+};
+
+enum {
+ OPMODE_OFF = 0,
+ OPMODE_LPM,
+ OPMODE_STANDBY,
+ OPMODE_STANDBY_LPM,
+ OPMODE_ON,
+};
+
+#ifdef CONFIG_POWER
+int max77686_set_ldo_voltage(struct pmic *p, int ldo, ulong uV);
+int max77686_set_ldo_mode(struct pmic *p, int ldo, char opmode);
+int max77686_set_buck_voltage(struct pmic *p, int buck, ulong uV);
+int max77686_set_buck_mode(struct pmic *p, int buck, char opmode);
+#endif
+
+#define MAX77686_LDO_VOLT_MAX_HEX 0x3f
+#define MAX77686_LDO_VOLT_MASK 0x3f
+#define MAX77686_LDO_MODE_MASK 0xc0
+#define MAX77686_LDO_MODE_OFF (0x00 << 0x06)
+#define MAX77686_LDO_MODE_LPM (0x01 << 0x06)
+#define MAX77686_LDO_MODE_STANDBY (0x01 << 0x06)
+#define MAX77686_LDO_MODE_STANDBY_LPM (0x02 << 0x06)
+#define MAX77686_LDO_MODE_ON (0x03 << 0x06)
+#define MAX77686_BUCK234_VOLT_MAX_HEX 0xff
+#define MAX77686_BUCK234_VOLT_MASK 0xff
+#define MAX77686_BUCK_VOLT_MAX_HEX 0x3f
+#define MAX77686_BUCK_VOLT_MASK 0x3f
+#define MAX77686_BUCK_MODE_MASK 0x03
+#define MAX77686_BUCK_MODE_SHIFT_1 0x00
+#define MAX77686_BUCK_MODE_SHIFT_2 0x04
+#define MAX77686_BUCK_MODE_OFF 0x00
+#define MAX77686_BUCK_MODE_STANDBY 0x01
+#define MAX77686_BUCK_MODE_LPM 0x02
+#define MAX77686_BUCK_MODE_ON 0x03
+
+/* For regulator hex<->volt conversion */
+#define MAX77686_LDO_UV_MIN 800000 /* Minimum LDO uV value */
+#define MAX77686_LDO_UV_LSTEP 25000 /* uV lower value step */
+#define MAX77686_LDO_UV_HSTEP 50000 /* uV higher value step */
+#define MAX77686_BUCK_UV_LMIN 600000 /* Lower minimun BUCK value */
+#define MAX77686_BUCK_UV_HMIN 750000 /* Higher minimun BUCK value */
+#define MAX77686_BUCK_UV_LSTEP 12500 /* uV lower value step */
+#define MAX77686_BUCK_UV_HSTEP 50000 /* uV higher value step */
+
+/* Buck1 1 volt value */
+#define MAX77686_BUCK1OUT_1V 0x5
+/* Buck1 1.05 volt value */
+#define MAX77686_BUCK1OUT_1_05V 0x6
+#define MAX77686_BUCK1CTRL_EN (3 << 0)
+/* Buck2 1.3 volt value */
+#define MAX77686_BUCK2DVS1_1_3V 0x38
+#define MAX77686_BUCK2CTRL_ON (1 << 4)
+/* Buck3 1.0125 volt value */
+#define MAX77686_BUCK3DVS1_1_0125V 0x21
+#define MAX77686_BUCK3CTRL_ON (1 << 4)
+/* Buck4 1.2 volt value */
+#define MAX77686_BUCK4DVS1_1_2V 0x30
+#define MAX77686_BUCK4CTRL_ON (1 << 4)
+/* LDO2 1.5 volt value */
+#define MAX77686_LD02CTRL1_1_5V 0x1c
+/* LDO3 1.8 volt value */
+#define MAX77686_LD03CTRL1_1_8V 0x14
+/* LDO5 1.8 volt value */
+#define MAX77686_LD05CTRL1_1_8V 0x14
+/* LDO10 1.8 volt value */
+#define MAX77686_LD10CTRL1_1_8V 0x14
+/*
+ * MAX77686_REG_PMIC_32KHZ set to 32KH CP
+ * output is activated
+ */
+#define MAX77686_32KHCP_EN (1 << 1)
+/*
+ * MAX77686_REG_PMIC_BBAT set to
+ * Back up batery charger on and
+ * limit voltage setting to 3.5v
+ */
+#define MAX77686_BBCHOSTEN (1 << 0)
+#define MAX77686_BBCVS_3_5V (3 << 3)
+#endif /* __MAX77686_PMIC_H_ */
diff --git a/include/power/max77693_fg.h b/include/power/max77693_fg.h
new file mode 100644
index 0000000..c2ae622
--- /dev/null
+++ b/include/power/max77693_fg.h
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ * Piotr Wilczek <p.wilczek@samsung.com>
+ */
+
+#ifndef __MAX77693_FG_H_
+#define __MAX77693_FG_H_
+
+/* MAX 77693 registers */
+enum {
+ MAX77693_STATUS = 0x00,
+ MAX77693_SOCREP = 0x06,
+ MAX77693_VCELL = 0x09,
+ MAX77693_CURRENT = 0x0A,
+ MAX77693_AVG_CURRENT = 0x0B,
+ MAX77693_SOCMIX = 0x0D,
+ MAX77693_SOCAV = 0x0E,
+ MAX77693_DESIGN_CAP = 0x18,
+ MAX77693_AVG_VCELL = 0x19,
+ MAX77693_CONFIG = 0x1D,
+ MAX77693_VERSION = 0x21,
+ MAX77693_LEARNCFG = 0x28,
+ MAX77693_FILTERCFG = 0x29,
+ MAX77693_RELAXCFG = 0x2A,
+ MAX77693_MISCCFG = 0x2B,
+ MAX77693_CGAIN = 0x2E,
+ MAX77693_COFF = 0x2F,
+ MAX77693_RCOMP0 = 0x38,
+ MAX77693_TEMPCO = 0x39,
+ MAX77693_FSTAT = 0x3D,
+ MAX77693_VFOCV = 0xEE,
+ MAX77693_VFSOC = 0xFF,
+
+ FG_NUM_OF_REGS = 0x100,
+};
+
+#define MAX77693_POR (1 << 1)
+
+#define MODEL_UNLOCK1 0x0059
+#define MODEL_UNLOCK2 0x00c4
+#define MODEL_LOCK1 0x0000
+#define MODEL_LOCK2 0x0000
+
+#define MAX77693_FUEL_I2C_ADDR (0x6C >> 1)
+
+int power_fg_init(unsigned char bus);
+#endif /* __MAX77693_FG_H_ */
diff --git a/include/power/max77693_muic.h b/include/power/max77693_muic.h
new file mode 100644
index 0000000..c9afab2
--- /dev/null
+++ b/include/power/max77693_muic.h
@@ -0,0 +1,73 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ * Piotr Wilczek <p.wilczek@samsung.com>
+ */
+
+#ifndef __MAX77693_MUIC_H_
+#define __MAX77693_MUIC_H_
+
+#include <power/power_chrg.h>
+
+/*
+ * MUIC REGISTER
+ */
+
+#define MAX77693_MUIC_PREFIX "max77693-muic:"
+
+/* MAX77693_MUIC_STATUS1 */
+#define MAX77693_MUIC_ADC_MASK 0x1F
+
+/* MAX77693_MUIC_STATUS2 */
+#define MAX77693_MUIC_CHG_NO 0x00
+#define MAX77693_MUIC_CHG_USB 0x01
+#define MAX77693_MUIC_CHG_USB_D 0x02
+#define MAX77693_MUIC_CHG_TA 0x03
+#define MAX77693_MUIC_CHG_TA_500 0x04
+#define MAX77693_MUIC_CHG_TA_1A 0x05
+#define MAX77693_MUIC_CHG_MASK 0x07
+
+/* MAX77693_MUIC_CONTROL1 */
+#define MAX77693_MUIC_CTRL1_DN1DP2 ((0x1 << 3) | 0x1)
+#define MAX77693_MUIC_CTRL1_UT1UR2 ((0x3 << 3) | 0x3)
+#define MAX77693_MUIC_CTRL1_ADN1ADP2 ((0x4 << 3) | 0x4)
+#define MAX77693_MUIC_CTRL1_AUT1AUR2 ((0x5 << 3) | 0x5)
+#define MAX77693_MUIC_CTRL1_MASK 0xC0
+
+#define MUIC_PATH_USB 0
+#define MUIC_PATH_UART 1
+
+#define MUIC_PATH_CP 0
+#define MUIC_PATH_AP 1
+
+enum muic_path {
+ MUIC_PATH_USB_CP,
+ MUIC_PATH_USB_AP,
+ MUIC_PATH_UART_CP,
+ MUIC_PATH_UART_AP,
+};
+
+/* MAX 777693 MUIC registers */
+enum {
+ MAX77693_MUIC_ID = 0x00,
+ MAX77693_MUIC_INT1 = 0x01,
+ MAX77693_MUIC_INT2 = 0x02,
+ MAX77693_MUIC_INT3 = 0x03,
+ MAX77693_MUIC_STATUS1 = 0x04,
+ MAX77693_MUIC_STATUS2 = 0x05,
+ MAX77693_MUIC_STATUS3 = 0x06,
+ MAX77693_MUIC_INTMASK1 = 0x07,
+ MAX77693_MUIC_INTMASK2 = 0x08,
+ MAX77693_MUIC_INTMASK3 = 0x09,
+ MAX77693_MUIC_CDETCTRL = 0x0A,
+ MAX77693_MUIC_CONTROL1 = 0x0C,
+ MAX77693_MUIC_CONTROL2 = 0x0D,
+ MAX77693_MUIC_CONTROL3 = 0x0E,
+
+ MUIC_NUM_OF_REGS = 0x0F,
+};
+
+#define MAX77693_MUIC_I2C_ADDR (0x4A >> 1)
+
+int power_muic_init(unsigned int bus);
+#endif /* __MAX77693_MUIC_H_ */
diff --git a/include/power/max77693_pmic.h b/include/power/max77693_pmic.h
new file mode 100644
index 0000000..9e0e05c
--- /dev/null
+++ b/include/power/max77693_pmic.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ * Piotr Wilczek <p.wilczek@samsung.com>
+ */
+
+#ifndef __MAX77693_PMIC_H_
+#define __MAX77693_PMIC_H_
+
+#include <power/power_chrg.h>
+
+#define CHARGER_MIN_CURRENT 200
+#define CHARGER_MAX_CURRENT 2000
+
+#define MAX77693_CHG_PREFIX "max77693-chg:"
+
+/* Registers */
+
+#define MAX77693_CHG_BASE 0xB0
+#define MAX77693_CHG_INT_OK 0xB2
+#define MAX77693_CHG_CNFG_00 0xB7
+#define MAX77693_CHG_CNFG_02 0xB9
+#define MAX77693_CHG_CNFG_06 0xBD
+#define MAX77693_SAFEOUT 0xC6
+
+#define PMIC_NUM_OF_REGS 0xC7
+
+#define MAX77693_CHG_DETBAT (0x1 << 7) /* MAX77693_CHG_INT_OK */
+#define MAX77693_CHG_MODE_ON 0x05 /* MAX77693_CHG_CNFG_00 */
+#define MAX77693_CHG_CC 0x3F /* MAX77693_CHG_CNFG_02 */
+#define MAX77693_CHG_LOCK (0x0 << 2) /* MAX77693_CHG_CNFG_06 */
+#define MAX77693_CHG_UNLOCK (0x3 << 2) /* MAX77693_CHG_CNFG_06 */
+
+#define MAX77693_ENSAFEOUT1 (1 << 6)
+#define MAX77693_ENSAFEOUT2 (1 << 7)
+
+#define MAX77693_PMIC_I2C_ADDR (0xCC >> 1)
+
+int pmic_init_max77693(unsigned char bus);
+#endif /* __MAX77693_PMIC_H_ */
diff --git a/include/power/max77696_pmic.h b/include/power/max77696_pmic.h
new file mode 100644
index 0000000..69bb7da
--- /dev/null
+++ b/include/power/max77696_pmic.h
@@ -0,0 +1,59 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2015 Freescale Semiconductor, Inc.
+ * Fabio Estevam <fabio.estevam@freescale.com>
+ */
+
+#ifndef __MAX77696_PMIC_H__
+#define __MAX77696_PMIC_H__
+
+#define CONFIG_POWER_MAX77696_I2C_ADDR 0x3C
+
+enum {
+ L01_CNFG1 = 0x43,
+ L01_CNFG2,
+ L02_CNFG1,
+ L02_CNFG2,
+ L03_CNFG1,
+ L03_CNFG2,
+ L04_CNFG1,
+ L04_CNFG2,
+ L05_CNFG1,
+ L05_CNFG2,
+ L06_CNFG1,
+ L06_CNFG2,
+ L07_CNFG1,
+ L07_CNFG2,
+ L08_CNFG1,
+ L08_CNFG2,
+ L09_CNFG1,
+ L09_CNFG2,
+ L10_CNFG1,
+ L10_CNFG2,
+ LDO_INT1,
+ LDO_INT2,
+ LDO_INT1M,
+ LDO_INT2M,
+ LDO_CNFG3,
+ SW1_CNTRL,
+ SW2_CNTRL,
+ SW3_CNTRL,
+ SW4_CNTRL,
+ EPDCNFG,
+ EPDINTS,
+ EPDINT,
+ EPDINTM,
+ EPDVCOM,
+ EPDVEE,
+ EPDVNEG,
+ EPDVPOS,
+ EPDVDDH,
+ EPDSEQ,
+ EPDOKINTS,
+ CID = 0x9c,
+ PMIC_NUM_OF_REGS,
+};
+
+int power_max77696_init(unsigned char bus);
+
+#endif
diff --git a/include/power/max8997_muic.h b/include/power/max8997_muic.h
new file mode 100644
index 0000000..e4ceab6
--- /dev/null
+++ b/include/power/max8997_muic.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Lukasz Majewski <l.majewski@samsung.com>
+ */
+
+#ifndef __MAX8997_MUIC_H_
+#define __MAX8997_MUIC_H_
+
+#include <power/power_chrg.h>
+
+/* MAX8997_MUIC_STATUS2 */
+#define MAX8997_MUIC_CHG_NO 0x00
+#define MAX8997_MUIC_CHG_USB 0x01
+#define MAX8997_MUIC_CHG_USB_D 0x02
+#define MAX8997_MUIC_CHG_TA 0x03
+#define MAX8997_MUIC_CHG_TA_500 0x04
+#define MAX8997_MUIC_CHG_TA_1A 0x05
+#define MAX8997_MUIC_CHG_MASK 0x07
+
+/* MAX 8997 MUIC registers */
+enum {
+ MAX8997_MUIC_ID = 0x00,
+ MAX8997_MUIC_INT1 = 0x01,
+ MAX8997_MUIC_INT2 = 0x02,
+ MAX8997_MUIC_INT3 = 0x03,
+ MAX8997_MUIC_STATUS1 = 0x04,
+ MAX8997_MUIC_STATUS2 = 0x05,
+ MAX8997_MUIC_STATUS3 = 0x06,
+ MAX8997_MUIC_INTMASK1 = 0x07,
+ MAX8997_MUIC_INTMASK2 = 0x08,
+ MAX8997_MUIC_INTMASK3 = 0x09,
+ MAX8997_MUIC_CDETCTRL = 0x0A,
+ MAX8997_MUIC_CONTROL1 = 0x0C,
+ MAX8997_MUIC_CONTROL2 = 0x0D,
+ MAX8997_MUIC_CONTROL3 = 0x0E,
+
+ MUIC_NUM_OF_REGS = 0x0F,
+};
+
+#define MAX8997_MUIC_I2C_ADDR (0x4A >> 1)
+
+int power_muic_init(unsigned int bus);
+#endif /* __MAX8997_MUIC_H_ */
diff --git a/include/power/max8997_pmic.h b/include/power/max8997_pmic.h
new file mode 100644
index 0000000..956eebb
--- /dev/null
+++ b/include/power/max8997_pmic.h
@@ -0,0 +1,196 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Lukasz Majewski <l.majewski@samsung.com>
+ */
+
+#ifndef __MAX8997_PMIC_H_
+#define __MAX8997_PMIC_H_
+
+/* MAX 8997 registers */
+enum {
+ MAX8997_REG_PMIC_ID0 = 0x00,
+ MAX8997_REG_PMIC_ID1 = 0x01,
+ MAX8997_REG_INTSRC = 0x02,
+ MAX8997_REG_INT1 = 0x03,
+ MAX8997_REG_INT2 = 0x04,
+ MAX8997_REG_INT3 = 0x05,
+ MAX8997_REG_INT4 = 0x06,
+
+ MAX8997_REG_INT1MSK = 0x08,
+ MAX8997_REG_INT2MSK = 0x09,
+ MAX8997_REG_INT3MSK = 0x0a,
+ MAX8997_REG_INT4MSK = 0x0b,
+
+ MAX8997_REG_STATUS1 = 0x0d,
+ MAX8997_REG_STATUS2 = 0x0e,
+ MAX8997_REG_STATUS3 = 0x0f,
+ MAX8997_REG_STATUS4 = 0x10,
+
+ MAX8997_REG_MAINCON1 = 0x13,
+ MAX8997_REG_MAINCON2 = 0x14,
+ MAX8997_REG_BUCKRAMP = 0x15,
+
+ MAX8997_REG_BUCK1CTRL = 0x18,
+ MAX8997_REG_BUCK1DVS1 = 0x19,
+ MAX8997_REG_BUCK1DVS2 = 0x1a,
+ MAX8997_REG_BUCK1DVS3 = 0x1b,
+ MAX8997_REG_BUCK1DVS4 = 0x1c,
+ MAX8997_REG_BUCK1DVS5 = 0x1d,
+ MAX8997_REG_BUCK1DVS6 = 0x1e,
+ MAX8997_REG_BUCK1DVS7 = 0x1f,
+ MAX8997_REG_BUCK1DVS8 = 0x20,
+ MAX8997_REG_BUCK2CTRL = 0x21,
+ MAX8997_REG_BUCK2DVS1 = 0x22,
+ MAX8997_REG_BUCK2DVS2 = 0x23,
+ MAX8997_REG_BUCK2DVS3 = 0x24,
+ MAX8997_REG_BUCK2DVS4 = 0x25,
+ MAX8997_REG_BUCK2DVS5 = 0x26,
+ MAX8997_REG_BUCK2DVS6 = 0x27,
+ MAX8997_REG_BUCK2DVS7 = 0x28,
+ MAX8997_REG_BUCK2DVS8 = 0x29,
+ MAX8997_REG_BUCK3CTRL = 0x2a,
+ MAX8997_REG_BUCK3DVS = 0x2b,
+ MAX8997_REG_BUCK4CTRL = 0x2c,
+ MAX8997_REG_BUCK4DVS = 0x2d,
+ MAX8997_REG_BUCK5CTRL = 0x2e,
+ MAX8997_REG_BUCK5DVS1 = 0x2f,
+ MAX8997_REG_BUCK5DVS2 = 0x30,
+ MAX8997_REG_BUCK5DVS3 = 0x31,
+ MAX8997_REG_BUCK5DVS4 = 0x32,
+ MAX8997_REG_BUCK5DVS5 = 0x33,
+ MAX8997_REG_BUCK5DVS6 = 0x34,
+ MAX8997_REG_BUCK5DVS7 = 0x35,
+ MAX8997_REG_BUCK5DVS8 = 0x36,
+ MAX8997_REG_BUCK6CTRL = 0x37,
+ MAX8997_REG_BUCK6BPSKIPCTRL = 0x38,
+ MAX8997_REG_BUCK7CTRL = 0x39,
+ MAX8997_REG_BUCK7DVS = 0x3a,
+ MAX8997_REG_LDO1CTRL = 0x3b,
+ MAX8997_REG_LDO2CTRL = 0x3c,
+ MAX8997_REG_LDO3CTRL = 0x3d,
+ MAX8997_REG_LDO4CTRL = 0x3e,
+ MAX8997_REG_LDO5CTRL = 0x3f,
+ MAX8997_REG_LDO6CTRL = 0x40,
+ MAX8997_REG_LDO7CTRL = 0x41,
+ MAX8997_REG_LDO8CTRL = 0x42,
+ MAX8997_REG_LDO9CTRL = 0x43,
+ MAX8997_REG_LDO10CTRL = 0x44,
+ MAX8997_REG_LDO11CTRL = 0x45,
+ MAX8997_REG_LDO12CTRL = 0x46,
+ MAX8997_REG_LDO13CTRL = 0x47,
+ MAX8997_REG_LDO14CTRL = 0x48,
+ MAX8997_REG_LDO15CTRL = 0x49,
+ MAX8997_REG_LDO16CTRL = 0x4a,
+ MAX8997_REG_LDO17CTRL = 0x4b,
+ MAX8997_REG_LDO18CTRL = 0x4c,
+ MAX8997_REG_LDO21CTRL = 0x4d,
+
+ MAX8997_REG_MBCCTRL1 = 0x50,
+ MAX8997_REG_MBCCTRL2 = 0x51,
+ MAX8997_REG_MBCCTRL3 = 0x52,
+ MAX8997_REG_MBCCTRL4 = 0x53,
+ MAX8997_REG_MBCCTRL5 = 0x54,
+ MAX8997_REG_MBCCTRL6 = 0x55,
+ MAX8997_REG_OTPCGHCVS = 0x56,
+
+ MAX8997_REG_SAFEOUTCTRL = 0x5a,
+
+ MAX8997_REG_LBCNFG1 = 0x5e,
+ MAX8997_REG_LBCNFG2 = 0x5f,
+ MAX8997_REG_BBCCTRL = 0x60,
+
+ MAX8997_REG_FLASH1_CUR = 0x63, /* 0x63 ~ 0x6e for FLASH */
+ MAX8997_REG_FLASH2_CUR = 0x64,
+ MAX8997_REG_MOVIE_CUR = 0x65,
+ MAX8997_REG_GSMB_CUR = 0x66,
+ MAX8997_REG_BOOST_CNTL = 0x67,
+ MAX8997_REG_LEN_CNTL = 0x68,
+ MAX8997_REG_FLASH_CNTL = 0x69,
+ MAX8997_REG_WDT_CNTL = 0x6a,
+ MAX8997_REG_MAXFLASH1 = 0x6b,
+ MAX8997_REG_MAXFLASH2 = 0x6c,
+ MAX8997_REG_FLASHSTATUS = 0x6d,
+ MAX8997_REG_FLASHSTATUSMASK = 0x6e,
+
+ MAX8997_REG_GPIOCNTL1 = 0x70,
+ MAX8997_REG_GPIOCNTL2 = 0x71,
+ MAX8997_REG_GPIOCNTL3 = 0x72,
+ MAX8997_REG_GPIOCNTL4 = 0x73,
+ MAX8997_REG_GPIOCNTL5 = 0x74,
+ MAX8997_REG_GPIOCNTL6 = 0x75,
+ MAX8997_REG_GPIOCNTL7 = 0x76,
+ MAX8997_REG_GPIOCNTL8 = 0x77,
+ MAX8997_REG_GPIOCNTL9 = 0x78,
+ MAX8997_REG_GPIOCNTL10 = 0x79,
+ MAX8997_REG_GPIOCNTL11 = 0x7a,
+ MAX8997_REG_GPIOCNTL12 = 0x7b,
+
+ MAX8997_REG_LDO1CONFIG = 0x80,
+ MAX8997_REG_LDO2CONFIG = 0x81,
+ MAX8997_REG_LDO3CONFIG = 0x82,
+ MAX8997_REG_LDO4CONFIG = 0x83,
+ MAX8997_REG_LDO5CONFIG = 0x84,
+ MAX8997_REG_LDO6CONFIG = 0x85,
+ MAX8997_REG_LDO7CONFIG = 0x86,
+ MAX8997_REG_LDO8CONFIG = 0x87,
+ MAX8997_REG_LDO9CONFIG = 0x88,
+ MAX8997_REG_LDO10CONFIG = 0x89,
+ MAX8997_REG_LDO11CONFIG = 0x8a,
+ MAX8997_REG_LDO12CONFIG = 0x8b,
+ MAX8997_REG_LDO13CONFIG = 0x8c,
+ MAX8997_REG_LDO14CONFIG = 0x8d,
+ MAX8997_REG_LDO15CONFIG = 0x8e,
+ MAX8997_REG_LDO16CONFIG = 0x8f,
+ MAX8997_REG_LDO17CONFIG = 0x90,
+ MAX8997_REG_LDO18CONFIG = 0x91,
+ MAX8997_REG_LDO21CONFIG = 0x92,
+
+ MAX8997_REG_DVSOKTIMER1 = 0x97,
+ MAX8997_REG_DVSOKTIMER2 = 0x98,
+ MAX8997_REG_DVSOKTIMER4 = 0x99,
+ MAX8997_REG_DVSOKTIMER5 = 0x9a,
+
+ PMIC_NUM_OF_REGS = 0x9b,
+};
+
+#define ACTDISSAFEO1 (1 << 4)
+#define ACTDISSAFEO2 (1 << 5)
+#define ENSAFEOUT1 (1 << 6)
+#define ENSAFEOUT2 (1 << 7)
+
+#define ENBUCK (1 << 0)
+#define ACTIVE_DISCHARGE (1 << 3)
+#define GNSLCT (1 << 2)
+#define LDO_ADE (1 << 1)
+#define SAFEOUT_4_85V 0x00
+#define SAFEOUT_4_90V 0x01
+#define SAFEOUT_4_95V 0x02
+#define SAFEOUT_3_30V 0x03
+
+/* Charger */
+#define DETBAT (1 << 2)
+#define MBCICHFCSET (1 << 4)
+#define MBCHOSTEN (1 << 6)
+#define VCHGR_FC (1 << 7)
+
+#define CHARGER_MIN_CURRENT 200
+#define CHARGER_MAX_CURRENT 950
+#define CHARGER_CURRENT_RESOLUTION 50
+
+#define MAX8997_I2C_ADDR (0xCC >> 1)
+#define MAX8997_RTC_ADDR (0x0C >> 1)
+#define MAX8997_MUIC_ADDR (0x4A >> 1)
+#define MAX8997_FG_ADDR (0x6C >> 1)
+
+enum {
+ LDO_OFF = 0,
+ LDO_ON = 1,
+
+ DIS_LDO = (0x00 << 6),
+ EN_LDO = (0x3 << 6),
+};
+
+#define MAX8997_LDO_MAX_VAL 0x3F
+unsigned char max8997_reg_ldo(int uV);
+#endif /* __MAX8997_PMIC_H_ */
diff --git a/include/power/max8998_pmic.h b/include/power/max8998_pmic.h
new file mode 100644
index 0000000..b1a87d6
--- /dev/null
+++ b/include/power/max8998_pmic.h
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Lukasz Majewski <l.majewski@samsung.com>
+ */
+
+#ifndef __MAX8998_PMIC_H_
+#define __MAX8998_PMIC_H_
+
+/* MAX 8998 registers */
+enum {
+ MAX8998_REG_IRQ1,
+ MAX8998_REG_IRQ2,
+ MAX8998_REG_IRQ3,
+ MAX8998_REG_IRQ4,
+ MAX8998_REG_IRQM1,
+ MAX8998_REG_IRQM2,
+ MAX8998_REG_IRQM3,
+ MAX8998_REG_IRQM4,
+ MAX8998_REG_STATUS1,
+ MAX8998_REG_STATUS2,
+ MAX8998_REG_STATUSM1,
+ MAX8998_REG_STATUSM2,
+ MAX8998_REG_CHGR1,
+ MAX8998_REG_CHGR2,
+ MAX8998_REG_LDO_ACTIVE_DISCHARGE1,
+ MAX8998_REG_LDO_ACTIVE_DISCHARGE2,
+ MAX8998_REG_BUCK_ACTIVE_DISCHARGE3,
+ MAX8998_REG_ONOFF1,
+ MAX8998_REG_ONOFF2,
+ MAX8998_REG_ONOFF3,
+ MAX8998_REG_ONOFF4,
+ MAX8998_REG_BUCK1_VOLTAGE1,
+ MAX8998_REG_BUCK1_VOLTAGE2,
+ MAX8998_REG_BUCK1_VOLTAGE3,
+ MAX8998_REG_BUCK1_VOLTAGE4,
+ MAX8998_REG_BUCK2_VOLTAGE1,
+ MAX8998_REG_BUCK2_VOLTAGE2,
+ MAX8998_REG_BUCK3,
+ MAX8998_REG_BUCK4,
+ MAX8998_REG_LDO2_LDO3,
+ MAX8998_REG_LDO4,
+ MAX8998_REG_LDO5,
+ MAX8998_REG_LDO6,
+ MAX8998_REG_LDO7,
+ MAX8998_REG_LDO8_LDO9,
+ MAX8998_REG_LDO10_LDO11,
+ MAX8998_REG_LDO12,
+ MAX8998_REG_LDO13,
+ MAX8998_REG_LDO14,
+ MAX8998_REG_LDO15,
+ MAX8998_REG_LDO16,
+ MAX8998_REG_LDO17,
+ MAX8998_REG_BKCHR,
+ MAX8998_REG_LBCNFG1,
+ MAX8998_REG_LBCNFG2,
+ PMIC_NUM_OF_REGS,
+};
+
+#define MAX8998_LDO3 (1 << 2)
+#define MAX8998_LDO4 (1 << 1)
+#define MAX8998_LDO7 (1 << 6)
+#define MAX8998_LDO8 (1 << 5)
+#define MAX8998_LDO17 (1 << 4)
+#define MAX8998_SAFEOUT1 (1 << 4)
+
+#define MAX8998_I2C_ADDR (0xCC >> 1)
+
+enum { LDO_OFF, LDO_ON };
+
+#endif /* __MAX8998_PMIC_H_ */
diff --git a/include/power/mc34vr500_pmic.h b/include/power/mc34vr500_pmic.h
new file mode 100644
index 0000000..d2edda6
--- /dev/null
+++ b/include/power/mc34vr500_pmic.h
@@ -0,0 +1,174 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2016 Freescale Semiconductor, Inc.
+ * Hou Zhiqiang <Zhiqiang.Hou@freescale.com>
+ */
+
+#ifndef __MC34VR500_H_
+#define __MC34VR500_H_
+
+#include <power/pmic.h>
+
+#define MC34VR500_I2C_ADDR 0x08
+
+/* Drivers name */
+#define MC34VR500_REGULATOR_DRIVER "mc34vr500_regulator"
+
+/* Register map */
+enum {
+ MC34VR500_DEVICEID = 0x00,
+
+ MC34VR500_SILICONREVID = 0x03,
+ MC34VR500_FABID,
+ MC34VR500_INTSTAT0,
+ MC34VR500_INTMASK0,
+ MC34VR500_INTSENSE0,
+ MC34VR500_INTSTAT1,
+ MC34VR500_INTMASK1,
+ MC34VR500_INTSENSE1,
+
+ MC34VR500_INTSTAT4 = 0x11,
+ MC34VR500_INTMASK4,
+ MC34VR500_INTSENSE4,
+
+ MC34VR500_PWRCTL = 0x1B,
+
+ MC34VR500_SW1VOLT = 0x2E,
+ MC34VR500_SW1STBY,
+ MC34VR500_SW1OFF,
+ MC34VR500_SW1MODE,
+ MC34VR500_SW1CONF,
+ MC34VR500_SW2VOLT,
+ MC34VR500_SW2STBY,
+ MC34VR500_SW2OFF,
+ MC34VR500_SW2MODE,
+ MC34VR500_SW2CONF,
+
+ MC34VR500_SW3VOLT = 0x3C,
+ MC34VR500_SW3STBY,
+ MC34VR500_SW3OFF,
+ MC34VR500_SW3MODE,
+ MC34VR500_SW3CONF,
+
+ MC34VR500_SW4VOLT = 0x4A,
+ MC34VR500_SW4STBY,
+ MC34VR500_SW4OFF,
+ MC34VR500_SW4MODE,
+ MC34VR500_SW4CONF,
+
+ MC34VR500_REFOUTCRTRL = 0x6A,
+
+ MC34VR500_LDO1CTL = 0x6D,
+ MC34VR500_LDO2CTL,
+ MC34VR500_LDO3CTL,
+ MC34VR500_LDO4CTL,
+ MC34VR500_LDO5CTL,
+
+ MC34VR500_PAGE_REGISTER = 0x7F,
+
+ /* Internal RAM */
+ MC34VR500_SW1_VOLT = 0xA8,
+ MC34VR500_SW1_SEQ,
+ MC34VR500_SW1_CONFIG,
+
+ MC34VR500_SW2_VOLT = 0xAC,
+ MC34VR500_SW2_SEQ,
+ MC34VR500_SW2_CONFIG,
+
+ MC34VR500_SW3_VOLT = 0xB0,
+ MC34VR500_SW3_SEQ,
+ MC34VR500_SW3_CONFIG,
+
+ MC34VR500_SW4_VOLT = 0xB8,
+ MC34VR500_SW4_SEQ,
+ MC34VR500_SW4_CONFIG,
+
+ MC34VR500_REFOUT_SEQ = 0xC4,
+
+ MC34VR500_LDO1_VOLT = 0xCC,
+ MC34VR500_LDO1_SEQ,
+
+ MC34VR500_LDO2_VOLT = 0xD0,
+ MC34VR500_LDO2_SEQ,
+
+ MC34VR500_LDO3_VOLT = 0xD4,
+ MC34VR500_LDO3_SEQ,
+
+ MC34VR500_LDO4_VOLT = 0xD8,
+ MC34VR500_LDO4_SEQ,
+
+ MC34VR500_LDO5_VOLT = 0xDC,
+ MC34VR500_LDO5_SEQ,
+
+ MC34VR500_PU_CONFIG1 = 0xE0,
+
+ MC34VR500_TBB_POR = 0xE4,
+
+ MC34VR500_PWRGD_EN = 0xE8,
+
+ MC34VR500_NUM_OF_REGS,
+};
+
+/* Registor offset based on SWxVOLT register */
+#define MC34VR500_VOLT_OFFSET 0
+#define MC34VR500_STBY_OFFSET 1
+#define MC34VR500_OFF_OFFSET 2
+#define MC34VR500_MODE_OFFSET 3
+#define MC34VR500_CONF_OFFSET 4
+
+#define SW_MODE_MASK 0xf
+#define SW_MODE_SHIFT 0
+
+#define LDO_VOL_MASK 0xf
+#define LDO_EN (1 << 4)
+#define LDO_MODE_SHIFT 4
+#define LDO_MODE_MASK (1 << 4)
+#define LDO_MODE_OFF 0
+#define LDO_MODE_ON 1
+
+#define REFOUTEN (1 << 4)
+
+/*
+ * Regulator Mode Control
+ *
+ * OFF: The regulator is switched off and the output voltage is discharged.
+ * PFM: In this mode, the regulator is always in PFM mode, which is useful
+ * at light loads for optimized efficiency.
+ * PWM: In this mode, the regulator is always in PWM mode operation
+ * regardless of load conditions.
+ * APS: In this mode, the regulator moves automatically between pulse
+ * skipping mode and PWM mode depending on load conditions.
+ *
+ * SWxMODE[3:0]
+ * Normal Mode | Standby Mode | value
+ * OFF OFF 0x0
+ * PWM OFF 0x1
+ * PFM OFF 0x3
+ * APS OFF 0x4
+ * PWM PWM 0x5
+ * PWM APS 0x6
+ * APS APS 0x8
+ * APS PFM 0xc
+ * PWM PFM 0xd
+ */
+#define OFF_OFF 0x0
+#define PWM_OFF 0x1
+#define PFM_OFF 0x3
+#define APS_OFF 0x4
+#define PWM_PWM 0x5
+#define PWM_APS 0x6
+#define APS_APS 0x8
+#define APS_PFM 0xc
+#define PWM_PFM 0xd
+
+enum swx {
+ SW1 = 0,
+ SW2,
+ SW3,
+ SW4,
+};
+
+int mc34vr500_get_sw_volt(uint8_t sw);
+int mc34vr500_set_sw_volt(uint8_t sw, int sw_volt);
+int power_mc34vr500_init(unsigned char bus);
+#endif /* __MC34VR500_PMIC_H_ */
diff --git a/include/power/palmas.h b/include/power/palmas.h
new file mode 100644
index 0000000..df5f15c
--- /dev/null
+++ b/include/power/palmas.h
@@ -0,0 +1,26 @@
+#define PALMAS 0x0
+#define TPS659038 0x1
+#define TPS65917 0x2
+
+/* I2C device address for pmic palmas */
+#define PALMAS_I2C_ADDR (0x12 >> 1)
+#define PALMAS_LDO_NUM 11
+#define PALMAS_SMPS_NUM 8
+
+/* Drivers name */
+#define PALMAS_LDO_DRIVER "palmas_ldo"
+#define PALMAS_SMPS_DRIVER "palmas_smps"
+
+#define PALMAS_SMPS_VOLT_MASK 0x7F
+#define PALMAS_SMPS_RANGE_MASK 0x80
+#define PALMAS_SMPS_VOLT_MAX_HEX 0x7F
+#define PALMAS_SMPS_VOLT_MAX 3300000
+#define PALMAS_SMPS_MODE_MASK 0x3
+#define PALMAS_SMPS_STATUS_MASK 0x30
+
+#define PALMAS_LDO_VOLT_MASK 0x3F
+#define PALMAS_LDO_VOLT_MAX_HEX 0x3F
+#define PALMAS_LDO_VOLT_MAX 3300000
+#define PALMAS_LDO_MODE_MASK 0x1
+#define PALMAS_LDO_STATUS_MASK 0x10
+#define PALMAS_LDO_BYPASS_EN 0x40
diff --git a/include/power/pfuze100_pmic.h b/include/power/pfuze100_pmic.h
new file mode 100644
index 0000000..f4383ed
--- /dev/null
+++ b/include/power/pfuze100_pmic.h
@@ -0,0 +1,258 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2014 Gateworks Corporation
+ * Tim Harvey <tharvey@gateworks.com>
+ */
+
+#ifndef __PFUZE100_PMIC_H_
+#define __PFUZE100_PMIC_H_
+
+/* Device ID */
+enum {PFUZE100 = 0x10, PFUZE200 = 0x11, PFUZE3000 = 0x30};
+
+#define PFUZE100_REGULATOR_DRIVER "pfuze100_regulator"
+
+/* PFUZE100 registers */
+enum {
+ PFUZE100_DEVICEID = 0x00,
+ PFUZE100_REVID = 0x03,
+ PFUZE100_FABID = 0x04,
+
+ PFUZE100_SW1ABVOL = 0x20,
+ PFUZE100_SW1ABSTBY = 0x21,
+ PFUZE100_SW1ABOFF = 0x22,
+ PFUZE100_SW1ABMODE = 0x23,
+ PFUZE100_SW1ABCONF = 0x24,
+ PFUZE100_SW1CVOL = 0x2e,
+ PFUZE100_SW1CSTBY = 0x2f,
+ PFUZE100_SW1COFF = 0x30,
+ PFUZE100_SW1CMODE = 0x31,
+ PFUZE100_SW1CCONF = 0x32,
+ PFUZE100_SW2VOL = 0x35,
+ PFUZE100_SW2STBY = 0x36,
+ PFUZE100_SW2OFF = 0x37,
+ PFUZE100_SW2MODE = 0x38,
+ PFUZE100_SW2CONF = 0x39,
+ PFUZE100_SW3AVOL = 0x3c,
+ PFUZE100_SW3ASTBY = 0x3D,
+ PFUZE100_SW3AOFF = 0x3E,
+ PFUZE100_SW3AMODE = 0x3F,
+ PFUZE100_SW3ACONF = 0x40,
+ PFUZE100_SW3BVOL = 0x43,
+ PFUZE100_SW3BSTBY = 0x44,
+ PFUZE100_SW3BOFF = 0x45,
+ PFUZE100_SW3BMODE = 0x46,
+ PFUZE100_SW3BCONF = 0x47,
+ PFUZE100_SW4VOL = 0x4a,
+ PFUZE100_SW4STBY = 0x4b,
+ PFUZE100_SW4OFF = 0x4c,
+ PFUZE100_SW4MODE = 0x4d,
+ PFUZE100_SW4CONF = 0x4e,
+ PFUZE100_SWBSTCON1 = 0x66,
+ PFUZE100_VREFDDRCON = 0x6a,
+ PFUZE100_VSNVSVOL = 0x6b,
+ PFUZE100_VGEN1VOL = 0x6c,
+ PFUZE100_VGEN2VOL = 0x6d,
+ PFUZE100_VGEN3VOL = 0x6e,
+ PFUZE100_VGEN4VOL = 0x6f,
+ PFUZE100_VGEN5VOL = 0x70,
+ PFUZE100_VGEN6VOL = 0x71,
+
+ PFUZE100_NUM_OF_REGS = 0x7f,
+};
+
+/* Registor offset based on VOLT register */
+#define PFUZE100_VOL_OFFSET 0
+#define PFUZE100_STBY_OFFSET 1
+#define PFUZE100_OFF_OFFSET 2
+#define PFUZE100_MODE_OFFSET 3
+#define PFUZE100_CONF_OFFSET 4
+
+/*
+ * Buck Regulators
+ */
+
+#define PFUZE100_SW1ABC_SETP(x) ((x - 3000) / 250)
+
+/* SW1A/B/C Output Voltage Configuration */
+#define SW1x_0_300V 0
+#define SW1x_0_325V 1
+#define SW1x_0_350V 2
+#define SW1x_0_375V 3
+#define SW1x_0_400V 4
+#define SW1x_0_425V 5
+#define SW1x_0_450V 6
+#define SW1x_0_475V 7
+#define SW1x_0_500V 8
+#define SW1x_0_525V 9
+#define SW1x_0_550V 10
+#define SW1x_0_575V 11
+#define SW1x_0_600V 12
+#define SW1x_0_625V 13
+#define SW1x_0_650V 14
+#define SW1x_0_675V 15
+#define SW1x_0_700V 16
+#define SW1x_0_725V 17
+#define SW1x_0_750V 18
+#define SW1x_0_775V 19
+#define SW1x_0_800V 20
+#define SW1x_0_825V 21
+#define SW1x_0_850V 22
+#define SW1x_0_875V 23
+#define SW1x_0_900V 24
+#define SW1x_0_925V 25
+#define SW1x_0_950V 26
+#define SW1x_0_975V 27
+#define SW1x_1_000V 28
+#define SW1x_1_025V 29
+#define SW1x_1_050V 30
+#define SW1x_1_075V 31
+#define SW1x_1_100V 32
+#define SW1x_1_125V 33
+#define SW1x_1_150V 34
+#define SW1x_1_175V 35
+#define SW1x_1_200V 36
+#define SW1x_1_225V 37
+#define SW1x_1_250V 38
+#define SW1x_1_275V 39
+#define SW1x_1_300V 40
+#define SW1x_1_325V 41
+#define SW1x_1_350V 42
+#define SW1x_1_375V 43
+#define SW1x_1_400V 44
+#define SW1x_1_425V 45
+#define SW1x_1_450V 46
+#define SW1x_1_475V 47
+#define SW1x_1_500V 48
+#define SW1x_1_525V 49
+#define SW1x_1_550V 50
+#define SW1x_1_575V 51
+#define SW1x_1_600V 52
+#define SW1x_1_625V 53
+#define SW1x_1_650V 54
+#define SW1x_1_675V 55
+#define SW1x_1_700V 56
+#define SW1x_1_725V 57
+#define SW1x_1_750V 58
+#define SW1x_1_775V 59
+#define SW1x_1_800V 60
+#define SW1x_1_825V 61
+#define SW1x_1_850V 62
+#define SW1x_1_875V 63
+
+#define SW1x_NORMAL_MASK 0x3f
+#define SW1x_STBY_MASK 0x3f
+#define SW1x_OFF_MASK 0x3f
+
+#define SW_MODE_MASK 0xf
+#define SW_MODE_SHIFT 0
+
+#define SW1xCONF_DVSSPEED_MASK 0xc0
+#define SW1xCONF_DVSSPEED_2US 0x00
+#define SW1xCONF_DVSSPEED_4US 0x40
+#define SW1xCONF_DVSSPEED_8US 0x80
+#define SW1xCONF_DVSSPEED_16US 0xc0
+
+/*
+ * LDO Configuration
+ */
+
+/* VGEN1/2 Voltage Configuration */
+#define LDOA_0_80V 0
+#define LDOA_0_85V 1
+#define LDOA_0_90V 2
+#define LDOA_0_95V 3
+#define LDOA_1_00V 4
+#define LDOA_1_05V 5
+#define LDOA_1_10V 6
+#define LDOA_1_15V 7
+#define LDOA_1_20V 8
+#define LDOA_1_25V 9
+#define LDOA_1_30V 10
+#define LDOA_1_35V 11
+#define LDOA_1_40V 12
+#define LDOA_1_45V 13
+#define LDOA_1_50V 14
+#define LDOA_1_55V 15
+
+/* VGEN3/4/5/6 Voltage Configuration */
+#define LDOB_1_80V 0
+#define LDOB_1_90V 1
+#define LDOB_2_00V 2
+#define LDOB_2_10V 3
+#define LDOB_2_20V 4
+#define LDOB_2_30V 5
+#define LDOB_2_40V 6
+#define LDOB_2_50V 7
+#define LDOB_2_60V 8
+#define LDOB_2_70V 9
+#define LDOB_2_80V 10
+#define LDOB_2_90V 11
+#define LDOB_3_00V 12
+#define LDOB_3_10V 13
+#define LDOB_3_20V 14
+#define LDOB_3_30V 15
+
+#define LDO_VOL_MASK 0xf
+#define LDO_EN (1 << 4)
+#define LDO_MODE_SHIFT 4
+#define LDO_MODE_MASK (1 << 4)
+#define LDO_MODE_OFF 0
+#define LDO_MODE_ON 1
+
+#define VREFDDRCON_EN (1 << 4)
+/*
+ * Boost Regulator
+ */
+
+/* SWBST Output Voltage */
+#define SWBST_5_00V 0
+#define SWBST_5_05V 1
+#define SWBST_5_10V 2
+#define SWBST_5_15V 3
+
+#define SWBST_VOL_MASK 0x3
+#define SWBST_MODE_MASK 0xC
+#define SWBST_MODE_SHIFT 0x2
+#define SWBST_MODE_OFF 0
+#define SWBST_MODE_PFM 1
+#define SWBST_MODE_AUTO 2
+#define SWBST_MODE_APS 3
+
+/*
+ * Regulator Mode Control
+ *
+ * OFF: The regulator is switched off and the output voltage is discharged.
+ * PFM: In this mode, the regulator is always in PFM mode, which is useful
+ * at light loads for optimized efficiency.
+ * PWM: In this mode, the regulator is always in PWM mode operation
+ * regardless of load conditions.
+ * APS: In this mode, the regulator moves automatically between pulse
+ * skipping mode and PWM mode depending on load conditions.
+ *
+ * SWxMODE[3:0]
+ * Normal Mode | Standby Mode | value
+ * OFF OFF 0x0
+ * PWM OFF 0x1
+ * PFM OFF 0x3
+ * APS OFF 0x4
+ * PWM PWM 0x5
+ * PWM APS 0x6
+ * APS APS 0x8
+ * APS PFM 0xc
+ * PWM PFM 0xd
+ */
+#define OFF_OFF 0x0
+#define PWM_OFF 0x1
+#define PFM_OFF 0x3
+#define APS_OFF 0x4
+#define PWM_PWM 0x5
+#define PWM_APS 0x6
+#define APS_APS 0x8
+#define APS_PFM 0xc
+#define PWM_PFM 0xd
+
+#define SWITCH_SIZE 0x7
+
+int power_pfuze100_init(unsigned char bus);
+#endif
diff --git a/include/power/pfuze3000_pmic.h b/include/power/pfuze3000_pmic.h
new file mode 100644
index 0000000..b836d67
--- /dev/null
+++ b/include/power/pfuze3000_pmic.h
@@ -0,0 +1,82 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2015 Freescale Semiconductor, Inc
+ * Peng Fan <Peng.Fan@freescale.com>
+ */
+#ifndef __PFUZE3000_PMIC_H_
+#define __PFUZE3000_PMIC_H_
+
+/* PFUZE3000 registers */
+enum {
+ PFUZE3000_DEVICEID = 0x00,
+
+ PFUZE3000_REVID = 0x03,
+ PFUZE3000_FABID = 0x04,
+ PFUZE3000_INTSTAT0 = 0x05,
+ PFUZE3000_INTMASK0 = 0x06,
+ PFUZE3000_INTSENSE0 = 0x07,
+ PFUZE3000_INTSTAT1 = 0x08,
+ PFUZE3000_INTMASK1 = 0x09,
+ PFUZE3000_INTSENSE1 = 0x0A,
+
+ PFUZE3000_INTSTAT3 = 0x0E,
+ PFUZE3000_INTMASK3 = 0x0F,
+ PFUZE3000_INTSENSE3 = 0x10,
+ PFUZE3000_INTSTAT4 = 0x11,
+ PFUZE3000_INTMASK4 = 0x12,
+ PFUZE3000_INTSENSE4 = 0x13,
+
+ PFUZE3000_COINCTL = 0x1A,
+ PFUZE3000_PWRCTL = 0x1B,
+ PFUZE3000_MEMA = 0x1C,
+ PFUZE3000_MEMB = 0x1D,
+ PFUZE3000_MEMC = 0x1E,
+ PFUZE3000_MEMD = 0x1F,
+
+ PFUZE3000_SW1AVOLT = 0x20,
+ PFUZE3000_SW1ASTBY = 0x21,
+ PFUZE3000_SW1AOFF = 0x22,
+ PFUZE3000_SW1AMODE = 0x23,
+ PFUZE3000_SW1ACONF = 0x24,
+
+ PFUZE3000_SW1BVOLT = 0x2E,
+ PFUZE3000_SW1BSTBY = 0x2F,
+ PFUZE3000_SW1BOFF = 0x30,
+ PFUZE3000_SW1BMODE = 0x31,
+ PFUZE3000_SW1BCONF = 0x32,
+
+ PFUZE3000_SW2VOLT = 0x35,
+ PFUZE3000_SW2STBY = 0x36,
+ PFUZE3000_SW2OFF = 0x37,
+ PFUZE3000_SW2MODE = 0x38,
+ PFUZE3000_SW2CONF = 0x39,
+
+ PFUZE3000_SW3VOLT = 0x3C,
+ PFUZE3000_SW3STBY = 0x3D,
+ PFUZE3000_SW3OFF = 0x3E,
+ PFUZE3000_SW3MODE = 0x3F,
+ PFUZE3000_SW3CONF = 0x40,
+
+ PFUZE3000_SWBSTCTL = 0x66,
+
+ PFUZE3000_LDOGCTL = 0x69,
+ PFUZE3000_VREFDDRCTL = 0x6A,
+ PFUZE3000_VSNVSCTL = 0x6B,
+ PFUZE3000_VLDO1CTL = 0x6C,
+ PFUZE3000_VLDO2CTL = 0x6D,
+ PFUZE3000_VCC_SDCTL = 0x6E,
+ PFUZE3000_V33CTL = 0x6F,
+ PFUZE3000_VLDO3CTL = 0x70,
+ PFUZE3000_VLD4CTL = 0x71,
+
+ PFUZE3000_NUM_OF_REGS = 0x100,
+};
+
+int power_pfuze3000_init(unsigned char bus);
+
+/* Voltage Configuration */
+#define PFUZE3000_SW1AB_SETP(x) ((x - 7000) / 250)
+#define PFUZE3000_SW3_SETP(x) ((x - 9000) / 500)
+#define PFUZE3000_VLDO_SETP(x) ((x - 8000) / 500)
+
+#endif
diff --git a/include/power/pmic.h b/include/power/pmic.h
new file mode 100644
index 0000000..be9de6b
--- /dev/null
+++ b/include/power/pmic.h
@@ -0,0 +1,330 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2014-2015 Samsung Electronics
+ * Przemyslaw Marczak <p.marczak@samsung.com>
+ *
+ * Copyright (C) 2011-2012 Samsung Electronics
+ * Lukasz Majewski <l.majewski@samsung.com>
+ */
+
+#ifndef __CORE_PMIC_H_
+#define __CORE_PMIC_H_
+
+#include <dm/ofnode.h>
+#include <i2c.h>
+#include <linux/list.h>
+#include <power/power_chrg.h>
+
+enum { PMIC_I2C, PMIC_SPI, PMIC_NONE};
+
+#ifdef CONFIG_POWER
+enum { I2C_PMIC, I2C_NUM, };
+enum { PMIC_READ, PMIC_WRITE, };
+enum { PMIC_SENSOR_BYTE_ORDER_LITTLE, PMIC_SENSOR_BYTE_ORDER_BIG, };
+
+enum {
+ PMIC_CHARGER_DISABLE,
+ PMIC_CHARGER_ENABLE,
+};
+
+struct p_i2c {
+ unsigned char addr;
+ unsigned char *buf;
+ unsigned char tx_num;
+};
+
+struct p_spi {
+ unsigned int cs;
+ unsigned int mode;
+ unsigned int bitlen;
+ unsigned int clk;
+ unsigned int flags;
+ u32 (*prepare_tx)(u32 reg, u32 *val, u32 write);
+};
+
+struct pmic;
+struct power_fg {
+ int (*fg_battery_check) (struct pmic *p, struct pmic *bat);
+ int (*fg_battery_update) (struct pmic *p, struct pmic *bat);
+};
+
+struct power_chrg {
+ int (*chrg_type) (struct pmic *p);
+ int (*chrg_bat_present) (struct pmic *p);
+ int (*chrg_state) (struct pmic *p, int state, int current);
+};
+
+struct power_battery {
+ struct battery *bat;
+ int (*battery_init) (struct pmic *bat, struct pmic *p1,
+ struct pmic *p2, struct pmic *p3);
+ int (*battery_charge) (struct pmic *bat);
+ /* Keep info about power devices involved with battery operation */
+ struct pmic *chrg, *fg, *muic;
+};
+
+struct pmic {
+ const char *name;
+ unsigned char bus;
+ unsigned char interface;
+ unsigned char sensor_byte_order;
+ unsigned int number_of_regs;
+ union hw {
+ struct p_i2c i2c;
+ struct p_spi spi;
+ } hw;
+
+ void (*low_power_mode) (void);
+ struct power_battery *pbat;
+ struct power_chrg *chrg;
+ struct power_fg *fg;
+
+ struct pmic *parent;
+ struct list_head list;
+};
+#endif /* CONFIG_POWER */
+
+#ifdef CONFIG_DM_PMIC
+/**
+ * U-Boot PMIC Framework
+ * =====================
+ *
+ * UCLASS_PMIC - This is designed to provide an I/O interface for PMIC devices.
+ *
+ * For the multi-function PMIC devices, this can be used as parent I/O device
+ * for each IC's interface. Then, each child uses its parent for read/write.
+ *
+ * The driver model tree could look like this:
+ *
+ *_ root device
+ * |_ BUS 0 device (e.g. I2C0) - UCLASS_I2C/SPI/...
+ * | |_ PMIC device (READ/WRITE ops) - UCLASS_PMIC
+ * | |_ REGULATOR device (ldo/buck/... ops) - UCLASS_REGULATOR
+ * | |_ CHARGER device (charger ops) - UCLASS_CHARGER (in the future)
+ * | |_ MUIC device (microUSB connector ops) - UCLASS_MUIC (in the future)
+ * | |_ ...
+ * |
+ * |_ BUS 1 device (e.g. I2C1) - UCLASS_I2C/SPI/...
+ * |_ PMIC device (READ/WRITE ops) - UCLASS_PMIC
+ * |_ RTC device (rtc ops) - UCLASS_RTC (in the future)
+ *
+ * We can find two PMIC cases in boards design:
+ * - single I/O interface
+ * - multiple I/O interfaces
+ * We bind a single PMIC device for each interface, to provide an I/O for
+ * its child devices. And each child usually implements a different function,
+ * controlled by the same interface.
+ *
+ * The binding should be done automatically. If device tree nodes/subnodes are
+ * proper defined, then:
+ *
+ * |_ the ROOT driver will bind the device for I2C/SPI node:
+ * |_ the I2C/SPI driver should bind a device for pmic node:
+ * |_ the PMIC driver should bind devices for its childs:
+ * |_ regulator (child)
+ * |_ charger (child)
+ * |_ other (child)
+ *
+ * The same for other device nodes, for multi-interface PMIC.
+ *
+ * Note:
+ * Each PMIC interface driver should use a different compatible string.
+ *
+ * If a PMIC child device driver needs access the PMIC-specific registers,
+ * it need know only the register address and the access can be done through
+ * the parent pmic driver. Like in the example:
+ *
+ *_ root driver
+ * |_ dev: bus I2C0 - UCLASS_I2C
+ * | |_ dev: my_pmic (read/write) (is parent) - UCLASS_PMIC
+ * | |_ dev: my_regulator (set value/etc..) (is child) - UCLASS_REGULATOR
+ *
+ * To ensure such device relationship, the pmic device driver should also bind
+ * all its child devices, like in the example below. It can be done by calling
+ * the 'pmic_bind_children()' - please refer to the function description, which
+ * can be found in this header file. This function, should be called inside the
+ * driver's bind() method.
+ *
+ * For the example driver, please refer the MAX77686 driver:
+ * - 'drivers/power/pmic/max77686.c'
+ */
+
+/**
+ * struct dm_pmic_ops - PMIC device I/O interface
+ *
+ * Should be implemented by UCLASS_PMIC device drivers. The standard
+ * device operations provides the I/O interface for it's childs.
+ *
+ * @reg_count: device's register count
+ * @read: read 'len' bytes at "reg" and store it into the 'buffer'
+ * @write: write 'len' bytes from the 'buffer' to the register at 'reg' address
+ */
+struct dm_pmic_ops {
+ int (*reg_count)(struct udevice *dev);
+ int (*read)(struct udevice *dev, uint reg, uint8_t *buffer, int len);
+ int (*write)(struct udevice *dev, uint reg, const uint8_t *buffer,
+ int len);
+};
+
+/**
+ * enum pmic_op_type - used for various pmic devices operation calls,
+ * for reduce a number of lines with the same code for read/write or get/set.
+ *
+ * @PMIC_OP_GET - get operation
+ * @PMIC_OP_SET - set operation
+*/
+enum pmic_op_type {
+ PMIC_OP_GET,
+ PMIC_OP_SET,
+};
+
+/**
+ * struct pmic_child_info - basic device's child info for bind child nodes with
+ * the driver by the node name prefix and driver name. This is a helper struct
+ * for function: pmic_bind_children().
+ *
+ * @prefix - child node name prefix (or its name if is unique or single)
+ * @driver - driver name for the sub-node with prefix
+ */
+struct pmic_child_info {
+ const char *prefix;
+ const char *driver;
+};
+
+/* drivers/power/pmic-uclass.c */
+
+/**
+ * pmic_bind_children() - bind drivers for given parent pmic, using child info
+ * found in 'child_info' array.
+ *
+ * @pmic - pmic device - the parent of found child's
+ * @child_info - N-childs info array
+ * @return a positive number of childs, or 0 if no child found (error)
+ *
+ * Note: For N-childs the child_info array should have N+1 entries and the last
+ * entry prefix should be NULL - the same as for drivers compatible.
+ *
+ * For example, a single prefix info (N=1):
+ * static const struct pmic_child_info bind_info[] = {
+ * { .prefix = "ldo", .driver = "ldo_driver" },
+ * { },
+ * };
+ *
+ * This function is useful for regulator sub-nodes:
+ * my_regulator@0xa {
+ * reg = <0xa>;
+ * (pmic - bind automatically by compatible)
+ * compatible = "my_pmic";
+ * ...
+ * (pmic's childs - bind by pmic_bind_children())
+ * (nodes prefix: "ldo", driver: "my_regulator_ldo")
+ * ldo1 { ... };
+ * ldo2 { ... };
+ *
+ * (nodes prefix: "buck", driver: "my_regulator_buck")
+ * buck1 { ... };
+ * buck2 { ... };
+ * };
+ */
+int pmic_bind_children(struct udevice *pmic, ofnode parent,
+ const struct pmic_child_info *child_info);
+
+/**
+ * pmic_get: get the pmic device using its name
+ *
+ * @name - device name
+ * @devp - returned pointer to the pmic device
+ * @return 0 on success or negative value of errno.
+ *
+ * The returned devp device can be used with pmic_read/write calls
+ */
+int pmic_get(const char *name, struct udevice **devp);
+
+/**
+ * pmic_reg_count: get the pmic register count
+ *
+ * The required pmic device can be obtained by 'pmic_get()'
+ *
+ * @dev - pointer to the UCLASS_PMIC device
+ * @return register count value on success or negative value of errno.
+ */
+int pmic_reg_count(struct udevice *dev);
+
+/**
+ * pmic_read/write: read/write to the UCLASS_PMIC device
+ *
+ * The required pmic device can be obtained by 'pmic_get()'
+ *
+ * @pmic - pointer to the UCLASS_PMIC device
+ * @reg - device register offset
+ * @buffer - pointer to read/write buffer
+ * @len - byte count for read/write
+ * @return 0 on success or negative value of errno.
+ */
+int pmic_read(struct udevice *dev, uint reg, uint8_t *buffer, int len);
+int pmic_write(struct udevice *dev, uint reg, const uint8_t *buffer, int len);
+
+/**
+ * pmic_reg_read() - read a PMIC register value
+ *
+ * @dev: PMIC device to read
+ * @reg: Register to read
+ * @return value read on success or negative value of errno.
+ */
+int pmic_reg_read(struct udevice *dev, uint reg);
+
+/**
+ * pmic_reg_write() - write a PMIC register value
+ *
+ * @dev: PMIC device to write
+ * @reg: Register to write
+ * @value: Value to write
+ * @return 0 on success or negative value of errno.
+ */
+int pmic_reg_write(struct udevice *dev, uint reg, uint value);
+
+/**
+ * pmic_clrsetbits() - clear and set bits in a PMIC register
+ *
+ * This reads a register, optionally clears some bits, optionally sets some
+ * bits, then writes the register.
+ *
+ * @dev: PMIC device to update
+ * @reg: Register to update
+ * @clr: Bit mask to clear (set those bits that you want cleared)
+ * @set: Bit mask to set (set those bits that you want set)
+ * @return 0 on success or negative value of errno.
+ */
+int pmic_clrsetbits(struct udevice *dev, uint reg, uint clr, uint set);
+
+/*
+ * This structure holds the private data for PMIC uclass
+ * For now we store information about the number of bytes
+ * being sent at once to the device.
+ */
+struct uc_pmic_priv {
+ uint trans_len;
+};
+
+#endif /* CONFIG_DM_PMIC */
+
+#ifdef CONFIG_POWER
+int pmic_init(unsigned char bus);
+int power_init_board(void);
+int pmic_dialog_init(unsigned char bus);
+int check_reg(struct pmic *p, u32 reg);
+struct pmic *pmic_alloc(void);
+struct pmic *pmic_get(const char *s);
+int pmic_probe(struct pmic *p);
+int pmic_reg_read(struct pmic *p, u32 reg, u32 *val);
+int pmic_reg_write(struct pmic *p, u32 reg, u32 val);
+int pmic_set_output(struct pmic *p, u32 reg, int ldo, int on);
+#endif
+
+#define pmic_i2c_addr (p->hw.i2c.addr)
+#define pmic_i2c_tx_num (p->hw.i2c.tx_num)
+
+#define pmic_spi_bitlen (p->hw.spi.bitlen)
+#define pmic_spi_flags (p->hw.spi.flags)
+
+#endif /* __CORE_PMIC_H_ */
diff --git a/include/power/power_chrg.h b/include/power/power_chrg.h
new file mode 100644
index 0000000..db19953
--- /dev/null
+++ b/include/power/power_chrg.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Lukasz Majewski <l.majewski@samsung.com>
+ */
+
+#ifndef __POWER_CHARGER_H_
+#define __POWER_CHARGER_H_
+
+/* Type of available chargers */
+enum {
+ CHARGER_NO = 0,
+ CHARGER_TA,
+ CHARGER_USB,
+ CHARGER_TA_500,
+ CHARGER_UNKNOWN,
+};
+
+enum {
+ UNKNOWN,
+ EXT_SOURCE,
+ CHARGE,
+ NORMAL,
+};
+
+#endif /* __POWER_CHARGER_H_ */
diff --git a/include/power/regulator.h b/include/power/regulator.h
new file mode 100644
index 0000000..6c6e2cd
--- /dev/null
+++ b/include/power/regulator.h
@@ -0,0 +1,465 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2014-2015 Samsung Electronics
+ * Przemyslaw Marczak <p.marczak@samsung.com>
+ */
+
+#ifndef _INCLUDE_REGULATOR_H_
+#define _INCLUDE_REGULATOR_H_
+
+/**
+ * U-Boot Voltage/Current Regulator
+ * ================================
+ *
+ * The regulator API is based on a driver model, with the device tree support.
+ * And this header describes the functions and data types for the uclass id:
+ * 'UCLASS_REGULATOR' and the regulator driver API.
+ *
+ * The regulator uclass - is based on uclass platform data which is allocated,
+ * automatically for each regulator device on bind and 'dev->uclass_platdata'
+ * points to it. The data type is: 'struct dm_regulator_uclass_platdata'.
+ * The uclass file: 'drivers/power/regulator/regulator-uclass.c'
+ *
+ * The regulator device - is based on driver's model 'struct udevice'.
+ * The API can use regulator name in two meanings:
+ * - devname - the regulator device's name: 'dev->name'
+ * - platname - the device's platdata's name. So in the code it looks like:
+ * 'uc_pdata = dev->uclass_platdata'; 'name = uc_pdata->name'.
+ *
+ * The regulator device driver - provide an implementation of uclass operations
+ * pointed by 'dev->driver->ops' as a struct of type 'struct dm_regulator_ops'.
+ *
+ * To proper bind the regulator device, the device tree node should provide
+ * regulator constraints, like in the example below:
+ *
+ * ldo1 {
+ * regulator-name = "VDD_MMC_1.8V"; (must be unique for proper bind)
+ * regulator-min-microvolt = <1000000>; (optional)
+ * regulator-max-microvolt = <1000000>; (optional)
+ * regulator-min-microamp = <1000>; (optional)
+ * regulator-max-microamp = <1000>; (optional)
+ * regulator-always-on; (optional)
+ * regulator-boot-on; (optional)
+ * };
+ *
+ * Note: For the proper operation, at least name constraint is needed, since
+ * it can be used when calling regulator_get_by_platname(). And the mandatory
+ * rule for this name is, that it must be globally unique for the single dts.
+ * If regulator-name property is not provided, node name will be chosen.
+ *
+ * Regulator bind:
+ * For each regulator device, the device_bind() should be called with passed
+ * device tree offset. This is required for this uclass's '.post_bind' method,
+ * which does the scan on the device node, for the 'regulator-name' constraint.
+ * If the parent is not a PMIC device, and the child is not bind by function:
+ * 'pmic_bind_childs()', then it's recommended to bind the device by call to
+ * dm_scan_fdt_dev() - this is usually done automatically for bus devices,
+ * as a post bind method.
+ *
+ * Regulator get:
+ * Having the device's name constraint, we can call regulator_by_platname(),
+ * to find the required regulator. Before return, the regulator is probed,
+ * and the rest of its constraints are put into the device's uclass platform
+ * data, by the uclass regulator '.pre_probe' method.
+ *
+ * For more info about PMIC bind, please refer to file: 'include/power/pmic.h'
+ *
+ * Note:
+ * Please do not use the device_bind_by_name() function, since it pass '-1' as
+ * device node offset - and the bind will fail on uclass .post_bind method,
+ * because of missing 'regulator-name' constraint.
+ *
+ *
+ * Fixed Voltage/Current Regulator
+ * ===============================
+ *
+ * When fixed voltage regulator is needed, then enable the config:
+ * - CONFIG_DM_REGULATOR_FIXED
+ *
+ * The driver file: 'drivers/power/regulator/fixed.c', provides basic support
+ * for control the GPIO, and return the device tree constraint values.
+ *
+ * To bind the fixed voltage regulator device, we usually use a 'simple-bus'
+ * node as a parent. And 'regulator-fixed' for the driver compatible. This is
+ * the same as in the kernel. The example node of fixed regulator:
+ *
+ * simple-bus {
+ * compatible = "simple-bus";
+ * #address-cells = <1>;
+ * #size-cells = <0>;
+ *
+ * blue_led {
+ * compatible = "regulator-fixed";
+ * regulator-name = "VDD_LED_3.3V";
+ * regulator-min-microvolt = <3300000>;
+ * regulator-max-microvolt = <3300000>;
+ * gpio = <&gpc1 0 GPIO_ACTIVE_LOW>;
+ * };
+ * };
+ *
+ * The fixed regulator devices also provide regulator uclass platform data. And
+ * devices bound from such node, can use the regulator drivers API.
+*/
+
+/* enum regulator_type - used for regulator_*() variant calls */
+enum regulator_type {
+ REGULATOR_TYPE_LDO = 0,
+ REGULATOR_TYPE_BUCK,
+ REGULATOR_TYPE_DVS,
+ REGULATOR_TYPE_FIXED,
+ REGULATOR_TYPE_GPIO,
+ REGULATOR_TYPE_OTHER,
+};
+
+/**
+ * struct dm_regulator_mode - this structure holds an information about
+ * each regulator operation mode. Probably in most cases - an array.
+ * This will be probably a driver-static data, since it is device-specific.
+ *
+ * @id - a driver-specific mode id
+ * @register_value - a driver-specific value for its mode id
+ * @name - the name of mode - used for regulator command
+ * Note:
+ * The field 'id', should be always a positive number, since the negative values
+ * are reserved for the errno numbers when returns the mode id.
+ */
+struct dm_regulator_mode {
+ int id; /* Set only as >= 0 (negative value is reserved for errno) */
+ int register_value;
+ const char *name;
+};
+
+enum regulator_flag {
+ REGULATOR_FLAG_AUTOSET_UV = 1 << 0,
+ REGULATOR_FLAG_AUTOSET_UA = 1 << 1,
+};
+
+/**
+ * struct dm_regulator_uclass_platdata - pointed by dev->uclass_platdata, and
+ * allocated on each regulator bind. This structure holds an information
+ * about each regulator's constraints and supported operation modes.
+ * There is no "step" voltage value - so driver should take care of this.
+ *
+ * @type - one of 'enum regulator_type'
+ * @mode - pointer to the regulator mode (array if more than one)
+ * @mode_count - number of '.mode' entries
+ * @min_uV* - minimum voltage (micro Volts)
+ * @max_uV* - maximum voltage (micro Volts)
+ * @min_uA* - minimum amperage (micro Amps)
+ * @max_uA* - maximum amperage (micro Amps)
+ * @always_on* - bool type, true or false
+ * @boot_on* - bool type, true or false
+ * TODO(sjg@chromium.org): Consider putting the above two into @flags
+ * @ramp_delay - Time to settle down after voltage change (unit: uV/us)
+ * @flags: - flags value (see REGULATOR_FLAG_...)
+ * @name** - fdt regulator name - should be taken from the device tree
+ * ctrl_reg: - Control register offset used to enable/disable regulator
+ * volt_reg: - register offset for writing voltage vsel values
+ *
+ * Note:
+ * * - set automatically on device probe by the uclass's '.pre_probe' method.
+ * ** - set automatically on device bind by the uclass's '.post_bind' method.
+ * The constraints: type, mode, mode_count, can be set by device driver, e.g.
+ * by the driver '.probe' method.
+ */
+struct dm_regulator_uclass_platdata {
+ enum regulator_type type;
+ struct dm_regulator_mode *mode;
+ int mode_count;
+ int min_uV;
+ int max_uV;
+ int min_uA;
+ int max_uA;
+ unsigned int ramp_delay;
+ bool always_on;
+ bool boot_on;
+ const char *name;
+ int flags;
+ u8 ctrl_reg;
+ u8 volt_reg;
+};
+
+/* Regulator device operations */
+struct dm_regulator_ops {
+ /**
+ * The regulator output value function calls operates on a micro Volts.
+ *
+ * get/set_value - get/set output value of the given output number
+ * @dev - regulator device
+ * Sets:
+ * @uV - set the output value [micro Volts]
+ * @return output value [uV] on success or negative errno if fail.
+ */
+ int (*get_value)(struct udevice *dev);
+ int (*set_value)(struct udevice *dev, int uV);
+
+ /**
+ * The regulator output current function calls operates on a micro Amps.
+ *
+ * get/set_current - get/set output current of the given output number
+ * @dev - regulator device
+ * Sets:
+ * @uA - set the output current [micro Amps]
+ * @return output value [uA] on success or negative errno if fail.
+ */
+ int (*get_current)(struct udevice *dev);
+ int (*set_current)(struct udevice *dev, int uA);
+
+ /**
+ * The most basic feature of the regulator output is its enable state.
+ *
+ * get/set_enable - get/set enable state of the given output number
+ * @dev - regulator device
+ * Sets:
+ * @enable - set true - enable or false - disable
+ * @return true/false for get or -errno if fail; 0 / -errno for set.
+ */
+ int (*get_enable)(struct udevice *dev);
+ int (*set_enable)(struct udevice *dev, bool enable);
+
+ /**
+ * The 'get/set_mode()' function calls should operate on a driver-
+ * specific mode id definitions, which should be found in:
+ * field 'id' of struct dm_regulator_mode.
+ *
+ * get/set_mode - get/set operation mode of the given output number
+ * @dev - regulator device
+ * Sets
+ * @mode_id - set output mode id (struct dm_regulator_mode->id)
+ * @return id/0 for get/set on success or negative errno if fail.
+ * Note:
+ * The field 'id' of struct type 'dm_regulator_mode', should be always
+ * a positive number, since the negative is reserved for the error.
+ */
+ int (*get_mode)(struct udevice *dev);
+ int (*set_mode)(struct udevice *dev, int mode_id);
+};
+
+/**
+ * regulator_mode: returns a pointer to the array of regulator mode info
+ *
+ * @dev - pointer to the regulator device
+ * @modep - pointer to the returned mode info array
+ * @return - count of modep entries on success or negative errno if fail.
+ */
+int regulator_mode(struct udevice *dev, struct dm_regulator_mode **modep);
+
+/**
+ * regulator_get_value: get microvoltage voltage value of a given regulator
+ *
+ * @dev - pointer to the regulator device
+ * @return - positive output value [uV] on success or negative errno if fail.
+ */
+int regulator_get_value(struct udevice *dev);
+
+/**
+ * regulator_set_value: set the microvoltage value of a given regulator.
+ *
+ * @dev - pointer to the regulator device
+ * @uV - the output value to set [micro Volts]
+ * @return - 0 on success or -errno val if fails
+ */
+int regulator_set_value(struct udevice *dev, int uV);
+
+/**
+ * regulator_set_value_force: set the microvoltage value of a given regulator
+ * without any min-,max condition check
+ *
+ * @dev - pointer to the regulator device
+ * @uV - the output value to set [micro Volts]
+ * @return - 0 on success or -errno val if fails
+ */
+int regulator_set_value_force(struct udevice *dev, int uV);
+
+/**
+ * regulator_get_current: get microampere value of a given regulator
+ *
+ * @dev - pointer to the regulator device
+ * @return - positive output current [uA] on success or negative errno if fail.
+ */
+int regulator_get_current(struct udevice *dev);
+
+/**
+ * regulator_set_current: set the microampere value of a given regulator.
+ *
+ * @dev - pointer to the regulator device
+ * @uA - set the output current [micro Amps]
+ * @return - 0 on success or -errno val if fails
+ */
+int regulator_set_current(struct udevice *dev, int uA);
+
+/**
+ * regulator_get_enable: get regulator device enable state.
+ *
+ * @dev - pointer to the regulator device
+ * @return - true/false of enable state or -errno val if fails
+ */
+int regulator_get_enable(struct udevice *dev);
+
+/**
+ * regulator_set_enable: set regulator enable state
+ *
+ * @dev - pointer to the regulator device
+ * @enable - set true or false
+ * @return - 0 on success or -errno val if fails
+ */
+int regulator_set_enable(struct udevice *dev, bool enable);
+
+/**
+ * regulator_set_enable_if_allowed: set regulator enable state if allowed by
+ * regulator
+ *
+ * @dev - pointer to the regulator device
+ * @enable - set true or false
+ * @return - 0 on success or if enabling is not supported
+ * -errno val if fails.
+ */
+int regulator_set_enable_if_allowed(struct udevice *dev, bool enable);
+
+/**
+ * regulator_get_mode: get active operation mode id of a given regulator
+ *
+ * @dev - pointer to the regulator device
+ * @return - positive mode 'id' number on success or -errno val if fails
+ * Note:
+ * The device can provide an array of operating modes, which is type of struct
+ * dm_regulator_mode. Each mode has it's own 'id', which should be unique inside
+ * that array. By calling this function, the driver should return an active mode
+ * id of the given regulator device.
+ */
+int regulator_get_mode(struct udevice *dev);
+
+/**
+ * regulator_set_mode: set the given regulator's, active mode id
+ *
+ * @dev - pointer to the regulator device
+ * @mode_id - mode id to set ('id' field of struct type dm_regulator_mode)
+ * @return - 0 on success or -errno value if fails
+ * Note:
+ * The device can provide an array of operating modes, which is type of struct
+ * dm_regulator_mode. Each mode has it's own 'id', which should be unique inside
+ * that array. By calling this function, the driver should set the active mode
+ * of a given regulator to given by "mode_id" argument.
+ */
+int regulator_set_mode(struct udevice *dev, int mode_id);
+
+/**
+ * regulators_enable_boot_on() - enable regulators needed for boot
+ *
+ * This enables all regulators which are marked to be on at boot time. This
+ * only works for regulators which don't have a range for voltage/current,
+ * since in that case it is not possible to know which value to use.
+ *
+ * This effectively calls regulator_autoset() for every regulator.
+ */
+int regulators_enable_boot_on(bool verbose);
+
+/**
+ * regulator_autoset: setup the voltage/current on a regulator
+ *
+ * The setup depends on constraints found in device's uclass's platform data
+ * (struct dm_regulator_uclass_platdata):
+ *
+ * - Enable - will set - if any of: 'always_on' or 'boot_on' is set to true,
+ * or if both are unset, then the function returns
+ * - Voltage value - will set - if '.min_uV' and '.max_uV' values are equal
+ * - Current limit - will set - if '.min_uA' and '.max_uA' values are equal
+ *
+ * The function returns on the first-encountered error.
+ *
+ * @platname - expected string for dm_regulator_uclass_platdata .name field
+ * @devp - returned pointer to the regulator device - if non-NULL passed
+ * @return: 0 on success or negative value of errno.
+ */
+int regulator_autoset(struct udevice *dev);
+
+/**
+ * regulator_autoset_by_name: setup the regulator given by its uclass's
+ * platform data name field. The setup depends on constraints found in device's
+ * uclass's platform data (struct dm_regulator_uclass_platdata):
+ * - Enable - will set - if any of: 'always_on' or 'boot_on' is set to true,
+ * or if both are unset, then the function returns
+ * - Voltage value - will set - if '.min_uV' and '.max_uV' values are equal
+ * - Current limit - will set - if '.min_uA' and '.max_uA' values are equal
+ *
+ * The function returns on first encountered error.
+ *
+ * @platname - expected string for dm_regulator_uclass_platdata .name field
+ * @devp - returned pointer to the regulator device - if non-NULL passed
+ * @return: 0 on success or negative value of errno.
+ *
+ * The returned 'regulator' device can be used with:
+ * - regulator_get/set_*
+ */
+int regulator_autoset_by_name(const char *platname, struct udevice **devp);
+
+/**
+ * regulator_list_autoset: setup the regulators given by list of their uclass's
+ * platform data name field. The setup depends on constraints found in device's
+ * uclass's platform data. The function loops with calls to:
+ * regulator_autoset_by_name() for each name from the list.
+ *
+ * @list_platname - an array of expected strings for .name field of each
+ * regulator's uclass platdata
+ * @list_devp - an array of returned pointers to the successfully setup
+ * regulator devices if non-NULL passed
+ * @verbose - (true/false) print each regulator setup info, or be quiet
+ * @return 0 on successfully setup of all list entries, otherwise first error.
+ *
+ * The returned 'regulator' devices can be used with:
+ * - regulator_get/set_*
+ *
+ * Note: The list must ends with NULL entry, like in the "platname" list below:
+ * char *my_regulators[] = {
+ * "VCC_3.3V",
+ * "VCC_1.8V",
+ * NULL,
+ * };
+ */
+int regulator_list_autoset(const char *list_platname[],
+ struct udevice *list_devp[],
+ bool verbose);
+
+/**
+ * regulator_get_by_devname: returns the pointer to the pmic regulator device.
+ * Search by name, found in regulator device's name.
+ *
+ * @devname - expected string for 'dev->name' of regulator device
+ * @devp - returned pointer to the regulator device
+ * @return 0 on success or negative value of errno.
+ *
+ * The returned 'regulator' device is probed and can be used with:
+ * - regulator_get/set_*
+ */
+int regulator_get_by_devname(const char *devname, struct udevice **devp);
+
+/**
+ * regulator_get_by_platname: returns the pointer to the pmic regulator device.
+ * Search by name, found in regulator uclass platdata.
+ *
+ * @platname - expected string for uc_pdata->name of regulator uclass platdata
+ * @devp - returns pointer to the regulator device or NULL on error
+ * @return 0 on success or negative value of errno.
+ *
+ * The returned 'regulator' device is probed and can be used with:
+ * - regulator_get/set_*
+ */
+int regulator_get_by_platname(const char *platname, struct udevice **devp);
+
+/**
+ * device_get_supply_regulator: returns the pointer to the supply regulator.
+ * Search by phandle, found in device's node.
+ *
+ * Note: Please pay attention to proper order of device bind sequence.
+ * The regulator device searched by the phandle, must be binded before
+ * this function call.
+ *
+ * @dev - device with supply phandle
+ * @supply_name - phandle name of regulator
+ * @devp - returned pointer to the supply device
+ * @return 0 on success or negative value of errno.
+ */
+int device_get_supply_regulator(struct udevice *dev, const char *supply_name,
+ struct udevice **devp);
+
+#endif /* _INCLUDE_REGULATOR_H_ */
diff --git a/include/power/rk8xx_pmic.h b/include/power/rk8xx_pmic.h
new file mode 100644
index 0000000..c06248f
--- /dev/null
+++ b/include/power/rk8xx_pmic.h
@@ -0,0 +1,194 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2015 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+
+#ifndef _PMIC_RK8XX_H_
+#define _PMIC_RK8XX_H_
+
+enum {
+ REG_SECONDS = 0x00,
+ REG_MINUTES,
+ REG_HOURS,
+ REG_DAYS,
+ REG_MONTHS,
+ REG_YEARS,
+ REG_WEEKS,
+ REG_ALARM_SECONDS,
+ REG_ALARM_MINUTES,
+ REG_ALARM_HOURS,
+ REG_ALARM_DAYS,
+ REG_ALARM_MONTHS,
+ REG_ALARM_YEARS,
+
+ REG_RTC_CTRL = 0x10,
+ REG_RTC_STATUS,
+ REG_RTC_INT,
+ REG_RTC_COMP_LSB,
+ REG_RTC_COMP_MSB,
+
+ ID_MSB = 0x17,
+ ID_LSB,
+
+ REG_CLK32OUT = 0x20,
+ REG_VB_MON,
+ REG_THERMAL,
+ REG_DCDC_EN,
+ REG_LDO_EN,
+ REG_SLEEP_SET_OFF1,
+ REG_SLEEP_SET_OFF2,
+ REG_DCDC_UV_STS,
+ REG_DCDC_UV_ACT,
+ REG_LDO_UV_STS,
+ REG_LDO_UV_ACT,
+ REG_DCDC_PG,
+ REG_LDO_PG,
+ REG_VOUT_MON_TDB,
+ REG_BUCK1_CONFIG,
+ REG_BUCK1_ON_VSEL,
+ REG_BUCK1_SLP_VSEL,
+ REG_BUCK1_DVS_VSEL,
+ REG_BUCK2_CONFIG,
+ REG_BUCK2_ON_VSEL,
+ REG_BUCK2_SLP_VSEL,
+ REG_BUCK2_DVS_VSEL,
+ REG_BUCK3_CONFIG,
+ REG_BUCK4_CONFIG,
+ REG_BUCK4_ON_VSEL,
+ REG_BUCK4_SLP_VSEL,
+ REG_BOOST_CONFIG_REG,
+ REG_LDO1_ON_VSEL,
+ REG_LDO1_SLP_VSEL,
+ REG_LDO2_ON_VSEL,
+ REG_LDO2_SLP_VSEL,
+ REG_LDO3_ON_VSEL,
+ REG_LDO3_SLP_VSEL,
+ REG_LDO4_ON_VSEL,
+ REG_LDO4_SLP_VSEL,
+ REG_LDO5_ON_VSEL,
+ REG_LDO5_SLP_VSEL,
+ REG_LDO6_ON_VSEL,
+ REG_LDO6_SLP_VSEL,
+ REG_LDO7_ON_VSEL,
+ REG_LDO7_SLP_VSEL,
+ REG_LDO8_ON_VSEL,
+ REG_LDO8_SLP_VSEL,
+ REG_DEVCTRL,
+ REG_INT_STS1,
+ REG_INT_STS_MSK1,
+ REG_INT_STS2,
+ REG_INT_STS_MSK2,
+ REG_IO_POL,
+ REG_OTP_VDD_EN,
+ REG_H5V_EN,
+ REG_SLEEP_SET_OFF,
+ REG_BOOST_LDO9_ON_VSEL,
+ REG_BOOST_LDO9_SLP_VSEL,
+ REG_BOOST_CTRL,
+
+ /* Not sure what this does */
+ REG_DCDC_ILMAX = 0x90,
+ REG_CHRG_COMP = 0x9a,
+ REG_SUP_STS = 0xa0,
+ REG_USB_CTRL,
+ REG1_CHRG_CTRL,
+ REG2_CHRG_CTRL,
+ REG3_CHRG_CTRL,
+ REG_BAT_CTRL,
+ REG_BAT_HTS_TS1,
+ REG_BAT_LTS_TS1,
+ REG_BAT_HTS_TS2,
+ REG_BAT_LTS_TS2,
+ REG_TS_CTRL,
+ REG_ADC_CTRL,
+ REG_ON_SOURCE,
+ REG_OFF_SOURCE,
+ REG_GGCON,
+ REG_GGSTS,
+ REG_FRAME_SMP_INTERV,
+ REG_AUTO_SLP_CUR_THR,
+ REG3_GASCNT_CAL,
+ REG2_GASCNT_CAL,
+ REG1_GASCNT_CAL,
+ REG0_GASCNT_CAL,
+ REG3_GASCNT,
+ REG2_GASCNT,
+ REG1_GASCNT,
+ REG0_GASCNT,
+ REGH_BAT_CUR_AVG,
+ REGL_BAT_CUR_AVG,
+ REGH_TS1_ADC,
+ REGL_TS1_ADC,
+ REGH_TS2_ADC,
+ REGL_TS2_ADC,
+ REGH_BAT_OCV,
+ REGL_BAT_OCV,
+ REGH_BAT_VOL,
+ REGL_BAT_VOL,
+ REGH_RELAX_ENTRY_THRES,
+ REGL_RELAX_ENTRY_THRES,
+ REGH_RELAX_EXIT_THRES,
+ REGL_RELAX_EXIT_THRES,
+ REGH_RELAX_VOL1,
+ REGL_RELAX_VOL1,
+ REGH_RELAX_VOL2,
+ REGL_RELAX_VOL2,
+ REGH_BAT_CUR_R_CALC,
+ REGL_BAT_CUR_R_CALC,
+ REGH_BAT_VOL_R_CALC,
+ REGL_BAT_VOL_R_CALC,
+ REGH_CAL_OFFSET,
+ REGL_CAL_OFFSET,
+ REG_NON_ACT_TIMER_CNT,
+ REGH_VCALIB0,
+ REGL_VCALIB0,
+ REGH_VCALIB1,
+ REGL_VCALIB1,
+ REGH_IOFFSET,
+ REGL_IOFFSET,
+ REG_SOC,
+ REG3_REMAIN_CAP,
+ REG2_REMAIN_CAP,
+ REG1_REMAIN_CAP,
+ REG0_REMAIN_CAP,
+ REG_UPDAT_LEVE,
+ REG3_NEW_FCC,
+ REG2_NEW_FCC,
+ REG1_NEW_FCC,
+ REG0_NEW_FCC,
+ REG_NON_ACT_TIMER_CNT_SAVE,
+ REG_OCV_VOL_VALID,
+ REG_REBOOT_CNT,
+ REG_POFFSET,
+ REG_MISC_MARK,
+ REG_HALT_CNT,
+ REGH_CALC_REST,
+ REGL_CALC_REST,
+ SAVE_DATA19,
+ RK808_NUM_OF_REGS,
+};
+
+enum {
+ RK805_ID = 0x8050,
+ RK808_ID = 0x0000,
+ RK818_ID = 0x8180,
+};
+
+#define RK8XX_ID_MSK 0xfff0
+
+struct rk8xx_reg_table {
+ char *name;
+ u8 reg_ctl;
+ u8 reg_vol;
+};
+
+struct rk8xx_priv {
+ int variant;
+};
+
+int rk8xx_spl_configure_buck(struct udevice *pmic, int buck, int uvolt);
+int rk818_spl_configure_usb_input_current(struct udevice *pmic, int current_ma);
+int rk818_spl_configure_usb_chrg_shutdown(struct udevice *pmic, int uvolt);
+
+#endif
diff --git a/include/power/rn5t567_pmic.h b/include/power/rn5t567_pmic.h
new file mode 100644
index 0000000..93bc7cb
--- /dev/null
+++ b/include/power/rn5t567_pmic.h
@@ -0,0 +1,112 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2016 Toradex AG
+ * Stefan Agner <stefan.agner@toradex.com>
+ */
+#ifndef __RN5T567_PMIC_H_
+#define __RN5T567_PMIC_H_
+
+/* RN5T567 registers */
+enum {
+ RN5T567_LSIVER = 0x00,
+ RN5T567_OTPVER = 0x01,
+ RN5T567_IODAC = 0x02,
+ RN5T567_VINDAC = 0x03,
+ RN5T567_OUT32KEN = 0x05,
+
+ RN5T567_CPUCNT = 0x06,
+
+ RN5T567_PSWR = 0x07,
+ RN5T567_PONHIS = 0x09,
+ RN5T567_POFFHIS = 0x0A,
+ RN5T567_WATCHDOG = 0x0B,
+ RN5T567_WATCHDOGCNT = 0x0C,
+ RN5T567_PWRFUNC = 0x0D,
+ RN5T567_SLPCNT = 0x0E,
+ RN5T567_REPCNT = 0x0F,
+ RN5T567_PWRONTIMSET = 0x10,
+ RN5T567_NOETIMSETCNT = 0x11,
+ RN5T567_PWRIREN = 0x12,
+ RN5T567_PWRIRQ = 0x13,
+ RN5T567_PWRMON = 0x14,
+ RN5T567_PWRIRSEL = 0x15,
+
+ RN5T567_DC1_SLOT = 0x16,
+ RN5T567_DC2_SLOT = 0x17,
+ RN5T567_DC3_SLOT = 0x18,
+ RN5T567_DC4_SLOT = 0x19,
+
+ RN5T567_LDO1_SLOT = 0x1B,
+ RN5T567_LDO2_SLOT = 0x1C,
+ RN5T567_LDO3_SLOT = 0x1D,
+ RN5T567_LDO4_SLOT = 0x1E,
+ RN5T567_LDO5_SLOT = 0x1F,
+
+ RN5T567_PSO0_SLOT = 0x25,
+ RN5T567_PSO1_SLOT = 0x26,
+ RN5T567_PSO2_SLOT = 0x27,
+ RN5T567_PSO3_SLOT = 0x28,
+
+ RN5T567_LDORTC1_SLOT = 0x2A,
+
+ RN5T567_DC1CTL = 0x2C,
+ RN5T567_DC1CTL2 = 0x2D,
+ RN5T567_DC2CTL = 0x2E,
+ RN5T567_DC2CTL2 = 0x2F,
+ RN5T567_DC3CTL = 0x30,
+ RN5T567_DC3CTL2 = 0x31,
+ RN5T567_DC4CTL = 0x32,
+ RN5T567_DC4CTL2 = 0x33,
+
+ RN5T567_DC1DAC = 0x36,
+ RN5T567_DC2DAC = 0x37,
+ RN5T567_DC3DAC = 0x38,
+ RN5T567_DC4DAC = 0x39,
+
+ RN5T567_DC1DAC_SLP = 0x3B,
+ RN5T567_DC2DAC_SLP = 0x3C,
+ RN5T567_DC3DAC_SLP = 0x3D,
+ RN5T567_DC4DAC_SLP = 0x3E,
+
+ RN5T567_DCIREN = 0x40,
+ RN5T567_DCIRQ = 0x41,
+ RN5T567_DCIRMON = 0x42,
+
+ RN5T567_LDOEN1 = 0x44,
+ RN5T567_LDOEN2 = 0x45,
+ RN5T567_LDODIS1 = 0x46,
+
+ RN5T567_LDO1DAC = 0x4C,
+ RN5T567_LDO2DAC = 0x4D,
+ RN5T567_LDO3DAC = 0x4E,
+ RN5T567_LDO4DAC = 0x4F,
+ RN5T567_LDO5DAC = 0x50,
+
+ RN5T567_LDORTC1DAC = 0x56,
+ RN5T567_LDORTC2DAC = 0x57,
+
+ RN5T567_LDO1DAC_SLP = 0x58,
+ RN5T567_LDO2DAC_SLP = 0x59,
+ RN5T567_LDO3DAC_SLP = 0x5A,
+ RN5T567_LDO4DAC_SLP = 0x5B,
+ RN5T567_LDO5DAC_SLP = 0x5C,
+
+ RN5T567_IOSEL = 0x90,
+ RN5T567_IOOUT = 0x91,
+ RN5T567_GPEDGE1 = 0x92,
+ RN5T567_EN_GPIR = 0x94,
+ RN5T567_IR_GPR = 0x95,
+ RN5T567_IR_GPF = 0x96,
+ RN5T567_MON_IOIN = 0x97,
+ RN5T567_GPLED_FUNC = 0x98,
+ RN5T567_INTPOL = 0x9C,
+ RN5T567_INTEN = 0x9D,
+ RN5T567_INTMON = 0x9E,
+
+ RN5T567_PREVINDAC = 0xB0,
+ RN5T567_OVTEMP = 0xBC,
+
+ RN5T567_NUM_OF_REGS = 0xBF,
+};
+
+#endif
diff --git a/include/power/s2mps11.h b/include/power/s2mps11.h
new file mode 100644
index 0000000..22b38ff
--- /dev/null
+++ b/include/power/s2mps11.h
@@ -0,0 +1,164 @@
+#ifndef __S2MPS11__H__
+#define __S2MPS11__H__
+
+enum s2mps11_reg {
+ S2MPS11_REG_ID = 0,
+ S2MPS11_REG_INT1,
+ S2MPS11_REG_INT2,
+ S2MPS11_REG_INT3,
+ S2MPS11_REG_INT1M,
+ S2MPS11_REG_INT2M,
+ S2MPS11_REG_INT3M,
+ S2MPS11_REG_STATUS1,
+ S2MPS11_REG_STATUS2,
+ S2MPS11_REG_OFFSRC,
+ S2MPS11_REG_PWRONSRC,
+ S2MPS11_REG_RTC_CTRL,
+ S2MPS11_REG_CTRL1,
+ S2MPS11_REG_ETC_TEST,
+ S2MPS11_REG_RSVD3,
+ S2MPS11_REG_BU_CHG,
+ S2MPS11_REG_RAMP,
+ S2MPS11_REG_RAMP_BUCK,
+ S2MPS11_REG_LDO1_8,
+ S2MPS11_REG_LDO9_16,
+ S2MPS11_REG_LDO17_24,
+ S2MPS11_REG_LDO25_32,
+ S2MPS11_REG_LDO33_38,
+ S2MPS11_REG_LDO1_8_OVC,
+ S2MPS11_REG_LDO9_16_OVC,
+ S2MPS11_REG_LDO17_24_OVC,
+ S2MPS11_REG_LDO25_32_OVC,
+ S2MPS11_REG_LDO33_38_OVC,
+ S2MPS11_REG_RESERVED1,
+ S2MPS11_REG_RESERVED2,
+ S2MPS11_REG_RESERVED3,
+ S2MPS11_REG_RESERVED4,
+ S2MPS11_REG_RESERVED5,
+ S2MPS11_REG_RESERVED6,
+ S2MPS11_REG_RESERVED7,
+ S2MPS11_REG_RESERVED8,
+ S2MPS11_REG_WDRSTEN_CTRL,
+ S2MPS11_REG_B1CTRL1,
+ S2MPS11_REG_B1CTRL2,
+ S2MPS11_REG_B2CTRL1,
+ S2MPS11_REG_B2CTRL2,
+ S2MPS11_REG_B3CTRL1,
+ S2MPS11_REG_B3CTRL2,
+ S2MPS11_REG_B4CTRL1,
+ S2MPS11_REG_B4CTRL2,
+ S2MPS11_REG_B5CTRL1,
+ S2MPS11_REG_BUCK5_SW,
+ S2MPS11_REG_B5CTRL2,
+ S2MPS11_REG_B5CTRL3,
+ S2MPS11_REG_B5CTRL4,
+ S2MPS11_REG_B5CTRL5,
+ S2MPS11_REG_B6CTRL1,
+ S2MPS11_REG_B6CTRL2,
+ S2MPS11_REG_B7CTRL1,
+ S2MPS11_REG_B7CTRL2,
+ S2MPS11_REG_B8CTRL1,
+ S2MPS11_REG_B8CTRL2,
+ S2MPS11_REG_B9CTRL1,
+ S2MPS11_REG_B9CTRL2,
+ S2MPS11_REG_B10CTRL1,
+ S2MPS11_REG_B10CTRL2,
+ S2MPS11_REG_L1CTRL,
+ S2MPS11_REG_L2CTRL,
+ S2MPS11_REG_L3CTRL,
+ S2MPS11_REG_L4CTRL,
+ S2MPS11_REG_L5CTRL,
+ S2MPS11_REG_L6CTRL,
+ S2MPS11_REG_L7CTRL,
+ S2MPS11_REG_L8CTRL,
+ S2MPS11_REG_L9CTRL,
+ S2MPS11_REG_L10CTRL,
+ S2MPS11_REG_L11CTRL,
+ S2MPS11_REG_L12CTRL,
+ S2MPS11_REG_L13CTRL,
+ S2MPS11_REG_L14CTRL,
+ S2MPS11_REG_L15CTRL,
+ S2MPS11_REG_L16CTRL,
+ S2MPS11_REG_L17CTRL,
+ S2MPS11_REG_L18CTRL,
+ S2MPS11_REG_L19CTRL,
+ S2MPS11_REG_L20CTRL,
+ S2MPS11_REG_L21CTRL,
+ S2MPS11_REG_L22CTRL,
+ S2MPS11_REG_L23CTRL,
+ S2MPS11_REG_L24CTRL,
+ S2MPS11_REG_L25CTRL,
+ S2MPS11_REG_L26CTRL,
+ S2MPS11_REG_L27CTRL,
+ S2MPS11_REG_L28CTRL,
+ S2MPS11_REG_L29CTRL,
+ S2MPS11_REG_L30CTRL,
+ S2MPS11_REG_L31CTRL,
+ S2MPS11_REG_L32CTRL,
+ S2MPS11_REG_L33CTRL,
+ S2MPS11_REG_L34CTRL,
+ S2MPS11_REG_L35CTRL,
+ S2MPS11_REG_L36CTRL,
+ S2MPS11_REG_L37CTRL,
+ S2MPS11_REG_L38CTRL,
+ S2MPS11_REG_COUNT,
+};
+
+#define S2MPS11_LDO26_ENABLE 0xec
+
+#define S2MPS11_LDO_NUM 26
+#define S2MPS11_BUCK_NUM 10
+
+/* Driver name */
+#define S2MPS11_BUCK_DRIVER "s2mps11_buck"
+#define S2MPS11_OF_BUCK_PREFIX "BUCK"
+#define S2MPS11_LDO_DRIVER "s2mps11_ldo"
+#define S2MPS11_OF_LDO_PREFIX "LDO"
+
+/* BUCK */
+#define S2MPS11_BUCK_VOLT_MASK 0xff
+#define S2MPS11_BUCK9_VOLT_MASK 0x1f
+
+#define S2MPS11_BUCK_LSTEP 6250
+#define S2MPS11_BUCK_HSTEP 12500
+#define S2MPS11_BUCK9_STEP 25000
+
+#define S2MPS11_BUCK_UV_MIN 600000
+#define S2MPS11_BUCK_UV_HMIN 750000
+#define S2MPS11_BUCK9_UV_MIN 1400000
+
+#define S2MPS11_BUCK_VOLT_MAX_HEX 0xA0
+#define S2MPS11_BUCK5_VOLT_MAX_HEX 0xDF
+#define S2MPS11_BUCK7_8_10_VOLT_MAX_HEX 0xDC
+#define S2MPS11_BUCK9_VOLT_MAX_HEX 0x5F
+
+#define S2MPS11_BUCK_MODE_SHIFT 6
+#define S2MPS11_BUCK_MODE_MASK (0x3)
+#define S2MPS11_BUCK_MODE_OFF (0x0 << 6)
+#define S2MPS11_BUCK_MODE_STANDBY (0x1 << 6)
+#define S2MPS11_BUCK_MODE_ON (0x3 << 6)
+
+/* LDO */
+#define S2MPS11_LDO_VOLT_MASK 0x3F
+#define S2MPS11_LDO_VOLT_MAX_HEX 0x3F
+
+#define S2MPS11_LDO_STEP 25000
+#define S2MPS11_LDO_UV_MIN 800000
+
+#define S2MPS11_LDO_MODE_MASK 0x3
+#define S2MPS11_LDO_MODE_SHIFT 6
+
+#define S2MPS11_LDO_MODE_OFF (0x0 << 6)
+#define S2MPS11_LDO_MODE_STANDBY (0x1 << 6)
+#define S2MPS11_LDO_MODE_STANDBY_LPM (0x2 << 6)
+#define S2MPS11_LDO_MODE_ON (0x3 << 6)
+
+enum {
+ OP_OFF = 0,
+ OP_LPM,
+ OP_STANDBY,
+ OP_STANDBY_LPM,
+ OP_ON,
+};
+
+#endif
diff --git a/include/power/s5m8767.h b/include/power/s5m8767.h
new file mode 100644
index 0000000..f75ed5d
--- /dev/null
+++ b/include/power/s5m8767.h
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2015 Google, Inc
+ */
+
+#ifndef __S5M8767_H_
+#define __S5M8767_H_
+
+enum s5m8767_regnum {
+ S5M8767_BUCK1 = 0,
+ S5M8767_BUCK2,
+ S5M8767_BUCK3,
+ S5M8767_BUCK4,
+ S5M8767_BUCK5,
+ S5M8767_BUCK6,
+ S5M8767_BUCK7,
+ S5M8767_BUCK8,
+ S5M8767_BUCK9,
+ S5M8767_LDO1,
+ S5M8767_LDO2,
+ S5M8767_LDO3,
+ S5M8767_LDO4,
+ S5M8767_LDO5,
+ S5M8767_LDO6,
+ S5M8767_LDO7,
+ S5M8767_LDO8,
+ S5M8767_LDO9,
+ S5M8767_LDO10,
+ S5M8767_LDO11,
+ S5M8767_LDO12,
+ S5M8767_LDO13,
+ S5M8767_LDO14,
+ S5M8767_LDO15,
+ S5M8767_LDO16,
+ S5M8767_LDO17,
+ S5M8767_LDO18,
+ S5M8767_LDO19,
+ S5M8767_LDO20,
+ S5M8767_LDO21,
+ S5M8767_LDO22,
+ S5M8767_LDO23,
+ S5M8767_LDO24,
+ S5M8767_LDO25,
+ S5M8767_LDO26,
+ S5M8767_LDO27,
+ S5M8767_LDO28,
+ S5M8767_EN32KHZ_CP,
+
+ S5M8767_NUM_OF_REGS,
+};
+
+struct sec_voltage_desc {
+ int max;
+ int min;
+ int step;
+};
+
+/**
+ * struct s5m8767_para - s5m8767 register parameters
+ * @param vol_addr i2c address of the given buck/ldo register
+ * @param vol_bitpos bit position to be set or clear within register
+ * @param vol_bitmask bit mask value
+ * @param reg_enaddr control register address, which enable the given
+ * given buck/ldo.
+ * @param reg_enbiton value to be written to buck/ldo to make it ON
+ * @param vol Voltage information
+ */
+struct s5m8767_para {
+ enum s5m8767_regnum regnum;
+ u8 vol_addr;
+ u8 vol_bitpos;
+ u8 vol_bitmask;
+ u8 reg_enaddr;
+ u8 reg_enbiton;
+ const struct sec_voltage_desc *vol;
+};
+
+/* Drivers name */
+#define S5M8767_LDO_DRIVER "s5m8767_ldo"
+#define S5M8767_BUCK_DRIVER "s5m8767_buck"
+
+int s5m8767_enable_32khz_cp(struct udevice *dev);
+
+#endif /* __S5M8767_PMIC_H_ */
diff --git a/include/power/sandbox_pmic.h b/include/power/sandbox_pmic.h
new file mode 100644
index 0000000..1dbd15b
--- /dev/null
+++ b/include/power/sandbox_pmic.h
@@ -0,0 +1,144 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2015 Samsung Electronics
+ * Przemyslaw Marczak <p.marczak@samsung.com>
+ */
+
+#ifndef _SANDBOX_PMIC_H_
+#define _SANDBOX_PMIC_H_
+
+#define SANDBOX_LDO_DRIVER "sandbox_ldo"
+#define SANDBOX_OF_LDO_PREFIX "ldo"
+#define SANDBOX_BUCK_DRIVER "sandbox_buck"
+#define SANDBOX_OF_BUCK_PREFIX "buck"
+
+#define SANDBOX_BUCK_COUNT 3
+#define SANDBOX_LDO_COUNT 2
+/*
+ * Sandbox PMIC registers:
+ * We have only 12 significant registers, but we alloc 16 for padding.
+ */
+enum {
+ SANDBOX_PMIC_REG_BUCK1_UV = 0,
+ SANDBOX_PMIC_REG_BUCK1_UA,
+ SANDBOX_PMIC_REG_BUCK1_OM,
+
+ SANDBOX_PMIC_REG_BUCK2_UV,
+ SANDBOX_PMIC_REG_BUCK2_UA,
+ SANDBOX_PMIC_REG_BUCK2_OM,
+
+ SANDBOX_PMIC_REG_LDO_OFFSET,
+ SANDBOX_PMIC_REG_LDO1_UV = SANDBOX_PMIC_REG_LDO_OFFSET,
+ SANDBOX_PMIC_REG_LDO1_UA,
+ SANDBOX_PMIC_REG_LDO1_OM,
+
+ SANDBOX_PMIC_REG_LDO2_UV,
+ SANDBOX_PMIC_REG_LDO2_UA,
+ SANDBOX_PMIC_REG_LDO2_OM,
+
+ SANDBOX_PMIC_REG_COUNT = 16,
+};
+
+/* Register offset for output: micro Volts, micro Amps, Operation Mode */
+enum {
+ OUT_REG_UV = 0,
+ OUT_REG_UA,
+ OUT_REG_OM,
+ OUT_REG_COUNT,
+};
+
+/* Buck operation modes */
+enum {
+ BUCK_OM_OFF = 0,
+ BUCK_OM_ON,
+ BUCK_OM_PWM,
+ BUCK_OM_COUNT,
+};
+
+/* Ldo operation modes */
+enum {
+ LDO_OM_OFF = 0,
+ LDO_OM_ON,
+ LDO_OM_SLEEP,
+ LDO_OM_STANDBY,
+ LDO_OM_COUNT,
+};
+
+/* BUCK1 Voltage: min: 0.8V, step: 25mV, max 2.4V */
+#define OUT_BUCK1_UV_MIN 800000
+#define OUT_BUCK1_UV_MAX 2400000
+#define OUT_BUCK1_UV_STEP 25000
+
+/* BUCK1 Amperage: min: 150mA, step: 25mA, max: 250mA */
+#define OUT_BUCK1_UA_MIN 150000
+#define OUT_BUCK1_UA_MAX 250000
+#define OUT_BUCK1_UA_STEP 25000
+
+/* BUCK2 Voltage: min: 0.75V, step: 50mV, max 3.95V */
+#define OUT_BUCK2_UV_MIN 750000
+#define OUT_BUCK2_UV_MAX 3950000
+#define OUT_BUCK2_UV_STEP 50000
+
+/* LDO1 Voltage: min: 0.8V, step: 25mV, max 2.4V */
+#define OUT_LDO1_UV_MIN 800000
+#define OUT_LDO1_UV_MAX 2400000
+#define OUT_LDO1_UV_STEP 25000
+
+/* LDO1 Amperage: min: 100mA, step: 50mA, max: 200mA */
+#define OUT_LDO1_UA_MIN 100000
+#define OUT_LDO1_UA_MAX 200000
+#define OUT_LDO1_UA_STEP 50000
+
+/* LDO2 Voltage: min: 0.75V, step: 50mV, max 3.95V */
+#define OUT_LDO2_UV_MIN 750000
+#define OUT_LDO2_UV_MAX 3950000
+#define OUT_LDO2_UV_STEP 50000
+
+/* register <-> value conversion */
+#define REG2VAL(min, step, reg) ((min) + ((step) * (reg)))
+#define VAL2REG(min, step, val) (((val) - (min)) / (step))
+
+/* Operation mode id -> register value conversion */
+#define OM2REG(x) (x)
+
+/* Test data for: test/dm/power.c */
+
+/* BUCK names */
+#define SANDBOX_BUCK1_DEVNAME "buck1"
+#define SANDBOX_BUCK1_PLATNAME "SUPPLY_1.2V"
+#define SANDBOX_BUCK2_DEVNAME "buck2"
+#define SANDBOX_BUCK2_PLATNAME "SUPPLY_3.3V"
+/* BUCK3: for testing fallback regulator prefix matching during bind */
+#define SANDBOX_BUCK3_DEVNAME "no_match_by_nodename"
+#define SANDBOX_BUCK3_PLATNAME "buck_SUPPLY_1.5V"
+/* LDO names */
+#define SANDBOX_LDO1_DEVNAME "ldo1"
+#define SANDBOX_LDO1_PLATNAME "VDD_EMMC_1.8V"
+#define SANDBOX_LDO2_DEVNAME "ldo2"
+#define SANDBOX_LDO2_PLATNAME "VDD_LCD_3.3V"
+
+/*
+ * Expected regulators setup after call of:
+ * - regulator_autoset_by_name()
+ * - regulator_list_autoset()
+ */
+
+/* BUCK1: for testing regulator_autoset_by_name() */
+#define SANDBOX_BUCK1_AUTOSET_EXPECTED_UV 1200000
+#define SANDBOX_BUCK1_AUTOSET_EXPECTED_UA 200000
+#define SANDBOX_BUCK1_AUTOSET_EXPECTED_ENABLE true
+
+/* BUCK2: for testing sandbox ADC's supply */
+#define SANDBOX_BUCK2_INITIAL_EXPECTED_UV 3000000
+#define SANDBOX_BUCK2_SET_UV 3300000
+
+/* LDO1/2 for testing regulator_list_autoset() */
+#define SANDBOX_LDO1_AUTOSET_EXPECTED_UV 1800000
+#define SANDBOX_LDO1_AUTOSET_EXPECTED_UA 100000
+#define SANDBOX_LDO1_AUTOSET_EXPECTED_ENABLE true
+
+#define SANDBOX_LDO2_AUTOSET_EXPECTED_UV 3000000
+#define SANDBOX_LDO2_AUTOSET_EXPECTED_UA -ENOSYS
+#define SANDBOX_LDO2_AUTOSET_EXPECTED_ENABLE false
+
+#endif
diff --git a/include/power/stpmic1.h b/include/power/stpmic1.h
new file mode 100644
index 0000000..dc8b5a7
--- /dev/null
+++ b/include/power/stpmic1.h
@@ -0,0 +1,111 @@
+/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
+/*
+ * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
+ */
+
+#ifndef __PMIC_STPMIC1_H_
+#define __PMIC_STPMIC1_H_
+
+#define STPMIC1_MAIN_CR 0x10
+#define STPMIC1_BUCKS_MRST_CR 0x18
+#define STPMIC1_LDOS_MRST_CR 0x1a
+#define STPMIC1_BUCKX_MAIN_CR(buck) (0x20 + (buck))
+#define STPMIC1_REFDDR_MAIN_CR 0x24
+#define STPMIC1_LDOX_MAIN_CR(ldo) (0x25 + (ldo))
+#define STPMIC1_BST_SW_CR 0x40
+#define STPMIC1_NVM_SR 0xb8
+#define STPMIC1_NVM_CR 0xb9
+
+/* Main PMIC Control Register (MAIN_CR) */
+#define STPMIC1_SWOFF BIT(0)
+#define STPMIC1_RREQ_EN BIT(1)
+
+/* BUCKS_MRST_CR */
+#define STPMIC1_MRST_BUCK(buck) BIT(buck)
+#define STPMIC1_MRST_BUCK_DEBUG (STPMIC1_MRST_BUCK(STPMIC1_BUCK1) | \
+ STPMIC1_MRST_BUCK(STPMIC1_BUCK3))
+
+/* LDOS_MRST_CR */
+#define STPMIC1_MRST_LDO(ldo) BIT(ldo)
+#define STPMIC1_MRST_LDO_DEBUG 0
+
+/* BUCKx_MAIN_CR (x=1...4) */
+#define STPMIC1_BUCK_ENA BIT(0)
+#define STPMIC1_BUCK_PREG_MODE BIT(1)
+#define STPMIC1_BUCK_VOUT_MASK GENMASK(7, 2)
+#define STPMIC1_BUCK_VOUT_SHIFT 2
+#define STPMIC1_BUCK_VOUT(sel) (sel << STPMIC1_BUCK_VOUT_SHIFT)
+
+#define STPMIC1_BUCK2_1200000V STPMIC1_BUCK_VOUT(24)
+#define STPMIC1_BUCK2_1350000V STPMIC1_BUCK_VOUT(30)
+
+#define STPMIC1_BUCK3_1800000V STPMIC1_BUCK_VOUT(39)
+
+/* REFDDR_MAIN_CR */
+#define STPMIC1_VREF_ENA BIT(0)
+
+/* LDOX_MAIN_CR */
+#define STPMIC1_LDO_ENA BIT(0)
+#define STPMIC1_LDO12356_VOUT_MASK GENMASK(6, 2)
+#define STPMIC1_LDO12356_VOUT_SHIFT 2
+#define STPMIC1_LDO_VOUT(sel) (sel << STPMIC1_LDO12356_VOUT_SHIFT)
+
+#define STPMIC1_LDO3_MODE BIT(7)
+#define STPMIC1_LDO3_DDR_SEL 31
+#define STPMIC1_LDO3_1800000 STPMIC1_LDO_VOUT(9)
+
+#define STPMIC1_LDO4_UV 3300000
+
+/* BST_SW_CR */
+#define STPMIC1_BST_ON BIT(0)
+#define STPMIC1_VBUSOTG_ON BIT(1)
+#define STPMIC1_SWOUT_ON BIT(2)
+#define STPMIC1_PWR_SW_ON (STPMIC1_VBUSOTG_ON | STPMIC1_SWOUT_ON)
+
+/* NVM_SR */
+#define STPMIC1_NVM_BUSY BIT(0)
+
+/* NVM_CR */
+#define STPMIC1_NVM_CMD_PROGRAM 1
+#define STPMIC1_NVM_CMD_READ 2
+
+/* Timeout */
+#define STPMIC1_DEFAULT_START_UP_DELAY_MS 1
+#define STPMIC1_DEFAULT_STOP_DELAY_MS 5
+#define STPMIC1_USB_BOOST_START_UP_DELAY_MS 10
+
+enum {
+ STPMIC1_BUCK1,
+ STPMIC1_BUCK2,
+ STPMIC1_BUCK3,
+ STPMIC1_BUCK4,
+ STPMIC1_MAX_BUCK,
+};
+
+enum {
+ STPMIC1_PREG_MODE_HP,
+ STPMIC1_PREG_MODE_LP,
+};
+
+enum {
+ STPMIC1_LDO1,
+ STPMIC1_LDO2,
+ STPMIC1_LDO3,
+ STPMIC1_LDO4,
+ STPMIC1_LDO5,
+ STPMIC1_LDO6,
+ STPMIC1_MAX_LDO,
+};
+
+enum {
+ STPMIC1_LDO_MODE_NORMAL,
+ STPMIC1_LDO_MODE_BYPASS,
+ STPMIC1_LDO_MODE_SINK_SOURCE,
+};
+
+enum {
+ STPMIC1_PWR_SW1,
+ STPMIC1_PWR_SW2,
+ STPMIC1_MAX_PWR_SW,
+};
+#endif
diff --git a/include/power/tps62362.h b/include/power/tps62362.h
new file mode 100644
index 0000000..f0fc538
--- /dev/null
+++ b/include/power/tps62362.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2014 Texas Instruments Incorporated - http://www.ti.com
+ * Author: Felipe Balbi <balbi@ti.com>
+ */
+
+#ifndef __POWER_TPS62362_H__
+#define __POWER_TPS62362_H__
+
+/* I2C chip address */
+#define TPS62362_I2C_ADDR 0x60
+
+/* Registers */
+#define TPS62362_SET0 0x00
+#define TPS62362_SET1 0x01
+#define TPS62362_SET2 0x02
+#define TPS62362_SET3 0x03
+#define TPS62362_NUM_REGS 4
+
+#define TPS62362_DCDC_VOLT_SEL_0950MV 0x12
+#define TPS62362_DCDC_VOLT_SEL_1100MV 0x21
+#define TPS62362_DCDC_VOLT_SEL_1200MV 0x2b
+#define TPS62362_DCDC_VOLT_SEL_1260MV 0x31
+#define TPS62362_DCDC_VOLT_SEL_1330MV 0x38
+
+int tps62362_voltage_update(unsigned char reg, unsigned char volt_sel);
+int power_tps62362_init(unsigned char bus);
+#endif /* __POWER_TPS62362_H__ */
diff --git a/include/power/tps65090.h b/include/power/tps65090.h
new file mode 100644
index 0000000..2716968
--- /dev/null
+++ b/include/power/tps65090.h
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2015 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+
+#ifndef __TPS65090_PMIC_H_
+#define __TPS65090_PMIC_H_
+
+/* I2C device address for TPS65090 PMU */
+#define TPS65090_I2C_ADDR 0x48
+
+/* TPS65090 register addresses */
+enum {
+ REG_IRQ1 = 0,
+ REG_CG_CTRL0 = 4,
+ REG_CG_STATUS1 = 0xa,
+ REG_FET_BASE = 0xe, /* Not a real register, FETs count from here */
+ REG_FET1_CTRL,
+ REG_FET2_CTRL,
+ REG_FET3_CTRL,
+ REG_FET4_CTRL,
+ REG_FET5_CTRL,
+ REG_FET6_CTRL,
+ REG_FET7_CTRL,
+ TPS65090_NUM_REGS,
+};
+
+enum {
+ IRQ1_VBATG = 1 << 3,
+ CG_CTRL0_ENC_MASK = 0x01,
+
+ MAX_FET_NUM = 7,
+ MAX_CTRL_READ_TRIES = 5,
+
+ /* TPS65090 FET_CTRL register values */
+ FET_CTRL_TOFET = 1 << 7, /* Timeout, startup, overload */
+ FET_CTRL_PGFET = 1 << 4, /* Power good for FET status */
+ FET_CTRL_WAIT = 3 << 2, /* Overcurrent timeout max */
+ FET_CTRL_ADENFET = 1 << 1, /* Enable output auto discharge */
+ FET_CTRL_ENFET = 1 << 0, /* Enable FET */
+};
+
+enum {
+ /* Status register fields */
+ TPS65090_ST1_OTC = 1 << 0,
+ TPS65090_ST1_OCC = 1 << 1,
+ TPS65090_ST1_STATE_SHIFT = 4,
+ TPS65090_ST1_STATE_MASK = 0xf << TPS65090_ST1_STATE_SHIFT,
+};
+
+/* Drivers name */
+#define TPS65090_FET_DRIVER "tps65090_fet"
+
+#endif /* __TPS65090_PMIC_H_ */
diff --git a/include/power/tps65217.h b/include/power/tps65217.h
new file mode 100644
index 0000000..669a94a
--- /dev/null
+++ b/include/power/tps65217.h
@@ -0,0 +1,89 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2011-2013
+ * Texas Instruments, <www.ti.com>
+ *
+ * For more details, please see the TRM at http://www.ti.com/product/tps65217a
+ */
+
+#ifndef __POWER_TPS65217_H__
+#define __POWER_TPS65217_H__
+
+/* I2C chip address */
+#define TPS65217_CHIP_PM 0x24
+
+/* Registers */
+enum {
+ TPS65217_CHIPID = 0x00,
+ TPS65217_POWER_PATH,
+ TPS65217_INTERRUPT,
+ TPS65217_CHGCONFIG0,
+ TPS65217_CHGCONFIG1,
+ TPS65217_CHGCONFIG2,
+ TPS65217_CHGCONFIG3,
+ TPS65217_WLEDCTRL1,
+ TPS65217_WLEDCTRL2,
+ TPS65217_MUXCTRL,
+ TPS65217_STATUS,
+ TPS65217_PASSWORD,
+ TPS65217_PGOOD,
+ TPS65217_DEFPG,
+ TPS65217_DEFDCDC1,
+ TPS65217_DEFDCDC2,
+ TPS65217_DEFDCDC3,
+ TPS65217_DEFSLEW,
+ TPS65217_DEFLDO1,
+ TPS65217_DEFLDO2,
+ TPS65217_DEFLS1,
+ TPS65217_DEFLS2,
+ TPS65217_ENABLE,
+ TPS65217_RESERVED0, /* no 0x17 register available */
+ TPS65217_DEFUVLO,
+ TPS65217_SEQ1,
+ TPS65217_SEQ2,
+ TPS65217_SEQ3,
+ TPS65217_SEQ4,
+ TPS65217_SEQ5,
+ TPS65217_SEQ6,
+ TPS65217_PMIC_NUM_OF_REGS,
+};
+
+#define TPS65217_PROT_LEVEL_NONE 0x00
+#define TPS65217_PROT_LEVEL_1 0x01
+#define TPS65217_PROT_LEVEL_2 0x02
+
+#define TPS65217_PASSWORD_LOCK_FOR_WRITE 0x00
+#define TPS65217_PASSWORD_UNLOCK 0x7D
+
+#define TPS65217_DCDC_GO 0x80
+
+#define TPS65217_MASK_ALL_BITS 0xFF
+
+#define TPS65217_USB_INPUT_CUR_LIMIT_MASK 0x03
+#define TPS65217_USB_INPUT_CUR_LIMIT_100MA 0x00
+#define TPS65217_USB_INPUT_CUR_LIMIT_500MA 0x01
+#define TPS65217_USB_INPUT_CUR_LIMIT_1300MA 0x02
+#define TPS65217_USB_INPUT_CUR_LIMIT_1800MA 0x03
+
+#define TPS65217_DCDC_VOLT_SEL_950MV 0x02
+#define TPS65217_DCDC_VOLT_SEL_1100MV 0x08
+#define TPS65217_DCDC_VOLT_SEL_1125MV 0x09
+#define TPS65217_DCDC_VOLT_SEL_1200MV 0x0c
+#define TPS65217_DCDC_VOLT_SEL_1275MV 0x0F
+#define TPS65217_DCDC_VOLT_SEL_1325MV 0x11
+
+#define TPS65217_LDO_MASK 0x1F
+#define TPS65217_LDO_VOLTAGE_OUT_1_8 0x06
+#define TPS65217_LDO_VOLTAGE_OUT_3_3 0x1F
+
+#define TPS65217_PWR_OFF 0x80
+#define TPS65217_PWR_SRC_USB_BITMASK 0x4
+#define TPS65217_PWR_SRC_AC_BITMASK 0x8
+
+int power_tps65217_init(unsigned char bus);
+
+int tps65217_reg_read(uchar src_reg, uchar *src_val);
+int tps65217_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,
+ uchar mask);
+int tps65217_voltage_update(uchar dc_cntrl_reg, uchar volt_sel);
+#endif /* __POWER_TPS65217_H__ */
diff --git a/include/power/tps65218.h b/include/power/tps65218.h
new file mode 100644
index 0000000..bb66c3f
--- /dev/null
+++ b/include/power/tps65218.h
@@ -0,0 +1,82 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2014
+ * Texas Instruments, <www.ti.com>
+ */
+
+#ifndef __POWER_TPS65218_H__
+#define __POWER_TPS65218_H__
+
+#include <linux/bitops.h>
+
+/* I2C chip address */
+#define TPS65218_CHIP_PM 0x24
+
+/* Registers */
+enum {
+ TPS65218_CHIPID = 0x00,
+ TPS65218_INT1,
+ TPS65218_INT2,
+ TPS65218_INT_MASK1,
+ TPS65218_INT_MASK2,
+ TPS65218_STATUS,
+ TPS65218_CONTROL,
+ TPS65218_FLAG,
+ TPS65218_PASSWORD = 0x10,
+ TPS65218_ENABLE1,
+ TPS65218_ENABLE2,
+ TPS65218_CONFIG1,
+ TPS65218_CONFIG2,
+ TPS65218_CONFIG3,
+ TPS65218_DCDC1,
+ TPS65218_DCDC2,
+ TPS65218_DCDC3,
+ TPS65218_DCDC4,
+ TPS65218_SLEW,
+ TPS65218_LDO1,
+ TPS65218_SEQ1 = 0x20,
+ TPS65218_SEQ2,
+ TPS65218_SEQ3,
+ TPS65218_SEQ4,
+ TPS65218_SEQ5,
+ TPS65218_SEQ6,
+ TPS65218_SEQ7,
+ TPS65218_PMIC_NUM_OF_REGS,
+};
+
+#define TPS65218_PROT_LEVEL_NONE 0x00
+#define TPS65218_PROT_LEVEL_1 0x01
+#define TPS65218_PROT_LEVEL_2 0x02
+
+#define TPS65218_PASSWORD_LOCK_FOR_WRITE 0x00
+#define TPS65218_PASSWORD_UNLOCK 0x7D
+
+#define TPS65218_DCDC_GO 0x80
+
+#define TPS65218_MASK_ALL_BITS 0xFF
+
+#define TPS65218_DCDC_VSEL_MASK 0x3F
+
+#define TPS65218_DCDC_VOLT_SEL_0950MV 0x0a
+#define TPS65218_DCDC_VOLT_SEL_1100MV 0x19
+#define TPS65218_DCDC_VOLT_SEL_1200MV 0x23
+#define TPS65218_DCDC_VOLT_SEL_1260MV 0x29
+#define TPS65218_DCDC_VOLT_SEL_1330MV 0x30
+#define TPS65218_DCDC3_VOLT_SEL_1350MV 0x12
+#define TPS65218_DCDC3_VOLT_SEL_1200MV 0xC
+
+#define TPS65218_CC_STAT (BIT(0) | BIT(1))
+#define TPS65218_STATE (BIT(2) | BIT(3))
+#define TPS65218_PB_STATE BIT(4)
+#define TPS65218_AC_STATE BIT(5)
+#define TPS65218_EE BIT(6)
+#define TPS65218_FSEAL BIT(7)
+
+int tps65218_reg_read(uchar dest_reg, uchar *dest_val);
+int tps65218_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,
+ uchar mask);
+int tps65218_voltage_update(uchar dc_cntrl_reg, uchar volt_sel);
+int tps65218_toggle_fseal(void);
+int tps65218_lock_fseal(void);
+int power_tps65218_init(unsigned char bus);
+#endif /* __POWER_TPS65218_H__ */
diff --git a/include/power/tps65910.h b/include/power/tps65910.h
new file mode 100644
index 0000000..21b2a21
--- /dev/null
+++ b/include/power/tps65910.h
@@ -0,0 +1,78 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2011-2013
+ * Texas Instruments, <www.ti.com>
+ *
+ * For more details, please see the TRM at http://www.ti.com/product/tps65910
+ */
+#ifndef __POWER_TPS65910_H__
+#define __POWER_TPS65910_H__
+
+#define MPU 0
+#define CORE 1
+
+#define TPS65910_SR_I2C_ADDR 0x12
+#define TPS65910_CTRL_I2C_ADDR 0x2D
+
+/* PMIC Register offsets */
+enum {
+ TPS65910_VDD1_REG = 0x21,
+ TPS65910_VDD1_OP_REG = 0x22,
+ TPS65910_VDD2_REG = 0x24,
+ TPS65910_VDD2_OP_REG = 0x25,
+ TPS65910_DEVCTRL_REG = 0x3F,
+};
+
+/* VDD2 & VDD1 control register (VDD2_REG & VDD1_REG) */
+#define TPS65910_VGAIN_SEL_MASK (0x3 << 6)
+#define TPS65910_ILMAX_MASK (0x1 << 5)
+#define TPS65910_TSTEP_MASK (0x7 << 2)
+#define TPS65910_ST_MASK (0x3)
+
+#define TPS65910_REG_VGAIN_SEL_X1 (0x0 << 6)
+#define TPS65910_REG_VGAIN_SEL_X1_0 (0x1 << 6)
+#define TPS65910_REG_VGAIN_SEL_X3 (0x2 << 6)
+#define TPS65910_REG_VGAIN_SEL_X4 (0x3 << 6)
+
+#define TPS65910_REG_ILMAX_1_0_A (0x0 << 5)
+#define TPS65910_REG_ILMAX_1_5_A (0x1 << 5)
+
+#define TPS65910_REG_TSTEP_ (0x0 << 2)
+#define TPS65910_REG_TSTEP_12_5 (0x1 << 2)
+#define TPS65910_REG_TSTEP_9_4 (0x2 << 2)
+#define TPS65910_REG_TSTEP_7_5 (0x3 << 2)
+#define TPS65910_REG_TSTEP_6_25 (0x4 << 2)
+#define TPS65910_REG_TSTEP_4_7 (0x5 << 2)
+#define TPS65910_REG_TSTEP_3_12 (0x6 << 2)
+#define TPS65910_REG_TSTEP_2_5 (0x7 << 2)
+
+#define TPS65910_REG_ST_OFF (0x0)
+#define TPS65910_REG_ST_ON_HI_POW (0x1)
+#define TPS65910_REG_ST_OFF_1 (0x2)
+#define TPS65910_REG_ST_ON_LOW_POW (0x3)
+
+
+/* VDD2 & VDD1 voltage selection register. (VDD2_OP_REG & VDD1_OP_REG) */
+#define TPS65910_OP_REG_SEL (0x7F)
+
+#define TPS65910_OP_REG_CMD_MASK (0x1 << 7)
+#define TPS65910_OP_REG_CMD_OP (0x0 << 7)
+#define TPS65910_OP_REG_CMD_SR (0x1 << 7)
+
+#define TPS65910_OP_REG_SEL_MASK (0x7F)
+#define TPS65910_OP_REG_SEL_0_9_5 (0x1F) /* 0.9500 V */
+#define TPS65910_OP_REG_SEL_1_1_0 (0x2B) /* 1.1000 V */
+#define TPS65910_OP_REG_SEL_1_1_3 (0x2E) /* 1.1375 V */
+#define TPS65910_OP_REG_SEL_1_2_0 (0x33) /* 1.2000 V */
+#define TPS65910_OP_REG_SEL_1_2_6 (0x38) /* 1.2625 V */
+#define TPS65910_OP_REG_SEL_1_3_2_5 (0x3D) /* 1.3250 V */
+
+/* Device control register . (DEVCTRL_REG) */
+#define TPS65910_DEVCTRL_REG_SR_CTL_I2C_MASK (0x1 << 4)
+#define TPS65910_DEVCTRL_REG_SR_CTL_I2C_SEL_SR_I2C (0x0 << 4)
+#define TPS65910_DEVCTRL_REG_SR_CTL_I2C_SEL_CTL_I2C (0x1 << 4)
+
+int power_tps65910_init(unsigned char bus);
+int tps65910_set_i2c_control(void);
+int tps65910_voltage_update(unsigned int module, unsigned char vddx_op_vol_sel);
+#endif /* __POWER_TPS65910_H__ */
diff --git a/include/power/tps65910_pmic.h b/include/power/tps65910_pmic.h
new file mode 100644
index 0000000..6621478
--- /dev/null
+++ b/include/power/tps65910_pmic.h
@@ -0,0 +1,129 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) EETS GmbH, 2017, Felix Brack <f.brack@eets.ch>
+ */
+
+#ifndef __TPS65910_PMIC_H_
+#define __TPS65910_PMIC_H_
+
+#define TPS65910_I2C_SEL_MASK (0x1 << 4)
+#define TPS65910_VDD_SR_MASK (0x1 << 7)
+#define TPS65910_GAIN_SEL_MASK (0x3 << 6)
+#define TPS65910_VDD_SEL_MASK 0x7f
+#define TPS65910_VDD_SEL_MIN 3
+#define TPS65910_VDD_SEL_MAX 75
+#define TPS65910_SEL_MASK (0x3 << 2)
+#define TPS65910_SUPPLY_STATE_MASK 0x3
+#define TPS65910_SUPPLY_STATE_OFF 0x0
+#define TPS65910_SUPPLY_STATE_ON 0x1
+
+/* i2c registers */
+enum {
+ TPS65910_REG_RTC_SEC = 0x00,
+ TPS65910_REG_RTC_MIN,
+ TPS65910_REG_RTC_HOUR,
+ TPS65910_REG_RTC_DAY,
+ TPS65910_REG_RTC_MONTH,
+ TPS65910_REG_RTC_YEAR,
+ TPS65910_REG_RTC_WEEK,
+ TPS65910_REG_RTC_ALARM_SEC = 0x08,
+ TPS65910_REG_RTC_ALARM_MIN,
+ TPS65910_REG_RTC_ALARM_HOUR,
+ TPS65910_REG_RTC_ALARM_DAY,
+ TPS65910_REG_RTC_ALARM_MONTH,
+ TPS65910_REG_RTC_ALARM_YEAR,
+ TPS65910_REG_RTC_CTRL = 0x10,
+ TPS65910_REG_RTC_STAT,
+ TPS65910_REG_RTC_INT,
+ TPS65910_REG_RTC_COMP_LSB,
+ TPS65910_REG_RTC_COMP_MSB,
+ TPS65910_REG_RTC_RESISTOR_PRG,
+ TPS65910_REG_RTC_RESET_STAT,
+ TPS65910_REG_BACKUP1,
+ TPS65910_REG_BACKUP2,
+ TPS65910_REG_BACKUP3,
+ TPS65910_REG_BACKUP4,
+ TPS65910_REG_BACKUP5,
+ TPS65910_REG_PUADEN,
+ TPS65910_REG_REF,
+ TPS65910_REG_VRTC,
+ TPS65910_REG_VIO = 0x20,
+ TPS65910_REG_VDD1,
+ TPS65910_REG_VDD1_VAL,
+ TPS65910_REG_VDD1_VAL_SR,
+ TPS65910_REG_VDD2,
+ TPS65910_REG_VDD2_VAL,
+ TPS65910_REG_VDD2_VAL_SR,
+ TPS65910_REG_VDD3,
+ TPS65910_REG_VDIG1 = 0x30,
+ TPS65910_REG_VDIG2,
+ TPS65910_REG_VAUX1,
+ TPS65910_REG_VAUX2,
+ TPS65910_REG_VAUX33,
+ TPS65910_REG_VMMC,
+ TPS65910_REG_VPLL,
+ TPS65910_REG_VDAC,
+ TPS65910_REG_THERM,
+ TPS65910_REG_BATTERY_BACKUP_CHARGE,
+ TPS65910_REG_DCDC_CTRL = 0x3e,
+ TPS65910_REG_DEVICE_CTRL,
+ TPS65910_REG_DEVICE_CTRL2,
+ TPS65910_REG_SLEEP_KEEP_LDO_ON,
+ TPS65910_REG_SLEEP_KEEP_RES_ON,
+ TPS65910_REG_SLEEP_SET_LDO_OFF,
+ TPS65910_REG_SLEEP_SET_RES_OFF,
+ TPS65910_REG_EN1_LDO_ASS,
+ TPS65910_REG_EM1_SMPS_ASS,
+ TPS65910_REG_EN2_LDO_ASS,
+ TPS65910_REG_EM2_SMPS_ASS,
+ TPS65910_REG_INT_STAT = 0x50,
+ TPS65910_REG_INT_MASK,
+ TPS65910_REG_INT_STAT2,
+ TPS65910_REG_INT_MASK2,
+ TPS65910_REG_GPIO = 0x60,
+ TPS65910_REG_JTAGREVNUM = 0x80,
+ TPS65910_NUM_REGS
+};
+
+/* chip supplies */
+enum {
+ TPS65910_SUPPLY_VCCIO = 0x00,
+ TPS65910_SUPPLY_VCC1,
+ TPS65910_SUPPLY_VCC2,
+ TPS65910_SUPPLY_VCC3,
+ TPS65910_SUPPLY_VCC4,
+ TPS65910_SUPPLY_VCC5,
+ TPS65910_SUPPLY_VCC6,
+ TPS65910_SUPPLY_VCC7,
+ TPS65910_NUM_SUPPLIES
+};
+
+/* regulator unit numbers */
+enum {
+ TPS65910_UNIT_VRTC = 0x00,
+ TPS65910_UNIT_VIO,
+ TPS65910_UNIT_VDD1,
+ TPS65910_UNIT_VDD2,
+ TPS65910_UNIT_VDD3,
+ TPS65910_UNIT_VDIG1,
+ TPS65910_UNIT_VDIG2,
+ TPS65910_UNIT_VPLL,
+ TPS65910_UNIT_VDAC,
+ TPS65910_UNIT_VAUX1,
+ TPS65910_UNIT_VAUX2,
+ TPS65910_UNIT_VAUX33,
+ TPS65910_UNIT_VMMC,
+};
+
+/* platform data */
+struct tps65910_regulator_pdata {
+ u32 supply; /* regulator supply voltage in uV */
+ uint unit; /* unit-address according to DT */
+};
+
+/* driver names */
+#define TPS65910_BUCK_DRIVER "tps65910_buck"
+#define TPS65910_BOOST_DRIVER "tps65910_boost"
+#define TPS65910_LDO_DRIVER "tps65910_ldo"
+
+#endif /* __TPS65910_PMIC_H_ */