Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316919
b: refs/heads/master
c: a188b68
h: refs/heads/master
i:
  316917: 9e028ff
  316915: 953edc0
  316911: b3296ab
v: v3
  • Loading branch information
Lukasz Majewski authored and Felipe Balbi committed Jun 22, 2012
1 parent 57793cc commit 22e8db2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 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: d6e16a89578fcc8834be634c85c5c5ddc2d13229
refs/heads/master: a188b6897e3dca82dd6f5beceabf1fc62b9786d9
33 changes: 30 additions & 3 deletions trunk/drivers/usb/gadget/s3c-hsotg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2963,9 +2963,6 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget,
goto err;
}

s3c_hsotg_phy_enable(hsotg);

s3c_hsotg_core_init(hsotg);
hsotg->last_rst = jiffies;
dev_info(hsotg->dev, "bound driver %s\n", driver->driver.name);
return 0;
Expand Down Expand Up @@ -3028,10 +3025,40 @@ static int s3c_hsotg_gadget_getframe(struct usb_gadget *gadget)
return s3c_hsotg_read_frameno(to_hsotg(gadget));
}

/**
* s3c_hsotg_pullup - connect/disconnect the USB PHY
* @gadget: The usb gadget state
* @is_on: Current state of the USB PHY
*
* Connect/Disconnect the USB PHY pullup
*/
static int s3c_hsotg_pullup(struct usb_gadget *gadget, int is_on)
{
struct s3c_hsotg *hsotg = to_hsotg(gadget);
unsigned long flags = 0;

dev_dbg(hsotg->dev, "%s: is_in: %d\n", __func__, is_on);

spin_lock_irqsave(&hsotg->lock, flags);
if (is_on) {
s3c_hsotg_phy_enable(hsotg);
s3c_hsotg_core_init(hsotg);
} else {
s3c_hsotg_disconnect(hsotg);
s3c_hsotg_phy_disable(hsotg);
}

hsotg->gadget.speed = USB_SPEED_UNKNOWN;
spin_unlock_irqrestore(&hsotg->lock, flags);

return 0;
}

static struct usb_gadget_ops s3c_hsotg_gadget_ops = {
.get_frame = s3c_hsotg_gadget_getframe,
.udc_start = s3c_hsotg_udc_start,
.udc_stop = s3c_hsotg_udc_stop,
.pullup = s3c_hsotg_pullup,
};

/**
Expand Down

0 comments on commit 22e8db2

Please sign in to comment.