summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
Commit message (Collapse)AuthorAgeFilesLines
...
* usb: dwc3: gadget: let udc-core manage gadget->devFelipe Balbi2013-03-181-15/+2
| | | | | | | We don't need to register that device ourselves if we simply set gadget->register_my_device. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: remove unnecessary codeFelipe Balbi2013-03-041-3/+0
| | | | | | | | | the params variables on dwc3_gadget_conndone_interrupt() is only memset() to zero but never used in that function, so we can safely drop the variable and memset() call. Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge 3.8-rc5 into usb-nextGreg Kroah-Hartman2013-01-251-0/+1
|\ | | | | | | | | | | | | This fixes up a conflict with drivers/usb/serial/io_ti.c that came up in linux-next. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * usb: dwc3: gadget: fix ep->maxburst for ep0Pratyush Anand2013-01-181-0/+1
| | | | | | | | | | | | | | | | | | dwc3_gadget_set_ep_config expects maxburst as incremented by 1. So, by default initialize ep->maxburst to 1 for ep0. Cc: <stable@vger.kernel.org> Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: change HIRD threshold to 12Felipe Balbi2013-01-241-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First of all, that 28 value makes no sense as HIRD threshold is a 4-bit value, second of all it's causing issues for OMAP5. Using 12 because commit cbc725b3 (usb: dwc3: keep default hird threshold value as 4b1100) had the intention of setting the maximum allowed value of 0xc. Also, original code has been wrong forever, so this should be backported as far back as possible. Cc: <stable@vger.kernel.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: req->queued must be forced to false in cleanupPratyush Anand2013-01-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | I am not sure, why I found it during SG debugging. But, I noticed that even when req_queued list was empty, there were some request in request_list having queued flag true. If I run test second time, it first removes all request from request_list and hence busy_slot was wrongly incremented. Cc: <stable@vger.kernel.org> Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: fix scatter gather implementationPratyush Anand2013-01-181-92/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To work with scatter gather properly, fixes have been done in number of functions. I will explain requirement of each fixes one by one. start_slot: used to retrieve all request of SG during cleanup dwc3_gadget_giveback: We need to skip link TRB if it was one of the intermediate TRB of SG. dwc3_prepare_one_trb: We need to track all submitted TRBs during cleanup. Since, all TRBs would be serially allocated, so we can just keep starting slot info and we can always find rest of them. We need to pass sg node number, so that we cab appropriately program ISOC_FIRST/ISOC, Chain etc. dwc3_prepare_trbs: last_one should be set when it is last node of SG as well as last node of request_list. __dwc3_cleanup_done_trbs: It has been prepared after re-factorization of dwc3_cleanup_done_reqs. It is called for each TRB of SG. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: no need to pass params in case of UPDATE_TRANSFERPratyush Anand2013-01-181-4/+5
| | | | | | | | | | | | | | UPDATE_TRANSFER does not need any parameters. So, no need to prepare it. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: fix skip LINK_TRB on ISOCPratyush Anand2013-01-181-8/+5
| | | | | | | | | | | | | | | | | | | | When we reach to link trb, we just need to increase free_slot and then calculate TRB. Return is not correct, as it will cause wrong TRB DMA address to fetch in case of update transfer. Cc: <stable@vger.kernel.org> Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: fix isoc END TRANSFER ConditionPratyush Anand2013-01-181-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were still some corner cases where isoc transfer was not able to restart, specially when missed isoc does not happen , and in fact gadget does not queue any new request during giveback. Cleanup function calls giveback first, which provides a way to queue another request to gadget. But gadget did not had any data. So , it did not call ep_queue. To twist it further, gadget did not queue till cleanup for last queued TRB is called. If we ever reach this scenario, we must call END TRANSFER, so that we receive a new xfernotready with information about current microframe number. Also insure that there is no request submitted to core when issuing END TRANSFER. Cc: <stable@vger.kernel.org> # v3.8 Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: correct return from ep_queuePratyush Anand2013-01-181-0/+2
| | | | | | | | | | | | | | | | Its better to return from each if condition as they are mutually exclusive. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: fix missed isocPratyush Anand2013-01-181-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two reasons to generate missed isoc. 1. when the host does not poll for all the data. 2. because of application-side delays that prevent all the data from being transferred in programmed microframe. Current code was able to handle first case only. This patch handles scenario 2 as well.Scenario 2 sometime may occur with complex gadget application, however it can be easily reproduced for testing purpose as follows: a. use isoc binterval as 1 in f_sourcesink. b. use pattern=0 c. introduce a delay of 150us deliberately in source_sink_complete, so that after few frames it lands into scenario 2. d. now run testusb 16 (isoc in test). You will notice that if this patch is not applied then isoc transfer is not able to recover after first missed. Current patch's approach is as under: If missed isoc occurs and there is no request queued then issue END TRANSFER, so that core generates next xfernotready and we will issue a fresh START TRANSFER. If there are still queued request then wait, do not issue either END or UPDATE TRANSFER, just attach next request in request_list during giveback. If any future queued request is successfully transferred then we will issue UPDATE TRANSFER for all request in the request_list. Cc: <stable@vger.kernel.org> # v3.6 v3.7 v3.8 Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: Enable usb2 LPM only when connected as usb2.0Pratyush Anand2013-01-181-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Synopsys says: The HIRD Threshold field must be set to ‘0’ when the device core is operating in super speed mode. This patch implements above statement. Cc: <stable@vger.kernel.org> # v3.6 v3.7 v3.8 Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: don't redefine 'ret'Felipe Balbi2013-01-181-2/+0
|/ | | | | | | we have an extra 'ret' variable shadowing a previous definition. Remove it. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: remove use of __devinitBill Pemberton2012-11-211-2/+2
| | | | | | | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Geoff Levand <geoff@infradead.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Olav Kongas <ok@artecdesign.ee> Cc: Lennert Buytenhek <kernel@wantstofly.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: dwc3: gadget: fix 'endpoint always busy' bugFelipe Balbi2012-10-151-1/+1
| | | | | | | | | | | | | | | | | | | If a USB transfer has already been started, meaning we have already issued StartTransfer command to that particular endpoint, DWC3_EP_BUSY flag has also already been set. When we try to cancel this transfer which is already in controller's cache, we will not receive XferComplete event and we must clear DWC3_EP_BUSY in order to allow subsequent requests to be properly started. The best place to clear that flag is right after issuing DWC3_DEPCMD_ENDTRANSFER. Cc: stable@vger.kernel.org # v3.4 v3.5 v3.6 Reported-by: Moiz Sonasath <m-sonasath@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge 3.6-rc6 into usb-nextGreg Kroah-Hartman2012-09-161-2/+19
|\ | | | | | | | | | | | | | | | | This resolves the merge problems with: drivers/usb/dwc3/gadget.c drivers/usb/musb/tusb6010.c that had been seen in linux-next. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * usb: dwc3: gadget: fix pending isoc handlingPratyush Anand2012-09-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | If xfernotready is received and there is no request in request_list then REQUEST_PENDING flag must be set, so that next request in ep queue is executed. In case of isoc transfer, if xfernotready is already elapsed and even first request has not been queued to request_list, then issue END TRANSFER, so that you can receive xfernotready again and can have notion of current microframe. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: correct cache sync issue in case of ep0_bouncedPratyush Anand2012-09-061-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of ep0 out, if length is not aligned to maxpacket size then we use dwc->ep_bounce_addr for dma transfer and not request->dma. Since, we have alreday done memcpy from dwc->ep0_bounce to request->buf, so we do not need to issue cache sync function. In fact, cache sync function will bring wrong data in request->buf from request->dma in this scenario. So, cache sync function must not be executed in case of ep0 bounced. Cc: <stable@vger.kernel.org> # v3.4 v3.5 Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: set up burst size only superspeed modeChanho Park2012-08-311-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When connection is established non-ss mode, endpoint.maxburst is correctly set to 0, this means that current code will set maxburst bitfield on DEPCFG's parameter 0 to the highest possible value (0x0f) which is wrong. Even though this hasn't caused any issues so far (HW seems to ignore that when not running in SS mode) we want to make sure maxburst bitfield is only set to anything other than zero if we're running on SuperSpeed mode. In order to achieve that, let's check for gadget's operating speed before setting maxburst bitfield when issuing DEPCFG command. [ balbi@ti.com : improved commit log a bit in order to clarify the situation ] Signed-off-by: Chanho Park <chanho61.park@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: warn about endpoint already enabled before changing ep nameFelipe Balbi2012-08-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case some gadget driver tries to enable an endpoint which is already enabled, we print a nice WARN so we can track broken gadget drivers. The only problem is that we're printing the WARN when we already changed endpoint's name, which would result in endpoints named as: ep1in-bulk-bulk-bulk-bulk-bulk-bulk-bulk To prevent that, we will continue to print the WARN, but do so before changing endpoint's name and return early. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: Fix dwc3_stop_active_transfer for synchronization delayPratyush Anand2012-08-091-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | dwc3_stop_active_transfer has been called from two places. After each calling of this function , we should allow 100 us delay to synchronize with interconnect. It would be better if we put this delay in that function only, rather than into calling routine of this function. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Reported-by: Michel Sanches <michel.sanches@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: correct missed isoc when endpoint is busyPratyush Anand2012-08-071-1/+2
| | | | | | | | | | | | | | | | | | When MISSED_ISOC is set, BUSY is also set. Since, we are handling MISSED_ISOC as a separate case in third scenario, therefore handle only BUSY but not MISSED_ISOC in second scenario. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: Fix sparse warningsMoiz Sonasath2012-08-071-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following sparse warnings: drivers/usb/dwc3/gadget.c:1096:7: warning: symbol 'ret' shadows an earlier one drivers/usb/dwc3/gadget.c:1058:8: originally declared here drivers/usb/dwc3/gadget.c:1100:16: warning: symbol 'dwc' shadows an earlier one drivers/usb/dwc3/gadget.c:1057:15: originally declared here drivers/usb/dwc3/gadget.c:1118:16: warning: symbol 'dwc' shadows an earlier one drivers/usb/dwc3/gadget.c:1057:15: originally declared here drivers/usb/dwc3/gadget.c:1800:19: warning: symbol 'dep' shadows an earlier one drivers/usb/dwc3/gadget.c:1778:18: originally declared here Also, fix the potential checkpatch errors around the if() loops that this fix patch can create. Signed-off-by: Moiz Sonasath <m-sonasath@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: set Ignore Sequence Number bit from ConnectDone EventFelipe Balbi2012-08-031-8/+13
|/ | | | | | | Databook says we should set Ignore Sequence Number bit from ConnectDone Event, so let's do so. Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge tag 'dwc3-for-v3.6' of ↵Greg Kroah-Hartman2012-07-051-147/+216
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next usb: dwc3: patches for v3.6 merge window lots of changes for the dwc3 driver which will make the driver a lot more stable and some changes which are just cosmetic. The bulk of changes is related to mis-defined macros which were never used before, some fixes to error path which e.g. prevent the driver from initiating two transfer on ep0out in case of stall, some fixes to request dequeueing and the End Transfer Command. We have some changes to U1/U2 handling where we were enabling those transtions at the wrong spot (though we haven't seen a problem from that as of today). A few patches will make it easier to add support for newer releases of the core by adding definitions for new registers and changing the code to act accordingly when certain revisions are detected. There's also the usual comestic changes to make the driver easier to maintain and make it easier for new- comers to understand the driver. Also one patch fixing a double inclusion of a header.
| * usb: dwc3: return error in case of run/stop timeoutPratyush Anand2012-07-021-4/+7
| | | | | | | | | | | | | | | | Although timeout has never been experienced, still to make it meaningful, its better to return error if it ever occurs. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: enable ACCEPT{U1,U2}ENA when SetConfiguration receivedPratyush Anand2012-07-021-1/+0
| | | | | | | | | | | | | | | | As per databook, ACCEPT{U1,U2}ENA bits should be set after receiving SetConfiguration Command. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: no need to clear INIT{U1,U2}ENA bitsPratyush Anand2012-07-021-1/+0
| | | | | | | | | | | | | | | | as per databook, these bits are cleared by hardware on each USB reset, so no need to clear it explicitly by software in reset ISR. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: keep default hird threshold value as 4b1100Pratyush Anand2012-07-021-1/+1
| | | | | | | | | | | | | | | | as per data book any HIRD threshold value greater than 4b1100 is invalid. So set the maximum valid value as default values. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: correct set_halt implementation for ep0Pratyush Anand2012-07-021-2/+5
| | | | | | | | | | | | | | | | | | | | set_halt for ep0 is called to stall a deferred control responses by the gadget. We already have a function to stall default control endpoint. This patch points set_halt for ep0 to the already available function. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Michel Sanches <michel.sanches@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: remove duplicated code from __dwc3_gadget_ep_set_haltFelipe Balbi2012-06-251-9/+0
| | | | | | | | | | | | | | | | | | | | whenever we want to stall ep0, we always call dwc3_ep0_stall_and_restart() which makes sure to send ep0state properly rendering the code in __dwc3_gadget_ep_set_halt() duplicated. Reported-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: rename res_trans_idx to resource_indexFelipe Balbi2012-06-251-8/+8
| | | | | | | | | | | | | | resource_index is more human readable. No functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: split special cases of ep_queue()Felipe Balbi2012-06-251-22/+28
| | | | | | | | | | | | | | | | | | | | | | | | It makes it easier to read and also avoids setting DWC3_EP_PENDING_REQUEST just so the next branch evaluates true. No functional changes otherwise. Cc: Pratyush Anand <pratyush.anand@st.com> Cc: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: remove WARN_ON from dwc_stop_active_transferPratyush Anand2012-06-251-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we are sure that, if res_trans_idx is zero, then endpoint has been stopped. So it's safe to just return if endpoint is already stopped. No need to generate warning anymore. While doing so, it's better to return when res_trans_idx is zero and decrease one level of indentation. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> [ balbi@ti.com: slightly changed commit log ] Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: giveback all queued request when ep disabled or reset receivedPratyush Anand2012-06-151-2/+5
| | | | | | | | | | | | | | | | | | | | In case of ep_disable and reset interrupt is received and, still there was at least one request queued for dma transfer, then endpoint is stopped first. Once endpoint is stopped, callback for all queued request must be called. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: resume phy during gadget initialization on recent coresPratyush Anand2012-06-061-2/+2
| | | | | | | | | | | | | | It is needed to enumerate recent cores like 2.10a. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: ignore endpoint IRQs when endpoint is disabledFelipe Balbi2012-06-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By the time we're disabling the endpoint, HW could already have posted more events to our event buffer. In that case, we will receive endpoint events for a disabled endpoint. In order to protect ourselves from that situation, we simply ignore endpoint interrupts whenever the endpoint is disabled. Tested-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: don't call stop_active_transfers() on disconnectFelipe Balbi2012-06-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | In case we get disconnected, we will call gadget driver's disconnect method, which should make sure to disable all endpoints. At that point we will call stop_active_transfers() to make sure we didn't leave any pending request on the controller. Tested-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: don't wait for ep cmd IRQFelipe Balbi2012-06-061-39/+27
| | | | | | | | | | | | | | | | | | That IRQ is causing way too much trouble. We have a different handling which was agreed with IP provider and has been tested with FPGA and OMAP5. Tested-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: drop useless codeFelipe Balbi2012-06-061-3/+0
| | | | | | | | | | | | | | | | We never set CMDIOC bit for Start Transfer command, so that code will never be used. Tested-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: Fix break from cleanup request loopPratyush Anand2012-06-041-1/+2
| | | | | | | | | | | | | | | | | | If event status says that its last completed TRB but TRB is still owned by HW then break from the loop, because we are not going to get correct TRB status from trb control/size register. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: Fix missed isoc IN transactionPratyush Anand2012-06-041-24/+49
| | | | | | | | | | | | | | | | | | | | If an IN transfer is missed on isoc endpoint, then driver must insure that next ep_queue is properly handled. This patch fixes this issue by starting a new transfer for next queued request. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * USB: DWC3: Generate interrupt on each TRB as default optionPratyush Anand2012-06-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently in case of isoc, interrupt is programmed after each TRB_NUM/4 ie 8th TRB. A TRB is programmed against each submitted request from gadget. If we do not want to limit the minimum number of necessary request to be submitted from gadget then we must receive interrupt on each TRB submission. There can be such situation with a gadget working with ping-pong buffer. If a gadget does not want to receive interrupt after each request completion then it may set no_interrupt flag. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: move AcceptU1Ena and AcceptU2Ena to Reset IRQGerard CAUVY2012-06-031-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the databook, the DWC3 Core will reset those bits to 0 on USB Bus Reset. This means we must re-enable those bits on every reset interrupt. Because we will always get a Reset interrupt after loading a gadget driver, we can, instead of re-enabling something that was just lost, move the handling of those bits to the Reset Interrupt. This patch fixes USB30CV U1/U2 Test. Signed-off-by: Gerard CAUVY <g-cauvy1@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: disable U1/U2 on disconnectFelipe Balbi2012-06-031-5/+2
| | | | | | | | | | | | | | | | If we get a disconnect IRQ, we should take the core out of low power mode so we can reconnect afterwards. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: prevent DCTL register corruptionFelipe Balbi2012-06-031-0/+1
| | | | | | | | | | | | | | | | | | If we don't read out the contents of the register (in order to reinitialize 'reg' variable) we will be writing unknown contents to the DCTL register whenever we try to use dwc3_gadget_wakeup() function. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: support new revisions of DWC3 corePaul Zimmerman2012-06-031-13/+70
| | | | | | | | | | | | | | | | | | | | Recent cores (>= 1.94a) have a set of new features, commands and a slightly different programming model. This patch aims to support those changes. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: rename phy_power() to phy_suspend()Paul Zimmerman2012-06-031-16/+16
| | | | | | | | | | | | | | | | | | those two functions don't power PHYs, they simply put them in suspend state. Rename to reflect better what functions actually do. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: reinitialize retriesPaul Zimmerman2012-06-031-0/+1
| | | | | | | | | | | | | | retries is used twice without being reinitialized. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud