Commit 2818e13a authored by Serge Semin's avatar Serge Semin Committed by Greg Kroah-Hartman

usb: usb251xb: Add USB2517 LED settings

USB2517 supports two LED modes: USB mode and speed (default) indication
mode. The last one can be switched on by corresponding dts property.
Since USB251xb hubs doesn't support LEDs settings, we need to ignore
this setting.
Signed-off-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dd99d106
...@@ -163,6 +163,7 @@ struct usb251xb { ...@@ -163,6 +163,7 @@ struct usb251xb {
struct usb251xb_data { struct usb251xb_data {
u16 product_id; u16 product_id;
u8 port_cnt; u8 port_cnt;
bool led_support;
bool bat_support; bool bat_support;
char product_str[USB251XB_STRING_BUFSIZE / 2]; /* ASCII string */ char product_str[USB251XB_STRING_BUFSIZE / 2]; /* ASCII string */
}; };
...@@ -170,6 +171,7 @@ struct usb251xb_data { ...@@ -170,6 +171,7 @@ struct usb251xb_data {
static const struct usb251xb_data usb2512b_data = { static const struct usb251xb_data usb2512b_data = {
.product_id = 0x2512, .product_id = 0x2512,
.port_cnt = 2, .port_cnt = 2,
.led_support = false,
.bat_support = true, .bat_support = true,
.product_str = "USB2512B", .product_str = "USB2512B",
}; };
...@@ -177,6 +179,7 @@ static const struct usb251xb_data usb2512b_data = { ...@@ -177,6 +179,7 @@ static const struct usb251xb_data usb2512b_data = {
static const struct usb251xb_data usb2512bi_data = { static const struct usb251xb_data usb2512bi_data = {
.product_id = 0x2512, .product_id = 0x2512,
.port_cnt = 2, .port_cnt = 2,
.led_support = false,
.bat_support = true, .bat_support = true,
.product_str = "USB2512Bi", .product_str = "USB2512Bi",
}; };
...@@ -184,6 +187,7 @@ static const struct usb251xb_data usb2512bi_data = { ...@@ -184,6 +187,7 @@ static const struct usb251xb_data usb2512bi_data = {
static const struct usb251xb_data usb2513b_data = { static const struct usb251xb_data usb2513b_data = {
.product_id = 0x2513, .product_id = 0x2513,
.port_cnt = 3, .port_cnt = 3,
.led_support = false,
.bat_support = true, .bat_support = true,
.product_str = "USB2513B", .product_str = "USB2513B",
}; };
...@@ -191,6 +195,7 @@ static const struct usb251xb_data usb2513b_data = { ...@@ -191,6 +195,7 @@ static const struct usb251xb_data usb2513b_data = {
static const struct usb251xb_data usb2513bi_data = { static const struct usb251xb_data usb2513bi_data = {
.product_id = 0x2513, .product_id = 0x2513,
.port_cnt = 3, .port_cnt = 3,
.led_support = false,
.bat_support = true, .bat_support = true,
.product_str = "USB2513Bi", .product_str = "USB2513Bi",
}; };
...@@ -198,6 +203,7 @@ static const struct usb251xb_data usb2513bi_data = { ...@@ -198,6 +203,7 @@ static const struct usb251xb_data usb2513bi_data = {
static const struct usb251xb_data usb2514b_data = { static const struct usb251xb_data usb2514b_data = {
.product_id = 0x2514, .product_id = 0x2514,
.port_cnt = 4, .port_cnt = 4,
.led_support = false,
.bat_support = true, .bat_support = true,
.product_str = "USB2514B", .product_str = "USB2514B",
}; };
...@@ -205,6 +211,7 @@ static const struct usb251xb_data usb2514b_data = { ...@@ -205,6 +211,7 @@ static const struct usb251xb_data usb2514b_data = {
static const struct usb251xb_data usb2514bi_data = { static const struct usb251xb_data usb2514bi_data = {
.product_id = 0x2514, .product_id = 0x2514,
.port_cnt = 4, .port_cnt = 4,
.led_support = false,
.bat_support = true, .bat_support = true,
.product_str = "USB2514Bi", .product_str = "USB2514Bi",
}; };
...@@ -212,6 +219,7 @@ static const struct usb251xb_data usb2514bi_data = { ...@@ -212,6 +219,7 @@ static const struct usb251xb_data usb2514bi_data = {
static const struct usb251xb_data usb2517_data = { static const struct usb251xb_data usb2517_data = {
.product_id = 0x2517, .product_id = 0x2517,
.port_cnt = 7, .port_cnt = 7,
.led_support = true,
.bat_support = false, .bat_support = false,
.product_str = "USB2517", .product_str = "USB2517",
}; };
...@@ -219,6 +227,7 @@ static const struct usb251xb_data usb2517_data = { ...@@ -219,6 +227,7 @@ static const struct usb251xb_data usb2517_data = {
static const struct usb251xb_data usb2517i_data = { static const struct usb251xb_data usb2517i_data = {
.product_id = 0x2517, .product_id = 0x2517,
.port_cnt = 7, .port_cnt = 7,
.led_support = true,
.bat_support = false, .bat_support = false,
.product_str = "USB2517i", .product_str = "USB2517i",
}; };
...@@ -442,6 +451,9 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, ...@@ -442,6 +451,9 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,
if (of_get_property(np, "port-mapping-mode", NULL)) if (of_get_property(np, "port-mapping-mode", NULL))
hub->conf_data3 |= BIT(3); hub->conf_data3 |= BIT(3);
if (data->led_support && of_get_property(np, "led-usb-mode", NULL))
hub->conf_data3 &= ~BIT(1);
if (of_get_property(np, "string-support", NULL)) if (of_get_property(np, "string-support", NULL))
hub->conf_data3 |= BIT(0); hub->conf_data3 |= BIT(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment