public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 1/5] MFD: TPS65910: Add support for TPS65911 device
@ 2011-05-05  0:21 Jorge Eduardo Candelaria
  2011-05-13 16:30 ` Samuel Ortiz
  0 siblings, 1 reply; 3+ messages in thread
From: Jorge Eduardo Candelaria @ 2011-05-05  0:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, sameo, lrg, Graeme Gregory, grant.likely

The TPS65911 is the next generation of the TPS65910 family of
PMIC chips. It adds a few features:

- Watchdog Timer
- PWM & LED generators
- Comparators for system control status

It also adds a set of Interrupts and GPIOs, among other things.

The driver exports a function to identify between different
versions of the tps65910 family, allowing other modules to
identify the capabilities of the current chip.

Signed-off-by: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
---
 drivers/mfd/tps65910.c       |    5 +++-
 include/linux/mfd/tps65910.h |   46 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index bf649cf..11c4a66 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -139,6 +139,8 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
 	struct tps65910_platform_data *init_data;
 	int ret = 0;
 
+	tps65910->id = id->driver_data;
+
 	pmic_plat_data = dev_get_platdata(&i2c->dev);
 	if (!pmic_plat_data)
 		return -EINVAL;
@@ -192,7 +194,8 @@ static int tps65910_i2c_remove(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id tps65910_i2c_id[] = {
-       { "tps65910", 0 },
+       { "tps65910", TPS65910 },
+       { "tps65911", TPS65911 },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id);
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index be08a0c..6ceea0d 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -17,6 +17,14 @@
 #ifndef __LINUX_MFD_TPS65910_H
 #define __LINUX_MFD_TPS65910_H
 
+/* TPS chip id list */
+#define TPS65910			0
+#define TPS65911			1
+
+/* TPS regulator type list */
+#define REGULATOR_LDO			0
+#define REGULATOR_DCDC			1
+
 /*
  * List of registers for component TPS65910
  *
@@ -97,6 +105,21 @@
 #define TPS65910_MAX_REGISTER				0x80
 
 /*
+ * List of registers specific to TPS65911
+ */
+#define TPS65911_VDDCTRL				0x27
+#define TPS65911_VDDCTRL_OP				0x28
+#define TPS65911_VDDCTRL_SR				0x29
+#define TPS65911_LDO1					0x30
+#define TPS65911_LDO2					0x31
+#define TPS65911_LDO5					0x32
+#define TPS65911_LDO8					0x33
+#define TPS65911_LDO7					0x34
+#define TPS65911_LDO6					0x35
+#define TPS65911_LDO4					0x36
+#define TPS65911_LDO3					0x37
+
+/*
  * List of register bitfields for component TPS65910
  *
  */
@@ -702,6 +725,23 @@
 #define JTAGVERNUM_VERNUM_SHIFT				0
 
 
+/* Register VDDCTRL (0x27) bit definitions */
+#define VDDCTRL_ST_MASK                                  0x03
+#define VDDCTRL_ST_SHIFT                                 0
+
+
+/*Register VDDCTRL_OP  (0x28) bit definitios */
+#define VDDCTRL_OP_CMD_MASK                              0x80
+#define VDDCTRL_OP_CMD_SHIFT                             7
+#define VDDCTRL_OP_SEL_MASK                              0x7F
+#define VDDCTRL_OP_SEL_SHIFT                             0
+
+
+/*Register VDDCTRL_SR  (0x29) bit definitions */
+#define VDDCTRL_SR_SEL_MASK                              0x7F
+#define VDDCTRL_SR_SEL_SHIFT                             0
+
+
 /* IRQ Definitions */
 #define TPS65910_IRQ_VBAT_VMBDCH			0
 #define TPS65910_IRQ_VBAT_VMHI				1
@@ -742,6 +782,7 @@ struct tps65910 {
 	struct device *dev;
 	struct i2c_client *i2c_client;
 	struct mutex io_mutex;
+	unsigned int id;
 	int (*read)(struct tps65910 *tps65910, u8 reg, int size, void *dest);
 	int (*write)(struct tps65910 *tps65910, u8 reg, int size, void *src);
 
@@ -771,4 +812,9 @@ void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base);
 int tps65910_irq_init(struct tps65910 *tps65910, int irq,
 		struct tps65910_platform_data *pdata);
 
+static inline int tps65910_chip_id(struct tps65910 *tps65910)
+{
+	return tps65910->id;
+}
+
 #endif /*  __LINUX_MFD_TPS65910_H */
-- 
1.7.1


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

* Re: [PATCHv2 1/5] MFD: TPS65910: Add support for TPS65911 device
  2011-05-05  0:21 [PATCHv2 1/5] MFD: TPS65910: Add support for TPS65911 device Jorge Eduardo Candelaria
@ 2011-05-13 16:30 ` Samuel Ortiz
  2011-05-16 12:34   ` Liam Girdwood
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Ortiz @ 2011-05-13 16:30 UTC (permalink / raw)
  To: Jorge Eduardo Candelaria
  Cc: linux-kernel, broonie, lrg, Graeme Gregory, grant.likely

Hi Jorge,

On Wed, May 04, 2011 at 07:21:21PM -0500, Jorge Eduardo Candelaria wrote:
> The TPS65911 is the next generation of the TPS65910 family of
> PMIC chips. It adds a few features:
> 
> - Watchdog Timer
> - PWM & LED generators
> - Comparators for system control status
> 
> It also adds a set of Interrupts and GPIOs, among other things.
> 
> The driver exports a function to identify between different
> versions of the tps65910 family, allowing other modules to
> identify the capabilities of the current chip.
Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Liam, I'm ok with this one going through your tree.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* Re: [PATCHv2 1/5] MFD: TPS65910: Add support for TPS65911 device
  2011-05-13 16:30 ` Samuel Ortiz
@ 2011-05-16 12:34   ` Liam Girdwood
  0 siblings, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2011-05-16 12:34 UTC (permalink / raw)
  To: Jorge Eduardo Candelaria
  Cc: Samuel Ortiz, linux-kernel@vger.kernel.org,
	broonie@opensource.wolfsonmicro.com, Graeme Gregory,
	grant.likely@secretlab.ca

On 13/05/11 17:30, Samuel Ortiz wrote:
> Hi Jorge,
> 
> On Wed, May 04, 2011 at 07:21:21PM -0500, Jorge Eduardo Candelaria wrote:
>> The TPS65911 is the next generation of the TPS65910 family of
>> PMIC chips. It adds a few features:
>>
>> - Watchdog Timer
>> - PWM & LED generators
>> - Comparators for system control status
>>
>> It also adds a set of Interrupts and GPIOs, among other things.
>>
>> The driver exports a function to identify between different
>> versions of the tps65910 family, allowing other modules to
>> identify the capabilities of the current chip.
> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
> 
> Liam, I'm ok with this one going through your tree.
> 

Jorge, could you fix up 4/5 re the review comment and resend with Ack's. I'll then apply.

Thanks

Liam


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

end of thread, other threads:[~2011-05-16 12:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-05  0:21 [PATCHv2 1/5] MFD: TPS65910: Add support for TPS65911 device Jorge Eduardo Candelaria
2011-05-13 16:30 ` Samuel Ortiz
2011-05-16 12:34   ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox