* from 0x00 to 0x4F: step is 12.5mV, range is from 0.6V to 1.6V
* from 0x50 to 0x3F step is 50mV, range is from 1.6V to 1.8V
*/
-static const struct regulator_linear_range buck_volt_range1[] = {
+static const struct linear_range buck_volt_range1[] = {
REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x54, 50000),
};
* from 0x00 to 0x4F VOUT step is 12.5mV, range is from 0.6V to 1.6V
* from 0x50 to 0x72 step is 50mV, range is from 1.6V to 3.3V
*/
-static const struct regulator_linear_range buck_volt_range2[] = {
+static const struct linear_range buck_volt_range2[] = {
REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x72, 50000),
};
*/
static int pm88x_get_vbuck_vol(unsigned int val, struct pm88x_buck_info *info)
{
- const struct regulator_linear_range *range;
+ const struct linear_range *range;
int i, volt = -EINVAL;
/* get the voltage via the register value */
return -EINVAL;
if (val >= range->min_sel && val <= range->max_sel) {
- volt = (val - range->min_sel) * range->uV_step + range->min_uV;
+ volt = (val - range->min_sel) * range->step + range->min;
break;
}
}
if (match) {
const_info = match->data;
init_data = of_get_regulator_init_data(&pdev->dev,
- pdev->dev.of_node);
+ pdev->dev.of_node, &const_info->desc);
} else {
dev_err(&pdev->dev, "parse dts fails!\n");
return -EINVAL;
if (match) {
const_info = match->data;
init_data = of_get_regulator_init_data(&pdev->dev,
- pdev->dev.of_node);
+ pdev->dev.of_node, &const_info->desc);
} else {
dev_err(&pdev->dev, "parse dts fails!\n");
return -EINVAL;
#define PM880_BUCK_AUDIO_OF_MATCH(comp, label) \
PM88X_BUCK_AUDIO_OF_MATCH(pm880, PM880_ID, comp, label)
-static const struct regulator_linear_range buck_slp_volt_range1[] = {
+static const struct linear_range buck_slp_volt_range1[] = {
REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x54, 50000),
};
-static const struct regulator_linear_range buck_audio_volt_range1[] = {
+static const struct linear_range buck_audio_volt_range1[] = {
REGULATOR_LINEAR_RANGE(600000, 0, 0x54, 12500),
};
* to a real voltage value (in uV) according to the voltage table.
*/
static int pm88x_get_vvr_vol(unsigned int val, unsigned int n_linear_ranges,
- const struct regulator_linear_range *ranges)
+ const struct linear_range *ranges)
{
- const struct regulator_linear_range *range;
+ const struct linear_range *range;
int i, volt = -EINVAL;
/* get the voltage via the register value */
return -EINVAL;
if (val >= range->min_sel && val <= range->max_sel) {
- volt = (val - range->min_sel) * range->uV_step + range->min_uV;
+ volt = (val - range->min_sel) * range->step + range->min;
break;
}
}
if (match) {
const_info = match->data;
init_data = of_get_regulator_init_data(&pdev->dev,
- pdev->dev.of_node);
+ pdev->dev.of_node, &const_info->desc);
ret = of_get_legacy_init_data(&pdev->dev, &init_data);
if (ret < 0)
return ret;
PM880_ID_BUCK_MAX = 7,
};
+enum {
+ PM880_ID_BUCK1A_SLP = 0,
+ PM880_ID_BUCK1B_SLP,
+};
+
+enum {
+ PM880_ID_BUCK1A_AUDIO = 0,
+ PM880_ID_BUCK1B_AUDIO,
+};
+
enum {
PM880_ID_LDO1 = 0,
PM880_ID_LDO2,
PM886_ID_LDO_MAX = 16,
};
+enum {
+ PM886_ID_BUCK1_SLP = 0,
+};
+
#endif /* __LINUX_MFD_88PM886_H */
#define PM88X_VBUS_NAME "88pm88x-vbus"
#define PM88X_CFD_NAME "88pm88x-leds"
#define PM88X_RGB_NAME "88pm88x-rgb"
+#define PM88X_DEBUGFS_NAME "88pm88x-debugfs"
#define PM88X_GPADC_NAME "88pm88x-gpadc"
+#define PM88X_HWMON_NAME "88pm88x-hwmon"
#define PM88X_DVC_NAME "88pm88x-dvc"
+#define PM88X_VIRTUAL_REGULATOR_NAME "88pm88x-vr"
enum pm88x_type {
PM886 = 1,
PM880 = 2,
};
+enum {
+ PM88X_ID_VOTG = 0,
+};
+
+enum {
+ PM88X_RGB_LED0,
+ PM88X_RGB_LED1,
+ PM88X_RGB_LED2,
+};
+
enum pm88x_pages {
PM88X_BASE_PAGE = 0,
PM88X_LDO_PAGE,
PM88X_MAX_IRQ, /* 28 */
};
-/* 3 rgb led indicators */
-enum {
- PM88X_RGB_LED0,
- PM88X_RGB_LED1,
- PM88X_RGB_LED2,
-};
-
/* camera flash/torch */
enum {
PM88X_NO_LED = -1,