From e4ce4ecd962e17a92974b3c7ba063d29fce8c86f Mon Sep 17 00:00:00 2001 From: Michael Grzeschik Date: Thu, 13 Jun 2013 17:59:47 +0300 Subject: usb: chipidea: udc: configure iso endpoints This patch adds iso endpoint support to the device controller. It makes use of the multiplication bits in the maxpacket field of the endpoint and calculates the multiplier bits for each transfer description on every request. Signed-off-by: Michael Grzeschik Reviewed-by: Peter Chen Signed-off-by: Alexander Shishkin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/chipidea/udc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/usb/chipidea/udc.h') diff --git a/drivers/usb/chipidea/udc.h b/drivers/usb/chipidea/udc.h index d12e8b59b110..a75724a19e1a 100644 --- a/drivers/usb/chipidea/udc.h +++ b/drivers/usb/chipidea/udc.h @@ -50,6 +50,7 @@ struct ci13xxx_qh { #define QH_MAX_PKT (0x07FFUL << 16) #define QH_ZLT BIT(29) #define QH_MULT (0x0003UL << 30) +#define QH_ISO_MULT(x) ((x >> 11) & 0x03) /* 1 */ u32 curr; /* 2 - 8 */ -- cgit v1.2.3 From cc9e6c495b0a37cc4f7003e470bcbb15ea760377 Mon Sep 17 00:00:00 2001 From: Michael Grzeschik Date: Thu, 13 Jun 2013 17:59:53 +0300 Subject: usb: chipidea: udc: manage dynamic amount of tds with a linked list Instead of having a limited number of usable tds in the udc we use a linked list to support dynamic amount of needed tds for all special gadget types. This improves throughput. Signed-off-by: Michael Grzeschik Reviewed-by: Felipe Balbi Signed-off-by: Alexander Shishkin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/chipidea/udc.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/usb/chipidea/udc.h') diff --git a/drivers/usb/chipidea/udc.h b/drivers/usb/chipidea/udc.h index a75724a19e1a..0ecc0ad4f513 100644 --- a/drivers/usb/chipidea/udc.h +++ b/drivers/usb/chipidea/udc.h @@ -60,6 +60,12 @@ struct ci13xxx_qh { struct usb_ctrlrequest setup; } __attribute__ ((packed, aligned(4))); +struct td_node { + struct list_head td; + dma_addr_t dma; + struct ci13xxx_td *ptr; +}; + /** * struct ci13xxx_req - usb request representation * @req: request structure for gadget drivers @@ -72,10 +78,7 @@ struct ci13xxx_qh { struct ci13xxx_req { struct usb_request req; struct list_head queue; - struct ci13xxx_td *ptr; - dma_addr_t dma; - struct ci13xxx_td *zptr; - dma_addr_t zdma; + struct list_head tds; }; #ifdef CONFIG_USB_CHIPIDEA_UDC -- cgit v1.2.3 From 8e22978c57087aac4d88693278db1cc3e94f1253 Mon Sep 17 00:00:00 2001 From: Alexander Shishkin Date: Mon, 24 Jun 2013 14:46:36 +0300 Subject: usb: chipidea: drop "13xxx" infix "ci13xxx" is bad for at least the following reasons: * people often mistype it * it doesn't add any informational value to the names it's used in * it needlessly attracts mail filters This patch replaces it with "ci_hdrc", "ci_udc" or "ci_hw", depending on the situation. Modules with ci13xxx prefix are also renamed accordingly and aliases are added for compatibility. Otherwise, no functional changes. Signed-off-by: Alexander Shishkin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/chipidea/udc.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/usb/chipidea/udc.h') diff --git a/drivers/usb/chipidea/udc.h b/drivers/usb/chipidea/udc.h index 0ecc0ad4f513..455ac2169226 100644 --- a/drivers/usb/chipidea/udc.h +++ b/drivers/usb/chipidea/udc.h @@ -20,7 +20,7 @@ #define TX 1 /* similar to USB_DIR_IN but can be used as an index */ /* DMA layout of transfer descriptors */ -struct ci13xxx_td { +struct ci_hw_td { /* 0 */ u32 next; #define TD_TERMINATE BIT(0) @@ -43,7 +43,7 @@ struct ci13xxx_td { } __attribute__ ((packed, aligned(4))); /* DMA layout of queue heads */ -struct ci13xxx_qh { +struct ci_hw_qh { /* 0 */ u32 cap; #define QH_IOS BIT(15) @@ -54,7 +54,7 @@ struct ci13xxx_qh { /* 1 */ u32 curr; /* 2 - 8 */ - struct ci13xxx_td td; + struct ci_hw_td td; /* 9 */ u32 RESERVED; struct usb_ctrlrequest setup; @@ -63,11 +63,11 @@ struct ci13xxx_qh { struct td_node { struct list_head td; dma_addr_t dma; - struct ci13xxx_td *ptr; + struct ci_hw_td *ptr; }; /** - * struct ci13xxx_req - usb request representation + * struct ci_hw_req - usb request representation * @req: request structure for gadget drivers * @queue: link to QH list * @ptr: transfer descriptor for this request @@ -75,7 +75,7 @@ struct td_node { * @zptr: transfer descriptor for the zero packet * @zdma: dma address of the zero packet's transfer descriptor */ -struct ci13xxx_req { +struct ci_hw_req { struct usb_request req; struct list_head queue; struct list_head tds; @@ -83,11 +83,11 @@ struct ci13xxx_req { #ifdef CONFIG_USB_CHIPIDEA_UDC -int ci_hdrc_gadget_init(struct ci13xxx *ci); +int ci_hdrc_gadget_init(struct ci_hdrc *ci); #else -static inline int ci_hdrc_gadget_init(struct ci13xxx *ci) +static inline int ci_hdrc_gadget_init(struct ci_hdrc *ci) { return -ENXIO; } -- cgit v1.2.3