@@ -13,8 +13,7 @@
#include <linux/regulator/mt6358-regulator.h>
#include <linux/regulator/of_regulator.h>
-#define MT6358_BUCK_MODE_AUTO 0
-#define MT6358_BUCK_MODE_FORCE_PWM 1
+#include <dt-bindings/regulator/mediatek,mt6397-regulator.h>
/*
* MT6358 regulators' information
@@ -326,7 +325,7 @@ static const struct linear_range vldo28_ranges[] = {
static unsigned int mt6358_map_mode(unsigned int mode)
{
- return mode == MT6358_BUCK_MODE_AUTO ?
+ return mode == MT6397_BUCK_MODE_AUTO ?
REGULATOR_MODE_NORMAL : REGULATOR_MODE_FAST;
}
@@ -371,10 +370,10 @@ static int mt6358_regulator_set_mode(struct regulator_dev *rdev,
switch (mode) {
case REGULATOR_MODE_FAST:
- val = MT6358_BUCK_MODE_FORCE_PWM;
+ val = MT6397_BUCK_MODE_FORCE_PWM;
break;
case REGULATOR_MODE_NORMAL:
- val = MT6358_BUCK_MODE_AUTO;
+ val = MT6397_BUCK_MODE_AUTO;
break;
default:
return -EINVAL;
@@ -402,9 +401,9 @@ static unsigned int mt6358_regulator_get_mode(struct regulator_dev *rdev)
}
switch ((regval & info->modeset_mask) >> (ffs(info->modeset_mask) - 1)) {
- case MT6358_BUCK_MODE_AUTO:
+ case MT6397_BUCK_MODE_AUTO:
return REGULATOR_MODE_NORMAL;
- case MT6358_BUCK_MODE_FORCE_PWM:
+ case MT6397_BUCK_MODE_FORCE_PWM:
return REGULATOR_MODE_FAST;
default:
return -EINVAL;