Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325951
b: refs/heads/master
c: 51e1e7b
h: refs/heads/master
i:
  325949: 5539642
  325947: fbc06a3
  325943: 68bbf0b
  325935: 30dcb10
  325919: 3073393
  325887: dbd92cc
v: v3
  • Loading branch information
Felipe Balbi committed Sep 10, 2012
1 parent 5088b13 commit 02fd559
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d720f057fda4bae91a5108a11587374b9e396c6a
refs/heads/master: 51e1e7bcef53e6a91cfffff0145ab315def61f61
15 changes: 15 additions & 0 deletions trunk/drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <linux/dma-mapping.h>
#include <linux/of.h>

#include <linux/usb/otg.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>

Expand Down Expand Up @@ -136,6 +137,8 @@ static void dwc3_core_soft_reset(struct dwc3 *dwc)
reg |= DWC3_GUSB2PHYCFG_PHYSOFTRST;
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);

usb_phy_init(dwc->usb2_phy);
usb_phy_init(dwc->usb3_phy);
mdelay(100);

/* Clear USB3 PHY reset */
Expand Down Expand Up @@ -465,6 +468,18 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
return -ENOMEM;
}

dwc->usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(dwc->usb2_phy)) {
dev_err(dev, "no usb2 phy configured\n");
return -EPROBE_DEFER;
}

dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3);
if (IS_ERR_OR_NULL(dwc->usb3_phy)) {
dev_err(dev, "no usb3 phy configured\n");
return -EPROBE_DEFER;
}

spin_lock_init(&dwc->lock);
platform_set_drvdata(pdev, dwc);

Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/usb/dwc3/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ struct dwc3_scratchpad_array {
* @maximum_speed: maximum speed requested (mainly for testing purposes)
* @revision: revision register contents
* @mode: mode of operation
* @usb2_phy: pointer to USB2 PHY
* @usb3_phy: pointer to USB3 PHY
* @is_selfpowered: true when we are selfpowered
* @three_stage_setup: set if we perform a three phase setup
* @ep0_bounced: true when we used bounce buffer
Expand Down Expand Up @@ -667,6 +669,9 @@ struct dwc3 {
struct usb_gadget gadget;
struct usb_gadget_driver *gadget_driver;

struct usb_phy *usb2_phy;
struct usb_phy *usb3_phy;

void __iomem *regs;
size_t regs_size;

Expand Down

0 comments on commit 02fd559

Please sign in to comment.