diff options
-rw-r--r-- | drivers/usb/otg/nop-usb-xceiv.c | 25 | ||||
-rw-r--r-- | include/linux/usb/otg.h | 4 |
2 files changed, 12 insertions, 17 deletions
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index c567168f89af..9ed5ea568679 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c | |||
@@ -22,8 +22,8 @@ | |||
22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
23 | * | 23 | * |
24 | * Current status: | 24 | * Current status: |
25 | * this is to add "nop" transceiver for all those phy which is | 25 | * This provides a "nop" transceiver for PHYs which are |
26 | * autonomous such as isp1504 etc. | 26 | * autonomous such as isp1504, isp1707, etc. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
@@ -36,30 +36,25 @@ struct nop_usb_xceiv { | |||
36 | struct device *dev; | 36 | struct device *dev; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static u64 nop_xceiv_dmamask = DMA_BIT_MASK(32); | 39 | static struct platform_device *pd; |
40 | |||
41 | static struct platform_device nop_xceiv_device = { | ||
42 | .name = "nop_usb_xceiv", | ||
43 | .id = -1, | ||
44 | .dev = { | ||
45 | .dma_mask = &nop_xceiv_dmamask, | ||
46 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
47 | .platform_data = NULL, | ||
48 | }, | ||
49 | }; | ||
50 | 40 | ||
51 | void usb_nop_xceiv_register(void) | 41 | void usb_nop_xceiv_register(void) |
52 | { | 42 | { |
53 | if (platform_device_register(&nop_xceiv_device) < 0) { | 43 | if (pd) |
44 | return; | ||
45 | pd = platform_device_register_simple("nop_usb_xceiv", -1, NULL, 0); | ||
46 | if (!pd) { | ||
54 | printk(KERN_ERR "Unable to register usb nop transceiver\n"); | 47 | printk(KERN_ERR "Unable to register usb nop transceiver\n"); |
55 | return; | 48 | return; |
56 | } | 49 | } |
57 | } | 50 | } |
51 | EXPORT_SYMBOL(usb_nop_xceiv_register); | ||
58 | 52 | ||
59 | void usb_nop_xceiv_unregister(void) | 53 | void usb_nop_xceiv_unregister(void) |
60 | { | 54 | { |
61 | platform_device_unregister(&nop_xceiv_device); | 55 | platform_device_unregister(pd); |
62 | } | 56 | } |
57 | EXPORT_SYMBOL(usb_nop_xceiv_unregister); | ||
63 | 58 | ||
64 | static inline struct nop_usb_xceiv *xceiv_to_nop(struct otg_transceiver *x) | 59 | static inline struct nop_usb_xceiv *xceiv_to_nop(struct otg_transceiver *x) |
65 | { | 60 | { |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 1aaa826396a1..2443c0e7a80c 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -80,10 +80,10 @@ struct otg_transceiver { | |||
80 | 80 | ||
81 | /* for board-specific init logic */ | 81 | /* for board-specific init logic */ |
82 | extern int otg_set_transceiver(struct otg_transceiver *); | 82 | extern int otg_set_transceiver(struct otg_transceiver *); |
83 | #ifdef CONFIG_NOP_USB_XCEIV | 83 | |
84 | /* sometimes transceivers are accessed only through e.g. ULPI */ | ||
84 | extern void usb_nop_xceiv_register(void); | 85 | extern void usb_nop_xceiv_register(void); |
85 | extern void usb_nop_xceiv_unregister(void); | 86 | extern void usb_nop_xceiv_unregister(void); |
86 | #endif | ||
87 | 87 | ||
88 | 88 | ||
89 | /* for usb host and peripheral controller drivers */ | 89 | /* for usb host and peripheral controller drivers */ |