summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/udc/amd5536udc.h
diff options
context:
space:
mode:
authorRaviteja Garimella <raviteja.garimella@broadcom.com>2017-03-28 13:02:03 +0200
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-04-11 09:58:25 +0200
commit97b3ffa233b94741ae77d6ece2476331935bf15b (patch)
tree144632eb3dd8bae9cd6dd202e51137e5c1a17dd6 /drivers/usb/gadget/udc/amd5536udc.h
parentusb: gadget: udc: renesas_usb3: add support for usb role swap (diff)
downloadlinux-97b3ffa233b94741ae77d6ece2476331935bf15b.tar.xz
linux-97b3ffa233b94741ae77d6ece2476331935bf15b.zip
usb: gadget: udc: amd5536: split core and PCI layer
This patch splits the amd5536udc driver into two -- one that does pci device registration and the other file that does the rest of the driver tasks like the gadget/ep ops etc for Synopsys UDC. This way of splitting helps in exporting core driver symbols which can be used by any other platform/pci driver that is written for the same Synopsys USB device controller. The current patch also includes a change in the Kconfig and Makefile. A new config option USB_SNP_CORE will be selected automatically when any one of the platform or pci driver for the same UDC is selected. Main changes: - amd5536udc_pci.c: PCI device registration is moved to this file. - amd5536udc.c: This file does rest of the core UDC fucntionality. 9 symbols are exported so as to be used by amd5536udc_pci.c. Module parameter definitions are moved to header file. - amd5536udc.h: Function declarations, module parameters definitions and few common header file includes are added to this file - Kconfig: New USB_SNP_CORE option is added which will be auto selected when any pci or platform driver config option for the UDC is chosen. - Makefile: Compiles the core and pci files separately. Signed-off-by: Raviteja Garimella <raviteja.garimella@broadcom.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/udc/amd5536udc.h')
-rw-r--r--drivers/usb/gadget/udc/amd5536udc.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/amd5536udc.h b/drivers/usb/gadget/udc/amd5536udc.h
index 4638d707f169..bd2a18e20d87 100644
--- a/drivers/usb/gadget/udc/amd5536udc.h
+++ b/drivers/usb/gadget/udc/amd5536udc.h
@@ -13,6 +13,12 @@
#ifndef AMD5536UDC_H
#define AMD5536UDC_H
+/* debug control */
+/* #define UDC_VERBOSE */
+
+#include <linux/usb/ch9.h>
+#include <linux/usb/gadget.h>
+
/* various constants */
#define UDC_RDE_TIMER_SECONDS 1
#define UDC_RDE_TIMER_DIV 10
@@ -567,6 +573,36 @@ union udc_setup_data {
struct usb_ctrlrequest request;
};
+/* Function declarations */
+int udc_enable_dev_setup_interrupts(struct udc *dev);
+int udc_mask_unused_interrupts(struct udc *dev);
+irqreturn_t udc_irq(int irq, void *pdev);
+void gadget_release(struct device *pdev);
+void udc_basic_init(struct udc *dev);
+void free_dma_pools(struct udc *dev);
+int init_dma_pools(struct udc *dev);
+void udc_remove(struct udc *dev);
+int udc_probe(struct udc *dev);
+
+/* DMA usage flag */
+static bool use_dma = 1;
+/* packet per buffer dma */
+static bool use_dma_ppb = 1;
+/* with per descr. update */
+static bool use_dma_ppb_du;
+/* full speed only mode */
+static bool use_fullspeed;
+
+/* module parameters */
+module_param(use_dma, bool, S_IRUGO);
+MODULE_PARM_DESC(use_dma, "true for DMA");
+module_param(use_dma_ppb, bool, S_IRUGO);
+MODULE_PARM_DESC(use_dma_ppb, "true for DMA in packet per buffer mode");
+module_param(use_dma_ppb_du, bool, S_IRUGO);
+MODULE_PARM_DESC(use_dma_ppb_du,
+ "true for DMA in packet per buffer mode with descriptor update");
+module_param(use_fullspeed, bool, S_IRUGO);
+MODULE_PARM_DESC(use_fullspeed, "true for fullspeed only");
/*
*---------------------------------------------------------------------------
* SET and GET bitfields in u32 values