diff options
author | Balaji T K <balajitk@ti.com> | 2009-12-13 18:25:31 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2009-12-13 18:25:31 -0500 |
commit | e8deb28ca8e221de0239eafb3c3d431d8854278e (patch) | |
tree | 2dffdb207366aa0a8f229775515fc207c16f8574 /include/linux/i2c | |
parent | c4aa6f314328142974c78377cd9476f8ec6f0eba (diff) |
mfd: Add support for twl6030 irq framework
This patch adds support for phoenix interrupt framework. New iInterrupt
status register A, B, C are introduced in Phoenix and are cleared on write.
Due to the differences in interrupt handling with respect to TWL4030,
twl6030-irq.c is created for TWL6030 PMIC
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/i2c')
-rw-r--r-- | include/linux/i2c/twl.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 0f812f5aa723..8e7405d9c624 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -89,6 +89,67 @@ | |||
89 | #define BCI_PRES_INTR_OFFSET 9 | 89 | #define BCI_PRES_INTR_OFFSET 9 |
90 | #define USB_PRES_INTR_OFFSET 10 | 90 | #define USB_PRES_INTR_OFFSET 10 |
91 | #define RTC_INTR_OFFSET 11 | 91 | #define RTC_INTR_OFFSET 11 |
92 | |||
93 | /* | ||
94 | * Offset from TWL6030_IRQ_BASE / pdata->irq_base | ||
95 | */ | ||
96 | #define PWR_INTR_OFFSET 0 | ||
97 | #define HOTDIE_INTR_OFFSET 12 | ||
98 | #define SMPSLDO_INTR_OFFSET 13 | ||
99 | #define BATDETECT_INTR_OFFSET 14 | ||
100 | #define SIMDETECT_INTR_OFFSET 15 | ||
101 | #define MMCDETECT_INTR_OFFSET 16 | ||
102 | #define GASGAUGE_INTR_OFFSET 17 | ||
103 | #define USBOTG_INTR_OFFSET 4 | ||
104 | #define CHARGER_INTR_OFFSET 2 | ||
105 | #define RSV_INTR_OFFSET 0 | ||
106 | |||
107 | /* INT register offsets */ | ||
108 | #define REG_INT_STS_A 0x00 | ||
109 | #define REG_INT_STS_B 0x01 | ||
110 | #define REG_INT_STS_C 0x02 | ||
111 | |||
112 | #define REG_INT_MSK_LINE_A 0x03 | ||
113 | #define REG_INT_MSK_LINE_B 0x04 | ||
114 | #define REG_INT_MSK_LINE_C 0x05 | ||
115 | |||
116 | #define REG_INT_MSK_STS_A 0x06 | ||
117 | #define REG_INT_MSK_STS_B 0x07 | ||
118 | #define REG_INT_MSK_STS_C 0x08 | ||
119 | |||
120 | /* MASK INT REG GROUP A */ | ||
121 | #define TWL6030_PWR_INT_MASK 0x07 | ||
122 | #define TWL6030_RTC_INT_MASK 0x18 | ||
123 | #define TWL6030_HOTDIE_INT_MASK 0x20 | ||
124 | #define TWL6030_SMPSLDOA_INT_MASK 0xC0 | ||
125 | |||
126 | /* MASK INT REG GROUP B */ | ||
127 | #define TWL6030_SMPSLDOB_INT_MASK 0x01 | ||
128 | #define TWL6030_BATDETECT_INT_MASK 0x02 | ||
129 | #define TWL6030_SIMDETECT_INT_MASK 0x04 | ||
130 | #define TWL6030_MMCDETECT_INT_MASK 0x08 | ||
131 | #define TWL6030_GPADC_INT_MASK 0x60 | ||
132 | #define TWL6030_GASGAUGE_INT_MASK 0x80 | ||
133 | |||
134 | /* MASK INT REG GROUP C */ | ||
135 | #define TWL6030_USBOTG_INT_MASK 0x0F | ||
136 | #define TWL6030_CHARGER_CTRL_INT_MASK 0x10 | ||
137 | #define TWL6030_CHARGER_FAULT_INT_MASK 0x60 | ||
138 | |||
139 | |||
140 | #define TWL4030_CLASS_ID 0x4030 | ||
141 | #define TWL6030_CLASS_ID 0x6030 | ||
142 | unsigned int twl_rev(void); | ||
143 | #define GET_TWL_REV (twl_rev()) | ||
144 | #define TWL_CLASS_IS(class, id) \ | ||
145 | static inline int twl_class_is_ ##class(void) \ | ||
146 | { \ | ||
147 | return ((id) == (GET_TWL_REV)) ? 1 : 0; \ | ||
148 | } | ||
149 | |||
150 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | ||
151 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | ||
152 | |||
92 | /* | 153 | /* |
93 | * Read and write single 8-bit registers | 154 | * Read and write single 8-bit registers |
94 | */ | 155 | */ |
@@ -104,6 +165,9 @@ int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | |||
104 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 165 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
105 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 166 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
106 | 167 | ||
168 | int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); | ||
169 | int twl6030_interrupt_mask(u8 bit_mask, u8 offset); | ||
170 | |||
107 | /*----------------------------------------------------------------------*/ | 171 | /*----------------------------------------------------------------------*/ |
108 | 172 | ||
109 | /* | 173 | /* |