]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/regulator/max77686-regulator.c
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / drivers / regulator / max77686-regulator.c
index 17ccf365a9c04d9cb33a246f74777f316d76f037..c301f37334758599fc98ba615a9159a62c9ba708 100644 (file)
@@ -41,6 +41,8 @@
 #define MAX77686_LDO_LOW_UVSTEP        25000
 #define MAX77686_BUCK_MINUV    750000
 #define MAX77686_BUCK_UVSTEP   50000
+#define MAX77686_BUCK_ENABLE_TIME      40              /* us */
+#define MAX77686_DVS_ENABLE_TIME       22              /* us */
 #define MAX77686_RAMP_DELAY    100000                  /* uV/us */
 #define MAX77686_DVS_RAMP_DELAY        27500                   /* uV/us */
 #define MAX77686_DVS_MINUV     600000
@@ -287,7 +289,7 @@ static int max77686_of_parse_cb(struct device_node *np,
        return 0;
 }
 
-static struct regulator_ops max77686_ops = {
+static const struct regulator_ops max77686_ops = {
        .list_voltage           = regulator_list_voltage_linear,
        .map_voltage            = regulator_map_voltage_linear,
        .is_enabled             = regulator_is_enabled_regmap,
@@ -299,7 +301,7 @@ static struct regulator_ops max77686_ops = {
        .set_suspend_mode       = max77686_set_suspend_mode,
 };
 
-static struct regulator_ops max77686_ldo_ops = {
+static const struct regulator_ops max77686_ldo_ops = {
        .list_voltage           = regulator_list_voltage_linear,
        .map_voltage            = regulator_map_voltage_linear,
        .is_enabled             = regulator_is_enabled_regmap,
@@ -312,7 +314,7 @@ static struct regulator_ops max77686_ldo_ops = {
        .set_suspend_disable    = max77686_set_suspend_disable,
 };
 
-static struct regulator_ops max77686_buck1_ops = {
+static const struct regulator_ops max77686_buck1_ops = {
        .list_voltage           = regulator_list_voltage_linear,
        .map_voltage            = regulator_map_voltage_linear,
        .is_enabled             = regulator_is_enabled_regmap,
@@ -324,7 +326,7 @@ static struct regulator_ops max77686_buck1_ops = {
        .set_suspend_disable    = max77686_set_suspend_disable,
 };
 
-static struct regulator_ops max77686_buck_dvs_ops = {
+static const struct regulator_ops max77686_buck_dvs_ops = {
        .list_voltage           = regulator_list_voltage_linear,
        .map_voltage            = regulator_map_voltage_linear,
        .is_enabled             = regulator_is_enabled_regmap,
@@ -422,6 +424,7 @@ static struct regulator_ops max77686_buck_dvs_ops = {
        .min_uV         = MAX77686_BUCK_MINUV,                          \
        .uV_step        = MAX77686_BUCK_UVSTEP,                         \
        .ramp_delay     = MAX77686_RAMP_DELAY,                          \
+       .enable_time    = MAX77686_BUCK_ENABLE_TIME,                    \
        .n_voltages     = MAX77686_VSEL_MASK + 1,                       \
        .vsel_reg       = MAX77686_REG_BUCK5OUT + (num - 5) * 2,        \
        .vsel_mask      = MAX77686_VSEL_MASK,                           \
@@ -439,6 +442,7 @@ static struct regulator_ops max77686_buck_dvs_ops = {
        .min_uV         = MAX77686_BUCK_MINUV,                          \
        .uV_step        = MAX77686_BUCK_UVSTEP,                         \
        .ramp_delay     = MAX77686_RAMP_DELAY,                          \
+       .enable_time    = MAX77686_BUCK_ENABLE_TIME,                    \
        .n_voltages     = MAX77686_VSEL_MASK + 1,                       \
        .vsel_reg       = MAX77686_REG_BUCK1OUT,                        \
        .vsel_mask      = MAX77686_VSEL_MASK,                           \
@@ -456,6 +460,7 @@ static struct regulator_ops max77686_buck_dvs_ops = {
        .min_uV         = MAX77686_DVS_MINUV,                           \
        .uV_step        = MAX77686_DVS_UVSTEP,                          \
        .ramp_delay     = MAX77686_DVS_RAMP_DELAY,                      \
+       .enable_time    = MAX77686_DVS_ENABLE_TIME,                     \
        .n_voltages     = MAX77686_DVS_VSEL_MASK + 1,                   \
        .vsel_reg       = MAX77686_REG_BUCK2DVS1 + (num - 2) * 10,      \
        .vsel_mask      = MAX77686_DVS_VSEL_MASK,                       \
@@ -553,17 +558,7 @@ static struct platform_driver max77686_pmic_driver = {
        .id_table = max77686_pmic_id,
 };
 
-static int __init max77686_pmic_init(void)
-{
-       return platform_driver_register(&max77686_pmic_driver);
-}
-subsys_initcall(max77686_pmic_init);
-
-static void __exit max77686_pmic_cleanup(void)
-{
-       platform_driver_unregister(&max77686_pmic_driver);
-}
-module_exit(max77686_pmic_cleanup);
+module_platform_driver(max77686_pmic_driver);
 
 MODULE_DESCRIPTION("MAXIM 77686 Regulator Driver");
 MODULE_AUTHOR("Chiwoong Byun <woong.byun@samsung.com>");