aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-04-02 06:19:28 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-02 18:16:16 -0400
commitd1cf4f65e1eb17bc8768d822755780588e42cf37 (patch)
tree4efef8bcb72ae0ad4643843d6341701774f34f70 /drivers/regulator
parent7f52ba7791a35a8e13a3be992fc98da66e68b77d (diff)
regulator: Add support for tps62362 and tps62363 in tps62360-regulator driver
According to the datasheet[1], tps62360 is register compatible with tps62362. tps62361B is register compatible with tps62363. Thus this patch adds support for tps62362 and tps62363. [1] http://www.ti.com/litv/pdf/slvsau9b Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/Kconfig4
-rw-r--r--drivers/regulator/tps62360-regulator.c30
2 files changed, 24 insertions, 10 deletions
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index ed37125b8877..8fb5f81c3569 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -268,11 +268,11 @@ config REGULATOR_TPS6105X
268 audio amplifiers. 268 audio amplifiers.
269 269
270config REGULATOR_TPS62360 270config REGULATOR_TPS62360
271 tristate "TI TPS62360 Power Regulator" 271 tristate "TI TPS6236x Power Regulator"
272 depends on I2C 272 depends on I2C
273 select REGMAP_I2C 273 select REGMAP_I2C
274 help 274 help
275 This driver supports TPS62360 voltage regulator chip. This 275 This driver supports TPS6236x voltage regulator chip. This
276 regulator is meant for processor core supply. This chip is 276 regulator is meant for processor core supply. This chip is
277 high-frequency synchronous step down dc-dc converter optimized 277 high-frequency synchronous step down dc-dc converter optimized
278 for battery-powered portable applications. 278 for battery-powered portable applications.
diff --git a/drivers/regulator/tps62360-regulator.c b/drivers/regulator/tps62360-regulator.c
index b18b7cad7f95..aa57632c0150 100644
--- a/drivers/regulator/tps62360-regulator.c
+++ b/drivers/regulator/tps62360-regulator.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * tps62360.c -- TI tps62360 2 * tps62360.c -- TI tps62360
3 * 3 *
4 * Driver for processor core supply tps62360 and tps62361B 4 * Driver for processor core supply tps62360, tps62361B, tps62362 and tps62363.
5 * 5 *
6 * Copyright (c) 2012, NVIDIA Corporation. 6 * Copyright (c) 2012, NVIDIA Corporation.
7 * 7 *
@@ -46,7 +46,7 @@
46#define REG_RAMPCTRL 6 46#define REG_RAMPCTRL 6
47#define REG_CHIPID 8 47#define REG_CHIPID 8
48 48
49enum chips {TPS62360, TPS62361}; 49enum chips {TPS62360, TPS62361, TPS62362, TPS62363};
50 50
51#define TPS62360_BASE_VOLTAGE 770 51#define TPS62360_BASE_VOLTAGE 770
52#define TPS62360_N_VOLTAGES 64 52#define TPS62360_N_VOLTAGES 64
@@ -296,14 +296,26 @@ static int __devinit tps62360_probe(struct i2c_client *client,
296 tps->vsel0_gpio = pdata->vsel0_gpio; 296 tps->vsel0_gpio = pdata->vsel0_gpio;
297 tps->vsel1_gpio = pdata->vsel1_gpio; 297 tps->vsel1_gpio = pdata->vsel1_gpio;
298 tps->dev = &client->dev; 298 tps->dev = &client->dev;
299 tps->voltage_base = (id->driver_data == TPS62360) ? 299
300 TPS62360_BASE_VOLTAGE : TPS62361_BASE_VOLTAGE; 300 switch (id->driver_data) {
301 tps->voltage_reg_mask = (id->driver_data == TPS62360) ? 0x3F : 0x7F; 301 case TPS62360:
302 case TPS62362:
303 tps->voltage_base = TPS62360_BASE_VOLTAGE;
304 tps->voltage_reg_mask = 0x3F;
305 tps->desc.n_voltages = TPS62360_N_VOLTAGES;
306 break;
307 case TPS62361:
308 case TPS62363:
309 tps->voltage_base = TPS62361_BASE_VOLTAGE;
310 tps->voltage_reg_mask = 0x7F;
311 tps->desc.n_voltages = TPS62361_N_VOLTAGES;
312 break;
313 default:
314 return -ENODEV;
315 }
302 316
303 tps->desc.name = id->name; 317 tps->desc.name = id->name;
304 tps->desc.id = 0; 318 tps->desc.id = 0;
305 tps->desc.n_voltages = (id->driver_data == TPS62360) ?
306 TPS62360_N_VOLTAGES : TPS62361_N_VOLTAGES;
307 tps->desc.ops = &tps62360_dcdc_ops; 319 tps->desc.ops = &tps62360_dcdc_ops;
308 tps->desc.type = REGULATOR_VOLTAGE; 320 tps->desc.type = REGULATOR_VOLTAGE;
309 tps->desc.owner = THIS_MODULE; 321 tps->desc.owner = THIS_MODULE;
@@ -435,6 +447,8 @@ static void tps62360_shutdown(struct i2c_client *client)
435static const struct i2c_device_id tps62360_id[] = { 447static const struct i2c_device_id tps62360_id[] = {
436 {.name = "tps62360", .driver_data = TPS62360}, 448 {.name = "tps62360", .driver_data = TPS62360},
437 {.name = "tps62361", .driver_data = TPS62361}, 449 {.name = "tps62361", .driver_data = TPS62361},
450 {.name = "tps62362", .driver_data = TPS62362},
451 {.name = "tps62363", .driver_data = TPS62363},
438 {}, 452 {},
439}; 453};
440 454
@@ -464,5 +478,5 @@ static void __exit tps62360_cleanup(void)
464module_exit(tps62360_cleanup); 478module_exit(tps62360_cleanup);
465 479
466MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); 480MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
467MODULE_DESCRIPTION("TPS62360 voltage regulator driver"); 481MODULE_DESCRIPTION("TPS6236x voltage regulator driver");
468MODULE_LICENSE("GPL v2"); 482MODULE_LICENSE("GPL v2");