aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/wm8350_power.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-11-04 11:10:52 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2009-12-13 13:21:40 -0500
commit6a6127462eb9096419fd4b3115ec5971d83a600f (patch)
tree8d7050226d8bcdbbe98f13c3ec90d62c4969879a /drivers/power/wm8350_power.c
parent5a65edbc12b6b34ef912114f1fc8215786f85b25 (diff)
mfd: Mask and unmask wm8350 IRQs on request and free
Bring the WM8350 IRQ API more in line with the generic IRQ API by masking and unmasking interrupts as they are requested and freed. This is mostly just a case of deleting the mask and unmask calls from the individual drivers. The RTC driver is changed to mask the periodic IRQ after requesting it rather than only unmasking the alarm IRQ. If the periodic IRQ fires in the period where it is reqested then there will be a spurious notification but there should be no serious consequences from this. The CODEC drive is changed to explicitly disable headphone jack detection prior to requesting the IRQs. This will avoid the IRQ firing with no jack set up. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/power/wm8350_power.c')
-rw-r--r--drivers/power/wm8350_power.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/drivers/power/wm8350_power.c b/drivers/power/wm8350_power.c
index 6e634cf7fc14..ad4f071e1287 100644
--- a/drivers/power/wm8350_power.c
+++ b/drivers/power/wm8350_power.c
@@ -391,80 +391,54 @@ static void wm8350_init_charger(struct wm8350 *wm8350)
391 /* register our interest in charger events */ 391 /* register our interest in charger events */
392 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT, 392 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT,
393 wm8350_charger_handler, 0, "Battery hot", wm8350); 393 wm8350_charger_handler, 0, "Battery hot", wm8350);
394 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT);
395 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD, 394 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD,
396 wm8350_charger_handler, 0, "Battery cold", wm8350); 395 wm8350_charger_handler, 0, "Battery cold", wm8350);
397 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD);
398 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL, 396 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL,
399 wm8350_charger_handler, 0, "Battery fail", wm8350); 397 wm8350_charger_handler, 0, "Battery fail", wm8350);
400 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL);
401 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_TO, 398 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_TO,
402 wm8350_charger_handler, 0, 399 wm8350_charger_handler, 0,
403 "Charger timeout", wm8350); 400 "Charger timeout", wm8350);
404 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_TO);
405 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_END, 401 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_END,
406 wm8350_charger_handler, 0, 402 wm8350_charger_handler, 0,
407 "Charge end", wm8350); 403 "Charge end", wm8350);
408 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_END);
409 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_START, 404 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_START,
410 wm8350_charger_handler, 0, 405 wm8350_charger_handler, 0,
411 "Charge start", wm8350); 406 "Charge start", wm8350);
412 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_START);
413 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_FAST_RDY, 407 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_FAST_RDY,
414 wm8350_charger_handler, 0, 408 wm8350_charger_handler, 0,
415 "Fast charge ready", wm8350); 409 "Fast charge ready", wm8350);
416 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_FAST_RDY);
417 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9, 410 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9,
418 wm8350_charger_handler, 0, 411 wm8350_charger_handler, 0,
419 "Battery <3.9V", wm8350); 412 "Battery <3.9V", wm8350);
420 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9);
421 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1, 413 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1,
422 wm8350_charger_handler, 0, 414 wm8350_charger_handler, 0,
423 "Battery <3.1V", wm8350); 415 "Battery <3.1V", wm8350);
424 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1);
425 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85, 416 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85,
426 wm8350_charger_handler, 0, 417 wm8350_charger_handler, 0,
427 "Battery <2.85V", wm8350); 418 "Battery <2.85V", wm8350);
428 419
429 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85);
430
431 /* and supply change events */ 420 /* and supply change events */
432 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_USB_FB, 421 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_USB_FB,
433 wm8350_charger_handler, 0, "USB", wm8350); 422 wm8350_charger_handler, 0, "USB", wm8350);
434 wm8350_unmask_irq(wm8350, WM8350_IRQ_EXT_USB_FB);
435 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_WALL_FB, 423 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_WALL_FB,
436 wm8350_charger_handler, 0, "Wall", wm8350); 424 wm8350_charger_handler, 0, "Wall", wm8350);
437 wm8350_unmask_irq(wm8350, WM8350_IRQ_EXT_WALL_FB);
438 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_BAT_FB, 425 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_BAT_FB,
439 wm8350_charger_handler, 0, "Battery", wm8350); 426 wm8350_charger_handler, 0, "Battery", wm8350);
440 wm8350_unmask_irq(wm8350, WM8350_IRQ_EXT_BAT_FB);
441} 427}
442 428
443static void free_charger_irq(struct wm8350 *wm8350) 429static void free_charger_irq(struct wm8350 *wm8350)
444{ 430{
445 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT);
446 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT); 431 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT);
447 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD);
448 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD); 432 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD);
449 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL);
450 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL); 433 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL);
451 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_TO);
452 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_TO); 434 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_TO);
453 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_END);
454 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_END); 435 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_END);
455 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_START);
456 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_START); 436 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_START);
457 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9);
458 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9); 437 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9);
459 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1);
460 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1); 438 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1);
461 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85);
462 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85); 439 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85);
463 wm8350_mask_irq(wm8350, WM8350_IRQ_EXT_USB_FB);
464 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_USB_FB); 440 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_USB_FB);
465 wm8350_mask_irq(wm8350, WM8350_IRQ_EXT_WALL_FB);
466 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_WALL_FB); 441 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_WALL_FB);
467 wm8350_mask_irq(wm8350, WM8350_IRQ_EXT_BAT_FB);
468 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_BAT_FB); 442 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_BAT_FB);
469} 443}
470 444