aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2012-02-13 06:24:04 -0500
committerFelipe Balbi <balbi@ti.com>2012-02-13 06:35:06 -0500
commit7a8a3a9bec7432eedcb32b54a3940d0593246060 (patch)
tree6b1e604271f9f733d5414d1f3e54d53c67a2feaa /drivers
parentde07e18c00c403d5076a5a697d83fe3ced73bc30 (diff)
usb: otg: Separate otg members from usb_phy
Introducing struct otg and collecting otg specific members to it from struct usb_phy. There are no changes to struct usb_phy at this stage. This also renames transceiver specific functions, and offers aliases for the old otg ones. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/otg/otg.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
index 56c0f1781d8c..801e597a1541 100644
--- a/drivers/usb/otg/otg.c
+++ b/drivers/usb/otg/otg.c
@@ -15,56 +15,56 @@
15 15
16#include <linux/usb/otg.h> 16#include <linux/usb/otg.h>
17 17
18static struct usb_phy *xceiv; 18static struct usb_phy *phy;
19 19
20/** 20/**
21 * otg_get_transceiver - find the (single) OTG transceiver 21 * usb_get_transceiver - find the (single) USB transceiver
22 * 22 *
23 * Returns the transceiver driver, after getting a refcount to it; or 23 * Returns the transceiver driver, after getting a refcount to it; or
24 * null if there is no such transceiver. The caller is responsible for 24 * null if there is no such transceiver. The caller is responsible for
25 * calling otg_put_transceiver() to release that count. 25 * calling usb_put_transceiver() to release that count.
26 * 26 *
27 * For use by USB host and peripheral drivers. 27 * For use by USB host and peripheral drivers.
28 */ 28 */
29struct usb_phy *otg_get_transceiver(void) 29struct usb_phy *usb_get_transceiver(void)
30{ 30{
31 if (xceiv) 31 if (phy)
32 get_device(xceiv->dev); 32 get_device(phy->dev);
33 return xceiv; 33 return phy;
34} 34}
35EXPORT_SYMBOL(otg_get_transceiver); 35EXPORT_SYMBOL(usb_get_transceiver);
36 36
37/** 37/**
38 * otg_put_transceiver - release the (single) OTG transceiver 38 * usb_put_transceiver - release the (single) USB transceiver
39 * @x: the transceiver returned by otg_get_transceiver() 39 * @x: the transceiver returned by usb_get_transceiver()
40 * 40 *
41 * Releases a refcount the caller received from otg_get_transceiver(). 41 * Releases a refcount the caller received from usb_get_transceiver().
42 * 42 *
43 * For use by USB host and peripheral drivers. 43 * For use by USB host and peripheral drivers.
44 */ 44 */
45void otg_put_transceiver(struct usb_phy *x) 45void usb_put_transceiver(struct usb_phy *x)
46{ 46{
47 if (x) 47 if (x)
48 put_device(x->dev); 48 put_device(x->dev);
49} 49}
50EXPORT_SYMBOL(otg_put_transceiver); 50EXPORT_SYMBOL(usb_put_transceiver);
51 51
52/** 52/**
53 * otg_set_transceiver - declare the (single) OTG transceiver 53 * usb_set_transceiver - declare the (single) USB transceiver
54 * @x: the USB OTG transceiver to be used; or NULL 54 * @x: the USB transceiver to be used; or NULL
55 * 55 *
56 * This call is exclusively for use by transceiver drivers, which 56 * This call is exclusively for use by transceiver drivers, which
57 * coordinate the activities of drivers for host and peripheral 57 * coordinate the activities of drivers for host and peripheral
58 * controllers, and in some cases for VBUS current regulation. 58 * controllers, and in some cases for VBUS current regulation.
59 */ 59 */
60int otg_set_transceiver(struct usb_phy *x) 60int usb_set_transceiver(struct usb_phy *x)
61{ 61{
62 if (xceiv && x) 62 if (phy && x)
63 return -EBUSY; 63 return -EBUSY;
64 xceiv = x; 64 phy = x;
65 return 0; 65 return 0;
66} 66}
67EXPORT_SYMBOL(otg_set_transceiver); 67EXPORT_SYMBOL(usb_set_transceiver);
68 68
69const char *otg_state_string(enum usb_otg_state state) 69const char *otg_state_string(enum usb_otg_state state)
70{ 70{