usb: musb: cleanup
cover usb: musb: cleanup
Most part of this patch series was obtained by splitting [RFC PATCH 2/3] usb: musb: omap glue: use omap-usb2 as the phy driver.
TO DO:
* dt adaptation of musb omap glue, twl4030, twl6030.
* Use control module driver API to write to control module registers (mailbox and power control of phy)
* send usb2 phy driver
* make musb omap glue make use of usb2 phy driver and make twl630 as a comparator driver.
Patch series depends on
[PATCH v4 0/3] usb: multi-phy support
Performed device mode testing in omap4 panda and omap3 beagle
Kishon Vijay Abraham I (5):
usb: musb: move work_struct(otg_notifier_work) from core to omap glue
usb: musb: twl: use mailbox API to send VBUS or ID events
drivers: usb: musb: move otg specific initializations from twl to
glue
usb: musb: omap: use devres API to allocate resources
drivers: usb: otg: twl: use devres API to allocate resources
drivers/usb/musb/musb_core.h | 2 - drivers/usb/musb/omap2430.c | 118 +++++++++++++++++++++++++--------------- drivers/usb/otg/twl4030-usb.c | 63 ++++++++-------------- drivers/usb/otg/twl6030-usb.c | 69 ++++++++---------------- include/linux/usb/musb-omap.h | 30 ++++++++++ 5 files changed, 150 insertions(+), 132 deletions(-) create mode 100644 include/linux/usb/musb-omap.h
Signature · 6 lines
1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/5 usb: musb: move work_struct(otg_notifier_work) from core to omap glue
Commit 712d8e fixed pm_runtime calls while atomic by using a work queue. While the issue and the work queue implementation is specific to omap (omap2430.c), the work_struct is defined as a member of struct musb (musb_core.h). Hence moved the work_struct from musb_core to omap glue.
--- drivers/usb/musb/musb_core.h | 2 -- drivers/usb/musb/omap2430.c | 24 +++++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-)
drivers/usb/musb/musb_core.h +0 -2
@@ -327,7 +327,6 @@ struct musb {irqreturn_t (*isr)(int ,void *);struct work_struct irq_work; -struct work_struct otg_notifier_work;u16 hwvers;/* this hub status bit is reserved by USB 2.0 and not seen by usbcore */
@@ -373,7 +372,6 @@ struct musb {u16 int_tx;struct usb_phy *xceiv; -u8 xceiv_event;int nIrq; unsigned irq_wake:1;
drivers/usb/musb/omap2430.c +15 -9
@@ -41,6 +41,8 @@struct omap2430_glue {struct device *dev;struct platform_device *musb; +u8 xceiv_event; +struct work_struct omap_musb_mailbox_work; };#define glue_to_musb (g) platform_get_drvdata(g->musb)
@@ -226,22 +228,26 @@ static inline void omap2430_low_level_init(struct musb *musb)static int musb_otg_notifications (struct notifier_block *nb,unsigned long event,void *unused) { - struct musb *musb = container_of(nb, struct musb, nb); + struct musb *musb = container_of(nb, struct musb, nb); +struct device *dev = musb->controller; +struct omap2430_glue *glue =dev_get_drvdata (dev->parent); - musb->xceiv_event = event; -schedule_work (&musb->otg_notifier_work); + glue->xceiv_event = event; +schedule_work (&glue->omap_musb_mailbox_work);return NOTIFY_OK ; } -static void musb_otg_notifier_work (struct work_struct *data_notifier_work) +static void omap_musb_mailbox_work (struct work_struct *data_notifier_work) { - struct musb *musb = container_of(data_notifier_work, struct musb, otg_notifier_work); +struct omap2430_glue *glue =container_of (data_notifier_work, + struct omap2430_glue, omap_musb_mailbox_work); +struct musb *musb =glue_to_musb (glue);struct device *dev = musb->controller;struct musb_hdrc_platform_data *pdata = dev->platform_data;struct omap_musb_board_data *data = pdata->board_data; -switch (musb->xceiv_event) { +switch (glue->xceiv_event) {case USB_EVENT_ID :dev_dbg (musb->controller,"ID GND\n" );
@@ -298,8 +304,6 @@ static int omap2430_musb_init(struct musb *musb)return -ENODEV ; } -INIT_WORK (&musb->otg_notifier_work, musb_otg_notifier_work); - status =pm_runtime_get_sync (dev);if (status <0 ) {dev_err (dev,"pm_runtime_get_sync FAILED %d\n" , status);
@@ -388,7 +392,6 @@ static void omap2430_musb_disable(struct musb *musb)static int omap2430_musb_exit (struct musb *musb) {del_timer_sync (&musb_idle_timer); -cancel_work_sync (&musb->otg_notifier_work);omap2430_low_level_exit (musb);usb_put_phy (musb->xceiv);
@@ -441,6 +444,8 @@ static int __devinit omap2430_probe(struct platform_device *pdev)platform_set_drvdata (pdev, glue); +INIT_WORK (&glue->omap_musb_mailbox_work, omap_musb_mailbox_work); + ret =platform_device_add_resources (musb, pdev->resource, pdev->num_resources);if (ret) {
@@ -478,6 +483,7 @@ static int __devexit omap2430_remove(struct platform_device *pdev) {struct omap2430_glue *glue =platform_get_drvdata (pdev); +cancel_work_sync (&glue->omap_musb_mailbox_work);platform_device_del (glue->musb);platform_device_put (glue->musb);kfree (glue);
Signature · 1 line
1.7.5.4
PATCH 2/5 usb: musb: twl: use mailbox API to send VBUS or ID events
In reply to Kishon Vijay Abraham IThe atomic notifier from twl4030/twl6030 to notifiy VBUS and ID events, is replaced by a direct call to omap musb blue.
--- drivers/usb/musb/omap2430.c | 90 ++++++++++++++++++++++++++--------------- drivers/usb/otg/twl4030-usb.c | 42 +++++++++---------- drivers/usb/otg/twl6030-usb.c | 47 +++++++++------------ include/linux/usb/musb-omap.h | 30 ++++++++++++++ 4 files changed, 128 insertions(+), 81 deletions(-) create mode 100644 include/linux/usb/musb-omap.h
drivers/usb/musb/omap2430.c +57 -33
@@ -34,6 +34,7 @@#include <linux/dma-mapping.h> #include <linux/pm_runtime.h> #include <linux/err.h> +#include <linux/usb/musb-omap.h> #include "musb_core.h" #include "omap2430.h"
@@ -41,11 +42,13 @@struct omap2430_glue {struct device *dev;struct platform_device *musb; -u8 xceiv_event; +enum omap_musb_vbus_id_status status;struct work_struct omap_musb_mailbox_work; };#define glue_to_musb (g) platform_get_drvdata(g->musb) +struct omap2430_glue *_glue; +static struct timer_list musb_idle_timer;static void musb_do_idle (unsigned long _musb)
@@ -225,50 +228,54 @@ static inline void omap2430_low_level_init(struct musb *musb)musb_writel (musb->mregs,OTG_FORCESTDBY , l); } -static int musb_otg_notifications (struct notifier_block *nb, -unsigned long event,void *unused) +void omap_musb_mailbox (enum omap_musb_vbus_id_status status) { - struct musb *musb = container_of(nb, struct musb, nb); -struct device *dev = musb->controller; -struct omap2430_glue *glue =dev_get_drvdata (dev->parent); +struct omap2430_glue *glue = _glue; +struct musb *musb =glue_to_musb (glue); - glue->xceiv_event = event; -schedule_work (&glue->omap_musb_mailbox_work); + glue->status = status; +if (!musb) { +dev_err (glue->dev,"musb core is not yet ready\n" ); +return ; + } -return NOTIFY_OK ; +schedule_work (&glue->omap_musb_mailbox_work); } +EXPORT_SYMBOL_GPL (omap_musb_mailbox); -static void omap_musb_mailbox_work (struct work_struct *data_notifier_work) +static void omap_musb_set_mailbox (struct omap2430_glue *glue) { -struct omap2430_glue *glue =container_of (data_notifier_work, - struct omap2430_glue, omap_musb_mailbox_work);struct musb *musb =glue_to_musb (glue);struct device *dev = musb->controller;struct musb_hdrc_platform_data *pdata = dev->platform_data;struct omap_musb_board_data *data = pdata->board_data; -switch (glue->xceiv_event) { -case USB_EVENT_ID : -dev_dbg (musb->controller,"ID GND\n" ); +switch (glue->status) { +case OMAP_MUSB_ID_GROUND : +dev_dbg (dev,"ID GND\n" ); + musb->xceiv->last_event =USB_EVENT_ID ;if (!is_otg_enabled (musb) || musb->gadget_driver) { -pm_runtime_get_sync (musb->controller); +pm_runtime_get_sync (dev);usb_phy_init (musb->xceiv);omap2430_musb_set_vbus (musb,1 ); }break ; -case USB_EVENT_VBUS : -dev_dbg (musb->controller,"VBUS Connect\n" ); +case OMAP_MUSB_VBUS_VALID : +dev_dbg (dev,"VBUS Connect\n" ); + musb->xceiv->last_event =USB_EVENT_VBUS ;if (musb->gadget_driver) -pm_runtime_get_sync (musb->controller); +pm_runtime_get_sync (dev);usb_phy_init (musb->xceiv);break ; -case USB_EVENT_NONE : -dev_dbg (musb->controller,"VBUS Disconnect\n" ); +case OMAP_MUSB_ID_FLOAT : +case OMAP_MUSB_VBUS_OFF : +dev_dbg (dev,"VBUS Disconnect\n" ); + musb->xceiv->last_event =USB_EVENT_NONE ;if (is_otg_enabled (musb) ||is_peripheral_enabled (musb))if (musb->gadget_driver) {pm_runtime_mark_last_busy (musb->controller);
@@ -282,15 +289,24 @@ static void omap_musb_mailbox_work(struct work_struct *data_notifier_work)usb_phy_shutdown (musb->xceiv);break ;default : -dev_dbg (musb->controller,"ID float\n" ); +dev_dbg (dev,"ID float\n" ); } } + +static void omap_musb_mailbox_work (struct work_struct *mailbox_work) +{ +struct omap2430_glue *glue =container_of (mailbox_work, + struct omap2430_glue, omap_musb_mailbox_work); +omap_musb_set_mailbox (glue); +} +static int omap2430_musb_init (struct musb *musb) {u32 l;int status =0 ;struct device *dev = musb->controller; +struct omap2430_glue *glue =dev_get_drvdata (dev->parent);struct musb_hdrc_platform_data *plat = dev->platform_data;struct omap_musb_board_data *data = plat->board_data;
@@ -330,14 +346,11 @@ static int omap2430_musb_init(struct musb *musb)musb_readl (musb->mregs,OTG_INTERFSEL ), musb_readl(musb->mregs, OTG_SIMENABLE)); - musb->nb.notifier_call = musb_otg_notifications; - status =usb_register_notifier (musb->xceiv, &musb->nb); - -if (status) -dev_dbg (musb->controller,"notification register failed\n" ); -setup_timer (&musb_idle_timer, musb_do_idle, (unsigned long ) musb); +if (glue->status !=OMAP_MUSB_UNKNOWN ) +omap_musb_set_mailbox (glue); +pm_runtime_put_noidle (musb->controller);return 0 ;
@@ -350,12 +363,13 @@ static void omap2430_musb_enable(struct musb *musb)u8 devctl;unsigned long timeout = jiffies +msecs_to_jiffies (1000 );struct device *dev = musb->controller; +struct omap2430_glue *glue =dev_get_drvdata (dev->parent);struct musb_hdrc_platform_data *pdata = dev->platform_data;struct omap_musb_board_data *data = pdata->board_data; -switch (musb->xceiv->last_event) { +switch (glue->status) { -case USB_EVENT_ID : +case OMAP_MUSB_ID_GROUND :usb_phy_init (musb->xceiv);if (data->interface_type !=MUSB_INTERFACE_UTMI )break ;
@@ -374,7 +388,7 @@ static void omap2430_musb_enable(struct musb *musb) }break ; -case USB_EVENT_VBUS : +case OMAP_MUSB_VBUS_VALID :usb_phy_init (musb->xceiv);break ;
@@ -385,7 +399,10 @@ static void omap2430_musb_enable(struct musb *musb)static void omap2430_musb_disable (struct musb *musb) { -if (musb->xceiv->last_event) +struct device *dev = musb->controller; +struct omap2430_glue *glue =dev_get_drvdata (dev->parent); + +if (glue->status !=OMAP_MUSB_UNKNOWN )usb_phy_shutdown (musb->xceiv); }
@@ -439,11 +456,18 @@ static int __devinit omap2430_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + glue->status =OMAP_MUSB_UNKNOWN ; pdata->platform_ops = &omap2430_ops;platform_set_drvdata (pdev, glue); +/* +* REVISIT if we ever have two instances of the wrapper, we will be +* in big trouble +*/ + _glue = glue; +INIT_WORK (&glue->omap_musb_mailbox_work, omap_musb_mailbox_work); ret = platform_device_add_resources(musb, pdev->resource,
@@ -552,7 +576,7 @@ static int __init omap2430_init(void) {return platform_driver_register (&omap2430_driver); } -module_init (omap2430_init); +subsys_initcall (omap2430_init); static void __exit omap2430_exit(void) {
drivers/usb/otg/twl4030-usb.c +20 -22
128 lines not on this page · raw message
drivers/usb/otg/twl6030-usb.c +21 -26
121 lines not on this page · raw message
include/linux/usb/musb-omap.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* Copyright (C) 2011-2012 by Texas Instruments +* +* The Inventra Controller Driver for Linux is free software; you +* can redistribute it and/or modify it under the terms of the GNU +* General Public License version 2 as published by the Free Software +* Foundation. +*/ + +#ifndef __MUSB_OMAP_H__ +#define __MUSB_OMAP_H__ + +enum omap_musb_vbus_id_status { +OMAP_MUSB_UNKNOWN =0 , +OMAP_MUSB_ID_GROUND , +OMAP_MUSB_ID_FLOAT , +OMAP_MUSB_VBUS_VALID , +OMAP_MUSB_VBUS_OFF , +}; + +#if (defined(CONFIG_USB_MUSB_OMAP2PLUS ) || \ + defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE )) +void omap_musb_mailbox (enum omap_musb_vbus_id_status status); +#else +static inline void omap_musb_mailbox (enum omap_musb_vbus_id_status status) +{ +} +#endif + +#endif /* __MUSB_OMAP_H__ */
Signature · 1 line
1.7.5.4
PATCH 3/5 drivers: usb: musb: move otg specific initializations from twl to glue
In reply to Kishon Vijay Abraham IMoved otg specific state(OTG_STATE_B_IDLE, OTG_STATE_A_IDLE) initializations from twl to glue. These initializations are removed from twl4030 and twl6030 and moved to the mailbox API defined in glue.
This is part of the cleanup in preparation to make use of usb2 phy driver.
--- drivers/usb/musb/omap2430.c | 5 +++++ drivers/usb/otg/twl4030-usb.c | 8 -------- drivers/usb/otg/twl6030-usb.c | 6 ------ 3 files changed, 5 insertions(+), 14 deletions(-)
drivers/usb/musb/omap2430.c +5 -0
@@ -249,11 +249,14 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)struct device *dev = musb->controller;struct musb_hdrc_platform_data *pdata = dev->platform_data;struct omap_musb_board_data *data = pdata->board_data; +struct usb_otg *otg = musb->xceiv->otg;switch (glue->status) {case OMAP_MUSB_ID_GROUND :dev_dbg (dev,"ID GND\n" ); + otg->default_a = true; + musb->xceiv->state =OTG_STATE_A_IDLE ; musb->xceiv->last_event =USB_EVENT_ID ;if (!is_otg_enabled (musb) || musb->gadget_driver) {pm_runtime_get_sync (dev);
@@ -265,6 +268,8 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)case OMAP_MUSB_VBUS_VALID :dev_dbg (dev,"VBUS Connect\n" ); + otg->default_a = false; + musb->xceiv->state =OTG_STATE_B_IDLE ; musb->xceiv->last_event =USB_EVENT_VBUS ;if (musb->gadget_driver)pm_runtime_get_sync (dev);
drivers/usb/otg/twl4030-usb.c +0 -8
@@ -251,7 +251,6 @@ static enum omap_musb_vbus_id_status {int status;enum omap_musb_vbus_id_status linkstat =OMAP_MUSB_UNKNOWN ; -struct usb_otg *otg = twl->phy.otg; twl->vbus_supplied = false;
@@ -289,13 +288,6 @@ static enum omap_musb_vbus_id_statusspin_lock_irq (&twl->lock); twl->linkstat = linkstat; -if (linkstat ==OMAP_MUSB_ID_GROUND ) { - otg->default_a = true; - twl->phy.state =OTG_STATE_A_IDLE ; - }else { - otg->default_a = false; - twl->phy.state =OTG_STATE_B_IDLE ; - }spin_unlock_irq (&twl->lock);return linkstat;
drivers/usb/otg/twl6030-usb.c +0 -6
@@ -256,7 +256,6 @@ static DEVICE_ATTR(vbus, 0444, twl6030_usb_vbus_show, NULL);static irqreturn_t twl6030_usb_irq (int irq,void *_twl) {struct twl6030_usb *twl = _twl; -struct usb_otg *otg = twl->phy.otg;enum omap_musb_vbus_id_status status =OMAP_MUSB_UNKNOWN ;u8 vbus_state, hw_state;
@@ -269,8 +268,6 @@ static irqreturn_t twl6030_usb_irq(int irq, void *_twl)regulator_enable (twl->usb3v3); twl->asleep =1 ; status =OMAP_MUSB_VBUS_VALID ; - otg->default_a = false; - twl->phy.state =OTG_STATE_B_IDLE ; twl->linkstat = status;omap_musb_mailbox (status); }else {
@@ -293,7 +290,6 @@ static irqreturn_t twl6030_usb_irq(int irq, void *_twl)static irqreturn_t twl6030_usbotg_irq (int irq,void *_twl) {struct twl6030_usb *twl = _twl; -struct usb_otg *otg = twl->phy.otg;enum omap_musb_vbus_id_status status =OMAP_MUSB_UNKNOWN ;u8 hw_state;
@@ -307,8 +303,6 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl)twl6030_writeb (twl,TWL_MODULE_USB ,USB_ID_INT_EN_HI_SET ,0x10 ); status =OMAP_MUSB_ID_GROUND ; - otg->default_a = true; - twl->phy.state =OTG_STATE_A_IDLE ; twl->linkstat = status;omap_musb_mailbox (status); }else {
Signature · 1 line
1.7.5.4
PATCH 4/5 usb: musb: omap: use devres API to allocate resources
In reply to Kishon Vijay Abraham Iused devres API while allocating memory resource and while getting usb phy so that these resources are released automatically on driver detach.
--- drivers/usb/musb/omap2430.c | 19 +++++++------------ 1 files changed, 7 insertions(+), 12 deletions(-)
drivers/usb/musb/omap2430.c +7 -12
@@ -319,7 +319,7 @@ static int omap2430_musb_init(struct musb *musb)* up through ULPI. TWL4030-family PMICs include one, * which needs a driver, drivers aren't always needed. */ - musb->xceiv =usb_get_phy (USB_PHY_TYPE_USB2 ); + musb->xceiv =devm_usb_get_phy (dev,USB_PHY_TYPE_USB2 );if (!musb->xceiv) {pr_err ("HS USB OTG: no transceiver configured\n" );return -ENODEV ;
@@ -416,7 +416,6 @@ static int omap2430_musb_exit(struct musb *musb)del_timer_sync (&musb_idle_timer);omap2430_low_level_exit (musb); -usb_put_phy (musb->xceiv);return 0 ; }
@@ -443,7 +442,7 @@ static int __devinit omap2430_probe(struct platform_device *pdev)struct omap2430_glue *glue;int ret = -ENOMEM ; - glue =kzalloc (sizeof (*glue),GFP_KERNEL ); + glue =devm_kzalloc (&pdev->dev,sizeof (*glue),GFP_KERNEL );if (!glue) {dev_err (&pdev->dev,"failed to allocate glue context\n" ); goto err0;
@@ -452,7 +451,7 @@ static int __devinit omap2430_probe(struct platform_device *pdev) musb =platform_device_alloc ("musb-hdrc" ,-1 );if (!musb) {dev_err (&pdev->dev,"failed to allocate musb device\n" ); - goto err1; + goto err0; } musb->dev.parent = &pdev->dev;
@@ -479,13 +478,13 @@ static int __devinit omap2430_probe(struct platform_device *pdev) pdev->num_resources);if (ret) {dev_err (&pdev->dev,"failed to add resources\n" ); - goto err2; + goto err1; } ret =platform_device_add_data (musb, pdata,sizeof (*pdata));if (ret) {dev_err (&pdev->dev,"failed to add platform_data\n" ); - goto err2; + goto err1; }pm_runtime_enable (&pdev->dev);
@@ -493,16 +492,13 @@ static int __devinit omap2430_probe(struct platform_device *pdev) ret =platform_device_add (musb);if (ret) {dev_err (&pdev->dev,"failed to register musb device\n" ); - goto err2; + goto err1; }return 0 ; -err2: -platform_device_put (musb); - err1: -kfree (glue); +platform_device_put (musb); err0:return ret;
@@ -515,7 +511,6 @@ static int __devexit omap2430_remove(struct platform_device *pdev)cancel_work_sync (&glue->omap_musb_mailbox_work);platform_device_del (glue->musb);platform_device_put (glue->musb); -kfree (glue);return 0 ; }
Signature · 1 line
1.7.5.4
PATCH 5/5 drivers: usb: otg: twl: use devres API to allocate resources
In reply to Kishon Vijay Abraham Iused devres API while allocating memory resource in twl4030 and twl6030 so that these resources are released automatically on driver detach.
--- drivers/usb/otg/twl4030-usb.c | 15 +++------------ drivers/usb/otg/twl6030-usb.c | 16 +++------------- 2 files changed, 6 insertions(+), 25 deletions(-)
drivers/usb/otg/twl4030-usb.c +3 -12
@@ -589,15 +589,13 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev)return -EINVAL ; } - twl =kzalloc (sizeof *twl,GFP_KERNEL ); + twl =devm_kzalloc (&pdev->dev,sizeof *twl,GFP_KERNEL );if (!twl)return -ENOMEM ; - otg =kzalloc (sizeof *otg,GFP_KERNEL ); -if (!otg) { -kfree (twl); + otg =devm_kzalloc (&pdev->dev,sizeof *otg,GFP_KERNEL ); +if (!otg)return -ENOMEM ; - } twl->dev = &pdev->dev; twl->irq =platform_get_irq (pdev,0 );
@@ -621,8 +619,6 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev) err =twl4030_usb_ldo_init (twl);if (err) {dev_err (&pdev->dev,"ldo init failed\n" ); -kfree (otg); -kfree (twl);return err; }usb_add_phy (&twl->phy,USB_PHY_TYPE_USB2 );
@@ -646,8 +642,6 @@ static int __devinit twl4030_usb_probe(struct platform_device *pdev)if (status <0 ) {dev_dbg (&pdev->dev,"can't get IRQ %d, err %d\n" , twl->irq, status); -kfree (otg); -kfree (twl);return status; }
@@ -691,9 +685,6 @@ static int __exit twl4030_usb_remove(struct platform_device *pdev)regulator_put (twl->usb1v8);regulator_put (twl->usb3v1); -kfree (twl->phy.otg); -kfree (twl); -return 0 ; }
drivers/usb/otg/twl6030-usb.c +3 -13
@@ -395,15 +395,13 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev)struct device *dev = &pdev->dev; pdata = dev->platform_data; - twl =kzalloc (sizeof *twl,GFP_KERNEL ); + twl =devm_kzalloc (dev,sizeof *twl,GFP_KERNEL );if (!twl)return -ENOMEM ; - otg =kzalloc (sizeof *otg,GFP_KERNEL ); -if (!otg) { -kfree (twl); + otg =devm_kzalloc (dev,sizeof *otg,GFP_KERNEL ); +if (!otg)return -ENOMEM ; - } twl->dev = &pdev->dev; twl->irq1 =platform_get_irq (pdev,0 );
@@ -430,8 +428,6 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev) err =twl6030_usb_ldo_init (twl);if (err) {dev_err (&pdev->dev,"ldo init failed\n" ); -kfree (otg); -kfree (twl);return err; }usb_add_phy (&twl->phy,USB_PHY_TYPE_USB2 );
@@ -450,8 +446,6 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev)dev_err (&pdev->dev,"can't get IRQ %d, err %d\n" , twl->irq1, status);device_remove_file (twl->dev, &dev_attr_vbus); -kfree (otg); -kfree (twl);return status; }
@@ -463,8 +457,6 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev) twl->irq2, status);free_irq (twl->irq1, twl);device_remove_file (twl->dev, &dev_attr_vbus); -kfree (otg); -kfree (twl);return status; }
@@ -495,8 +487,6 @@ static int __exit twl6030_usb_remove(struct platform_device *pdev) pdata->phy_exit (twl->dev);device_remove_file (twl->dev, &dev_attr_vbus);cancel_work_sync (&twl->set_vbus_work); -kfree (twl->phy.otg); -kfree (twl);return 0 ; }
Signature · 1 line
1.7.5.4
Re: [PATCH 1/5] usb: musb: move work_struct(otg_notifier_work) from core to omap glue
In reply to Kishon Vijay Abraham IHello.
Quoted 1 line · Kishon Vijay Abraham I
Commit 712d8e
Please also specify that commit's summary in parens.
Quoted 7 lines
fixed
pm_runtimecalls while atomic by using a work queue. While the issue and the work queue implementation is specific to omap (omap2430.c), thework_structis defined as a member of struct musb (musb_core.h). Hence moved thework_structfrommusb_coreto omap glue.Signed-off-by Kishon Vijay Abraham I<[email protected]>
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 11 lines · Kishon Vijay Abraham I
Most part of this patch series was obtained by splitting [RFC PATCH 2/3] usb: musb: omap glue: use omap-usb2 as the phy driver.
TO DO:
* dt adaptation of musb omap glue, twl4030, twl6030.
* Use control module driver API to write to control module registers (mailbox and power control of phy)
* send usb2 phy driver
* make musb omap glue make use of usb2 phy driver and make twl630 as a comparator driver.
Quoted 4 lines
Patch series depends on
[PATCH v4 0/3] usb: multi-phy supportPerformed device mode testing in omap4 panda and omap3 beagle
here too, we need a new version.
Signature · 1 line
balbi