Commit efd71c89 authored by Anton Vorontsov's avatar Anton Vorontsov

ab8500_charger: Convert to the new USB OTG calls

This patch fixes the following build errors:

ab8500_charger.c: In function 'ab8500_charger_remove':
ab8500_charger.c:2519:2: error: implicit declaration of function 'otg_unregister_notifier' [-Werror=implicit-function-declaration]
ab8500_charger.c:2520:2: error: implicit declaration of function 'otg_put_transceiver' [-Werror=implicit-function-declaration]
ab8500_charger.c: In function 'ab8500_charger_probe':
ab8500_charger.c:2688:2: error: implicit declaration of function 'otg_get_transceiver' [-Werror=implicit-function-declaration]
ab8500_charger.c:2688:10: warning: assignment makes pointer from integer without a cast [enabled by default]
ab8500_charger.c:2695:2: error: implicit declaration of function 'otg_register_notifier' [-Werror=implicit-function-declaration]
Signed-off-by: default avatarAnton Vorontsov <anton.vorontsov@linaro.org>
parent 1f855824
...@@ -240,7 +240,7 @@ struct ab8500_charger { ...@@ -240,7 +240,7 @@ struct ab8500_charger {
struct work_struct usb_state_changed_work; struct work_struct usb_state_changed_work;
struct work_struct check_main_thermal_prot_work; struct work_struct check_main_thermal_prot_work;
struct work_struct check_usb_thermal_prot_work; struct work_struct check_usb_thermal_prot_work;
struct otg_transceiver *otg; struct usb_phy *usb_phy;
struct notifier_block nb; struct notifier_block nb;
}; };
...@@ -2516,8 +2516,8 @@ static int __devexit ab8500_charger_remove(struct platform_device *pdev) ...@@ -2516,8 +2516,8 @@ static int __devexit ab8500_charger_remove(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
dev_err(di->dev, "%s mask and set failed\n", __func__); dev_err(di->dev, "%s mask and set failed\n", __func__);
otg_unregister_notifier(di->otg, &di->nb); usb_unregister_notifier(di->usb_phy, &di->nb);
otg_put_transceiver(di->otg); usb_put_transceiver(di->usb_phy);
/* Delete the work queue */ /* Delete the work queue */
destroy_workqueue(di->charger_wq); destroy_workqueue(di->charger_wq);
...@@ -2685,17 +2685,17 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev) ...@@ -2685,17 +2685,17 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
goto free_ac; goto free_ac;
} }
di->otg = otg_get_transceiver(); di->usb_phy = usb_get_transceiver();
if (!di->otg) { if (!di->usb_phy) {
dev_err(di->dev, "failed to get otg transceiver\n"); dev_err(di->dev, "failed to get usb transceiver\n");
ret = -EINVAL; ret = -EINVAL;
goto free_usb; goto free_usb;
} }
di->nb.notifier_call = ab8500_charger_usb_notifier_call; di->nb.notifier_call = ab8500_charger_usb_notifier_call;
ret = otg_register_notifier(di->otg, &di->nb); ret = usb_register_notifier(di->usb_phy, &di->nb);
if (ret) { if (ret) {
dev_err(di->dev, "failed to register otg notifier\n"); dev_err(di->dev, "failed to register usb notifier\n");
goto put_otg_transceiver; goto put_usb_phy;
} }
/* Identify the connected charger types during startup */ /* Identify the connected charger types during startup */
...@@ -2736,15 +2736,15 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev) ...@@ -2736,15 +2736,15 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
return ret; return ret;
free_irq: free_irq:
otg_unregister_notifier(di->otg, &di->nb); usb_unregister_notifier(di->usb_phy, &di->nb);
/* We also have to free all successfully registered irqs */ /* We also have to free all successfully registered irqs */
for (i = i - 1; i >= 0; i--) { for (i = i - 1; i >= 0; i--) {
irq = platform_get_irq_byname(pdev, ab8500_charger_irq[i].name); irq = platform_get_irq_byname(pdev, ab8500_charger_irq[i].name);
free_irq(irq, di); free_irq(irq, di);
} }
put_otg_transceiver: put_usb_phy:
otg_put_transceiver(di->otg); usb_put_transceiver(di->usb_phy);
free_usb: free_usb:
power_supply_unregister(&di->usb_chg.psy); power_supply_unregister(&di->usb_chg.psy);
free_ac: free_ac:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment