Commit 7fcf5584 authored by Serge Semin's avatar Serge Semin Committed by Greg Kroah-Hartman

usb: usb251xb: Add USB2517i specific struct and IDs

There are USB2517 and USB2517i hubs, which have almost the same
registers space as already supported USB251xBi series. The difference
it in DIDs and in a few functions. This patch adds the USB2517/i data
structures to the driver, so it would have different setting depending
on the device discovered on i2c-bus.
Signed-off-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8a52677
...@@ -238,8 +238,8 @@ config USB_HUB_USB251XB ...@@ -238,8 +238,8 @@ config USB_HUB_USB251XB
depends on I2C depends on I2C
help help
This option enables support for configuration via SMBus of the This option enables support for configuration via SMBus of the
Microchip USB251xB/xBi USB 2.0 Hub Controller series. Microchip USB251x/xBi USB 2.0 Hub Controller series. Configuration
Configuration parameters may be set in devicetree or platform data. parameters may be set in devicetree or platform data.
Say Y or M here if you need to configure such a device via SMBus. Say Y or M here if you need to configure such a device via SMBus.
config USB_HSIC_USB3503 config USB_HSIC_USB3503
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#define USB251XB_DEF_PRODUCT_ID_12 0x2512 /* USB2512B/12Bi */ #define USB251XB_DEF_PRODUCT_ID_12 0x2512 /* USB2512B/12Bi */
#define USB251XB_DEF_PRODUCT_ID_13 0x2513 /* USB2513B/13Bi */ #define USB251XB_DEF_PRODUCT_ID_13 0x2513 /* USB2513B/13Bi */
#define USB251XB_DEF_PRODUCT_ID_14 0x2514 /* USB2514B/14Bi */ #define USB251XB_DEF_PRODUCT_ID_14 0x2514 /* USB2514B/14Bi */
#define USB251XB_DEF_PRODUCT_ID_17 0x2517 /* USB2517/17i */
#define USB251XB_ADDR_DEVICE_ID_LSB 0x04 #define USB251XB_ADDR_DEVICE_ID_LSB 0x04
#define USB251XB_ADDR_DEVICE_ID_MSB 0x05 #define USB251XB_ADDR_DEVICE_ID_MSB 0x05
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
#define USB251XB_ADDR_PRODUCT_STRING_LEN 0x14 #define USB251XB_ADDR_PRODUCT_STRING_LEN 0x14
#define USB251XB_ADDR_PRODUCT_STRING 0x54 #define USB251XB_ADDR_PRODUCT_STRING 0x54
#define USB251XB_DEF_PRODUCT_STRING "USB251xB/xBi" #define USB251XB_DEF_PRODUCT_STRING "USB251xB/xBi/7i"
#define USB251XB_ADDR_SERIAL_STRING_LEN 0x15 #define USB251XB_ADDR_SERIAL_STRING_LEN 0x15
#define USB251XB_ADDR_SERIAL_STRING 0x92 #define USB251XB_ADDR_SERIAL_STRING 0x92
...@@ -185,6 +186,16 @@ static const struct usb251xb_data usb2514bi_data = { ...@@ -185,6 +186,16 @@ static const struct usb251xb_data usb2514bi_data = {
.product_str = "USB2514Bi", .product_str = "USB2514Bi",
}; };
static const struct usb251xb_data usb2517_data = {
.product_id = 0x2517,
.product_str = "USB2517",
};
static const struct usb251xb_data usb2517i_data = {
.product_id = 0x2517,
.product_str = "USB2517i",
};
static void usb251xb_reset(struct usb251xb *hub, int state) static void usb251xb_reset(struct usb251xb *hub, int state)
{ {
if (!gpio_is_valid(hub->gpio_reset)) if (!gpio_is_valid(hub->gpio_reset))
...@@ -509,6 +520,12 @@ static const struct of_device_id usb251xb_of_match[] = { ...@@ -509,6 +520,12 @@ static const struct of_device_id usb251xb_of_match[] = {
}, { }, {
.compatible = "microchip,usb2514bi", .compatible = "microchip,usb2514bi",
.data = &usb2514bi_data, .data = &usb2514bi_data,
}, {
.compatible = "microchip,usb2517",
.data = &usb2517_data,
}, {
.compatible = "microchip,usb2517i",
.data = &usb2517i_data,
}, { }, {
/* sentinel */ /* sentinel */
} }
...@@ -573,6 +590,8 @@ static const struct i2c_device_id usb251xb_id[] = { ...@@ -573,6 +590,8 @@ static const struct i2c_device_id usb251xb_id[] = {
{ "usb2513bi", 0 }, { "usb2513bi", 0 },
{ "usb2514b", 0 }, { "usb2514b", 0 },
{ "usb2514bi", 0 }, { "usb2514bi", 0 },
{ "usb2517", 0 },
{ "usb2517i", 0 },
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(i2c, usb251xb_id); MODULE_DEVICE_TABLE(i2c, usb251xb_id);
...@@ -589,5 +608,5 @@ static struct i2c_driver usb251xb_i2c_driver = { ...@@ -589,5 +608,5 @@ static struct i2c_driver usb251xb_i2c_driver = {
module_i2c_driver(usb251xb_i2c_driver); module_i2c_driver(usb251xb_i2c_driver);
MODULE_AUTHOR("Richard Leitner <richard.leitner@skidata.com>"); MODULE_AUTHOR("Richard Leitner <richard.leitner@skidata.com>");
MODULE_DESCRIPTION("USB251xB/xBi USB 2.0 Hub Controller Driver"); MODULE_DESCRIPTION("USB251x/xBi USB 2.0 Hub Controller Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
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