- 18 11月, 2016 2 次提交
-
-
由 John Youn 提交于
Move the gadget devicetree settings into the core_params structure and document them. Then set and check them in params.c, with the addition of some helper functions, and remove the equivalent code in gadget.c. Because these parameters came from the standalone s3c driver, they have a fixed default value rather than an autodetected one. Preserve and document this behavior to avoid any compatibility issues. Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 John Youn 提交于
This makes it consistent with the hw_params struct and simplifies the memory management for future refactoring. Fix up usage in all files. Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
- 03 11月, 2016 1 次提交
-
-
由 Masahiro Yamada 提交于
The combo of list_empty() check and return list_first_entry() can be replaced with list_first_entry_or_null(). Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
- 18 10月, 2016 2 次提交
-
-
由 John Youn 提交于
This reverts commit aa381a72 ("usb: dwc2: gadget: fix TX FIFO size and address initialization"). The original commit removed the FIFO size programming per endpoint. The DPTXFSIZn register is also used for DIEPTXFn and the SIZE field is r/w in dedicated fifo mode. So it isn't appropriate to simply remove this initialization as it might break existing behavior. Also, some cores might not have enough fifo space to handle the programming method used in the reverted patch, resulting in fifo initialization failure. Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Cc: Robert Baldyga <r.baldyga@samsung.com> Cc: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 John Youn 提交于
This reverts commit ba48eab8 ("usb: dwc2: gadget: change variable name to more meaningful"). This is needed to cleanly revert commit aa381a72 ("usb: dwc2: gadget: fix TX FIFO size and address initialization") which may cause regressions on some platforms. Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Cc: Robert Baldyga <r.baldyga@samsung.com> Cc: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
- 08 9月, 2016 1 次提交
-
-
由 John Youn 提交于
In dwc2_hsotg_udc_start(), don't initialize the controller for device mode unless we are actually in device mode. Tested-by: NHeiko Stuebner <heiko@sntech.de> Tested-by: NStefan Wahren <stefan.wahren@i2se.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
- 31 8月, 2016 6 次提交
-
-
由 Robert Baldyga 提交于
As kill_all_requests() potentially flushes TX FIFO, we should should free FIFO after calling it. Otherwise FIFO could stay unflushed properly. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Robert Baldyga 提交于
Since FIFO is always freed in dwc2_hsotg_ep_disable(), ep->fifo_index is always 0 in dwc2_hsotg_ep_enable(), hence code inside if() block is never executed. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Robert Baldyga 提交于
Since we handle FIFOs and endpoint separately, using variable named 'ep' in context of FIFO is misleading, hence we rename it to 'fifo'. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Robert Baldyga 提交于
According to DWC2 documentation, DPTxFSize field of DPTXFSIZn register is read only, which means that software cannot change FIFO size. Register description says: "The value of this register is the Largest Device Mode Periodic Tx Data FIFO Depth (parameter OTG_TX_DPERIO_DFIFO_DEPTH_n), as specified during coreConsultant configuration." That means, that we have to setup only FIFO start addresses (DPTxFStAddr), taking into account reset values of DPTxFSize. Initialize FIFO start addresses properly and remove unneeded core related to incorrect FIFO size initialization. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Robert Baldyga 提交于
In context of FIFO registers we use ep->fifo_index instead of ep->index. Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Wolfram Sang 提交于
All kmalloc-based functions print enough information on failures. Signed-off-by: NWolfram Sang <wsa-dev@sang-engineering.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 29 8月, 2016 1 次提交
-
-
由 Wolfram Sang 提交于
All kmalloc-based functions print enough information on failures. Signed-off-by: NWolfram Sang <wsa-dev@sang-engineering.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
- 21 6月, 2016 12 次提交
-
-
由 Vardan Mikayelyan 提交于
Done fixes and tested hsotg gadget's BDMA mode. Tested Control, Bulk, Isoc, Inter transfers. Added code for isoc transfers, removed unusable code, done minor fixes. Affected functions and IRQ handlers: - dwc2_hsotg_start_req(), - dwc2_hsotg_ep_enable(), - dwc2_hsotg_ep_queue(), - dwc2_hsotg_handle_outdone(), - GINTSTS_GOUTNAKEFF handler, Removed 'has_correct_parity' flag from 'dwc2_hsotg_ep' struct. Before this patch series, to set the data pid the DWC2 gadget driver was toggling the even/odd until it match, then were leaving it set. But now I have added mechanism to set pid and excluded all code where this flag was set. Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
Reimplemented EP disabled interrupt handler and moved to corresponding function. This interrupt indicates that the endpoint has been disabled per the application's request. For IN endpoints flushes txfifo, in case of BULK clears DCTL_CGNPINNAK, in case of ISOC completes current request. For ISOC-OUT endpoints completes expired requests. If there is remaining request starts it. This is the part of ISOC-OUT transfer drop flow. When ISOC-OUT transfer expired we must disable ep to drop ongoing transfer. Tested-by: NJohn Keeping <john@metanate.com> Reviewed-by: NVahram Aharonyan <vahrama@synopsys.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
Incomplete ISO IN interrupt indicates one of the following conditions occurred while transmitting an ISOC transaction. - Corrupted IN Token for ISOC EP. - Packet not complete in FIFO. Incomplete ISO OUT indicates that there is at least one isochronous OUT endpoint on which the transfer is not completed in the current microframe. The following actions will be taken: In case of EP-IN - Determine the EP - Disable EP directly from this handler; when "Endpoint Disabled" interrupt is received flush FIFO In case of EP-OUT - Determine the EP - If target frame elapsed set DCTL_SGOUTNAK, unmask GOUTNAKEFF and proceed as described in section 7.5.1 of DWC-HSOTG Programming Guide Also added dwc2_gadget_target_frame_elapsed() helper function which will be used in Incomplete ISO IN/OUT Interrupt handlers. Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
NAKINTRPT interrupt is starting point for isoc-in transfer, synchronization done with first in token received from host, core asserts this interrupt when responds with 0 length data to in token, received from host. The first IN token is asynchronous for device - device does not know when first one token will arrive from host. On first token arrival HW generates 2 interrupts: 'in token received while FIFO empty' and 'NAK'. NAK interrupt for ISOC in means that token has arrived and ZLP was sent in response to that as there was no data in FIFO. SW is basing on this interrupt to obtain frame in which token has come and then based on the interval calculates next frame for transfer. OUTTKNEPDIS interrupt is starting point for isoc-out transfer, synchronization done with first out token received from host while corresponding ep is disabled. For OUTs the reason is same - device does not know initial frame in which out token will come. For this HW generates OUTTKNEPDIS - out token is received while EP is disabled. Upon getting this interrupt SW starts calculation for next transfer frame. Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
Replaced repeating code with function call. Starts next request from ep queue. If queue is empty and ep is isoc -In case of OUT-EP unmasks OUTTKNEPDIS. OUTTKNEPDIS is masked in it's handler, so we need to unmask it here to be able to do resynchronization. Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
Reads and returns interrupts for given endpoint, by masking epint_reg with corresponding mask. Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
Calculate the interval according to the USB 2.0 specification section 9.6.6. Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
Increases and checks targeted frame number of current ep if overrun happened, sets flag and masks with DSTS_SOFFN_LIMIT Added following fields to struct dwc2_hsotg_ep -target_frame: Targeted frame num to setup next ISOC transfer -frame_overrun: Indicates SOF number overrun in DSTS Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
According DWC-OTG databook, "GOUTNakEff" is read only and can be cleared only by "DCTL.CGOUTNak", but here we do not need to clear it because DWC-OTG programming guide says that before disabling any OUT endpoint, the application must enable Global OUT NAK mode, so if this mode is enabled we can continue without this step. Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
No-op change. Changed field names to prevent misunderstanding. Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
This chunk is not needed here. There is no functionality depend on this, so if no-op, I think we do not need to have this interrupt unmasked. Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vardan Mikayelyan 提交于
Removed "ctrl |= DXEPCTL_USBACTEP" from dwc2_hsotg_start_req() function because this step is done in dwc2_hsotg_ep_enable(). Tested-by: NJohn Keeping <john@metanate.com> Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
- 31 5月, 2016 2 次提交
-
-
由 Vahram Aharonyan 提交于
Add a check in dwc2_hsotg_ep_sethalt() so that it does not halt isochronous endpoints. Signed-off-by: NVahram Aharonyan <vahrama@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vahram Aharonyan 提交于
The gadget API function usb_ep_set_halt() expects the gadget to return -EAGAIN if the ep is active. Add support for this behavior. Otherwise this may break mass storage protocol if a STALL is attempted on the endpoint. Signed-off-by: NVahram Aharonyan <vahrama@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
- 28 4月, 2016 2 次提交
-
-
由 Vardan Mikayelyan 提交于
In host slave mode, the core asserts the rxready, txfifoempty interrupts that get serviced in the gadget irq handler. Prevent servicing of these when not in the gadget mode of operation. Signed-off-by: NVardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
由 Vahram Aharonyan 提交于
Replaced the WARN_ON with a check and return of -EINVAL in the dwc2_hsotg_ep_enable function if ep0 is passed in. Signed-off-by: NVahram Aharonyan <vahrama@synopsys.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
- 04 4月, 2016 1 次提交
-
-
由 Przemek Rudy 提交于
The host/device mode set with dr_mode should be kept all the time, not being changed to OTG in gadget setup (by overriding CFGUSB_FORCEDEVMODE and CFGUSB_FORCEHOSTMODE bits). Acked-by: NJohn Youn <johnyoun@synopsys.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NPrzemek Rudy <prudy1@o2.pl> Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
-
- 04 3月, 2016 1 次提交
-
-
由 John Youn 提交于
Move the register save and restore functions into the host and gadget specific files. Tested-by: NDouglas Anderson <dianders@chromium.org> Reviewed-by: NDouglas Anderson <dianders@chromium.org> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@kernel.org>
-
- 23 12月, 2015 6 次提交
-
-
由 Marek Vasut 提交于
The "enumspd" field is located in register DSTS[2:1], but the code which checks the bitfield does not shift the value accordingly. This in turn causes incorrect detection of gadget link partner speed in dwc2_hsotg_irq_enumdone() . Shift the value accordingly to fix the problem with speed detection. Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NMarek Vasut <marex@denx.de> Cc: Felipe Balbi <balbi@ti.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: John Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 John Youn 提交于
Remove call to dwc2_hsotg_init() from dwc2_gadget_init(). The gadget_init function should not access any device registers because the mode isn't guaranteed here. Also, this is already called elsewhere before anything starts on the gadget so it is not necessary here. Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 John Youn 提交于
The dwc2_core_reset() function exists in the core so use that one instead. Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 John Youn 提交于
Use the previously cached hw params in the gadget. This saves a reset and force mode in the gadget initialization during probe and makes getting the hardware parameters consistent between gadget and host. Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Gregory Herrero 提交于
When receiving GINTSTS_GINNAKEFF or GINTSTS_GOUTNAKEFF interrupt, DCTL will be overwritten with DCTL_CGOUTNAK or DCTL_CGNPINNAK values. Instead of overwriting it, write only needed bits. It could cause an issue if GINTSTS_GINNAKEFF or GINTSTS_GOUTNAKEFF interrupt is received after dwc2 disabled pullup by writing DCTL_SFTDISCON bit. Pullup will then be re-enabled whereas it should not. Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NGregory Herrero <gregory.herrero@intel.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Du, Changbin 提交于
To stop an out endpoint, software should set sets the Global OUT NAK, but not the Global Non-periodic IN NAK. This driver bug leads the out-ep failed be in disabled state with below error. dwc2_hsotg_ep_stop_xfr: timeout DOEPCTL.EPDisable Acked-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NDu, Changbin <changbin.du@intel.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
- 14 10月, 2015 2 次提交
-
-
由 Marek Szyprowski 提交于
DWC2 module on some platforms needs three additional hardware resources: phy controller, clock and power supply. All of them must be enabled/activated to properly initialize and operate. This was initially handled in s3c-hsotg driver, which has been converted to 'gadget' part of dwc2 driver. Unfortunately, not all of this code got moved to common platform code, what resulted in accessing DWC2 registers without enabling low-level hardware resources. This fails for example on Exynos SoCs. This patch moves all the code for managing those resources to common platform.c file and provides convenient wrappers for controlling them. Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
由 Marek Szyprowski 提交于
init_mutex is a leftover from the time, when s3c-hsotg driver did not implement proper pull up/down control and emulated it by enabling enabling/disabling usb phy. Proper pull up/down control has been added by commit 5b9451f8 ("usb: dwc2: gadget: use soft-disconnect udc feature in pullup() method"), so init_muxtex can be removed now to avoid potential deadlocks with other locks. Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com> Acked-by: NJohn Youn <johnyoun@synopsys.com> Tested-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-
- 03 10月, 2015 1 次提交
-
-
由 Roman Bacik 提交于
USB OTG driver in isochronous mode has to set the parity of the receiving microframe. The parity is set to even by default. This causes problems for an audio gadget, if the host starts transmitting on odd microframes. This fix uses Incomplete Periodic Transfer interrupt to toggle between even and odd parity until the Transfer Complete interrupt is received. Signed-off-by: NRoman Bacik <rbacik@broadcom.com> Reviewed-by: NAbhinav Ratna <aratna@broadcom.com> Reviewed-by: NSrinath Mannam <srinath.mannam@broadcom.com> Signed-off-by: NScott Branden <sbranden@broadcom.com> Signed-off-by: NJohn Youn <johnyoun@synopsys.com> Signed-off-by: NFelipe Balbi <balbi@ti.com>
-