aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/wm8350_power.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-12-16 12:33:49 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-16 12:33:49 -0500
commitee1156c11a1121e118b0a7f2dec240f0d421b1fd (patch)
treeb8771cc5a9758af9d7410fc519227c036c222130 /drivers/power/wm8350_power.c
parentb9f8fcd55bbdb037e5332dbdb7b494f0b70861ac (diff)
parent8bea8672edfca7ec5f661cafb218f1205863b343 (diff)
Merge branch 'linus' into sched/urgent
Conflicts: kernel/sched_idletask.c Merge reason: resolve the conflicts, pick up latest changes. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/power/wm8350_power.c')
-rw-r--r--drivers/power/wm8350_power.c63
1 files changed, 24 insertions, 39 deletions
diff --git a/drivers/power/wm8350_power.c b/drivers/power/wm8350_power.c
index 28b0299c0043..ad4f071e1287 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,
184 184
185static DEVICE_ATTR(charger_state, 0444, charger_state_show, NULL); 185static DEVICE_ATTR(charger_state, 0444, charger_state_show, NULL);
186 186
187static void wm8350_charger_handler(struct wm8350 *wm8350, int irq, void *data) 187static irqreturn_t wm8350_charger_handler(int irq, void *data)
188{ 188{
189 struct wm8350 *wm8350 = data;
189 struct wm8350_power *power = &wm8350->power; 190 struct wm8350_power *power = &wm8350->power;
190 struct wm8350_charger_policy *policy = power->policy; 191 struct wm8350_charger_policy *policy = power->policy;
191 192
@@ -238,6 +239,8 @@ static void wm8350_charger_handler(struct wm8350 *wm8350, int irq, void *data)
238 default: 239 default:
239 dev_err(wm8350->dev, "Unknown interrupt %d\n", irq); 240 dev_err(wm8350->dev, "Unknown interrupt %d\n", irq);
240 } 241 }
242
243 return IRQ_HANDLED;
241} 244}
242 245
243/********************************************************************* 246/*********************************************************************
@@ -387,73 +390,55 @@ static void wm8350_init_charger(struct wm8350 *wm8350)
387{ 390{
388 /* register our interest in charger events */ 391 /* register our interest in charger events */
389 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT, 392 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT,
390 wm8350_charger_handler, NULL); 393 wm8350_charger_handler, 0, "Battery hot", wm8350);
391 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT);
392 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD, 394 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD,
393 wm8350_charger_handler, NULL); 395 wm8350_charger_handler, 0, "Battery cold", wm8350);
394 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD);
395 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL, 396 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL,
396 wm8350_charger_handler, NULL); 397 wm8350_charger_handler, 0, "Battery fail", wm8350);
397 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL);
398 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_TO, 398 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_TO,
399 wm8350_charger_handler, NULL); 399 wm8350_charger_handler, 0,
400 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_TO); 400 "Charger timeout", wm8350);
401 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_END, 401 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_END,
402 wm8350_charger_handler, NULL); 402 wm8350_charger_handler, 0,
403 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_END); 403 "Charge end", wm8350);
404 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_START, 404 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_START,
405 wm8350_charger_handler, NULL); 405 wm8350_charger_handler, 0,
406 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_START); 406 "Charge start", wm8350);
407 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_FAST_RDY, 407 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_FAST_RDY,
408 wm8350_charger_handler, NULL); 408 wm8350_charger_handler, 0,
409 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_FAST_RDY); 409 "Fast charge ready", wm8350);
410 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9, 410 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9,
411 wm8350_charger_handler, NULL); 411 wm8350_charger_handler, 0,
412 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9); 412 "Battery <3.9V", wm8350);
413 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1, 413 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1,
414 wm8350_charger_handler, NULL); 414 wm8350_charger_handler, 0,
415 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1); 415 "Battery <3.1V", wm8350);
416 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85, 416 wm8350_register_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85,
417 wm8350_charger_handler, NULL); 417 wm8350_charger_handler, 0,
418 wm8350_unmask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85); 418 "Battery <2.85V", wm8350);
419 419
420 /* and supply change events */ 420 /* and supply change events */
421 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_USB_FB, 421 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_USB_FB,
422 wm8350_charger_handler, NULL); 422 wm8350_charger_handler, 0, "USB", wm8350);
423 wm8350_unmask_irq(wm8350, WM8350_IRQ_EXT_USB_FB);
424 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_WALL_FB, 423 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_WALL_FB,
425 wm8350_charger_handler, NULL); 424 wm8350_charger_handler, 0, "Wall", wm8350);
426 wm8350_unmask_irq(wm8350, WM8350_IRQ_EXT_WALL_FB);
427 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_BAT_FB, 425 wm8350_register_irq(wm8350, WM8350_IRQ_EXT_BAT_FB,
428 wm8350_charger_handler, NULL); 426 wm8350_charger_handler, 0, "Battery", wm8350);
429 wm8350_unmask_irq(wm8350, WM8350_IRQ_EXT_BAT_FB);
430} 427}
431 428
432static void free_charger_irq(struct wm8350 *wm8350) 429static void free_charger_irq(struct wm8350 *wm8350)
433{ 430{
434 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT);
435 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT); 431 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_HOT);
436 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD);
437 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD); 432 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_COLD);
438 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL);
439 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL); 433 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_BAT_FAIL);
440 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_TO);
441 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_TO); 434 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_TO);
442 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_END);
443 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_END); 435 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_END);
444 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_START);
445 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_START); 436 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_START);
446 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9);
447 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9); 437 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P9);
448 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1);
449 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1); 438 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_3P1);
450 wm8350_mask_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85);
451 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85); 439 wm8350_free_irq(wm8350, WM8350_IRQ_CHG_VBATT_LT_2P85);
452 wm8350_mask_irq(wm8350, WM8350_IRQ_EXT_USB_FB);
453 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_USB_FB); 440 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_USB_FB);
454 wm8350_mask_irq(wm8350, WM8350_IRQ_EXT_WALL_FB);
455 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_WALL_FB); 441 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_WALL_FB);
456 wm8350_mask_irq(wm8350, WM8350_IRQ_EXT_BAT_FB);
457 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_BAT_FB); 442 wm8350_free_irq(wm8350, WM8350_IRQ_EXT_BAT_FB);
458} 443}
459 444