aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-isp1301.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-03-07 10:37:59 -0500
committerFelipe Balbi <balbi@ti.com>2013-03-18 05:18:08 -0400
commit94ae98433a397dd4695652fc62ca7bc784b08216 (patch)
tree4ab764590b2ae6a8535d8b773ac80d18535e58d3 /drivers/usb/phy/phy-isp1301.c
parentfd891498751f53dda3733d9e9ff8a1f6ea16c5e5 (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.c71
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
18static const struct i2c_device_id isp1301_id[] = {
19 { "isp1301", 0 },
20 { }
21};
22
23static struct i2c_client *isp1301_i2c_client;
24
25static 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
32static int isp1301_remove(struct i2c_client *client)
33{
34 return 0;
35}
36
37static 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
46module_i2c_driver(isp1301_driver);
47
48static 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
55struct 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}
67EXPORT_SYMBOL_GPL(isp1301_get_client);
68
69MODULE_AUTHOR("Roland Stigge <stigge@antcom.de>");
70MODULE_DESCRIPTION("NXP ISP1301 USB transceiver driver");
71MODULE_LICENSE("GPL");