diff options
author | Jorge Eduardo Candelaria <jedu@slimlogic.co.uk> | 2011-05-16 19:34:59 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-05-27 05:49:10 -0400 |
commit | 795570561cc9c8dc7f7582ed6c4d07121b1c4831 (patch) | |
tree | 767ca7646c6d23a5b8b38347014afe3f178cbdef | |
parent | 3c24019ddeab71ddf125ad2ad13a38041655c1fd (diff) |
MFD: TPS65910: Add support for TPS65911 device
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>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r-- | drivers/mfd/tps65910.c | 4 | ||||
-rw-r--r-- | include/linux/mfd/tps65910.h | 46 |
2 files changed, 49 insertions, 1 deletions
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c index e31824870b9f..2229e66d80db 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c | |||
@@ -157,6 +157,7 @@ static int tps65910_i2c_probe(struct i2c_client *i2c, | |||
157 | i2c_set_clientdata(i2c, tps65910); | 157 | i2c_set_clientdata(i2c, tps65910); |
158 | tps65910->dev = &i2c->dev; | 158 | tps65910->dev = &i2c->dev; |
159 | tps65910->i2c_client = i2c; | 159 | tps65910->i2c_client = i2c; |
160 | tps65910->id = id->driver_data; | ||
160 | tps65910->read = tps65910_i2c_read; | 161 | tps65910->read = tps65910_i2c_read; |
161 | tps65910->write = tps65910_i2c_write; | 162 | tps65910->write = tps65910_i2c_write; |
162 | mutex_init(&tps65910->io_mutex); | 163 | mutex_init(&tps65910->io_mutex); |
@@ -192,7 +193,8 @@ static int tps65910_i2c_remove(struct i2c_client *i2c) | |||
192 | } | 193 | } |
193 | 194 | ||
194 | static const struct i2c_device_id tps65910_i2c_id[] = { | 195 | static const struct i2c_device_id tps65910_i2c_id[] = { |
195 | { "tps65910", 0 }, | 196 | { "tps65910", TPS65910 }, |
197 | { "tps65911", TPS65911 }, | ||
196 | { } | 198 | { } |
197 | }; | 199 | }; |
198 | MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id); | 200 | MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id); |
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h index be08a0c7e7de..6ceea0dab8d7 100644 --- a/include/linux/mfd/tps65910.h +++ b/include/linux/mfd/tps65910.h | |||
@@ -17,6 +17,14 @@ | |||
17 | #ifndef __LINUX_MFD_TPS65910_H | 17 | #ifndef __LINUX_MFD_TPS65910_H |
18 | #define __LINUX_MFD_TPS65910_H | 18 | #define __LINUX_MFD_TPS65910_H |
19 | 19 | ||
20 | /* TPS chip id list */ | ||
21 | #define TPS65910 0 | ||
22 | #define TPS65911 1 | ||
23 | |||
24 | /* TPS regulator type list */ | ||
25 | #define REGULATOR_LDO 0 | ||
26 | #define REGULATOR_DCDC 1 | ||
27 | |||
20 | /* | 28 | /* |
21 | * List of registers for component TPS65910 | 29 | * List of registers for component TPS65910 |
22 | * | 30 | * |
@@ -97,6 +105,21 @@ | |||
97 | #define TPS65910_MAX_REGISTER 0x80 | 105 | #define TPS65910_MAX_REGISTER 0x80 |
98 | 106 | ||
99 | /* | 107 | /* |
108 | * List of registers specific to TPS65911 | ||
109 | */ | ||
110 | #define TPS65911_VDDCTRL 0x27 | ||
111 | #define TPS65911_VDDCTRL_OP 0x28 | ||
112 | #define TPS65911_VDDCTRL_SR 0x29 | ||
113 | #define TPS65911_LDO1 0x30 | ||
114 | #define TPS65911_LDO2 0x31 | ||
115 | #define TPS65911_LDO5 0x32 | ||
116 | #define TPS65911_LDO8 0x33 | ||
117 | #define TPS65911_LDO7 0x34 | ||
118 | #define TPS65911_LDO6 0x35 | ||
119 | #define TPS65911_LDO4 0x36 | ||
120 | #define TPS65911_LDO3 0x37 | ||
121 | |||
122 | /* | ||
100 | * List of register bitfields for component TPS65910 | 123 | * List of register bitfields for component TPS65910 |
101 | * | 124 | * |
102 | */ | 125 | */ |
@@ -702,6 +725,23 @@ | |||
702 | #define JTAGVERNUM_VERNUM_SHIFT 0 | 725 | #define JTAGVERNUM_VERNUM_SHIFT 0 |
703 | 726 | ||
704 | 727 | ||
728 | /* Register VDDCTRL (0x27) bit definitions */ | ||
729 | #define VDDCTRL_ST_MASK 0x03 | ||
730 | #define VDDCTRL_ST_SHIFT 0 | ||
731 | |||
732 | |||
733 | /*Register VDDCTRL_OP (0x28) bit definitios */ | ||
734 | #define VDDCTRL_OP_CMD_MASK 0x80 | ||
735 | #define VDDCTRL_OP_CMD_SHIFT 7 | ||
736 | #define VDDCTRL_OP_SEL_MASK 0x7F | ||
737 | #define VDDCTRL_OP_SEL_SHIFT 0 | ||
738 | |||
739 | |||
740 | /*Register VDDCTRL_SR (0x29) bit definitions */ | ||
741 | #define VDDCTRL_SR_SEL_MASK 0x7F | ||
742 | #define VDDCTRL_SR_SEL_SHIFT 0 | ||
743 | |||
744 | |||
705 | /* IRQ Definitions */ | 745 | /* IRQ Definitions */ |
706 | #define TPS65910_IRQ_VBAT_VMBDCH 0 | 746 | #define TPS65910_IRQ_VBAT_VMBDCH 0 |
707 | #define TPS65910_IRQ_VBAT_VMHI 1 | 747 | #define TPS65910_IRQ_VBAT_VMHI 1 |
@@ -742,6 +782,7 @@ struct tps65910 { | |||
742 | struct device *dev; | 782 | struct device *dev; |
743 | struct i2c_client *i2c_client; | 783 | struct i2c_client *i2c_client; |
744 | struct mutex io_mutex; | 784 | struct mutex io_mutex; |
785 | unsigned int id; | ||
745 | int (*read)(struct tps65910 *tps65910, u8 reg, int size, void *dest); | 786 | int (*read)(struct tps65910 *tps65910, u8 reg, int size, void *dest); |
746 | int (*write)(struct tps65910 *tps65910, u8 reg, int size, void *src); | 787 | int (*write)(struct tps65910 *tps65910, u8 reg, int size, void *src); |
747 | 788 | ||
@@ -771,4 +812,9 @@ void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); | |||
771 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, | 812 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, |
772 | struct tps65910_platform_data *pdata); | 813 | struct tps65910_platform_data *pdata); |
773 | 814 | ||
815 | static inline int tps65910_chip_id(struct tps65910 *tps65910) | ||
816 | { | ||
817 | return tps65910->id; | ||
818 | } | ||
819 | |||
774 | #endif /* __LINUX_MFD_TPS65910_H */ | 820 | #endif /* __LINUX_MFD_TPS65910_H */ |