diff options
author | Felipe Balbi <balbi@ti.com> | 2013-03-07 10:37:59 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-03-18 05:18:08 -0400 |
commit | 94ae98433a397dd4695652fc62ca7bc784b08216 (patch) | |
tree | 4ab764590b2ae6a8535d8b773ac80d18535e58d3 /drivers/usb/phy/phy-isp1301.c | |
parent | fd891498751f53dda3733d9e9ff8a1f6ea16c5e5 (diff) |
usb: phy: rename all phy drivers to phy-$name-usb.c
this will make sure that we have sensible names
for all phy drivers. Current situation was already
quite bad with too generic names being used.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/phy-isp1301.c')
-rw-r--r-- | drivers/usb/phy/phy-isp1301.c | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-isp1301.c b/drivers/usb/phy/phy-isp1301.c new file mode 100644 index 000000000000..18dbf7e37607 --- /dev/null +++ b/drivers/usb/phy/phy-isp1301.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * NXP ISP1301 USB transceiver driver | ||
3 | * | ||
4 | * Copyright (C) 2012 Roland Stigge | ||
5 | * | ||
6 | * Author: Roland Stigge <stigge@antcom.de> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/module.h> | ||
14 | #include <linux/i2c.h> | ||
15 | |||
16 | #define DRV_NAME "isp1301" | ||
17 | |||
18 | static const struct i2c_device_id isp1301_id[] = { | ||
19 | { "isp1301", 0 }, | ||
20 | { } | ||
21 | }; | ||
22 | |||
23 | static struct i2c_client *isp1301_i2c_client; | ||
24 | |||
25 | static int isp1301_probe(struct i2c_client *client, | ||
26 | const struct i2c_device_id *i2c_id) | ||
27 | { | ||
28 | isp1301_i2c_client = client; | ||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | static int isp1301_remove(struct i2c_client *client) | ||
33 | { | ||
34 | return 0; | ||
35 | } | ||
36 | |||
37 | static struct i2c_driver isp1301_driver = { | ||
38 | .driver = { | ||
39 | .name = DRV_NAME, | ||
40 | }, | ||
41 | .probe = isp1301_probe, | ||
42 | .remove = isp1301_remove, | ||
43 | .id_table = isp1301_id, | ||
44 | }; | ||
45 | |||
46 | module_i2c_driver(isp1301_driver); | ||
47 | |||
48 | static int match(struct device *dev, void *data) | ||
49 | { | ||
50 | struct device_node *node = (struct device_node *)data; | ||
51 | return (dev->of_node == node) && | ||
52 | (dev->driver == &isp1301_driver.driver); | ||
53 | } | ||
54 | |||
55 | struct i2c_client *isp1301_get_client(struct device_node *node) | ||
56 | { | ||
57 | if (node) { /* reference of ISP1301 I2C node via DT */ | ||
58 | struct device *dev = bus_find_device(&i2c_bus_type, NULL, | ||
59 | node, match); | ||
60 | if (!dev) | ||
61 | return NULL; | ||
62 | return to_i2c_client(dev); | ||
63 | } else { /* non-DT: only one ISP1301 chip supported */ | ||
64 | return isp1301_i2c_client; | ||
65 | } | ||
66 | } | ||
67 | EXPORT_SYMBOL_GPL(isp1301_get_client); | ||
68 | |||
69 | MODULE_AUTHOR("Roland Stigge <stigge@antcom.de>"); | ||
70 | MODULE_DESCRIPTION("NXP ISP1301 USB transceiver driver"); | ||
71 | MODULE_LICENSE("GPL"); | ||