0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __LP872X_REGULATOR_H__
0009 #define __LP872X_REGULATOR_H__
0010
0011 #include <linux/regulator/machine.h>
0012 #include <linux/platform_device.h>
0013 #include <linux/gpio/consumer.h>
0014
0015 #define LP872X_MAX_REGULATORS 9
0016
0017 #define LP8720_ENABLE_DELAY 200
0018 #define LP8725_ENABLE_DELAY 30000
0019
0020 enum lp872x_regulator_id {
0021 LP8720_ID_BASE,
0022 LP8720_ID_LDO1 = LP8720_ID_BASE,
0023 LP8720_ID_LDO2,
0024 LP8720_ID_LDO3,
0025 LP8720_ID_LDO4,
0026 LP8720_ID_LDO5,
0027 LP8720_ID_BUCK,
0028
0029 LP8725_ID_BASE,
0030 LP8725_ID_LDO1 = LP8725_ID_BASE,
0031 LP8725_ID_LDO2,
0032 LP8725_ID_LDO3,
0033 LP8725_ID_LDO4,
0034 LP8725_ID_LDO5,
0035 LP8725_ID_LILO1,
0036 LP8725_ID_LILO2,
0037 LP8725_ID_BUCK1,
0038 LP8725_ID_BUCK2,
0039
0040 LP872X_ID_MAX,
0041 };
0042
0043 enum lp872x_dvs_sel {
0044 SEL_V1,
0045 SEL_V2,
0046 };
0047
0048
0049
0050
0051
0052
0053
0054 struct lp872x_dvs {
0055 struct gpio_desc *gpio;
0056 enum lp872x_dvs_sel vsel;
0057 enum gpiod_flags init_state;
0058 };
0059
0060
0061
0062
0063
0064
0065 struct lp872x_regulator_data {
0066 enum lp872x_regulator_id id;
0067 struct regulator_init_data *init_data;
0068 };
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078 struct lp872x_platform_data {
0079 u8 general_config;
0080 bool update_config;
0081 struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS];
0082 struct lp872x_dvs *dvs;
0083 struct gpio_desc *enable_gpio;
0084 };
0085
0086 #endif