aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c/twl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/i2c/twl.h')
-rw-r--r--include/linux/i2c/twl.h54
1 files changed, 52 insertions, 2 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 0c0d1ae79981..ba4f88624fcd 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -91,6 +91,7 @@
91#define BCI_INTR_OFFSET 2 91#define BCI_INTR_OFFSET 2
92#define MADC_INTR_OFFSET 3 92#define MADC_INTR_OFFSET 3
93#define USB_INTR_OFFSET 4 93#define USB_INTR_OFFSET 4
94#define CHARGERFAULT_INTR_OFFSET 5
94#define BCI_PRES_INTR_OFFSET 9 95#define BCI_PRES_INTR_OFFSET 9
95#define USB_PRES_INTR_OFFSET 10 96#define USB_PRES_INTR_OFFSET 10
96#define RTC_INTR_OFFSET 11 97#define RTC_INTR_OFFSET 11
@@ -150,7 +151,12 @@
150#define MMC_PU (0x1 << 3) 151#define MMC_PU (0x1 << 3)
151#define MMC_PD (0x1 << 2) 152#define MMC_PD (0x1 << 2)
152 153
153 154#define TWL_SIL_TYPE(rev) ((rev) & 0x00FFFFFF)
155#define TWL_SIL_REV(rev) ((rev) >> 24)
156#define TWL_SIL_5030 0x09002F
157#define TWL5030_REV_1_0 0x00
158#define TWL5030_REV_1_1 0x10
159#define TWL5030_REV_1_2 0x30
154 160
155#define TWL4030_CLASS_ID 0x4030 161#define TWL4030_CLASS_ID 0x4030
156#define TWL6030_CLASS_ID 0x6030 162#define TWL6030_CLASS_ID 0x6030
@@ -165,6 +171,8 @@ static inline int twl_class_is_ ##class(void) \
165TWL_CLASS_IS(4030, TWL4030_CLASS_ID) 171TWL_CLASS_IS(4030, TWL4030_CLASS_ID)
166TWL_CLASS_IS(6030, TWL6030_CLASS_ID) 172TWL_CLASS_IS(6030, TWL6030_CLASS_ID)
167 173
174#define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */
175
168/* 176/*
169 * Read and write single 8-bit registers 177 * Read and write single 8-bit registers
170 */ 178 */
@@ -180,6 +188,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); 188int 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); 189int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
182 190
191int twl_get_type(void);
192int twl_get_version(void);
193
183int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); 194int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
184int twl6030_interrupt_mask(u8 bit_mask, u8 offset); 195int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
185 196
@@ -279,7 +290,12 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
279 *(Use TWL_4030_MODULE_INTBR) 290 *(Use TWL_4030_MODULE_INTBR)
280 */ 291 */
281 292
293#define REG_IDCODE_7_0 0x00
294#define REG_IDCODE_15_8 0x01
295#define REG_IDCODE_16_23 0x02
296#define REG_IDCODE_31_24 0x03
282#define REG_GPPUPDCTR1 0x0F 297#define REG_GPPUPDCTR1 0x0F
298#define REG_UNLOCK_TEST_REG 0x12
283 299
284/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */ 300/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */
285 301
@@ -288,6 +304,8 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
288#define SR_I2C_SCL_CTRL_PU BIT(4) 304#define SR_I2C_SCL_CTRL_PU BIT(4)
289#define SR_I2C_SDA_CTRL_PU BIT(6) 305#define SR_I2C_SDA_CTRL_PU BIT(6)
290 306
307#define TWL_EEPROM_R_UNLOCK 0x49
308
291/*----------------------------------------------------------------------*/ 309/*----------------------------------------------------------------------*/
292 310
293/* 311/*
@@ -501,7 +519,7 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
501#define RES_32KCLKOUT 26 519#define RES_32KCLKOUT 26
502#define RES_RESET 27 520#define RES_RESET 27
503/* Power Reference */ 521/* Power Reference */
504#define RES_Main_Ref 28 522#define RES_MAIN_REF 28
505 523
506#define TOTAL_RESOURCES 28 524#define TOTAL_RESOURCES 28
507/* 525/*
@@ -593,6 +611,7 @@ enum twl4030_usb_mode {
593 611
594struct twl4030_usb_data { 612struct twl4030_usb_data {
595 enum twl4030_usb_mode usb_mode; 613 enum twl4030_usb_mode usb_mode;
614 unsigned long features;
596 615
597 int (*phy_init)(struct device *dev); 616 int (*phy_init)(struct device *dev);
598 int (*phy_exit)(struct device *dev); 617 int (*phy_exit)(struct device *dev);
@@ -699,6 +718,20 @@ struct twl4030_platform_data {
699 struct regulator_init_data *vcxio; 718 struct regulator_init_data *vcxio;
700 struct regulator_init_data *vusb; 719 struct regulator_init_data *vusb;
701 struct regulator_init_data *clk32kg; 720 struct regulator_init_data *clk32kg;
721 /* TWL6025 LDO regulators */
722 struct regulator_init_data *ldo1;
723 struct regulator_init_data *ldo2;
724 struct regulator_init_data *ldo3;
725 struct regulator_init_data *ldo4;
726 struct regulator_init_data *ldo5;
727 struct regulator_init_data *ldo6;
728 struct regulator_init_data *ldo7;
729 struct regulator_init_data *ldoln;
730 struct regulator_init_data *ldousb;
731 /* TWL6025 DCDC regulators */
732 struct regulator_init_data *smps3;
733 struct regulator_init_data *smps4;
734 struct regulator_init_data *vio6025;
702}; 735};
703 736
704/*----------------------------------------------------------------------*/ 737/*----------------------------------------------------------------------*/
@@ -780,4 +813,21 @@ static inline int twl4030charger_usb_en(int enable) { return 0; }
780#define TWL6030_REG_VRTC 47 813#define TWL6030_REG_VRTC 47
781#define TWL6030_REG_CLK32KG 48 814#define TWL6030_REG_CLK32KG 48
782 815
816/* LDOs on 6025 have different names */
817#define TWL6025_REG_LDO2 49
818#define TWL6025_REG_LDO4 50
819#define TWL6025_REG_LDO3 51
820#define TWL6025_REG_LDO5 52
821#define TWL6025_REG_LDO1 53
822#define TWL6025_REG_LDO7 54
823#define TWL6025_REG_LDO6 55
824#define TWL6025_REG_LDOLN 56
825#define TWL6025_REG_LDOUSB 57
826
827/* 6025 DCDC supplies */
828#define TWL6025_REG_SMPS3 58
829#define TWL6025_REG_SMPS4 59
830#define TWL6025_REG_VIO 60
831
832
783#endif /* End of __TWL4030_H */ 833#endif /* End of __TWL4030_H */