Skip to content

Commit

Permalink
usb: dwc3: core: add current_dr_role member
Browse files Browse the repository at this point in the history
We're going to use this member to track which role we're currently
playing, that way we can more easily implement dual-role swap in
upcoming patches.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Roger Quadros authored and Felipe Balbi committed Apr 11, 2017
1 parent fac3234 commit 6b3261a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ void dwc3_set_mode(struct dwc3 *dwc, u32 mode)
reg &= ~(DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG));
reg |= DWC3_GCTL_PRTCAPDIR(mode);
dwc3_writel(dwc->regs, DWC3_GCTL, reg);

dwc->current_dr_role = mode;
}

u32 dwc3_core_fifo_space(struct dwc3_ep *dep, u8 type)
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/dwc3/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ struct dwc3_scratchpad_array {
* @maximum_speed: maximum speed requested (mainly for testing purposes)
* @revision: revision register contents
* @dr_mode: requested mode of operation
* @current_dr_role: current role of operation when in dual-role mode
* @hsphy_mode: UTMI phy mode, one of following:
* - USBPHY_INTERFACE_MODE_UTMI
* - USBPHY_INTERFACE_MODE_UTMIW
Expand Down Expand Up @@ -891,6 +892,7 @@ struct dwc3 {
size_t regs_size;

enum usb_dr_mode dr_mode;
u32 current_dr_role;
enum usb_phy_interface hsphy_mode;

u32 fladj;
Expand Down

0 comments on commit 6b3261a

Please sign in to comment.