diff options
author | Alex Frid <afrid@nvidia.com> | 2014-02-13 21:50:57 -0800 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2014-02-16 23:34:29 -0800 |
commit | db46e20ad3f16c2fdf1380485681717cd8cbfb39 (patch) | |
tree | b06ce808b92d068e8b75ef2a20ad7432c7a9c2cf /drivers/regulator | |
parent | bc575c99da866deeceb7d3ab8115d9290bd15062 (diff) |
regulator: tps51632 Add VSEL access attribute callback
Added callback to set voltage selector registers access attribute as
volatile or cached.
Bug 1454969
Change-Id: If246f7fe8d35cb99f28f1c07f4653646a141287b
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/367562
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/tps51632-regulator.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c index ff7184069d6e..a822730b7fe5 100644 --- a/drivers/regulator/tps51632-regulator.c +++ b/drivers/regulator/tps51632-regulator.c @@ -4,7 +4,7 @@ * Regulator driver for TPS51632 3-2-1 Phase D-Cap Step Down Driverless * Controller with serial VID control and DVFS. * - * Copyright (c) 2012, NVIDIA Corporation. + * Copyright (c) 2012-2014, NVIDIA Corporation. * * Author: Laxman Dewangan <ldewangan@nvidia.com> * @@ -89,6 +89,7 @@ struct tps51632_chip { struct regulator_desc desc; struct regulator_dev *rdev; struct regmap *regmap; + bool vsel_volatile; }; static int tps51632_dcdc_set_ramp_delay(struct regulator_dev *rdev, @@ -210,7 +211,12 @@ skip_pwm_config: static bool is_volatile_reg(struct device *dev, unsigned int reg) { + struct tps51632_chip *tps = dev_get_drvdata(dev); + switch (reg) { + case TPS51632_VOLTAGE_SELECT_REG: + case TPS51632_VOLTAGE_BASE_REG: + return tps->vsel_volatile; case TPS51632_OFFSET_REG: case TPS51632_FAULT_REG: case TPS51632_IMON_REG: @@ -220,6 +226,21 @@ static bool is_volatile_reg(struct device *dev, unsigned int reg) } } +static int tps51632_reg_volatile_set(struct device *dev, unsigned int reg, + bool is_volatile) +{ + struct tps51632_chip *tps = dev_get_drvdata(dev); + + switch (reg) { + case TPS51632_VOLTAGE_SELECT_REG: + case TPS51632_VOLTAGE_BASE_REG: + tps->vsel_volatile = is_volatile; + return 0; + default: + return -EINVAL; + } +} + static bool is_read_reg(struct device *dev, unsigned int reg) { switch (reg) { @@ -251,6 +272,7 @@ static const struct regmap_config tps51632_regmap_config = { .writeable_reg = is_write_reg, .readable_reg = is_read_reg, .volatile_reg = is_volatile_reg, + .reg_volatile_set = tps51632_reg_volatile_set, .max_register = TPS51632_MAX_REG - 1, .cache_type = REGCACHE_RBTREE, }; |