OSDN Git Service

usb: dwc2: gadget: Fix GUSBCFG.USBTRDTIM value
authorAmelie Delaunay <amelie.delaunay@st.com>
Thu, 12 Jan 2017 15:09:44 +0000 (16:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jul 2017 12:40:26 +0000 (14:40 +0200)
commit5f54c4e1e2afd0a437e24c0b9689728c1afc1591
treef864eacd5043554dbfb3a9caac4ff4a6b710ac9b
parent0e9867b7113c56b367f2e753cd411cf7cef0d2ec
usb: dwc2: gadget: Fix GUSBCFG.USBTRDTIM value

[ Upstream commit ca02954ada711b08e5b0d84590a631fd63ed39f9 ]

USBTrdTim must be programmed to 0x5 when phy has a UTMI+ 16-bit wide
interface or 0x9 when it has a 8-bit wide interface.
GUSBCFG reset value (Value After Reset: 0x1400) sets USBTrdTim to 0x5.
In case of 8-bit UTMI+, without clearing GUSBCFG.USBTRDTIM mask, USBTrdTim
results in 0xD (0x5 | 0x9).
That's why we need to clear GUSBCFG.USBTRDTIM mask before setting USBTrdTim
value, to ensure USBTrdTim is correctly set in case of 8-bit UTMI+.

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/gadget.c