aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/ci.h
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2012-05-11 10:25:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-11 19:56:15 -0400
commiteb70e5ab8f95a81283623c03d2c99dfc59fcb319 (patch)
treefc20c9d10484171490cf6b69f7f5b6f934803366 /drivers/usb/chipidea/ci.h
parent758fc9860c19eceb56e5886a5225db623c521971 (diff)
usb: chipidea: add host role
This adds EHCI host support to the chipidea driver. We want it to be part of the hdrc driver and not a standalone (sub-)driver module, as the structure of ehci-hcd.c suggests, so for chipidea controller we hack it to not provide platform-related code, but only the ehci hcd. The ehci-platform driver won't work for us here too, because the controller uses the same registers for both device and host mode and also otg-related bits, so it's not really possible to put ehci registers into a separate resource. This is not a pretty solution, but the alternative is exporting symbols from the chipidea driver to a ehci-chipidea driver and doing all the module refcounting. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/ci.h')
-rw-r--r--drivers/usb/chipidea/ci.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
index 0ab83411d80..c605acc5568 100644
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@ -15,6 +15,7 @@
15 15
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/irqreturn.h> 17#include <linux/irqreturn.h>
18#include <linux/usb.h>
18#include <linux/usb/gadget.h> 19#include <linux/usb/gadget.h>
19 20
20/****************************************************************************** 21/******************************************************************************
@@ -84,6 +85,7 @@ struct ci_role_driver {
84/** 85/**
85 * struct hw_bank - hardware register mapping representation 86 * struct hw_bank - hardware register mapping representation
86 * @lpm: set if the device is LPM capable 87 * @lpm: set if the device is LPM capable
88 * @phys: physical address of the controller's registers
87 * @abs: absolute address of the beginning of register window 89 * @abs: absolute address of the beginning of register window
88 * @cap: capability registers 90 * @cap: capability registers
89 * @op: operational registers 91 * @op: operational registers
@@ -92,6 +94,7 @@ struct ci_role_driver {
92 */ 94 */
93struct hw_bank { 95struct hw_bank {
94 unsigned lpm; 96 unsigned lpm;
97 resource_size_t phys;
95 void __iomem *abs; 98 void __iomem *abs;
96 void __iomem *cap; 99 void __iomem *cap;
97 void __iomem *op; 100 void __iomem *op;
@@ -128,6 +131,7 @@ struct hw_bank {
128 * @udc_driver: platform specific information supplied by parent device 131 * @udc_driver: platform specific information supplied by parent device
129 * @vbus_active: is VBUS active 132 * @vbus_active: is VBUS active
130 * @transceiver: pointer to USB PHY, if any 133 * @transceiver: pointer to USB PHY, if any
134 * @hcd: pointer to usb_hcd for ehci host driver
131 */ 135 */
132struct ci13xxx { 136struct ci13xxx {
133 struct device *dev; 137 struct device *dev;
@@ -160,6 +164,7 @@ struct ci13xxx {
160 struct ci13xxx_udc_driver *udc_driver; 164 struct ci13xxx_udc_driver *udc_driver;
161 int vbus_active; 165 int vbus_active;
162 struct usb_phy *transceiver; 166 struct usb_phy *transceiver;
167 struct usb_hcd *hcd;
163}; 168};
164 169
165static inline struct ci_role_driver *ci_role(struct ci13xxx *ci) 170static inline struct ci_role_driver *ci_role(struct ci13xxx *ci)
@@ -302,7 +307,7 @@ static inline u32 hw_test_and_write(struct ci13xxx *udc, enum ci13xxx_regs reg,
302 return (val & mask) >> ffs_nr(mask); 307 return (val & mask) >> ffs_nr(mask);
303} 308}
304 309
305int hw_device_reset(struct ci13xxx *ci); 310int hw_device_reset(struct ci13xxx *ci, u32 mode);
306 311
307int hw_port_test_set(struct ci13xxx *ci, u8 mode); 312int hw_port_test_set(struct ci13xxx *ci, u8 mode);
308 313