From 04905db0639720a908dbd3b9dc148c038880763f Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 2 Apr 2012 18:19:28 +0800 Subject: [PATCH] --- yaml --- r: 302143 b: refs/heads/master c: d1cf4f65e1eb17bc8768d822755780588e42cf37 h: refs/heads/master i: 302141: a0d9eacfc9cc24c0f938fb8de2fc10f54546aa06 302139: 019c25d5168f52d7450cd1c382779a4e7e2f370c 302135: 3971cad8ff464a579cbe579e6fdeddb1eb3f8a41 302127: c2cddf623bcdca529dfad9e84c7d84297dad9407 302111: 8ca496ae0058f4f844bda825660e2f525096e829 302079: efcea516635255e6beecec5423d8abc36a23fe79 v: v3 --- [refs] | 2 +- trunk/drivers/regulator/Kconfig | 4 +-- trunk/drivers/regulator/tps62360-regulator.c | 30 ++++++++++++++------ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 39ea2814f6e4..3e960df3bbd6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7f52ba7791a35a8e13a3be992fc98da66e68b77d +refs/heads/master: d1cf4f65e1eb17bc8768d822755780588e42cf37 diff --git a/trunk/drivers/regulator/Kconfig b/trunk/drivers/regulator/Kconfig index ed37125b8877..8fb5f81c3569 100644 --- a/trunk/drivers/regulator/Kconfig +++ b/trunk/drivers/regulator/Kconfig @@ -268,11 +268,11 @@ config REGULATOR_TPS6105X audio amplifiers. config REGULATOR_TPS62360 - tristate "TI TPS62360 Power Regulator" + tristate "TI TPS6236x Power Regulator" depends on I2C select REGMAP_I2C help - This driver supports TPS62360 voltage regulator chip. This + This driver supports TPS6236x voltage regulator chip. This regulator is meant for processor core supply. This chip is high-frequency synchronous step down dc-dc converter optimized for battery-powered portable applications. diff --git a/trunk/drivers/regulator/tps62360-regulator.c b/trunk/drivers/regulator/tps62360-regulator.c index b18b7cad7f95..aa57632c0150 100644 --- a/trunk/drivers/regulator/tps62360-regulator.c +++ b/trunk/drivers/regulator/tps62360-regulator.c @@ -1,7 +1,7 @@ /* * tps62360.c -- TI tps62360 * - * Driver for processor core supply tps62360 and tps62361B + * Driver for processor core supply tps62360, tps62361B, tps62362 and tps62363. * * Copyright (c) 2012, NVIDIA Corporation. * @@ -46,7 +46,7 @@ #define REG_RAMPCTRL 6 #define REG_CHIPID 8 -enum chips {TPS62360, TPS62361}; +enum chips {TPS62360, TPS62361, TPS62362, TPS62363}; #define TPS62360_BASE_VOLTAGE 770 #define TPS62360_N_VOLTAGES 64 @@ -296,14 +296,26 @@ static int __devinit tps62360_probe(struct i2c_client *client, tps->vsel0_gpio = pdata->vsel0_gpio; tps->vsel1_gpio = pdata->vsel1_gpio; tps->dev = &client->dev; - tps->voltage_base = (id->driver_data == TPS62360) ? - TPS62360_BASE_VOLTAGE : TPS62361_BASE_VOLTAGE; - tps->voltage_reg_mask = (id->driver_data == TPS62360) ? 0x3F : 0x7F; + + switch (id->driver_data) { + case TPS62360: + case TPS62362: + tps->voltage_base = TPS62360_BASE_VOLTAGE; + tps->voltage_reg_mask = 0x3F; + tps->desc.n_voltages = TPS62360_N_VOLTAGES; + break; + case TPS62361: + case TPS62363: + tps->voltage_base = TPS62361_BASE_VOLTAGE; + tps->voltage_reg_mask = 0x7F; + tps->desc.n_voltages = TPS62361_N_VOLTAGES; + break; + default: + return -ENODEV; + } tps->desc.name = id->name; tps->desc.id = 0; - tps->desc.n_voltages = (id->driver_data == TPS62360) ? - TPS62360_N_VOLTAGES : TPS62361_N_VOLTAGES; tps->desc.ops = &tps62360_dcdc_ops; tps->desc.type = REGULATOR_VOLTAGE; tps->desc.owner = THIS_MODULE; @@ -435,6 +447,8 @@ static void tps62360_shutdown(struct i2c_client *client) static const struct i2c_device_id tps62360_id[] = { {.name = "tps62360", .driver_data = TPS62360}, {.name = "tps62361", .driver_data = TPS62361}, + {.name = "tps62362", .driver_data = TPS62362}, + {.name = "tps62363", .driver_data = TPS62363}, {}, }; @@ -464,5 +478,5 @@ static void __exit tps62360_cleanup(void) module_exit(tps62360_cleanup); MODULE_AUTHOR("Laxman Dewangan "); -MODULE_DESCRIPTION("TPS62360 voltage regulator driver"); +MODULE_DESCRIPTION("TPS6236x voltage regulator driver"); MODULE_LICENSE("GPL v2");