aboutsummaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-11-04 16:10:51 +0000
committerSamuel Ortiz <sameo@linux.intel.com>2009-12-13 19:21:39 +0100
commit5a65edbc12b6b34ef912114f1fc8215786f85b25 (patch)
treeffe43bd1234b52ad1c3774b096a51594aabe49ad /drivers/power
parentb9f96b5dcb1e2a75d142e481b77805ffdc6ccea6 (diff)
mfd: Convert wm8350 IRQ handlers to irq_handler_t
This is done as simple code transformation, the semantics of the IRQ API provided by the core are are still very different to those of genirq (mainly with regard to masking). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/wm8350_power.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/drivers/power/wm8350_power.c b/drivers/power/wm8350_power.c
index 28b0299c004..6e634cf7fc1 100644
--- a/drivers/power/wm8350_power.c
+++ b/drivers/power/wm8350_power.c
@@ -184,8 +184,9 @@ static ssize_t charger_state_show(struct device *dev,
static DEVICE_ATTR(charger_state, 0444, charger_state_show, NULL);
-static void wm8350_charger_handler(struct wm8350 *wm8350, int irq, void *data)
+static irqreturn_t wm8350_charger_handler(int irq, void *data)
{
+ struct wm8350 *wm8350 = data;
struct wm8350_power *power = &wm8350->power;
struct wm8350_charger_policy *policy = power->policy;
@@ -238,6 +239,8 @@ static void wm8350_charger_handler(struct wm8350 *wm8350, int irq, void *data)
default:
dev_err(wm8350->dev, "Unknown interrupt %d\n", irq);
}
+
+ return IRQ_HANDLED;
}
/*********************************************************************
@@ -387,45 +390,53 @@ static void wm8350_init_charger(struct wm8350 *wm8350)
{
/* register our interest in charger events */
wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0, "Battery hot", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT);
wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0, "Battery cold", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD);
wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0, "Battery fail", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL);
wm8350_register_irq(wm8350, WM8350_IRQ_CHG_TO,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0,
+ "Charger timeout", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_TO);
wm8350_register_irq(wm8350, WM8350_IRQ_CHG_END,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0,
+ "Charge end", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_END);
wm8350_register_irq(wm8350, WM8350_IRQ_CHG_START,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0,
+ "Charge start", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_START);
wm8350_register_irq(wm8350, WM8350_IRQ_CHG_FAST_RDY,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0,
+ "Fast charge ready", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_FAST_RDY);
wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0,
+ "Battery <3.9V", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9);
wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0,
+ "Battery <3.1V", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1);
wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0,
+ "Battery <2.85V", wm8350);
+
wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85);
/* and supply change events */
wm8350_register_irq(wm8350, WM8350_IRQ_EXT_USB_FB,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0, "USB", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_EXT_USB_FB);
wm8350_register_irq(wm8350, WM8350_IRQ_EXT_WALL_FB,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0, "Wall", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_EXT_WALL_FB);
wm8350_register_irq(wm8350, WM8350_IRQ_EXT_BAT_FB,
- wm8350_charger_handler, NULL);
+ wm8350_charger_handler, 0, "Battery", wm8350);
wm8350_unmask_irq(wm8350, WM8350_IRQ_EXT_BAT_FB);
}