aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/usb/usb3503.txt5
-rw-r--r--drivers/usb/misc/usb3503.c14
2 files changed, 19 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/usb/usb3503.txt b/Documentation/devicetree/bindings/usb/usb3503.txt
index 6813a715fc7d..8c5be48b43c8 100644
--- a/Documentation/devicetree/bindings/usb/usb3503.txt
+++ b/Documentation/devicetree/bindings/usb/usb3503.txt
@@ -4,6 +4,10 @@ Required properties:
4- compatible: Should be "smsc,usb3503". 4- compatible: Should be "smsc,usb3503".
5- reg: Specifies the i2c slave address, it should be 0x08. 5- reg: Specifies the i2c slave address, it should be 0x08.
6- connect-gpios: Should specify GPIO for connect. 6- connect-gpios: Should specify GPIO for connect.
7- disabled-ports: Should specify the ports unused.
8 '1' or '2' or '3' are availe for this property to describe the port
9 number. 1~3 property values are possible to be desribed.
10 Do not describe this property if all ports have to be enabled.
7- intn-gpios: Should specify GPIO for interrupt. 11- intn-gpios: Should specify GPIO for interrupt.
8- reset-gpios: Should specify GPIO for reset. 12- reset-gpios: Should specify GPIO for reset.
9- initial-mode: Should specify initial mode. 13- initial-mode: Should specify initial mode.
@@ -14,6 +18,7 @@ Examples:
14 compatible = "smsc,usb3503"; 18 compatible = "smsc,usb3503";
15 reg = <0x08>; 19 reg = <0x08>;
16 connect-gpios = <&gpx3 0 1>; 20 connect-gpios = <&gpx3 0 1>;
21 disabled-ports = <2 3>;
17 intn-gpios = <&gpx3 4 1>; 22 intn-gpios = <&gpx3 4 1>;
18 reset-gpios = <&gpx3 5 1>; 23 reset-gpios = <&gpx3 5 1>;
19 initial-mode = <1>; 24 initial-mode = <1>;
diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index ab24bb345979..1908ec65c55b 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -186,6 +186,8 @@ static int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
186 struct usb3503 *hub; 186 struct usb3503 *hub;
187 int err = -ENOMEM; 187 int err = -ENOMEM;
188 u32 mode = USB3503_MODE_UNKNOWN; 188 u32 mode = USB3503_MODE_UNKNOWN;
189 const u32 *property;
190 int len;
189 191
190 hub = kzalloc(sizeof(struct usb3503), GFP_KERNEL); 192 hub = kzalloc(sizeof(struct usb3503), GFP_KERNEL);
191 if (!hub) { 193 if (!hub) {
@@ -203,6 +205,18 @@ static int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
203 hub->gpio_reset = pdata->gpio_reset; 205 hub->gpio_reset = pdata->gpio_reset;
204 hub->mode = pdata->initial_mode; 206 hub->mode = pdata->initial_mode;
205 } else if (np) { 207 } else if (np) {
208 hub->port_off_mask = 0;
209
210 property = of_get_property(np, "disabled-ports", &len);
211 if (property && (len / sizeof(u32)) > 0) {
212 int i;
213 for (i = 0; i < len / sizeof(u32); i++) {
214 u32 port = be32_to_cpu(property[i]);
215 if ((1 <= port) && (port <= 3))
216 hub->port_off_mask |= (1 << port);
217 }
218 }
219
206 hub->gpio_intn = of_get_named_gpio(np, "connect-gpios", 0); 220 hub->gpio_intn = of_get_named_gpio(np, "connect-gpios", 0);
207 if (hub->gpio_intn == -EPROBE_DEFER) 221 if (hub->gpio_intn == -EPROBE_DEFER)
208 return -EPROBE_DEFER; 222 return -EPROBE_DEFER;