aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2013-07-26 06:16:42 -0400
committerFelipe Balbi <balbi@ti.com>2013-08-09 10:26:00 -0400
commit3fa4d7344be0afebd80382ffeea6b1787cccf971 (patch)
tree82f2a35cfb964fe6c6f3fabac51693f5c09d6e1e /drivers/usb/phy
parent5ae90d8e467e625e447000cb4335c4db973b1095 (diff)
usb: phy: rename nop_usb_xceiv => usb_phy_gen_xceiv
The "nop" driver isn't a do-nothing-stub but supports a couple functions like clock on/off or is able to use a voltage regulator. This patch simply renames the driver to "generic" since it is easy possible to extend it by a simple function istead of writing a complete driver. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r--drivers/usb/phy/Makefile2
-rw-r--r--drivers/usb/phy/phy-generic.c (renamed from drivers/usb/phy/phy-nop.c)44
2 files changed, 23 insertions, 23 deletions
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index 070eca3af18b..24c5816409fd 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -14,7 +14,7 @@ phy-fsl-usb2-objs := phy-fsl-usb.o phy-fsm-usb.o
14obj-$(CONFIG_FSL_USB2_OTG) += phy-fsl-usb2.o 14obj-$(CONFIG_FSL_USB2_OTG) += phy-fsl-usb2.o
15obj-$(CONFIG_ISP1301_OMAP) += phy-isp1301-omap.o 15obj-$(CONFIG_ISP1301_OMAP) += phy-isp1301-omap.o
16obj-$(CONFIG_MV_U3D_PHY) += phy-mv-u3d-usb.o 16obj-$(CONFIG_MV_U3D_PHY) += phy-mv-u3d-usb.o
17obj-$(CONFIG_NOP_USB_XCEIV) += phy-nop.o 17obj-$(CONFIG_NOP_USB_XCEIV) += phy-generic.o
18obj-$(CONFIG_OMAP_CONTROL_USB) += phy-omap-control.o 18obj-$(CONFIG_OMAP_CONTROL_USB) += phy-omap-control.o
19obj-$(CONFIG_OMAP_USB2) += phy-omap-usb2.o 19obj-$(CONFIG_OMAP_USB2) += phy-omap-usb2.o
20obj-$(CONFIG_OMAP_USB3) += phy-omap-usb3.o 20obj-$(CONFIG_OMAP_USB3) += phy-omap-usb3.o
diff --git a/drivers/usb/phy/phy-nop.c b/drivers/usb/phy/phy-generic.c
index 55445e5d72e5..f379b7ded037 100644
--- a/drivers/usb/phy/phy-nop.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -30,13 +30,13 @@
30#include <linux/platform_device.h> 30#include <linux/platform_device.h>
31#include <linux/dma-mapping.h> 31#include <linux/dma-mapping.h>
32#include <linux/usb/otg.h> 32#include <linux/usb/otg.h>
33#include <linux/usb/nop-usb-xceiv.h> 33#include <linux/usb/usb_phy_gen_xceiv.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/clk.h> 35#include <linux/clk.h>
36#include <linux/regulator/consumer.h> 36#include <linux/regulator/consumer.h>
37#include <linux/of.h> 37#include <linux/of.h>
38 38
39struct nop_usb_xceiv { 39struct usb_phy_gen_xceiv {
40 struct usb_phy phy; 40 struct usb_phy phy;
41 struct device *dev; 41 struct device *dev;
42 struct clk *clk; 42 struct clk *clk;
@@ -50,9 +50,9 @@ void usb_nop_xceiv_register(void)
50{ 50{
51 if (pd) 51 if (pd)
52 return; 52 return;
53 pd = platform_device_register_simple("nop_usb_xceiv", -1, NULL, 0); 53 pd = platform_device_register_simple("usb_phy_gen_xceiv", -1, NULL, 0);
54 if (!pd) { 54 if (!pd) {
55 printk(KERN_ERR "Unable to register usb nop transceiver\n"); 55 pr_err("Unable to register generic usb transceiver\n");
56 return; 56 return;
57 } 57 }
58} 58}
@@ -72,7 +72,7 @@ static int nop_set_suspend(struct usb_phy *x, int suspend)
72 72
73static int nop_init(struct usb_phy *phy) 73static int nop_init(struct usb_phy *phy)
74{ 74{
75 struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev); 75 struct usb_phy_gen_xceiv *nop = dev_get_drvdata(phy->dev);
76 76
77 if (!IS_ERR(nop->vcc)) { 77 if (!IS_ERR(nop->vcc)) {
78 if (regulator_enable(nop->vcc)) 78 if (regulator_enable(nop->vcc))
@@ -93,7 +93,7 @@ static int nop_init(struct usb_phy *phy)
93 93
94static void nop_shutdown(struct usb_phy *phy) 94static void nop_shutdown(struct usb_phy *phy)
95{ 95{
96 struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev); 96 struct usb_phy_gen_xceiv *nop = dev_get_drvdata(phy->dev);
97 97
98 if (!IS_ERR(nop->reset)) { 98 if (!IS_ERR(nop->reset)) {
99 /* Assert RESET */ 99 /* Assert RESET */
@@ -139,11 +139,11 @@ static int nop_set_host(struct usb_otg *otg, struct usb_bus *host)
139 return 0; 139 return 0;
140} 140}
141 141
142static int nop_usb_xceiv_probe(struct platform_device *pdev) 142static int usb_phy_gen_xceiv_probe(struct platform_device *pdev)
143{ 143{
144 struct device *dev = &pdev->dev; 144 struct device *dev = &pdev->dev;
145 struct nop_usb_xceiv_platform_data *pdata = pdev->dev.platform_data; 145 struct usb_phy_gen_xceiv_platform_data *pdata = pdev->dev.platform_data;
146 struct nop_usb_xceiv *nop; 146 struct usb_phy_gen_xceiv *nop;
147 enum usb_phy_type type = USB_PHY_TYPE_USB2; 147 enum usb_phy_type type = USB_PHY_TYPE_USB2;
148 int err; 148 int err;
149 u32 clk_rate = 0; 149 u32 clk_rate = 0;
@@ -245,9 +245,9 @@ err_add:
245 return err; 245 return err;
246} 246}
247 247
248static int nop_usb_xceiv_remove(struct platform_device *pdev) 248static int usb_phy_gen_xceiv_remove(struct platform_device *pdev)
249{ 249{
250 struct nop_usb_xceiv *nop = platform_get_drvdata(pdev); 250 struct usb_phy_gen_xceiv *nop = platform_get_drvdata(pdev);
251 251
252 if (!IS_ERR(nop->clk)) 252 if (!IS_ERR(nop->clk))
253 clk_unprepare(nop->clk); 253 clk_unprepare(nop->clk);
@@ -264,29 +264,29 @@ static const struct of_device_id nop_xceiv_dt_ids[] = {
264 264
265MODULE_DEVICE_TABLE(of, nop_xceiv_dt_ids); 265MODULE_DEVICE_TABLE(of, nop_xceiv_dt_ids);
266 266
267static struct platform_driver nop_usb_xceiv_driver = { 267static struct platform_driver usb_phy_gen_xceiv_driver = {
268 .probe = nop_usb_xceiv_probe, 268 .probe = usb_phy_gen_xceiv_probe,
269 .remove = nop_usb_xceiv_remove, 269 .remove = usb_phy_gen_xceiv_remove,
270 .driver = { 270 .driver = {
271 .name = "nop_usb_xceiv", 271 .name = "usb_phy_gen_xceiv",
272 .owner = THIS_MODULE, 272 .owner = THIS_MODULE,
273 .of_match_table = nop_xceiv_dt_ids, 273 .of_match_table = nop_xceiv_dt_ids,
274 }, 274 },
275}; 275};
276 276
277static int __init nop_usb_xceiv_init(void) 277static int __init usb_phy_gen_xceiv_init(void)
278{ 278{
279 return platform_driver_register(&nop_usb_xceiv_driver); 279 return platform_driver_register(&usb_phy_gen_xceiv_driver);
280} 280}
281subsys_initcall(nop_usb_xceiv_init); 281subsys_initcall(usb_phy_gen_xceiv_init);
282 282
283static void __exit nop_usb_xceiv_exit(void) 283static void __exit usb_phy_gen_xceiv_exit(void)
284{ 284{
285 platform_driver_unregister(&nop_usb_xceiv_driver); 285 platform_driver_unregister(&usb_phy_gen_xceiv_driver);
286} 286}
287module_exit(nop_usb_xceiv_exit); 287module_exit(usb_phy_gen_xceiv_exit);
288 288
289MODULE_ALIAS("platform:nop_usb_xceiv"); 289MODULE_ALIAS("platform:usb_phy_gen_xceiv");
290MODULE_AUTHOR("Texas Instruments Inc"); 290MODULE_AUTHOR("Texas Instruments Inc");
291MODULE_DESCRIPTION("NOP USB Transceiver driver"); 291MODULE_DESCRIPTION("NOP USB Transceiver driver");
292MODULE_LICENSE("GPL"); 292MODULE_LICENSE("GPL");