config TWL4030_BCI_BATTERY
tristate "OMAP TWL4030 BCI Battery driver"
- depends on (MACH_OMAP_2430SDP || MACH_OMAP_3430SDP || MACH_OMAP_LDP) && TWL4030_MADC
- default y
+ depends on TWL4030_CORE && TWL4030_MADC
help
Support for OMAP TWL4030 BCI Battery driver.
This driver can give support for TWL4030 Battery Charge Interface.
/* REVISIT do we need to request both IRQs ?? */
/* request BCI interruption */
- ret = request_irq(TWL4030_MODIRQ_BCI, twl4030battery_interrupt,
+ irq = platform_get_irq(pdev, 1);
+ ret = request_irq(irq, twl4030battery_interrupt,
0, pdev->name, NULL);
if (ret) {
dev_dbg(&pdev->dev, "could not request irq %d, status %d\n",
- TWL4030_MODIRQ_BCI, ret);
+ irq, ret);
goto batt_irq_fail;
}
- irq = platform_get_irq(pdev, 0);
-
/* request Power interruption */
+ irq = platform_get_irq(pdev, 0);
ret = request_irq(irq, twl4030charger_interrupt,
0, pdev->name, di);
batt_failed:
free_irq(irq, di);
chg_irq_fail:
- free_irq(TWL4030_MODIRQ_BCI, NULL);
+ irq = platform_get_irq(pdev, 1);
+ free_irq(irq, NULL);
batt_irq_fail:
voltage_setup_fail:
temp_setup_fail:
static int __exit twl4030_bci_battery_remove(struct platform_device *pdev)
{
struct twl4030_bci_device_info *di = platform_get_drvdata(pdev);
- int irq = platform_get_irq(pdev, 0);
+ int irq;
twl4030charger_ac_en(DISABLE);
twl4030charger_usb_en(DISABLE);
twl4030battery_hw_level_en(DISABLE);
twl4030battery_hw_presence_en(DISABLE);
- free_irq(TWL4030_MODIRQ_BCI, NULL);
+ irq = platform_get_irq(pdev, 0);
free_irq(irq, di);
+ irq = platform_get_irq(pdev, 1);
+ free_irq(irq, NULL);
+
flush_scheduled_work();
power_supply_unregister(&di->bat);
power_supply_unregister(&di->bk_bat);
/* #define TWL4030_MODIRQ_GPIO (TWL4030_IRQ_BASE + 0) */
/* #define TWL4030_MODIRQ_KEYPAD (TWL4030_IRQ_BASE + 1) */
-#define TWL4030_MODIRQ_BCI (TWL4030_IRQ_BASE + 2)
+/* #define TWL4030_MODIRQ_BCI (TWL4030_IRQ_BASE + 2) */
#define TWL4030_MODIRQ_MADC (TWL4030_IRQ_BASE + 3)
/* #define TWL4030_MODIRQ_USB (TWL4030_IRQ_BASE + 4) */
/* #define TWL4030_MODIRQ_PWR (TWL4030_IRQ_BASE + 5) */