Commit 795570561cc9c8dc7f7582ed6c4d07121b1c4831

Authored by Jorge Eduardo Candelaria
Committed by Liam Girdwood
1 parent 3c24019dde

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>

Showing 2 changed files with 49 additions and 1 deletions Side-by-side Diff

drivers/mfd/tps65910.c
... ... @@ -157,6 +157,7 @@
157 157 i2c_set_clientdata(i2c, tps65910);
158 158 tps65910->dev = &i2c->dev;
159 159 tps65910->i2c_client = i2c;
  160 + tps65910->id = id->driver_data;
160 161 tps65910->read = tps65910_i2c_read;
161 162 tps65910->write = tps65910_i2c_write;
162 163 mutex_init(&tps65910->io_mutex);
... ... @@ -192,7 +193,8 @@
192 193 }
193 194  
194 195 static const struct i2c_device_id tps65910_i2c_id[] = {
195   - { "tps65910", 0 },
  196 + { "tps65910", TPS65910 },
  197 + { "tps65911", TPS65911 },
196 198 { }
197 199 };
198 200 MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id);
include/linux/mfd/tps65910.h
... ... @@ -17,6 +17,14 @@
17 17 #ifndef __LINUX_MFD_TPS65910_H
18 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 29 * List of registers for component TPS65910
22 30 *
... ... @@ -97,6 +105,21 @@
97 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 123 * List of register bitfields for component TPS65910
101 124 *
102 125 */
... ... @@ -702,6 +725,23 @@
702 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 745 /* IRQ Definitions */
706 746 #define TPS65910_IRQ_VBAT_VMBDCH 0
707 747 #define TPS65910_IRQ_VBAT_VMHI 1
... ... @@ -742,6 +782,7 @@
742 782 struct device *dev;
743 783 struct i2c_client *i2c_client;
744 784 struct mutex io_mutex;
  785 + unsigned int id;
745 786 int (*read)(struct tps65910 *tps65910, u8 reg, int size, void *dest);
746 787 int (*write)(struct tps65910 *tps65910, u8 reg, int size, void *src);
747 788  
... ... @@ -770,6 +811,11 @@
770 811 void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base);
771 812 int tps65910_irq_init(struct tps65910 *tps65910, int irq,
772 813 struct tps65910_platform_data *pdata);
  814 +
  815 +static inline int tps65910_chip_id(struct tps65910 *tps65910)
  816 +{
  817 + return tps65910->id;
  818 +}
773 819  
774 820 #endif /* __LINUX_MFD_TPS65910_H */