Re: [PATCH v4 06/12] usb: chipidea: udc: configure iso endpoints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 22-03-2013 17:20, Michael Grzeschik wrote:

The implementation is derived from the fsl_udc_core code in
fsl_ep_enable and makes basic iso handling possible.

Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
---
     Changes since v3:
      - added QH_ISO_TRANS macro
      - removed unused operations mentioned by Peter
     Changes since v2:
      - fixed usage of variable max
      - reworked on writel/readl patches
     Changes since v1:
      - fixed coding style issues mentioned by Sergei

  drivers/usb/chipidea/udc.c | 14 ++++++++------
  drivers/usb/chipidea/udc.h |  1 +
  2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 0ab7b0b..2e48b06 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
[...]
@@ -1027,19 +1029,19 @@ static int ep_enable(struct usb_ep *ep,
  	mEp->num  = usb_endpoint_num(desc);
  	mEp->type = usb_endpoint_type(desc);

-	mEp->ep.maxpacket = usb_endpoint_maxp(desc);
+	max = mEp->ep.maxpacket = usb_endpoint_maxp(desc);

  	trace_ci_ep_enable(mEp, 0);

-	if (mEp->type == USB_ENDPOINT_XFER_CONTROL)
+	if (mEp->type == USB_ENDPOINT_XFER_CONTROL) {
  		val |= QH_IOS;
-	else if (mEp->type == USB_ENDPOINT_XFER_ISOC)
-		val &= ~QH_MULT;
-
+	} else if (mEp->type == USB_ENDPOINT_XFER_ISOC) {
+		val |= QH_ISO_TRANS(max) << __ffs(QH_MULT);
+	}

I don't get why you added {} to each arm of the *if* -- they're both signle-statement it seems. scripts/chgeckpatch.pl should have warned you.

diff --git a/drivers/usb/chipidea/udc.h b/drivers/usb/chipidea/udc.h
index be60464..b2d7dcf 100644
--- a/drivers/usb/chipidea/udc.h
+++ b/drivers/usb/chipidea/udc.h
@@ -48,6 +48,7 @@ struct ci13xxx_qh {
 #define QH_MAX_PKT            (0x07FFUL << 16)
 #define QH_ZLT                BIT(29)
 #define QH_MULT               (0x0003UL << 30)
+#define QH_ISO_TRANS(x)       (1 + ((x >> 11) & 0x03))

The macro value should be indented by tabs (althought the ones above are indented by spaces).

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux