summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/isp1760-core.h
diff options
context:
space:
mode:
authorLaurent Pinchart2015-01-20 23:55:59 +0100
committerFelipe Balbi2015-01-27 16:39:26 +0100
commit5171446a3aec607c4f94a32758f51a68bc627fe3 (patch)
treeef715105026ba279886ab33ef1a089a4606b11dc /drivers/usb/host/isp1760-core.h
parentusb: isp1760: Set IRQF_SHARED flag in core code (diff)
downloadkernel-qcow2-linux-5171446a3aec607c4f94a32758f51a68bc627fe3.tar.gz
kernel-qcow2-linux-5171446a3aec607c4f94a32758f51a68bc627fe3.tar.xz
kernel-qcow2-linux-5171446a3aec607c4f94a32758f51a68bc627fe3.zip
usb: isp1760: Initialize the bus interface in core code
Although the corresponding register is part of the HCD register space, processor bus initialization is not specific to the HCD. To prepare for device controller support, move bus interface initialization to core code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/host/isp1760-core.h')
-rw-r--r--drivers/usb/host/isp1760-core.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/usb/host/isp1760-core.h b/drivers/usb/host/isp1760-core.h
index 0caeb1135275..cd4a0f3981d9 100644
--- a/drivers/usb/host/isp1760-core.h
+++ b/drivers/usb/host/isp1760-core.h
@@ -20,8 +20,29 @@
#include "isp1760-hcd.h"
+struct device;
+struct gpio_desc;
+
+/*
+ * Device flags that can vary from board to board. All of these
+ * indicate the most "atypical" case, so that a devflags of 0 is
+ * a sane default configuration.
+ */
+#define ISP1760_FLAG_BUS_WIDTH_16 0x00000002 /* 16-bit data bus width */
+#define ISP1760_FLAG_OTG_EN 0x00000004 /* Port 1 supports OTG */
+#define ISP1760_FLAG_ANALOG_OC 0x00000008 /* Analog overcurrent */
+#define ISP1760_FLAG_DACK_POL_HIGH 0x00000010 /* DACK active high */
+#define ISP1760_FLAG_DREQ_POL_HIGH 0x00000020 /* DREQ active high */
+#define ISP1760_FLAG_ISP1761 0x00000040 /* Chip is ISP1761 */
+#define ISP1760_FLAG_INTR_POL_HIGH 0x00000080 /* Interrupt polarity active high */
+#define ISP1760_FLAG_INTR_EDGE_TRIG 0x00000100 /* Interrupt edge triggered */
+
struct isp1760_device {
+ struct device *dev;
+
void __iomem *regs;
+ unsigned int devflags;
+ struct gpio_desc *rst_gpio;
struct isp1760_hcd hcd;
};
@@ -30,4 +51,14 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
struct device *dev, unsigned int devflags);
void isp1760_unregister(struct device *dev);
+static inline u32 isp1760_read32(void __iomem *base, u32 reg)
+{
+ return readl(base + reg);
+}
+
+static inline void isp1760_write32(void __iomem *base, u32 reg, u32 val)
+{
+ writel(val, base + reg);
+}
+
#endif