From 2dc9ae5789d95d429be537616e7392b2fd1d642d Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 19 Jul 2010 09:40:42 +0100 Subject: [PATCH] --- yaml --- r: 208051 b: refs/heads/master c: e7a9ff54271bf0ddbf641e5a0bde3ebda35808be h: refs/heads/master i: 208049: b72480f1aadee963e8e47eb0bd589745bf2a1da3 208047: 6f4ced7f45f4630bce8ddeb06c0a7746d965bb66 v: v3 --- [refs] | 2 +- trunk/drivers/usb/gadget/s3c-hsotg.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 801eabfaea34..b349900564e8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 679f9b7c7c7d3c746792138e9d7d76578ef52c41 +refs/heads/master: e7a9ff54271bf0ddbf641e5a0bde3ebda35808be diff --git a/trunk/drivers/usb/gadget/s3c-hsotg.c b/trunk/drivers/usb/gadget/s3c-hsotg.c index 4a251458c61d..354fd456f8cc 100644 --- a/trunk/drivers/usb/gadget/s3c-hsotg.c +++ b/trunk/drivers/usb/gadget/s3c-hsotg.c @@ -91,7 +91,9 @@ struct s3c_hsotg_req; * For periodic IN endpoints, we have fifo_size and fifo_load to try * and keep track of the amount of data in the periodic FIFO for each * of these as we don't have a status register that tells us how much - * is in each of them. + * is in each of them. (note, this may actually be useless information + * as in shared-fifo mode periodic in acts like a single-frame packet + * buffer than a fifo) */ struct s3c_hsotg_ep { struct usb_ep ep; @@ -474,6 +476,14 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg, size_left = S3C_DxEPTSIZ_XferSize_GET(epsize); + /* if shared fifo, we cannot write anything until the + * previous data has been completely sent. + */ + if (hs_ep->fifo_load != 0) { + s3c_hsotg_en_gsint(hsotg, S3C_GINTSTS_PTxFEmp); + return -ENOSPC; + } + dev_dbg(hsotg->dev, "%s: left=%d, load=%d, fifo=%d, size %d\n", __func__, size_left, hs_ep->size_loaded, hs_ep->fifo_load, hs_ep->fifo_size);