summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_io.h
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2014-11-24 11:04:59 -0800
committerFelipe Balbi <balbi@ti.com>2014-11-25 08:47:05 -0600
commit5450ac88dcf09b258d0404b45316583806799ef4 (patch)
treeb070badfee70901d4c8267e1bc04f3d3131e77ab /drivers/usb/musb/musb_io.h
parentb20f3f9e8e537ee25bfb86940903cba4b5abbde6 (diff)
downloadlinux-5450ac88dcf09b258d0404b45316583806799ef4.tar.bz2
usb: musb: Add function pointers for IO access functions
MUSB currently breaks badly if we try to build in support for multiple platforms. This also happens if done as loadable modules, which is not nice for distros. Let's fix the issue by adding new struct musb_io for the IO access functions that the platform code can populate. Note that we don't want to use the current ops as that's really platform_data and and set as a const. This should allow eventually adding function pointers also for the DMA code to struct musb_io, but that's a whole different set of patches. For now, let's just fix the PIO access. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_io.h')
-rw-r--r--drivers/usb/musb/musb_io.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_io.h b/drivers/usb/musb/musb_io.h
index eebeed78edd6..46c01c81a2a6 100644
--- a/drivers/usb/musb/musb_io.h
+++ b/drivers/usb/musb/musb_io.h
@@ -37,6 +37,24 @@
#include <linux/io.h>
+/**
+ * struct musb_io - IO functions for MUSB
+ * @quirks: platform specific flags
+ * @ep_offset: platform specific function to get end point offset
+ * @ep_select: platform specific function to select end point
+ * @fifo_offset: platform specific function to get fifo offset
+ * @read_fifo: platform specific function to read fifo
+ * @write_fifo: platform specific function to write fifo
+ */
+struct musb_io {
+ u32 quirks;
+ u32 (*ep_offset)(u8 epnum, u16 offset);
+ void (*ep_select)(void __iomem *mbase, u8 epnum);
+ u32 (*fifo_offset)(u8 epnum);
+ void (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf);
+ void (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf);
+};
+
#ifndef CONFIG_BLACKFIN
/* NOTE: these offsets are all in bytes */