aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2012-02-13 06:24:02 -0500
committerFelipe Balbi <balbi@ti.com>2012-02-13 06:34:36 -0500
commit8675381109b0eb1c948a423c2b35e3f4509cb25e (patch)
tree1b71e8d77114a75f5871569fd0784fe0b4c861e3 /include/linux/usb
parent62aa2b537c6f5957afd98e29f96897419ed5ebab (diff)
usb: otg: Rename otg_transceiver to usb_phy
This is the first step in separating USB transceivers from USB OTG utilities. Includes fixes to IMX code from Sascha Hauer. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Acked-by: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/intel_mid_otg.h6
-rw-r--r--include/linux/usb/msm_hsusb.h2
-rw-r--r--include/linux/usb/otg.h98
-rw-r--r--include/linux/usb/ulpi.h2
4 files changed, 54 insertions, 54 deletions
diff --git a/include/linux/usb/intel_mid_otg.h b/include/linux/usb/intel_mid_otg.h
index a0ccf795f362..756cf5543ffd 100644
--- a/include/linux/usb/intel_mid_otg.h
+++ b/include/linux/usb/intel_mid_otg.h
@@ -104,11 +104,11 @@ struct iotg_ulpi_access_ops {
104/* 104/*
105 * the Intel MID (Langwell/Penwell) otg transceiver driver needs to interact 105 * the Intel MID (Langwell/Penwell) otg transceiver driver needs to interact
106 * with device and host drivers to implement the USB OTG related feature. More 106 * with device and host drivers to implement the USB OTG related feature. More
107 * function members are added based on otg_transceiver data structure for this 107 * function members are added based on usb_phy data structure for this
108 * purpose. 108 * purpose.
109 */ 109 */
110struct intel_mid_otg_xceiv { 110struct intel_mid_otg_xceiv {
111 struct otg_transceiver otg; 111 struct usb_phy otg;
112 struct otg_hsm hsm; 112 struct otg_hsm hsm;
113 113
114 /* base address */ 114 /* base address */
@@ -147,7 +147,7 @@ struct intel_mid_otg_xceiv {
147 147
148}; 148};
149static inline 149static inline
150struct intel_mid_otg_xceiv *otg_to_mid_xceiv(struct otg_transceiver *otg) 150struct intel_mid_otg_xceiv *otg_to_mid_xceiv(struct usb_phy *otg)
151{ 151{
152 return container_of(otg, struct intel_mid_otg_xceiv, otg); 152 return container_of(otg, struct intel_mid_otg_xceiv, otg);
153} 153}
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h
index 00311fe9d0df..2d3547ae9562 100644
--- a/include/linux/usb/msm_hsusb.h
+++ b/include/linux/usb/msm_hsusb.h
@@ -160,7 +160,7 @@ struct msm_otg_platform_data {
160 * detection process. 160 * detection process.
161 */ 161 */
162struct msm_otg { 162struct msm_otg {
163 struct otg_transceiver otg; 163 struct usb_phy otg;
164 struct msm_otg_platform_data *pdata; 164 struct msm_otg_platform_data *pdata;
165 int irq; 165 int irq;
166 struct clk *clk; 166 struct clk *clk;
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index d87f44f5b04e..e0bc55702a89 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -43,14 +43,14 @@ enum usb_xceiv_events {
43 USB_EVENT_ENUMERATED, /* gadget driver enumerated */ 43 USB_EVENT_ENUMERATED, /* gadget driver enumerated */
44}; 44};
45 45
46struct otg_transceiver; 46struct usb_phy;
47 47
48/* for transceivers connected thru an ULPI interface, the user must 48/* for transceivers connected thru an ULPI interface, the user must
49 * provide access ops 49 * provide access ops
50 */ 50 */
51struct otg_io_access_ops { 51struct otg_io_access_ops {
52 int (*read)(struct otg_transceiver *otg, u32 reg); 52 int (*read)(struct usb_phy *x, u32 reg);
53 int (*write)(struct otg_transceiver *otg, u32 val, u32 reg); 53 int (*write)(struct usb_phy *x, u32 val, u32 reg);
54}; 54};
55 55
56/* 56/*
@@ -59,7 +59,7 @@ struct otg_io_access_ops {
59 * moment, using the transceiver, ID signal, HNP and sometimes static 59 * moment, using the transceiver, ID signal, HNP and sometimes static
60 * configuration information (including "board isn't wired for otg"). 60 * configuration information (including "board isn't wired for otg").
61 */ 61 */
62struct otg_transceiver { 62struct usb_phy {
63 struct device *dev; 63 struct device *dev;
64 const char *label; 64 const char *label;
65 unsigned int flags; 65 unsigned int flags;
@@ -82,40 +82,40 @@ struct otg_transceiver {
82 u16 port_change; 82 u16 port_change;
83 83
84 /* initialize/shutdown the OTG controller */ 84 /* initialize/shutdown the OTG controller */
85 int (*init)(struct otg_transceiver *otg); 85 int (*init)(struct usb_phy *x);
86 void (*shutdown)(struct otg_transceiver *otg); 86 void (*shutdown)(struct usb_phy *x);
87 87
88 /* bind/unbind the host controller */ 88 /* bind/unbind the host controller */
89 int (*set_host)(struct otg_transceiver *otg, 89 int (*set_host)(struct usb_phy *x,
90 struct usb_bus *host); 90 struct usb_bus *host);
91 91
92 /* bind/unbind the peripheral controller */ 92 /* bind/unbind the peripheral controller */
93 int (*set_peripheral)(struct otg_transceiver *otg, 93 int (*set_peripheral)(struct usb_phy *x,
94 struct usb_gadget *gadget); 94 struct usb_gadget *gadget);
95 95
96 /* effective for B devices, ignored for A-peripheral */ 96 /* effective for B devices, ignored for A-peripheral */
97 int (*set_power)(struct otg_transceiver *otg, 97 int (*set_power)(struct usb_phy *x,
98 unsigned mA); 98 unsigned mA);
99 99
100 /* effective for A-peripheral, ignored for B devices */ 100 /* effective for A-peripheral, ignored for B devices */
101 int (*set_vbus)(struct otg_transceiver *otg, 101 int (*set_vbus)(struct usb_phy *x,
102 bool enabled); 102 bool enabled);
103 103
104 /* for non-OTG B devices: set transceiver into suspend mode */ 104 /* for non-OTG B devices: set transceiver into suspend mode */
105 int (*set_suspend)(struct otg_transceiver *otg, 105 int (*set_suspend)(struct usb_phy *x,
106 int suspend); 106 int suspend);
107 107
108 /* for B devices only: start session with A-Host */ 108 /* for B devices only: start session with A-Host */
109 int (*start_srp)(struct otg_transceiver *otg); 109 int (*start_srp)(struct usb_phy *x);
110 110
111 /* start or continue HNP role switch */ 111 /* start or continue HNP role switch */
112 int (*start_hnp)(struct otg_transceiver *otg); 112 int (*start_hnp)(struct usb_phy *x);
113 113
114}; 114};
115 115
116 116
117/* for board-specific init logic */ 117/* for board-specific init logic */
118extern int otg_set_transceiver(struct otg_transceiver *); 118extern int otg_set_transceiver(struct usb_phy *);
119 119
120#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) 120#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
121/* sometimes transceivers are accessed only through e.g. ULPI */ 121/* sometimes transceivers are accessed only through e.g. ULPI */
@@ -132,50 +132,50 @@ static inline void usb_nop_xceiv_unregister(void)
132#endif 132#endif
133 133
134/* helpers for direct access thru low-level io interface */ 134/* helpers for direct access thru low-level io interface */
135static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) 135static inline int otg_io_read(struct usb_phy *x, u32 reg)
136{ 136{
137 if (otg->io_ops && otg->io_ops->read) 137 if (x->io_ops && x->io_ops->read)
138 return otg->io_ops->read(otg, reg); 138 return x->io_ops->read(x, reg);
139 139
140 return -EINVAL; 140 return -EINVAL;
141} 141}
142 142
143static inline int otg_io_write(struct otg_transceiver *otg, u32 val, u32 reg) 143static inline int otg_io_write(struct usb_phy *x, u32 val, u32 reg)
144{ 144{
145 if (otg->io_ops && otg->io_ops->write) 145 if (x->io_ops && x->io_ops->write)
146 return otg->io_ops->write(otg, val, reg); 146 return x->io_ops->write(x, val, reg);
147 147
148 return -EINVAL; 148 return -EINVAL;
149} 149}
150 150
151static inline int 151static inline int
152otg_init(struct otg_transceiver *otg) 152otg_init(struct usb_phy *x)
153{ 153{
154 if (otg->init) 154 if (x->init)
155 return otg->init(otg); 155 return x->init(x);
156 156
157 return 0; 157 return 0;
158} 158}
159 159
160static inline void 160static inline void
161otg_shutdown(struct otg_transceiver *otg) 161otg_shutdown(struct usb_phy *x)
162{ 162{
163 if (otg->shutdown) 163 if (x->shutdown)
164 otg->shutdown(otg); 164 x->shutdown(x);
165} 165}
166 166
167/* for usb host and peripheral controller drivers */ 167/* for usb host and peripheral controller drivers */
168#ifdef CONFIG_USB_OTG_UTILS 168#ifdef CONFIG_USB_OTG_UTILS
169extern struct otg_transceiver *otg_get_transceiver(void); 169extern struct usb_phy *otg_get_transceiver(void);
170extern void otg_put_transceiver(struct otg_transceiver *); 170extern void otg_put_transceiver(struct usb_phy *);
171extern const char *otg_state_string(enum usb_otg_state state); 171extern const char *otg_state_string(enum usb_otg_state state);
172#else 172#else
173static inline struct otg_transceiver *otg_get_transceiver(void) 173static inline struct usb_phy *otg_get_transceiver(void)
174{ 174{
175 return NULL; 175 return NULL;
176} 176}
177 177
178static inline void otg_put_transceiver(struct otg_transceiver *x) 178static inline void otg_put_transceiver(struct usb_phy *x)
179{ 179{
180} 180}
181 181
@@ -187,67 +187,67 @@ static inline const char *otg_state_string(enum usb_otg_state state)
187 187
188/* Context: can sleep */ 188/* Context: can sleep */
189static inline int 189static inline int
190otg_start_hnp(struct otg_transceiver *otg) 190otg_start_hnp(struct usb_phy *x)
191{ 191{
192 return otg->start_hnp(otg); 192 return x->start_hnp(x);
193} 193}
194 194
195/* Context: can sleep */ 195/* Context: can sleep */
196static inline int 196static inline int
197otg_set_vbus(struct otg_transceiver *otg, bool enabled) 197otg_set_vbus(struct usb_phy *x, bool enabled)
198{ 198{
199 return otg->set_vbus(otg, enabled); 199 return x->set_vbus(x, enabled);
200} 200}
201 201
202/* for HCDs */ 202/* for HCDs */
203static inline int 203static inline int
204otg_set_host(struct otg_transceiver *otg, struct usb_bus *host) 204otg_set_host(struct usb_phy *x, struct usb_bus *host)
205{ 205{
206 return otg->set_host(otg, host); 206 return x->set_host(x, host);
207} 207}
208 208
209/* for usb peripheral controller drivers */ 209/* for usb peripheral controller drivers */
210 210
211/* Context: can sleep */ 211/* Context: can sleep */
212static inline int 212static inline int
213otg_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *periph) 213otg_set_peripheral(struct usb_phy *x, struct usb_gadget *periph)
214{ 214{
215 return otg->set_peripheral(otg, periph); 215 return x->set_peripheral(x, periph);
216} 216}
217 217
218static inline int 218static inline int
219otg_set_power(struct otg_transceiver *otg, unsigned mA) 219otg_set_power(struct usb_phy *x, unsigned mA)
220{ 220{
221 return otg->set_power(otg, mA); 221 return x->set_power(x, mA);
222} 222}
223 223
224/* Context: can sleep */ 224/* Context: can sleep */
225static inline int 225static inline int
226otg_set_suspend(struct otg_transceiver *otg, int suspend) 226otg_set_suspend(struct usb_phy *x, int suspend)
227{ 227{
228 if (otg->set_suspend != NULL) 228 if (x->set_suspend != NULL)
229 return otg->set_suspend(otg, suspend); 229 return x->set_suspend(x, suspend);
230 else 230 else
231 return 0; 231 return 0;
232} 232}
233 233
234static inline int 234static inline int
235otg_start_srp(struct otg_transceiver *otg) 235otg_start_srp(struct usb_phy *x)
236{ 236{
237 return otg->start_srp(otg); 237 return x->start_srp(x);
238} 238}
239 239
240/* notifiers */ 240/* notifiers */
241static inline int 241static inline int
242otg_register_notifier(struct otg_transceiver *otg, struct notifier_block *nb) 242otg_register_notifier(struct usb_phy *x, struct notifier_block *nb)
243{ 243{
244 return atomic_notifier_chain_register(&otg->notifier, nb); 244 return atomic_notifier_chain_register(&x->notifier, nb);
245} 245}
246 246
247static inline void 247static inline void
248otg_unregister_notifier(struct otg_transceiver *otg, struct notifier_block *nb) 248otg_unregister_notifier(struct usb_phy *x, struct notifier_block *nb)
249{ 249{
250 atomic_notifier_chain_unregister(&otg->notifier, nb); 250 atomic_notifier_chain_unregister(&x->notifier, nb);
251} 251}
252 252
253/* for OTG controller drivers (and maybe other stuff) */ 253/* for OTG controller drivers (and maybe other stuff) */
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h
index 9595796d62ed..51ebf72bc449 100644
--- a/include/linux/usb/ulpi.h
+++ b/include/linux/usb/ulpi.h
@@ -181,7 +181,7 @@
181 181
182/*-------------------------------------------------------------------------*/ 182/*-------------------------------------------------------------------------*/
183 183
184struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops, 184struct usb_phy *otg_ulpi_create(struct otg_io_access_ops *ops,
185 unsigned int flags); 185 unsigned int flags);
186 186
187#ifdef CONFIG_USB_ULPI_VIEWPORT 187#ifdef CONFIG_USB_ULPI_VIEWPORT