aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@marvell.com>2010-02-08 05:02:00 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2010-03-07 16:17:20 -0500
commit2afa62ea76027b00e472ddb672191e6e15425b43 (patch)
tree3c70f220af28c859fea638e5eae4aed726f5dcdd /include/linux
parent7731074ab21745cde00578148ce760df107eaf27 (diff)
mfd: Use genirq in 88pm860x
Use genirq to simplify IRQ handling in 88pm860x. Remove the interface of mask/free IRQs on 88pm860x. All these work is taken by genirq. Update the touchscreen driver of 88pm860x since IRQ handling is changed. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mfd/88pm860x.h30
1 files changed, 12 insertions, 18 deletions
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index 80bc82a7ac96..73f92c5feea2 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -262,12 +262,13 @@ enum {
262 262
263/* Interrupt Number in 88PM8607 */ 263/* Interrupt Number in 88PM8607 */
264enum { 264enum {
265 PM8607_IRQ_ONKEY = 0, 265 PM8607_IRQ_ONKEY,
266 PM8607_IRQ_EXTON, 266 PM8607_IRQ_EXTON,
267 PM8607_IRQ_CHG, 267 PM8607_IRQ_CHG,
268 PM8607_IRQ_BAT, 268 PM8607_IRQ_BAT,
269 PM8607_IRQ_RTC, 269 PM8607_IRQ_RTC,
270 PM8607_IRQ_VBAT = 8, 270 PM8607_IRQ_CC,
271 PM8607_IRQ_VBAT,
271 PM8607_IRQ_VCHG, 272 PM8607_IRQ_VCHG,
272 PM8607_IRQ_VSYS, 273 PM8607_IRQ_VSYS,
273 PM8607_IRQ_TINT, 274 PM8607_IRQ_TINT,
@@ -275,7 +276,7 @@ enum {
275 PM8607_IRQ_GPADC1, 276 PM8607_IRQ_GPADC1,
276 PM8607_IRQ_GPADC2, 277 PM8607_IRQ_GPADC2,
277 PM8607_IRQ_GPADC3, 278 PM8607_IRQ_GPADC3,
278 PM8607_IRQ_AUDIO_SHORT = 16, 279 PM8607_IRQ_AUDIO_SHORT,
279 PM8607_IRQ_PEN, 280 PM8607_IRQ_PEN,
280 PM8607_IRQ_HEADSET, 281 PM8607_IRQ_HEADSET,
281 PM8607_IRQ_HOOK, 282 PM8607_IRQ_HOOK,
@@ -291,26 +292,19 @@ enum {
291 PM8607_CHIP_B0 = 0x48, 292 PM8607_CHIP_B0 = 0x48,
292}; 293};
293 294
294#define PM860X_NUM_IRQ 24
295
296struct pm860x_irq {
297 irq_handler_t handler;
298 void *data;
299};
300
301struct pm860x_chip { 295struct pm860x_chip {
302 struct device *dev; 296 struct device *dev;
303 struct mutex io_lock; 297 struct mutex io_lock;
304 struct mutex irq_lock; 298 struct mutex irq_lock;
305 struct i2c_client *client; 299 struct i2c_client *client;
306 struct i2c_client *companion; /* companion chip client */ 300 struct i2c_client *companion; /* companion chip client */
307 struct pm860x_irq irq[PM860X_NUM_IRQ];
308 301
309 int buck3_double; /* DVC ramp slope double */ 302 int buck3_double; /* DVC ramp slope double */
310 unsigned short companion_addr; 303 unsigned short companion_addr;
311 int id; 304 int id;
312 int irq_mode; 305 int irq_mode;
313 int chip_irq; 306 int irq_base;
307 int core_irq;
314 unsigned char chip_version; 308 unsigned char chip_version;
315 309
316}; 310};
@@ -347,14 +341,20 @@ struct pm860x_touch_pdata {
347 unsigned long flags; 341 unsigned long flags;
348}; 342};
349 343
344struct pm860x_power_pdata {
345 unsigned fast_charge; /* charge current */
346};
347
350struct pm860x_platform_data { 348struct pm860x_platform_data {
351 struct pm860x_backlight_pdata *backlight; 349 struct pm860x_backlight_pdata *backlight;
352 struct pm860x_led_pdata *led; 350 struct pm860x_led_pdata *led;
353 struct pm860x_touch_pdata *touch; 351 struct pm860x_touch_pdata *touch;
352 struct pm860x_power_pdata *power;
354 353
355 unsigned short companion_addr; /* I2C address of companion chip */ 354 unsigned short companion_addr; /* I2C address of companion chip */
356 int i2c_port; /* Controlled by GI2C or PI2C */ 355 int i2c_port; /* Controlled by GI2C or PI2C */
357 int irq_mode; /* Clear interrupt by read/write(0/1) */ 356 int irq_mode; /* Clear interrupt by read/write(0/1) */
357 int irq_base; /* IRQ base number of 88pm860x */
358 struct regulator_init_data *regulator[PM8607_MAX_REGULATOR]; 358 struct regulator_init_data *regulator[PM8607_MAX_REGULATOR];
359}; 359};
360 360
@@ -368,12 +368,6 @@ extern int pm860x_bulk_write(struct i2c_client *, int, int, unsigned char *);
368extern int pm860x_set_bits(struct i2c_client *, int, unsigned char, 368extern int pm860x_set_bits(struct i2c_client *, int, unsigned char,
369 unsigned char); 369 unsigned char);
370 370
371extern int pm860x_mask_irq(struct pm860x_chip *, int);
372extern int pm860x_unmask_irq(struct pm860x_chip *, int);
373extern int pm860x_request_irq(struct pm860x_chip *, int,
374 irq_handler_t handler, void *);
375extern int pm860x_free_irq(struct pm860x_chip *, int);
376
377extern int pm860x_device_init(struct pm860x_chip *chip, 371extern int pm860x_device_init(struct pm860x_chip *chip,
378 struct pm860x_platform_data *pdata); 372 struct pm860x_platform_data *pdata);
379extern void pm860x_device_exit(struct pm860x_chip *chip); 373extern void pm860x_device_exit(struct pm860x_chip *chip);