Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff9cce82 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'xceiv-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next

usb: phy: patches for v3.6 merge window

We are starting to support multiple USB phys as
we should thanks for Kishon's work. DeviceTree support
for USB PHYs won't come until discussion with DeviceTree
maintainer is finished.

Together with that series, we have one fix for twl4030
which missed a IRQF_ONESHOT annotation when requesting
a threaded IRQ without a top half handler, and removal
of an unused variable compilation warning to isp1301_omap.
parents 93314150 f8ecf829
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2517,7 +2517,7 @@ static int __devexit ab8500_charger_remove(struct platform_device *pdev)
		dev_err(di->dev, "%s mask and set failed\n", __func__);

	usb_unregister_notifier(di->usb_phy, &di->nb);
	usb_put_transceiver(di->usb_phy);
	usb_put_phy(di->usb_phy);

	/* Delete the work queue */
	destroy_workqueue(di->charger_wq);
@@ -2688,8 +2688,8 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
		goto free_ac;
	}

	di->usb_phy = usb_get_transceiver();
	if (!di->usb_phy) {
	di->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2);
	if (IS_ERR_OR_NULL(di->usb_phy)) {
		dev_err(di->dev, "failed to get usb transceiver\n");
		ret = -EINVAL;
		goto free_usb;
@@ -2747,7 +2747,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
		free_irq(irq, di);
	}
put_usb_phy:
	usb_put_transceiver(di->usb_phy);
	usb_put_phy(di->usb_phy);
free_usb:
	power_supply_unregister(&di->usb_chg.psy);
free_ac:
+4 −4
Original line number Diff line number Diff line
@@ -415,8 +415,8 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev)
	if (!isp)
		return -ENOMEM;

	isp->phy = usb_get_transceiver();
	if (!isp->phy)
	isp->phy = usb_get_phy(USB_PHY_TYPE_USB2);
	if (IS_ERR_OR_NULL(isp->phy))
		goto fail0;

	isp->dev = &pdev->dev;
@@ -475,7 +475,7 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev)
	power_supply_unregister(&isp->psy);
fail1:
	isp1704_charger_set_power(isp, 0);
	usb_put_transceiver(isp->phy);
	usb_put_phy(isp->phy);
fail0:
	kfree(isp);

@@ -490,7 +490,7 @@ static int __devexit isp1704_charger_remove(struct platform_device *pdev)

	usb_unregister_notifier(isp->phy, &isp->nb);
	power_supply_unregister(&isp->psy);
	usb_put_transceiver(isp->phy);
	usb_put_phy(isp->phy);
	isp1704_charger_set_power(isp, 0);
	kfree(isp);

+11 −11
Original line number Diff line number Diff line
@@ -321,11 +321,11 @@ static int pda_power_probe(struct platform_device *pdev)
	}

#ifdef CONFIG_USB_OTG_UTILS
	transceiver = usb_get_transceiver();
	if (transceiver && !pdata->is_usb_online) {
	transceiver = usb_get_phy(USB_PHY_TYPE_USB2);
	if (!IS_ERR_OR_NULL(transceiver)) {
		if (!pdata->is_usb_online)
			pdata->is_usb_online = otg_is_usb_online;
	}
	if (transceiver && !pdata->is_ac_online) {
		if (!pdata->is_ac_online)
			pdata->is_ac_online = otg_is_ac_online;
	}
#endif
@@ -373,7 +373,7 @@ static int pda_power_probe(struct platform_device *pdev)
	}

#ifdef CONFIG_USB_OTG_UTILS
	if (transceiver && pdata->use_otg_notifier) {
	if (!IS_ERR_OR_NULL(transceiver) && pdata->use_otg_notifier) {
		otg_nb.notifier_call = otg_handle_notification;
		ret = usb_register_notifier(transceiver, &otg_nb);
		if (ret) {
@@ -408,8 +408,8 @@ static int pda_power_probe(struct platform_device *pdev)
	if (pdata->is_ac_online && ac_irq)
		free_irq(ac_irq->start, &pda_psy_ac);
#ifdef CONFIG_USB_OTG_UTILS
	if (transceiver)
		usb_put_transceiver(transceiver);
	if (!IS_ERR_OR_NULL(transceiver))
		usb_put_phy(transceiver);
#endif
ac_irq_failed:
	if (pdata->is_ac_online)
@@ -443,8 +443,8 @@ static int pda_power_remove(struct platform_device *pdev)
	if (pdata->is_ac_online)
		power_supply_unregister(&pda_psy_ac);
#ifdef CONFIG_USB_OTG_UTILS
	if (transceiver)
		usb_put_transceiver(transceiver);
	if (!IS_ERR_OR_NULL(transceiver))
		usb_put_phy(transceiver);
#endif
	if (ac_draw) {
		regulator_put(ac_draw);
+7 −6
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/i2c/twl.h>
@@ -479,8 +480,8 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)

	INIT_WORK(&bci->work, twl4030_bci_usb_work);

	bci->transceiver = usb_get_transceiver();
	if (bci->transceiver != NULL) {
	bci->transceiver = usb_get_phy(USB_PHY_TYPE_USB2);
	if (!IS_ERR_OR_NULL(bci->transceiver)) {
		bci->usb_nb.notifier_call = twl4030_bci_usb_ncb;
		usb_register_notifier(bci->transceiver, &bci->usb_nb);
	}
@@ -507,9 +508,9 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
	return 0;

fail_unmask_interrupts:
	if (bci->transceiver != NULL) {
	if (!IS_ERR_OR_NULL(bci->transceiver)) {
		usb_unregister_notifier(bci->transceiver, &bci->usb_nb);
		usb_put_transceiver(bci->transceiver);
		usb_put_phy(bci->transceiver);
	}
	free_irq(bci->irq_bci, bci);
fail_bci_irq:
@@ -538,9 +539,9 @@ static int __exit twl4030_bci_remove(struct platform_device *pdev)
	twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff,
			 TWL4030_INTERRUPTS_BCIIMR2A);

	if (bci->transceiver != NULL) {
	if (!IS_ERR_OR_NULL(bci->transceiver)) {
		usb_unregister_notifier(bci->transceiver, &bci->usb_nb);
		usb_put_transceiver(bci->transceiver);
		usb_put_phy(bci->transceiver);
	}
	free_irq(bci->irq_bci, bci);
	free_irq(bci->irq_chg, bci);
+9 −8
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include <linux/device.h>
#include <linux/dmapool.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/module.h>
@@ -1687,7 +1688,7 @@ static int udc_start(struct ci13xxx *udc)

	udc->gadget.ep0 = &udc->ep0in->ep;

	udc->transceiver = usb_get_transceiver();
	udc->transceiver = usb_get_phy(USB_PHY_TYPE_USB2);

	if (udc->udc_driver->flags & CI13XXX_REQUIRE_TRANSCEIVER) {
		if (udc->transceiver == NULL) {
@@ -1712,7 +1713,7 @@ static int udc_start(struct ci13xxx *udc)
	if (retval)
		goto unreg_device;

	if (udc->transceiver) {
	if (!IS_ERR_OR_NULL(udc->transceiver)) {
		retval = otg_set_peripheral(udc->transceiver->otg,
						&udc->gadget);
		if (retval)
@@ -1729,9 +1730,9 @@ static int udc_start(struct ci13xxx *udc)
	return retval;

remove_trans:
	if (udc->transceiver) {
	if (!IS_ERR_OR_NULL(udc->transceiver)) {
		otg_set_peripheral(udc->transceiver->otg, &udc->gadget);
		usb_put_transceiver(udc->transceiver);
		usb_put_phy(udc->transceiver);
	}

	dev_err(dev, "error = %i\n", retval);
@@ -1740,8 +1741,8 @@ static int udc_start(struct ci13xxx *udc)
unreg_device:
	device_unregister(&udc->gadget.dev);
put_transceiver:
	if (udc->transceiver)
		usb_put_transceiver(udc->transceiver);
	if (!IS_ERR_OR_NULL(udc->transceiver))
		usb_put_phy(udc->transceiver);
free_pools:
	dma_pool_destroy(udc->td_pool);
free_qh_pool:
@@ -1772,9 +1773,9 @@ static void udc_stop(struct ci13xxx *udc)
	dma_pool_destroy(udc->td_pool);
	dma_pool_destroy(udc->qh_pool);

	if (udc->transceiver) {
	if (!IS_ERR_OR_NULL(udc->transceiver)) {
		otg_set_peripheral(udc->transceiver->otg, NULL);
		usb_put_transceiver(udc->transceiver);
		usb_put_phy(udc->transceiver);
	}
	dbg_remove_files(&udc->gadget.dev);
	device_unregister(&udc->gadget.dev);
Loading