linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFT] regulator: Add support for tps62362 and tps62363 in tps62360-regulator driver
@ 2012-04-02 10:19 Axel Lin
  2012-04-02 10:20 ` Laxman Dewangan
  2012-04-02 22:16 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-04-02 10:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Laxman Dewangan, Liam Girdwood, Mark Brown

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>
---
 drivers/regulator/Kconfig              |    4 ++--
 drivers/regulator/tps62360-regulator.c |   30 ++++++++++++++++++++++--------
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index ed37125..8fb5f81 100644
--- a/drivers/regulator/Kconfig
+++ b/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/drivers/regulator/tps62360-regulator.c b/drivers/regulator/tps62360-regulator.c
index b18b7ca..aa57632 100644
--- a/drivers/regulator/tps62360-regulator.c
+++ b/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 <ldewangan@nvidia.com>");
-MODULE_DESCRIPTION("TPS62360 voltage regulator driver");
+MODULE_DESCRIPTION("TPS6236x voltage regulator driver");
 MODULE_LICENSE("GPL v2");
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RFT] regulator: Add support for tps62362 and tps62363 in tps62360-regulator driver
  2012-04-02 10:19 [PATCH RFT] regulator: Add support for tps62362 and tps62363 in tps62360-regulator driver Axel Lin
@ 2012-04-02 10:20 ` Laxman Dewangan
  2012-04-02 22:16 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Laxman Dewangan @ 2012-04-02 10:20 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel@vger.kernel.org, Liam Girdwood, Mark Brown

On Monday 02 April 2012 03:49 PM, Axel Lin wrote:
> 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>

Thanks Axel for doing this. This was my todo list and was waiting for 
the board to be available for testing.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RFT] regulator: Add support for tps62362 and tps62363 in tps62360-regulator driver
  2012-04-02 10:19 [PATCH RFT] regulator: Add support for tps62362 and tps62363 in tps62360-regulator driver Axel Lin
  2012-04-02 10:20 ` Laxman Dewangan
@ 2012-04-02 22:16 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-04-02 22:16 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Laxman Dewangan, Liam Girdwood

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

On Mon, Apr 02, 2012 at 06:19:28PM +0800, Axel Lin wrote:
> 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.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-02 22:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-02 10:19 [PATCH RFT] regulator: Add support for tps62362 and tps62363 in tps62360-regulator driver Axel Lin
2012-04-02 10:20 ` Laxman Dewangan
2012-04-02 22:16 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).