forked from alistair23/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'usb-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel…
…/git/gregkh/usb Pull USB fixes from Greg KH: "Here are a number of small USB driver fixes for 5.11-rc3. Include in here are: - USB gadget driver fixes for reported issues - new usb-serial driver ids - dma from stack bugfixes - typec bugfixes - dwc3 bugfixes - xhci driver bugfixes - other small misc usb driver bugfixes All of these have been in linux-next with no reported issues" * tag 'usb-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (35 commits) usb: dwc3: gadget: Clear wait flag on dequeue usb: typec: Send uevent for num_altmodes update usb: typec: Fix copy paste error for NVIDIA alt-mode description usb: gadget: enable super speed plus kcov, usb: hide in_serving_softirq checks in __usb_hcd_giveback_urb usb: uas: Add PNY USB Portable SSD to unusual_uas usb: gadget: configfs: Preserve function ordering after bind failure usb: gadget: select CONFIG_CRC32 usb: gadget: core: change the comment for usb_gadget_connect usb: gadget: configfs: Fix use-after-free issue with udc_name usb: dwc3: gadget: Restart DWC3 gadget when enabling pullup usb: usbip: vhci_hcd: protect shift size USB: usblp: fix DMA to stack USB: serial: iuu_phoenix: fix DMA from stack USB: serial: option: add LongSung M5710 module support USB: serial: option: add Quectel EM160R-GL USB: Gadget: dummy-hcd: Fix shift-out-of-bounds bug usb: gadget: f_uac2: reset wMaxPacketSize usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one ...
- Loading branch information
Showing
33 changed files
with
267 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3883,7 +3883,7 @@ F: drivers/mtd/nand/raw/cadence-nand-controller.c | |
CADENCE USB3 DRD IP DRIVER | ||
M: Peter Chen <[email protected]> | ||
M: Pawel Laszczak <[email protected]> | ||
M: Roger Quadros <rogerq@ti.com> | ||
R: Roger Quadros <rogerq@kernel.org> | ||
R: Aswath Govindraju <[email protected]> | ||
L: [email protected] | ||
S: Maintained | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
* Author: Heikki Krogerus <[email protected]> | ||
*/ | ||
|
||
#include <linux/delay.h> | ||
#include <linux/time64.h> | ||
#include <linux/ulpi/regs.h> | ||
|
||
#include "core.h" | ||
|
@@ -17,14 +19,28 @@ | |
DWC3_GUSB2PHYACC_ADDR(ULPI_ACCESS_EXTENDED) | \ | ||
DWC3_GUSB2PHYACC_EXTEND_ADDR(a) : DWC3_GUSB2PHYACC_ADDR(a)) | ||
|
||
static int dwc3_ulpi_busyloop(struct dwc3 *dwc) | ||
#define DWC3_ULPI_BASE_DELAY DIV_ROUND_UP(NSEC_PER_SEC, 60000000L) | ||
|
||
static int dwc3_ulpi_busyloop(struct dwc3 *dwc, u8 addr, bool read) | ||
{ | ||
unsigned int count = 1000; | ||
unsigned long ns = 5L * DWC3_ULPI_BASE_DELAY; | ||
unsigned int count = 10000; | ||
u32 reg; | ||
|
||
if (addr >= ULPI_EXT_VENDOR_SPECIFIC) | ||
ns += DWC3_ULPI_BASE_DELAY; | ||
|
||
if (read) | ||
ns += DWC3_ULPI_BASE_DELAY; | ||
|
||
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); | ||
if (reg & DWC3_GUSB2PHYCFG_SUSPHY) | ||
usleep_range(1000, 1200); | ||
|
||
while (count--) { | ||
ndelay(ns); | ||
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYACC(0)); | ||
if (!(reg & DWC3_GUSB2PHYACC_BUSY)) | ||
if (reg & DWC3_GUSB2PHYACC_DONE) | ||
return 0; | ||
cpu_relax(); | ||
} | ||
|
@@ -38,16 +54,10 @@ static int dwc3_ulpi_read(struct device *dev, u8 addr) | |
u32 reg; | ||
int ret; | ||
|
||
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); | ||
if (reg & DWC3_GUSB2PHYCFG_SUSPHY) { | ||
reg &= ~DWC3_GUSB2PHYCFG_SUSPHY; | ||
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); | ||
} | ||
|
||
reg = DWC3_GUSB2PHYACC_NEWREGREQ | DWC3_ULPI_ADDR(addr); | ||
dwc3_writel(dwc->regs, DWC3_GUSB2PHYACC(0), reg); | ||
|
||
ret = dwc3_ulpi_busyloop(dwc); | ||
ret = dwc3_ulpi_busyloop(dwc, addr, true); | ||
if (ret) | ||
return ret; | ||
|
||
|
@@ -61,17 +71,11 @@ static int dwc3_ulpi_write(struct device *dev, u8 addr, u8 val) | |
struct dwc3 *dwc = dev_get_drvdata(dev); | ||
u32 reg; | ||
|
||
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); | ||
if (reg & DWC3_GUSB2PHYCFG_SUSPHY) { | ||
reg &= ~DWC3_GUSB2PHYCFG_SUSPHY; | ||
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); | ||
} | ||
|
||
reg = DWC3_GUSB2PHYACC_NEWREGREQ | DWC3_ULPI_ADDR(addr); | ||
reg |= DWC3_GUSB2PHYACC_WRITE | val; | ||
dwc3_writel(dwc->regs, DWC3_GUSB2PHYACC(0), reg); | ||
|
||
return dwc3_ulpi_busyloop(dwc); | ||
return dwc3_ulpi_busyloop(dwc, addr, false); | ||
} | ||
|
||
static const struct ulpi_ops dwc3_ulpi_ops = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.