diff options
author | Richard Röjfors <richard.rojfors@pelagicore.com> | 2010-12-07 11:28:33 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-10 17:28:29 -0500 |
commit | ff176a4e2972bdc7a8d65cdcb0bd0d26ab1528cf (patch) | |
tree | cce374b952270c965d118081c5cd4514c47981f8 /drivers/usb/gadget | |
parent | 49e208346616328e535b5d6ecd510ab38f210858 (diff) |
usb: pch_udc: Fix setup transfers with data out
This patch fixes an issue where the driver does not handle out data in
setup transactions.
The per endpoint cached status register is cleared in the
pch_udc_svc_control_out function. When there is out data available the
function pch_udc_svc_data_out is called which tries to pick it up the
status, which now is cleared to 0. When the status is 0, the function
doesn't start reading the data from the FIFO.
There is a second bug in all this, pch_udc_svc_data_out takes the
endpoint number (0 for EP0), while pch_udc_svc_control_out passes the
endpoint index (1 for EP0). Effectively pch_udc_svc_data_out picks up
the wrong internal ep structure.
This patch makes sure to put back the cached status and pass the
endpoint number rather than index when calling pch_udc_svc_data_out.
Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/pch_udc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c index 216f648bae6c..0c8dd81dddca 100644 --- a/drivers/usb/gadget/pch_udc.c +++ b/drivers/usb/gadget/pch_udc.c | |||
@@ -2150,7 +2150,10 @@ static void pch_udc_svc_control_out(struct pch_udc_dev *dev) | |||
2150 | pch_udc_set_dma(dev, DMA_DIR_RX); | 2150 | pch_udc_set_dma(dev, DMA_DIR_RX); |
2151 | } else { | 2151 | } else { |
2152 | /* control write */ | 2152 | /* control write */ |
2153 | pch_udc_svc_data_out(dev, UDC_EP0OUT_IDX); | 2153 | /* next function will pickuo an clear the status */ |
2154 | ep->epsts = stat; | ||
2155 | |||
2156 | pch_udc_svc_data_out(dev, 0); | ||
2154 | /* re-program desc. pointer for possible ZLPs */ | 2157 | /* re-program desc. pointer for possible ZLPs */ |
2155 | pch_udc_ep_set_ddptr(ep, ep->td_data_phys); | 2158 | pch_udc_ep_set_ddptr(ep, ep->td_data_phys); |
2156 | pch_udc_set_dma(dev, DMA_DIR_RX); | 2159 | pch_udc_set_dma(dev, DMA_DIR_RX); |