Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316975
b: refs/heads/master
c: 1e5acb8
h: refs/heads/master
i:
  316973: c386e9d
  316971: 58742d9
  316967: 8334100
  316959: 4684d5d
v: v3
  • Loading branch information
Kishon Vijay Abraham I authored and Felipe Balbi committed Jun 25, 2012
1 parent 185bb92 commit 990b894
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 410219dcd2ba8d8b4bcfa9c232f35bf505bc021a
refs/heads/master: 1e5acb8d6113a0f159257845e153d5b870ca618a
2 changes: 0 additions & 2 deletions trunk/drivers/usb/musb/musb_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -373,7 +372,6 @@ struct musb {
u16 int_tx;

struct usb_phy *xceiv;
u8 xceiv_event;

int nIrq;
unsigned irq_wake:1;
Expand Down
24 changes: 15 additions & 9 deletions trunk/drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 990b894

Please sign in to comment.