aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c
diff options
context:
space:
mode:
authorLesly A M <leslyam@ti.com>2011-04-14 08:27:53 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-05-26 13:45:24 -0400
commitca972d13382436530896e90591e2793e7a9e7eba (patch)
tree414e0e666015509a66342a8f5ce2184e0a1ef9ba /include/linux/i2c
parentd7ac829fa30d44d6553a0ead41f47bb92ee4d73e (diff)
mfd: TWL5030 version checking in twl-core
Added API to get the TWL5030 Si version from the IDCODE register. It is used for enabling the workaround for TWL erratum 27. Signed-off-by: Lesly A M <leslyam@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: David Derrick <dderrick@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/i2c')
-rw-r--r--include/linux/i2c/twl.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 4ebd7c32bc59..314218e79c4a 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -150,7 +150,12 @@
150#define MMC_PU (0x1 << 3) 150#define MMC_PU (0x1 << 3)
151#define MMC_PD (0x1 << 2) 151#define MMC_PD (0x1 << 2)
152 152
153 153#define TWL_SIL_TYPE(rev) ((rev) & 0x00FFFFFF)
154#define TWL_SIL_REV(rev) ((rev) >> 24)
155#define TWL_SIL_5030 0x09002F
156#define TWL5030_REV_1_0 0x00
157#define TWL5030_REV_1_1 0x10
158#define TWL5030_REV_1_2 0x30
154 159
155#define TWL4030_CLASS_ID 0x4030 160#define TWL4030_CLASS_ID 0x4030
156#define TWL6030_CLASS_ID 0x6030 161#define TWL6030_CLASS_ID 0x6030
@@ -180,6 +185,9 @@ int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg);
180int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); 185int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
181int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); 186int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
182 187
188int twl_get_type(void);
189int twl_get_version(void);
190
183int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); 191int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
184int twl6030_interrupt_mask(u8 bit_mask, u8 offset); 192int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
185 193
@@ -279,7 +287,12 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
279 *(Use TWL_4030_MODULE_INTBR) 287 *(Use TWL_4030_MODULE_INTBR)
280 */ 288 */
281 289
290#define REG_IDCODE_7_0 0x00
291#define REG_IDCODE_15_8 0x01
292#define REG_IDCODE_16_23 0x02
293#define REG_IDCODE_31_24 0x03
282#define REG_GPPUPDCTR1 0x0F 294#define REG_GPPUPDCTR1 0x0F
295#define REG_UNLOCK_TEST_REG 0x12
283 296
284/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */ 297/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */
285 298
@@ -288,6 +301,8 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
288#define SR_I2C_SCL_CTRL_PU BIT(4) 301#define SR_I2C_SCL_CTRL_PU BIT(4)
289#define SR_I2C_SDA_CTRL_PU BIT(6) 302#define SR_I2C_SDA_CTRL_PU BIT(6)
290 303
304#define TWL_EEPROM_R_UNLOCK 0x49
305
291/*----------------------------------------------------------------------*/ 306/*----------------------------------------------------------------------*/
292 307
293/* 308/*