From 04a6221c509e90b5f921d408bbf0afcf91147280 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Thu, 10 Jan 2013 16:35:53 +0800 Subject: usb: phy: mxs-phy: add set_suspend API It needs to call set_suspend during USB suspend/resume Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi --- drivers/usb/otg/mxs-phy.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'drivers/usb/otg') diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c index 76302720055a..5158332522b1 100644 --- a/drivers/usb/otg/mxs-phy.c +++ b/drivers/usb/otg/mxs-phy.c @@ -76,6 +76,25 @@ static void mxs_phy_shutdown(struct usb_phy *phy) clk_disable_unprepare(mxs_phy->clk); } +static int mxs_phy_suspend(struct usb_phy *x, int suspend) +{ + struct mxs_phy *mxs_phy = to_mxs_phy(x); + + if (suspend) { + writel_relaxed(0xffffffff, x->io_priv + HW_USBPHY_PWD); + writel_relaxed(BM_USBPHY_CTRL_CLKGATE, + x->io_priv + HW_USBPHY_CTRL_SET); + clk_disable_unprepare(mxs_phy->clk); + } else { + clk_prepare_enable(mxs_phy->clk); + writel_relaxed(BM_USBPHY_CTRL_CLKGATE, + x->io_priv + HW_USBPHY_CTRL_CLR); + writel_relaxed(0, x->io_priv + HW_USBPHY_PWD); + } + + return 0; +} + static int mxs_phy_on_connect(struct usb_phy *phy, enum usb_device_speed speed) { @@ -137,6 +156,7 @@ static int mxs_phy_probe(struct platform_device *pdev) mxs_phy->phy.label = DRIVER_NAME; mxs_phy->phy.init = mxs_phy_init; mxs_phy->phy.shutdown = mxs_phy_shutdown; + mxs_phy->phy.set_suspend = mxs_phy_suspend; mxs_phy->phy.notify_connect = mxs_phy_on_connect; mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect; -- cgit v1.2.1 From 63a1307930867a45f86a1a69f80315b2df7b7b49 Mon Sep 17 00:00:00 2001 From: Cesar Eduardo Barros Date: Tue, 4 Dec 2012 20:21:12 -0200 Subject: usb: phy: mv-otg: use to_delayed_work instead of cast Directly casting a work_struct pointer to a delayed_work is risky if the work member of struct delayed_work is ever moved from being the first member. Instead, use the inline function to_delayed_work(), which does the same cast in a safer way (using container_of). Signed-off-by: Cesar Eduardo Barros Signed-off-by: Felipe Balbi --- drivers/usb/otg/mv_otg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/otg') diff --git a/drivers/usb/otg/mv_otg.c b/drivers/usb/otg/mv_otg.c index 1dd57504186d..5104bc2b67b3 100644 --- a/drivers/usb/otg/mv_otg.c +++ b/drivers/usb/otg/mv_otg.c @@ -420,7 +420,7 @@ static void mv_otg_work(struct work_struct *work) struct usb_otg *otg; int old_state; - mvotg = container_of((struct delayed_work *)work, struct mv_otg, work); + mvotg = container_of(to_delayed_work(work), struct mv_otg, work); run: /* work queue is single thread, or we need spin_lock to protect */ -- cgit v1.2.1 From fb3dfe13d0cc7e76c9d4a73a72f17f80f63590a7 Mon Sep 17 00:00:00 2001 From: Chao Xie Date: Thu, 24 Jan 2013 01:38:28 -0500 Subject: usb: otg: mv_otg: use devm_xxx for probe use devm_xxx for otg driver probe. So we do need care about the resources release in driver remove or failure handling in driver probe. Signed-off-by: Chao Xie Signed-off-by: Felipe Balbi --- drivers/usb/otg/mv_otg.c | 82 +++++++++++++----------------------------------- 1 file changed, 22 insertions(+), 60 deletions(-) (limited to 'drivers/usb/otg') diff --git a/drivers/usb/otg/mv_otg.c b/drivers/usb/otg/mv_otg.c index 1dd57504186d..fe1b56a31947 100644 --- a/drivers/usb/otg/mv_otg.c +++ b/drivers/usb/otg/mv_otg.c @@ -662,18 +662,9 @@ static struct attribute_group inputs_attr_group = { int mv_otg_remove(struct platform_device *pdev) { struct mv_otg *mvotg = platform_get_drvdata(pdev); - int clk_i; sysfs_remove_group(&mvotg->pdev->dev.kobj, &inputs_attr_group); - if (mvotg->irq) - free_irq(mvotg->irq, mvotg); - - if (mvotg->pdata->vbus) - free_irq(mvotg->pdata->vbus->irq, mvotg); - if (mvotg->pdata->id) - free_irq(mvotg->pdata->id->irq, mvotg); - if (mvotg->qwork) { flush_workqueue(mvotg->qwork); destroy_workqueue(mvotg->qwork); @@ -681,21 +672,9 @@ int mv_otg_remove(struct platform_device *pdev) mv_otg_disable(mvotg); - if (mvotg->cap_regs) - iounmap(mvotg->cap_regs); - - if (mvotg->phy_regs) - iounmap(mvotg->phy_regs); - - for (clk_i = 0; clk_i <= mvotg->clknum; clk_i++) - clk_put(mvotg->clk[clk_i]); - usb_remove_phy(&mvotg->phy); platform_set_drvdata(pdev, NULL); - kfree(mvotg->phy.otg); - kfree(mvotg); - return 0; } @@ -714,17 +693,15 @@ static int mv_otg_probe(struct platform_device *pdev) } size = sizeof(*mvotg) + sizeof(struct clk *) * pdata->clknum; - mvotg = kzalloc(size, GFP_KERNEL); + mvotg = devm_kzalloc(&pdev->dev, size, GFP_KERNEL); if (!mvotg) { dev_err(&pdev->dev, "failed to allocate memory!\n"); return -ENOMEM; } - otg = kzalloc(sizeof *otg, GFP_KERNEL); - if (!otg) { - kfree(mvotg); + otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); + if (!otg) return -ENOMEM; - } platform_set_drvdata(pdev, mvotg); @@ -733,18 +710,18 @@ static int mv_otg_probe(struct platform_device *pdev) mvotg->clknum = pdata->clknum; for (clk_i = 0; clk_i < mvotg->clknum; clk_i++) { - mvotg->clk[clk_i] = clk_get(&pdev->dev, pdata->clkname[clk_i]); + mvotg->clk[clk_i] = devm_clk_get(&pdev->dev, + pdata->clkname[clk_i]); if (IS_ERR(mvotg->clk[clk_i])) { retval = PTR_ERR(mvotg->clk[clk_i]); - goto err_put_clk; + return retval; } } mvotg->qwork = create_singlethread_workqueue("mv_otg_queue"); if (!mvotg->qwork) { dev_dbg(&pdev->dev, "cannot create workqueue for OTG\n"); - retval = -ENOMEM; - goto err_put_clk; + return -ENOMEM; } INIT_DELAYED_WORK(&mvotg->work, mv_otg_work); @@ -772,7 +749,7 @@ static int mv_otg_probe(struct platform_device *pdev) goto err_destroy_workqueue; } - mvotg->phy_regs = ioremap(r->start, resource_size(r)); + mvotg->phy_regs = devm_ioremap(&pdev->dev, r->start, resource_size(r)); if (mvotg->phy_regs == NULL) { dev_err(&pdev->dev, "failed to map phy I/O memory\n"); retval = -EFAULT; @@ -784,21 +761,21 @@ static int mv_otg_probe(struct platform_device *pdev) if (r == NULL) { dev_err(&pdev->dev, "no I/O memory resource defined\n"); retval = -ENODEV; - goto err_unmap_phyreg; + goto err_destroy_workqueue; } - mvotg->cap_regs = ioremap(r->start, resource_size(r)); + mvotg->cap_regs = devm_ioremap(&pdev->dev, r->start, resource_size(r)); if (mvotg->cap_regs == NULL) { dev_err(&pdev->dev, "failed to map I/O memory\n"); retval = -EFAULT; - goto err_unmap_phyreg; + goto err_destroy_workqueue; } /* we will acces controller register, so enable the udc controller */ retval = mv_otg_enable_internal(mvotg); if (retval) { dev_err(&pdev->dev, "mv otg enable error %d\n", retval); - goto err_unmap_capreg; + goto err_destroy_workqueue; } mvotg->op_regs = @@ -806,9 +783,9 @@ static int mv_otg_probe(struct platform_device *pdev) + (readl(mvotg->cap_regs) & CAPLENGTH_MASK)); if (pdata->id) { - retval = request_threaded_irq(pdata->id->irq, NULL, - mv_otg_inputs_irq, - IRQF_ONESHOT, "id", mvotg); + retval = devm_request_threaded_irq(&pdev->dev, pdata->id->irq, + NULL, mv_otg_inputs_irq, + IRQF_ONESHOT, "id", mvotg); if (retval) { dev_info(&pdev->dev, "Failed to request irq for ID\n"); @@ -818,9 +795,9 @@ static int mv_otg_probe(struct platform_device *pdev) if (pdata->vbus) { mvotg->clock_gating = 1; - retval = request_threaded_irq(pdata->vbus->irq, NULL, - mv_otg_inputs_irq, - IRQF_ONESHOT, "vbus", mvotg); + retval = devm_request_threaded_irq(&pdev->dev, pdata->vbus->irq, + NULL, mv_otg_inputs_irq, + IRQF_ONESHOT, "vbus", mvotg); if (retval) { dev_info(&pdev->dev, "Failed to request irq for VBUS, " @@ -844,7 +821,7 @@ static int mv_otg_probe(struct platform_device *pdev) } mvotg->irq = r->start; - if (request_irq(mvotg->irq, mv_otg_irq, IRQF_SHARED, + if (devm_request_irq(&pdev->dev, mvotg->irq, mv_otg_irq, IRQF_SHARED, driver_name, mvotg)) { dev_err(&pdev->dev, "Request irq %d for OTG failed\n", mvotg->irq); @@ -857,14 +834,14 @@ static int mv_otg_probe(struct platform_device *pdev) if (retval < 0) { dev_err(&pdev->dev, "can't register transceiver, %d\n", retval); - goto err_free_irq; + goto err_disable_clk; } retval = sysfs_create_group(&pdev->dev.kobj, &inputs_attr_group); if (retval < 0) { dev_dbg(&pdev->dev, "Can't register sysfs attr group: %d\n", retval); - goto err_set_transceiver; + goto err_remove_phy; } spin_lock_init(&mvotg->wq_lock); @@ -879,30 +856,15 @@ static int mv_otg_probe(struct platform_device *pdev) return 0; -err_set_transceiver: +err_remove_phy: usb_remove_phy(&mvotg->phy); -err_free_irq: - free_irq(mvotg->irq, mvotg); err_disable_clk: - if (pdata->vbus) - free_irq(pdata->vbus->irq, mvotg); - if (pdata->id) - free_irq(pdata->id->irq, mvotg); mv_otg_disable_internal(mvotg); -err_unmap_capreg: - iounmap(mvotg->cap_regs); -err_unmap_phyreg: - iounmap(mvotg->phy_regs); err_destroy_workqueue: flush_workqueue(mvotg->qwork); destroy_workqueue(mvotg->qwork); -err_put_clk: - for (clk_i--; clk_i >= 0; clk_i--) - clk_put(mvotg->clk[clk_i]); platform_set_drvdata(pdev, NULL); - kfree(otg); - kfree(mvotg); return retval; } -- cgit v1.2.1 From b4a83e4df1bc864e89d3bb90e97f9caab656545d Mon Sep 17 00:00:00 2001 From: Kishon Vijay Abraham I Date: Fri, 25 Jan 2013 08:03:21 +0530 Subject: usb: otg: add an api to bind the usb controller and phy In order to support platforms which has multiple PHY's (of same type) and which has multiple USB controllers, a new design is adopted wherin the binding information (between the PHY and the USB controller) should be passed to the PHY library from platform specific file (board file). So added a new API to pass the binding information. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Felipe Balbi --- drivers/usb/otg/otg.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'drivers/usb/otg') diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c index a30c04115115..8e756d95a28f 100644 --- a/drivers/usb/otg/otg.c +++ b/drivers/usb/otg/otg.c @@ -18,6 +18,7 @@ #include static LIST_HEAD(phy_list); +static LIST_HEAD(phy_bind_list); static DEFINE_SPINLOCK(phy_lock); static struct usb_phy *__usb_find_phy(struct list_head *list, @@ -201,6 +202,42 @@ void usb_remove_phy(struct usb_phy *x) } EXPORT_SYMBOL(usb_remove_phy); +/** + * usb_bind_phy - bind the phy and the controller that uses the phy + * @dev_name: the device name of the device that will bind to the phy + * @index: index to specify the port number + * @phy_dev_name: the device name of the phy + * + * Fills the phy_bind structure with the dev_name and phy_dev_name. This will + * be used when the phy driver registers the phy and when the controller + * requests this phy. + * + * To be used by platform specific initialization code. + */ +int __init usb_bind_phy(const char *dev_name, u8 index, + const char *phy_dev_name) +{ + struct usb_phy_bind *phy_bind; + unsigned long flags; + + phy_bind = kzalloc(sizeof(*phy_bind), GFP_KERNEL); + if (!phy_bind) { + pr_err("phy_bind(): No memory for phy_bind"); + return -ENOMEM; + } + + phy_bind->dev_name = dev_name; + phy_bind->phy_dev_name = phy_dev_name; + phy_bind->index = index; + + spin_lock_irqsave(&phy_lock, flags); + list_add_tail(&phy_bind->list, &phy_bind_list); + spin_unlock_irqrestore(&phy_lock, flags); + + return 0; +} +EXPORT_SYMBOL_GPL(usb_bind_phy); + const char *otg_state_string(enum usb_otg_state state) { switch (state) { -- cgit v1.2.1 From 0fa4fab4ee46470ccd463c83be95434936942e05 Mon Sep 17 00:00:00 2001 From: Kishon Vijay Abraham I Date: Fri, 25 Jan 2013 08:03:22 +0530 Subject: usb: otg: utils: add facilities in phy lib to support multiple PHYs of same type In order to add support for multipe PHY's of the same type, new API's for adding PHY and getting PHY has been added. Now the binding information for the PHY and controller should be done in platform file using usb_bind_phy API. And for getting a PHY, the device pointer of the USB controller and an index should be passed. Based on the binding information that is added in the platform file, usb_get_phy_dev will return the appropriate PHY. Already existing API's to add and get phy by type is not removed. These API's are deprecated and will be removed once all the platforms start to use the new API. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Felipe Balbi --- drivers/usb/otg/otg.c | 118 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) (limited to 'drivers/usb/otg') diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c index 8e756d95a28f..4bb4333c9653 100644 --- a/drivers/usb/otg/otg.c +++ b/drivers/usb/otg/otg.c @@ -36,6 +36,24 @@ static struct usb_phy *__usb_find_phy(struct list_head *list, return ERR_PTR(-ENODEV); } +static struct usb_phy *__usb_find_phy_dev(struct device *dev, + struct list_head *list, u8 index) +{ + struct usb_phy_bind *phy_bind = NULL; + + list_for_each_entry(phy_bind, list, list) { + if (!(strcmp(phy_bind->dev_name, dev_name(dev))) && + phy_bind->index == index) { + if (phy_bind->phy) + return phy_bind->phy; + else + return ERR_PTR(-EPROBE_DEFER); + } + } + + return ERR_PTR(-ENODEV); +} + static void devm_usb_phy_release(struct device *dev, void *res) { struct usb_phy *phy = *(struct usb_phy **)res; @@ -111,6 +129,69 @@ err0: } EXPORT_SYMBOL(usb_get_phy); +/** + * usb_get_phy_dev - find the USB PHY + * @dev - device that requests this phy + * @index - the index of the phy + * + * Returns the phy driver, after getting a refcount to it; or + * -ENODEV if there is no such phy. The caller is responsible for + * calling usb_put_phy() to release that count. + * + * For use by USB host and peripheral drivers. + */ +struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) +{ + struct usb_phy *phy = NULL; + unsigned long flags; + + spin_lock_irqsave(&phy_lock, flags); + + phy = __usb_find_phy_dev(dev, &phy_bind_list, index); + if (IS_ERR(phy)) { + pr_err("unable to find transceiver\n"); + goto err0; + } + + get_device(phy->dev); + +err0: + spin_unlock_irqrestore(&phy_lock, flags); + + return phy; +} +EXPORT_SYMBOL(usb_get_phy_dev); + +/** + * devm_usb_get_phy_dev - find the USB PHY using device ptr and index + * @dev - device that requests this phy + * @index - the index of the phy + * + * Gets the phy using usb_get_phy_dev(), and associates a device with it using + * devres. On driver detach, release function is invoked on the devres data, + * then, devres data is freed. + * + * For use by USB host and peripheral drivers. + */ +struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index) +{ + struct usb_phy **ptr, *phy; + + ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL); + if (!ptr) + return NULL; + + phy = usb_get_phy_dev(dev, index); + if (!IS_ERR(phy)) { + *ptr = phy; + devres_add(dev, ptr); + } else + devres_free(ptr); + + return phy; +} +EXPORT_SYMBOL(devm_usb_get_phy_dev); + /** * devm_usb_put_phy - release the USB PHY * @dev - device that wants to release this phy @@ -185,6 +266,36 @@ out: } EXPORT_SYMBOL(usb_add_phy); +/** + * usb_add_phy_dev - declare the USB PHY + * @x: the USB phy to be used; or NULL + * + * This call is exclusively for use by phy drivers, which + * coordinate the activities of drivers for host and peripheral + * controllers, and in some cases for VBUS current regulation. + */ +int usb_add_phy_dev(struct usb_phy *x) +{ + struct usb_phy_bind *phy_bind; + unsigned long flags; + + if (!x->dev) { + dev_err(x->dev, "no device provided for PHY\n"); + return -EINVAL; + } + + spin_lock_irqsave(&phy_lock, flags); + list_for_each_entry(phy_bind, &phy_bind_list, list) + if (!(strcmp(phy_bind->phy_dev_name, dev_name(x->dev)))) + phy_bind->phy = x; + + list_add_tail(&x->head, &phy_list); + + spin_unlock_irqrestore(&phy_lock, flags); + return 0; +} +EXPORT_SYMBOL(usb_add_phy_dev); + /** * usb_remove_phy - remove the OTG PHY * @x: the USB OTG PHY to be removed; @@ -194,10 +305,15 @@ EXPORT_SYMBOL(usb_add_phy); void usb_remove_phy(struct usb_phy *x) { unsigned long flags; + struct usb_phy_bind *phy_bind; spin_lock_irqsave(&phy_lock, flags); - if (x) + if (x) { + list_for_each_entry(phy_bind, &phy_bind_list, list) + if (phy_bind->phy == x) + phy_bind->phy = NULL; list_del(&x->head); + } spin_unlock_irqrestore(&phy_lock, flags); } EXPORT_SYMBOL(usb_remove_phy); -- cgit v1.2.1 From 5d3c28b5a42df5ceaa854901ba2cccb76883c77e Mon Sep 17 00:00:00 2001 From: Kishon Vijay Abraham I Date: Fri, 25 Jan 2013 08:03:25 +0530 Subject: usb: otg: add device tree support to otg library Added an API devm_usb_get_phy_by_phandle(), to get usb phy by passing a device node phandle value. This function will return a pointer to the phy on success, -EPROBE_DEFER if there is a device_node for the phandle, but the phy has not been added, or a ERR_PTR() otherwise. Cc: Marc Kleine-Budde Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Felipe Balbi --- drivers/usb/otg/otg.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'drivers/usb/otg') diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c index 4bb4333c9653..e1814397ca3a 100644 --- a/drivers/usb/otg/otg.c +++ b/drivers/usb/otg/otg.c @@ -13,7 +13,9 @@ #include #include #include +#include #include +#include #include @@ -54,6 +56,20 @@ static struct usb_phy *__usb_find_phy_dev(struct device *dev, return ERR_PTR(-ENODEV); } +static struct usb_phy *__of_usb_find_phy(struct device_node *node) +{ + struct usb_phy *phy; + + list_for_each_entry(phy, &phy_list, head) { + if (node != phy->dev->of_node) + continue; + + return phy; + } + + return ERR_PTR(-ENODEV); +} + static void devm_usb_phy_release(struct device *dev, void *res) { struct usb_phy *phy = *(struct usb_phy **)res; @@ -129,6 +145,70 @@ err0: } EXPORT_SYMBOL(usb_get_phy); + /** + * devm_usb_get_phy_by_phandle - find the USB PHY by phandle + * @dev - device that requests this phy + * @phandle - name of the property holding the phy phandle value + * @index - the index of the phy + * + * Returns the phy driver associated with the given phandle value, + * after getting a refcount to it, -ENODEV if there is no such phy or + * -EPROBE_DEFER if there is a phandle to the phy, but the device is + * not yet loaded. While at that, it also associates the device with + * the phy using devres. On driver detach, release function is invoked + * on the devres data, then, devres data is freed. + * + * For use by USB host and peripheral drivers. + */ +struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, + const char *phandle, u8 index) +{ + struct usb_phy *phy = ERR_PTR(-ENOMEM), **ptr; + unsigned long flags; + struct device_node *node; + + if (!dev->of_node) { + dev_dbg(dev, "device does not have a device node entry\n"); + return ERR_PTR(-EINVAL); + } + + node = of_parse_phandle(dev->of_node, phandle, index); + if (!node) { + dev_dbg(dev, "failed to get %s phandle in %s node\n", phandle, + dev->of_node->full_name); + return ERR_PTR(-ENODEV); + } + + ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL); + if (!ptr) { + dev_dbg(dev, "failed to allocate memory for devres\n"); + goto err0; + } + + spin_lock_irqsave(&phy_lock, flags); + + phy = __of_usb_find_phy(node); + if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { + phy = ERR_PTR(-EPROBE_DEFER); + devres_free(ptr); + goto err1; + } + + *ptr = phy; + devres_add(dev, ptr); + + get_device(phy->dev); + +err1: + spin_unlock_irqrestore(&phy_lock, flags); + +err0: + of_node_put(node); + + return phy; +} +EXPORT_SYMBOL(devm_usb_get_phy_by_phandle); + /** * usb_get_phy_dev - find the USB PHY * @dev - device that requests this phy -- cgit v1.2.1 From c11747f6ce70253dbf73709bb0a5ff19acc48ec8 Mon Sep 17 00:00:00 2001 From: Kishon Vijay Abraham I Date: Fri, 25 Jan 2013 08:03:24 +0530 Subject: usb: musb: omap: make use of the new PHY lib APIs New PHY lib APIs like usb_add_phy_dev() and devm_usb_get_phy_dev() are used in MUSB (OMAP), in order to make use of the binding information provided in the board file (of OMAP platforms). All the platforms should be modified similar to this to add and get the PHY. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Felipe Balbi --- drivers/usb/otg/twl4030-usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/usb/otg') diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index 0a701938ab53..a994715a3101 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c @@ -610,6 +610,7 @@ static int twl4030_usb_probe(struct platform_device *pdev) twl->phy.dev = twl->dev; twl->phy.label = "twl4030"; twl->phy.otg = otg; + twl->phy.type = USB_PHY_TYPE_USB2; twl->phy.set_suspend = twl4030_set_suspend; otg->phy = &twl->phy; @@ -624,7 +625,7 @@ static int twl4030_usb_probe(struct platform_device *pdev) dev_err(&pdev->dev, "ldo init failed\n"); return err; } - usb_add_phy(&twl->phy, USB_PHY_TYPE_USB2); + usb_add_phy_dev(&twl->phy); platform_set_drvdata(pdev, twl); if (device_create_file(&pdev->dev, &dev_attr_vbus)) -- cgit v1.2.1