diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-16 11:38:01 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-16 11:38:01 -0500 |
commit | 0df8a3dbacb585bb9c8b2e55de43c6aac9d86488 (patch) | |
tree | 265a5ee634305b386ead7421e6669800e5044cc7 /drivers/usb | |
parent | 53b7f7b53d83727075c01f57f813fc141d53c3d5 (diff) | |
parent | beabdc3cd3e3ef9a56b62ee0e0b0663edacd5264 (diff) |
Merge tag 'usb-serial-4.11-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next
Johan writes:
USB-serial updates for v4.11-rc1 part 2
Here's one more device id for the new upd78f0730 driver and three
clean-up patches that are mostly moving some code around.
All have been in linux-next with no reported issues.
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/io_edgeport.c | 217 | ||||
-rw-r--r-- | drivers/usb/serial/io_tables.h | 232 | ||||
-rw-r--r-- | drivers/usb/serial/keyspan.c | 592 | ||||
-rw-r--r-- | drivers/usb/serial/keyspan.h | 629 | ||||
-rw-r--r-- | drivers/usb/serial/upd78f0730.c | 7 |
5 files changed, 808 insertions, 869 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 92abf92e5669..bb7673e80a57 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c | |||
@@ -57,6 +57,88 @@ | |||
57 | 57 | ||
58 | #define OPEN_TIMEOUT (5*HZ) /* 5 seconds */ | 58 | #define OPEN_TIMEOUT (5*HZ) /* 5 seconds */ |
59 | 59 | ||
60 | static const struct usb_device_id edgeport_2port_id_table[] = { | ||
61 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2) }, | ||
62 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2I) }, | ||
63 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_421) }, | ||
64 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_21) }, | ||
65 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2_DIN) }, | ||
66 | { } | ||
67 | }; | ||
68 | |||
69 | static const struct usb_device_id edgeport_4port_id_table[] = { | ||
70 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4) }, | ||
71 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_RAPIDPORT_4) }, | ||
72 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4T) }, | ||
73 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_MT4X56USB) }, | ||
74 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4I) }, | ||
75 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU) }, | ||
76 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4_DIN) }, | ||
77 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_22I) }, | ||
78 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_412_4) }, | ||
79 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_COMPATIBLE) }, | ||
80 | { } | ||
81 | }; | ||
82 | |||
83 | static const struct usb_device_id edgeport_8port_id_table[] = { | ||
84 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8) }, | ||
85 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU) }, | ||
86 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8I) }, | ||
87 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8R) }, | ||
88 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8RR) }, | ||
89 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_412_8) }, | ||
90 | { } | ||
91 | }; | ||
92 | |||
93 | static const struct usb_device_id Epic_port_id_table[] = { | ||
94 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0202) }, | ||
95 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0203) }, | ||
96 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0310) }, | ||
97 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0311) }, | ||
98 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0312) }, | ||
99 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A758) }, | ||
100 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A794) }, | ||
101 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A225) }, | ||
102 | { } | ||
103 | }; | ||
104 | |||
105 | /* Devices that this driver supports */ | ||
106 | static const struct usb_device_id id_table_combined[] = { | ||
107 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4) }, | ||
108 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_RAPIDPORT_4) }, | ||
109 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4T) }, | ||
110 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_MT4X56USB) }, | ||
111 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2) }, | ||
112 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4I) }, | ||
113 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2I) }, | ||
114 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_421) }, | ||
115 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_21) }, | ||
116 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU) }, | ||
117 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8) }, | ||
118 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2_DIN) }, | ||
119 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4_DIN) }, | ||
120 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU) }, | ||
121 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_22I) }, | ||
122 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_412_4) }, | ||
123 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_COMPATIBLE) }, | ||
124 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8I) }, | ||
125 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8R) }, | ||
126 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8RR) }, | ||
127 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_412_8) }, | ||
128 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0202) }, | ||
129 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0203) }, | ||
130 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0310) }, | ||
131 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0311) }, | ||
132 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0312) }, | ||
133 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A758) }, | ||
134 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A794) }, | ||
135 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A225) }, | ||
136 | { } /* Terminating entry */ | ||
137 | }; | ||
138 | |||
139 | MODULE_DEVICE_TABLE(usb, id_table_combined); | ||
140 | |||
141 | |||
60 | /* receive port state */ | 142 | /* receive port state */ |
61 | enum RXSTATE { | 143 | enum RXSTATE { |
62 | EXPECT_HDR1 = 0, /* Expect header byte 1 */ | 144 | EXPECT_HDR1 = 0, /* Expect header byte 1 */ |
@@ -217,8 +299,6 @@ static void edge_release(struct usb_serial *serial); | |||
217 | static int edge_port_probe(struct usb_serial_port *port); | 299 | static int edge_port_probe(struct usb_serial_port *port); |
218 | static int edge_port_remove(struct usb_serial_port *port); | 300 | static int edge_port_remove(struct usb_serial_port *port); |
219 | 301 | ||
220 | #include "io_tables.h" /* all of the devices that this driver supports */ | ||
221 | |||
222 | /* function prototypes for all of our local functions */ | 302 | /* function prototypes for all of our local functions */ |
223 | 303 | ||
224 | static void process_rcvd_data(struct edgeport_serial *edge_serial, | 304 | static void process_rcvd_data(struct edgeport_serial *edge_serial, |
@@ -3032,6 +3112,139 @@ static int edge_port_remove(struct usb_serial_port *port) | |||
3032 | return 0; | 3112 | return 0; |
3033 | } | 3113 | } |
3034 | 3114 | ||
3115 | static struct usb_serial_driver edgeport_2port_device = { | ||
3116 | .driver = { | ||
3117 | .owner = THIS_MODULE, | ||
3118 | .name = "edgeport_2", | ||
3119 | }, | ||
3120 | .description = "Edgeport 2 port adapter", | ||
3121 | .id_table = edgeport_2port_id_table, | ||
3122 | .num_ports = 2, | ||
3123 | .open = edge_open, | ||
3124 | .close = edge_close, | ||
3125 | .throttle = edge_throttle, | ||
3126 | .unthrottle = edge_unthrottle, | ||
3127 | .attach = edge_startup, | ||
3128 | .disconnect = edge_disconnect, | ||
3129 | .release = edge_release, | ||
3130 | .port_probe = edge_port_probe, | ||
3131 | .port_remove = edge_port_remove, | ||
3132 | .ioctl = edge_ioctl, | ||
3133 | .set_termios = edge_set_termios, | ||
3134 | .tiocmget = edge_tiocmget, | ||
3135 | .tiocmset = edge_tiocmset, | ||
3136 | .tiocmiwait = usb_serial_generic_tiocmiwait, | ||
3137 | .get_icount = usb_serial_generic_get_icount, | ||
3138 | .write = edge_write, | ||
3139 | .write_room = edge_write_room, | ||
3140 | .chars_in_buffer = edge_chars_in_buffer, | ||
3141 | .break_ctl = edge_break, | ||
3142 | .read_int_callback = edge_interrupt_callback, | ||
3143 | .read_bulk_callback = edge_bulk_in_callback, | ||
3144 | .write_bulk_callback = edge_bulk_out_data_callback, | ||
3145 | }; | ||
3146 | |||
3147 | static struct usb_serial_driver edgeport_4port_device = { | ||
3148 | .driver = { | ||
3149 | .owner = THIS_MODULE, | ||
3150 | .name = "edgeport_4", | ||
3151 | }, | ||
3152 | .description = "Edgeport 4 port adapter", | ||
3153 | .id_table = edgeport_4port_id_table, | ||
3154 | .num_ports = 4, | ||
3155 | .open = edge_open, | ||
3156 | .close = edge_close, | ||
3157 | .throttle = edge_throttle, | ||
3158 | .unthrottle = edge_unthrottle, | ||
3159 | .attach = edge_startup, | ||
3160 | .disconnect = edge_disconnect, | ||
3161 | .release = edge_release, | ||
3162 | .port_probe = edge_port_probe, | ||
3163 | .port_remove = edge_port_remove, | ||
3164 | .ioctl = edge_ioctl, | ||
3165 | .set_termios = edge_set_termios, | ||
3166 | .tiocmget = edge_tiocmget, | ||
3167 | .tiocmset = edge_tiocmset, | ||
3168 | .tiocmiwait = usb_serial_generic_tiocmiwait, | ||
3169 | .get_icount = usb_serial_generic_get_icount, | ||
3170 | .write = edge_write, | ||
3171 | .write_room = edge_write_room, | ||
3172 | .chars_in_buffer = edge_chars_in_buffer, | ||
3173 | .break_ctl = edge_break, | ||
3174 | .read_int_callback = edge_interrupt_callback, | ||
3175 | .read_bulk_callback = edge_bulk_in_callback, | ||
3176 | .write_bulk_callback = edge_bulk_out_data_callback, | ||
3177 | }; | ||
3178 | |||
3179 | static struct usb_serial_driver edgeport_8port_device = { | ||
3180 | .driver = { | ||
3181 | .owner = THIS_MODULE, | ||
3182 | .name = "edgeport_8", | ||
3183 | }, | ||
3184 | .description = "Edgeport 8 port adapter", | ||
3185 | .id_table = edgeport_8port_id_table, | ||
3186 | .num_ports = 8, | ||
3187 | .open = edge_open, | ||
3188 | .close = edge_close, | ||
3189 | .throttle = edge_throttle, | ||
3190 | .unthrottle = edge_unthrottle, | ||
3191 | .attach = edge_startup, | ||
3192 | .disconnect = edge_disconnect, | ||
3193 | .release = edge_release, | ||
3194 | .port_probe = edge_port_probe, | ||
3195 | .port_remove = edge_port_remove, | ||
3196 | .ioctl = edge_ioctl, | ||
3197 | .set_termios = edge_set_termios, | ||
3198 | .tiocmget = edge_tiocmget, | ||
3199 | .tiocmset = edge_tiocmset, | ||
3200 | .tiocmiwait = usb_serial_generic_tiocmiwait, | ||
3201 | .get_icount = usb_serial_generic_get_icount, | ||
3202 | .write = edge_write, | ||
3203 | .write_room = edge_write_room, | ||
3204 | .chars_in_buffer = edge_chars_in_buffer, | ||
3205 | .break_ctl = edge_break, | ||
3206 | .read_int_callback = edge_interrupt_callback, | ||
3207 | .read_bulk_callback = edge_bulk_in_callback, | ||
3208 | .write_bulk_callback = edge_bulk_out_data_callback, | ||
3209 | }; | ||
3210 | |||
3211 | static struct usb_serial_driver epic_device = { | ||
3212 | .driver = { | ||
3213 | .owner = THIS_MODULE, | ||
3214 | .name = "epic", | ||
3215 | }, | ||
3216 | .description = "EPiC device", | ||
3217 | .id_table = Epic_port_id_table, | ||
3218 | .num_ports = 1, | ||
3219 | .open = edge_open, | ||
3220 | .close = edge_close, | ||
3221 | .throttle = edge_throttle, | ||
3222 | .unthrottle = edge_unthrottle, | ||
3223 | .attach = edge_startup, | ||
3224 | .disconnect = edge_disconnect, | ||
3225 | .release = edge_release, | ||
3226 | .port_probe = edge_port_probe, | ||
3227 | .port_remove = edge_port_remove, | ||
3228 | .ioctl = edge_ioctl, | ||
3229 | .set_termios = edge_set_termios, | ||
3230 | .tiocmget = edge_tiocmget, | ||
3231 | .tiocmset = edge_tiocmset, | ||
3232 | .tiocmiwait = usb_serial_generic_tiocmiwait, | ||
3233 | .get_icount = usb_serial_generic_get_icount, | ||
3234 | .write = edge_write, | ||
3235 | .write_room = edge_write_room, | ||
3236 | .chars_in_buffer = edge_chars_in_buffer, | ||
3237 | .break_ctl = edge_break, | ||
3238 | .read_int_callback = edge_interrupt_callback, | ||
3239 | .read_bulk_callback = edge_bulk_in_callback, | ||
3240 | .write_bulk_callback = edge_bulk_out_data_callback, | ||
3241 | }; | ||
3242 | |||
3243 | static struct usb_serial_driver * const serial_drivers[] = { | ||
3244 | &edgeport_2port_device, &edgeport_4port_device, | ||
3245 | &edgeport_8port_device, &epic_device, NULL | ||
3246 | }; | ||
3247 | |||
3035 | module_usb_serial_driver(serial_drivers, id_table_combined); | 3248 | module_usb_serial_driver(serial_drivers, id_table_combined); |
3036 | 3249 | ||
3037 | MODULE_AUTHOR(DRIVER_AUTHOR); | 3250 | MODULE_AUTHOR(DRIVER_AUTHOR); |
diff --git a/drivers/usb/serial/io_tables.h b/drivers/usb/serial/io_tables.h deleted file mode 100644 index ae5fac5656c9..000000000000 --- a/drivers/usb/serial/io_tables.h +++ /dev/null | |||
@@ -1,232 +0,0 @@ | |||
1 | /* | ||
2 | * IO Edgeport Driver tables | ||
3 | * | ||
4 | * Copyright (C) 2001 | ||
5 | * Greg Kroah-Hartman (greg@kroah.com) | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef IO_TABLES_H | ||
15 | #define IO_TABLES_H | ||
16 | |||
17 | static const struct usb_device_id edgeport_2port_id_table[] = { | ||
18 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2) }, | ||
19 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2I) }, | ||
20 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_421) }, | ||
21 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_21) }, | ||
22 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2_DIN) }, | ||
23 | { } | ||
24 | }; | ||
25 | |||
26 | static const struct usb_device_id edgeport_4port_id_table[] = { | ||
27 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4) }, | ||
28 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_RAPIDPORT_4) }, | ||
29 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4T) }, | ||
30 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_MT4X56USB) }, | ||
31 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4I) }, | ||
32 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU) }, | ||
33 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4_DIN) }, | ||
34 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_22I) }, | ||
35 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_412_4) }, | ||
36 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_COMPATIBLE) }, | ||
37 | { } | ||
38 | }; | ||
39 | |||
40 | static const struct usb_device_id edgeport_8port_id_table[] = { | ||
41 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8) }, | ||
42 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU) }, | ||
43 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8I) }, | ||
44 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8R) }, | ||
45 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8RR) }, | ||
46 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_412_8) }, | ||
47 | { } | ||
48 | }; | ||
49 | |||
50 | static const struct usb_device_id Epic_port_id_table[] = { | ||
51 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0202) }, | ||
52 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0203) }, | ||
53 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0310) }, | ||
54 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0311) }, | ||
55 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0312) }, | ||
56 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A758) }, | ||
57 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A794) }, | ||
58 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A225) }, | ||
59 | { } | ||
60 | }; | ||
61 | |||
62 | /* Devices that this driver supports */ | ||
63 | static const struct usb_device_id id_table_combined[] = { | ||
64 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4) }, | ||
65 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_RAPIDPORT_4) }, | ||
66 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4T) }, | ||
67 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_MT4X56USB) }, | ||
68 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2) }, | ||
69 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4I) }, | ||
70 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2I) }, | ||
71 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_421) }, | ||
72 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_21) }, | ||
73 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU) }, | ||
74 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8) }, | ||
75 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2_DIN) }, | ||
76 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4_DIN) }, | ||
77 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU) }, | ||
78 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_22I) }, | ||
79 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_412_4) }, | ||
80 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_COMPATIBLE) }, | ||
81 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8I) }, | ||
82 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8R) }, | ||
83 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8RR) }, | ||
84 | { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_412_8) }, | ||
85 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0202) }, | ||
86 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0203) }, | ||
87 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0310) }, | ||
88 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0311) }, | ||
89 | { USB_DEVICE(USB_VENDOR_ID_NCR, NCR_DEVICE_ID_EPIC_0312) }, | ||
90 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A758) }, | ||
91 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A794) }, | ||
92 | { USB_DEVICE(USB_VENDOR_ID_AXIOHM, AXIOHM_DEVICE_ID_EPIC_A225) }, | ||
93 | { } /* Terminating entry */ | ||
94 | }; | ||
95 | |||
96 | MODULE_DEVICE_TABLE(usb, id_table_combined); | ||
97 | |||
98 | static struct usb_serial_driver edgeport_2port_device = { | ||
99 | .driver = { | ||
100 | .owner = THIS_MODULE, | ||
101 | .name = "edgeport_2", | ||
102 | }, | ||
103 | .description = "Edgeport 2 port adapter", | ||
104 | .id_table = edgeport_2port_id_table, | ||
105 | .num_ports = 2, | ||
106 | .open = edge_open, | ||
107 | .close = edge_close, | ||
108 | .throttle = edge_throttle, | ||
109 | .unthrottle = edge_unthrottle, | ||
110 | .attach = edge_startup, | ||
111 | .disconnect = edge_disconnect, | ||
112 | .release = edge_release, | ||
113 | .port_probe = edge_port_probe, | ||
114 | .port_remove = edge_port_remove, | ||
115 | .ioctl = edge_ioctl, | ||
116 | .set_termios = edge_set_termios, | ||
117 | .tiocmget = edge_tiocmget, | ||
118 | .tiocmset = edge_tiocmset, | ||
119 | .tiocmiwait = usb_serial_generic_tiocmiwait, | ||
120 | .get_icount = usb_serial_generic_get_icount, | ||
121 | .write = edge_write, | ||
122 | .write_room = edge_write_room, | ||
123 | .chars_in_buffer = edge_chars_in_buffer, | ||
124 | .break_ctl = edge_break, | ||
125 | .read_int_callback = edge_interrupt_callback, | ||
126 | .read_bulk_callback = edge_bulk_in_callback, | ||
127 | .write_bulk_callback = edge_bulk_out_data_callback, | ||
128 | }; | ||
129 | |||
130 | static struct usb_serial_driver edgeport_4port_device = { | ||
131 | .driver = { | ||
132 | .owner = THIS_MODULE, | ||
133 | .name = "edgeport_4", | ||
134 | }, | ||
135 | .description = "Edgeport 4 port adapter", | ||
136 | .id_table = edgeport_4port_id_table, | ||
137 | .num_ports = 4, | ||
138 | .open = edge_open, | ||
139 | .close = edge_close, | ||
140 | .throttle = edge_throttle, | ||
141 | .unthrottle = edge_unthrottle, | ||
142 | .attach = edge_startup, | ||
143 | .disconnect = edge_disconnect, | ||
144 | .release = edge_release, | ||
145 | .port_probe = edge_port_probe, | ||
146 | .port_remove = edge_port_remove, | ||
147 | .ioctl = edge_ioctl, | ||
148 | .set_termios = edge_set_termios, | ||
149 | .tiocmget = edge_tiocmget, | ||
150 | .tiocmset = edge_tiocmset, | ||
151 | .tiocmiwait = usb_serial_generic_tiocmiwait, | ||
152 | .get_icount = usb_serial_generic_get_icount, | ||
153 | .write = edge_write, | ||
154 | .write_room = edge_write_room, | ||
155 | .chars_in_buffer = edge_chars_in_buffer, | ||
156 | .break_ctl = edge_break, | ||
157 | .read_int_callback = edge_interrupt_callback, | ||
158 | .read_bulk_callback = edge_bulk_in_callback, | ||
159 | .write_bulk_callback = edge_bulk_out_data_callback, | ||
160 | }; | ||
161 | |||
162 | static struct usb_serial_driver edgeport_8port_device = { | ||
163 | .driver = { | ||
164 | .owner = THIS_MODULE, | ||
165 | .name = "edgeport_8", | ||
166 | }, | ||
167 | .description = "Edgeport 8 port adapter", | ||
168 | .id_table = edgeport_8port_id_table, | ||
169 | .num_ports = 8, | ||
170 | .open = edge_open, | ||
171 | .close = edge_close, | ||
172 | .throttle = edge_throttle, | ||
173 | .unthrottle = edge_unthrottle, | ||
174 | .attach = edge_startup, | ||
175 | .disconnect = edge_disconnect, | ||
176 | .release = edge_release, | ||
177 | .port_probe = edge_port_probe, | ||
178 | .port_remove = edge_port_remove, | ||
179 | .ioctl = edge_ioctl, | ||
180 | .set_termios = edge_set_termios, | ||
181 | .tiocmget = edge_tiocmget, | ||
182 | .tiocmset = edge_tiocmset, | ||
183 | .tiocmiwait = usb_serial_generic_tiocmiwait, | ||
184 | .get_icount = usb_serial_generic_get_icount, | ||
185 | .write = edge_write, | ||
186 | .write_room = edge_write_room, | ||
187 | .chars_in_buffer = edge_chars_in_buffer, | ||
188 | .break_ctl = edge_break, | ||
189 | .read_int_callback = edge_interrupt_callback, | ||
190 | .read_bulk_callback = edge_bulk_in_callback, | ||
191 | .write_bulk_callback = edge_bulk_out_data_callback, | ||
192 | }; | ||
193 | |||
194 | static struct usb_serial_driver epic_device = { | ||
195 | .driver = { | ||
196 | .owner = THIS_MODULE, | ||
197 | .name = "epic", | ||
198 | }, | ||
199 | .description = "EPiC device", | ||
200 | .id_table = Epic_port_id_table, | ||
201 | .num_ports = 1, | ||
202 | .open = edge_open, | ||
203 | .close = edge_close, | ||
204 | .throttle = edge_throttle, | ||
205 | .unthrottle = edge_unthrottle, | ||
206 | .attach = edge_startup, | ||
207 | .disconnect = edge_disconnect, | ||
208 | .release = edge_release, | ||
209 | .port_probe = edge_port_probe, | ||
210 | .port_remove = edge_port_remove, | ||
211 | .ioctl = edge_ioctl, | ||
212 | .set_termios = edge_set_termios, | ||
213 | .tiocmget = edge_tiocmget, | ||
214 | .tiocmset = edge_tiocmset, | ||
215 | .tiocmiwait = usb_serial_generic_tiocmiwait, | ||
216 | .get_icount = usb_serial_generic_get_icount, | ||
217 | .write = edge_write, | ||
218 | .write_room = edge_write_room, | ||
219 | .chars_in_buffer = edge_chars_in_buffer, | ||
220 | .break_ctl = edge_break, | ||
221 | .read_int_callback = edge_interrupt_callback, | ||
222 | .read_bulk_callback = edge_bulk_in_callback, | ||
223 | .write_bulk_callback = edge_bulk_out_data_callback, | ||
224 | }; | ||
225 | |||
226 | static struct usb_serial_driver * const serial_drivers[] = { | ||
227 | &edgeport_2port_device, &edgeport_4port_device, | ||
228 | &edgeport_8port_device, &epic_device, NULL | ||
229 | }; | ||
230 | |||
231 | #endif | ||
232 | |||
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 1f9414bdd649..5662d324edd2 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -41,11 +41,508 @@ | |||
41 | #include <linux/usb.h> | 41 | #include <linux/usb.h> |
42 | #include <linux/usb/serial.h> | 42 | #include <linux/usb/serial.h> |
43 | #include <linux/usb/ezusb.h> | 43 | #include <linux/usb/ezusb.h> |
44 | #include "keyspan.h" | ||
45 | 44 | ||
46 | #define DRIVER_AUTHOR "Hugh Blemings <hugh@misc.nu" | 45 | #define DRIVER_AUTHOR "Hugh Blemings <hugh@misc.nu" |
47 | #define DRIVER_DESC "Keyspan USB to Serial Converter Driver" | 46 | #define DRIVER_DESC "Keyspan USB to Serial Converter Driver" |
48 | 47 | ||
48 | /* Function prototypes for Keyspan serial converter */ | ||
49 | static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port); | ||
50 | static void keyspan_close(struct usb_serial_port *port); | ||
51 | static void keyspan_dtr_rts(struct usb_serial_port *port, int on); | ||
52 | static int keyspan_startup(struct usb_serial *serial); | ||
53 | static void keyspan_disconnect(struct usb_serial *serial); | ||
54 | static void keyspan_release(struct usb_serial *serial); | ||
55 | static int keyspan_port_probe(struct usb_serial_port *port); | ||
56 | static int keyspan_port_remove(struct usb_serial_port *port); | ||
57 | static int keyspan_write_room(struct tty_struct *tty); | ||
58 | static int keyspan_write(struct tty_struct *tty, struct usb_serial_port *port, | ||
59 | const unsigned char *buf, int count); | ||
60 | static void keyspan_send_setup(struct usb_serial_port *port, int reset_port); | ||
61 | static void keyspan_set_termios(struct tty_struct *tty, | ||
62 | struct usb_serial_port *port, | ||
63 | struct ktermios *old); | ||
64 | static void keyspan_break_ctl(struct tty_struct *tty, int break_state); | ||
65 | static int keyspan_tiocmget(struct tty_struct *tty); | ||
66 | static int keyspan_tiocmset(struct tty_struct *tty, unsigned int set, | ||
67 | unsigned int clear); | ||
68 | static int keyspan_fake_startup(struct usb_serial *serial); | ||
69 | |||
70 | static int keyspan_usa19_calc_baud(struct usb_serial_port *port, | ||
71 | u32 baud_rate, u32 baudclk, | ||
72 | u8 *rate_hi, u8 *rate_low, | ||
73 | u8 *prescaler, int portnum); | ||
74 | static int keyspan_usa19w_calc_baud(struct usb_serial_port *port, | ||
75 | u32 baud_rate, u32 baudclk, | ||
76 | u8 *rate_hi, u8 *rate_low, | ||
77 | u8 *prescaler, int portnum); | ||
78 | static int keyspan_usa28_calc_baud(struct usb_serial_port *port, | ||
79 | u32 baud_rate, u32 baudclk, | ||
80 | u8 *rate_hi, u8 *rate_low, | ||
81 | u8 *prescaler, int portnum); | ||
82 | static int keyspan_usa19hs_calc_baud(struct usb_serial_port *port, | ||
83 | u32 baud_rate, u32 baudclk, | ||
84 | u8 *rate_hi, u8 *rate_low, | ||
85 | u8 *prescaler, int portnum); | ||
86 | |||
87 | static int keyspan_usa28_send_setup(struct usb_serial *serial, | ||
88 | struct usb_serial_port *port, | ||
89 | int reset_port); | ||
90 | static int keyspan_usa26_send_setup(struct usb_serial *serial, | ||
91 | struct usb_serial_port *port, | ||
92 | int reset_port); | ||
93 | static int keyspan_usa49_send_setup(struct usb_serial *serial, | ||
94 | struct usb_serial_port *port, | ||
95 | int reset_port); | ||
96 | static int keyspan_usa90_send_setup(struct usb_serial *serial, | ||
97 | struct usb_serial_port *port, | ||
98 | int reset_port); | ||
99 | static int keyspan_usa67_send_setup(struct usb_serial *serial, | ||
100 | struct usb_serial_port *port, | ||
101 | int reset_port); | ||
102 | |||
103 | /* Values used for baud rate calculation - device specific */ | ||
104 | #define KEYSPAN_INVALID_BAUD_RATE (-1) | ||
105 | #define KEYSPAN_BAUD_RATE_OK (0) | ||
106 | #define KEYSPAN_USA18X_BAUDCLK (12000000L) /* a guess */ | ||
107 | #define KEYSPAN_USA19_BAUDCLK (12000000L) | ||
108 | #define KEYSPAN_USA19W_BAUDCLK (24000000L) | ||
109 | #define KEYSPAN_USA19HS_BAUDCLK (14769231L) | ||
110 | #define KEYSPAN_USA28_BAUDCLK (1843200L) | ||
111 | #define KEYSPAN_USA28X_BAUDCLK (12000000L) | ||
112 | #define KEYSPAN_USA49W_BAUDCLK (48000000L) | ||
113 | |||
114 | /* Some constants used to characterise each device. */ | ||
115 | #define KEYSPAN_MAX_NUM_PORTS (4) | ||
116 | #define KEYSPAN_MAX_FLIPS (2) | ||
117 | |||
118 | /* | ||
119 | * Device info for the Keyspan serial converter, used by the overall | ||
120 | * usb-serial probe function. | ||
121 | */ | ||
122 | #define KEYSPAN_VENDOR_ID (0x06cd) | ||
123 | |||
124 | /* Product IDs for the products supported, pre-renumeration */ | ||
125 | #define keyspan_usa18x_pre_product_id 0x0105 | ||
126 | #define keyspan_usa19_pre_product_id 0x0103 | ||
127 | #define keyspan_usa19qi_pre_product_id 0x010b | ||
128 | #define keyspan_mpr_pre_product_id 0x011b | ||
129 | #define keyspan_usa19qw_pre_product_id 0x0118 | ||
130 | #define keyspan_usa19w_pre_product_id 0x0106 | ||
131 | #define keyspan_usa28_pre_product_id 0x0101 | ||
132 | #define keyspan_usa28x_pre_product_id 0x0102 | ||
133 | #define keyspan_usa28xa_pre_product_id 0x0114 | ||
134 | #define keyspan_usa28xb_pre_product_id 0x0113 | ||
135 | #define keyspan_usa49w_pre_product_id 0x0109 | ||
136 | #define keyspan_usa49wlc_pre_product_id 0x011a | ||
137 | |||
138 | /* | ||
139 | * Product IDs post-renumeration. Note that the 28x and 28xb have the same | ||
140 | * id's post-renumeration but behave identically so it's not an issue. As | ||
141 | * such, the 28xb is not listed in any of the device tables. | ||
142 | */ | ||
143 | #define keyspan_usa18x_product_id 0x0112 | ||
144 | #define keyspan_usa19_product_id 0x0107 | ||
145 | #define keyspan_usa19qi_product_id 0x010c | ||
146 | #define keyspan_usa19hs_product_id 0x0121 | ||
147 | #define keyspan_mpr_product_id 0x011c | ||
148 | #define keyspan_usa19qw_product_id 0x0119 | ||
149 | #define keyspan_usa19w_product_id 0x0108 | ||
150 | #define keyspan_usa28_product_id 0x010f | ||
151 | #define keyspan_usa28x_product_id 0x0110 | ||
152 | #define keyspan_usa28xa_product_id 0x0115 | ||
153 | #define keyspan_usa28xb_product_id 0x0110 | ||
154 | #define keyspan_usa28xg_product_id 0x0135 | ||
155 | #define keyspan_usa49w_product_id 0x010a | ||
156 | #define keyspan_usa49wlc_product_id 0x012a | ||
157 | #define keyspan_usa49wg_product_id 0x0131 | ||
158 | |||
159 | struct keyspan_device_details { | ||
160 | /* product ID value */ | ||
161 | int product_id; | ||
162 | |||
163 | enum {msg_usa26, msg_usa28, msg_usa49, msg_usa90, msg_usa67} msg_format; | ||
164 | |||
165 | /* Number of physical ports */ | ||
166 | int num_ports; | ||
167 | |||
168 | /* 1 if endpoint flipping used on input, 0 if not */ | ||
169 | int indat_endp_flip; | ||
170 | |||
171 | /* 1 if endpoint flipping used on output, 0 if not */ | ||
172 | int outdat_endp_flip; | ||
173 | |||
174 | /* | ||
175 | * Table mapping input data endpoint IDs to physical port | ||
176 | * number and flip if used | ||
177 | */ | ||
178 | int indat_endpoints[KEYSPAN_MAX_NUM_PORTS]; | ||
179 | |||
180 | /* Same for output endpoints */ | ||
181 | int outdat_endpoints[KEYSPAN_MAX_NUM_PORTS]; | ||
182 | |||
183 | /* Input acknowledge endpoints */ | ||
184 | int inack_endpoints[KEYSPAN_MAX_NUM_PORTS]; | ||
185 | |||
186 | /* Output control endpoints */ | ||
187 | int outcont_endpoints[KEYSPAN_MAX_NUM_PORTS]; | ||
188 | |||
189 | /* Endpoint used for input status */ | ||
190 | int instat_endpoint; | ||
191 | |||
192 | /* Endpoint used for input data 49WG only */ | ||
193 | int indat_endpoint; | ||
194 | |||
195 | /* Endpoint used for global control functions */ | ||
196 | int glocont_endpoint; | ||
197 | |||
198 | int (*calculate_baud_rate)(struct usb_serial_port *port, | ||
199 | u32 baud_rate, u32 baudclk, | ||
200 | u8 *rate_hi, u8 *rate_low, u8 *prescaler, | ||
201 | int portnum); | ||
202 | u32 baudclk; | ||
203 | }; | ||
204 | |||
205 | /* | ||
206 | * Now for each device type we setup the device detail structure with the | ||
207 | * appropriate information (provided in Keyspan's documentation) | ||
208 | */ | ||
209 | |||
210 | static const struct keyspan_device_details usa18x_device_details = { | ||
211 | .product_id = keyspan_usa18x_product_id, | ||
212 | .msg_format = msg_usa26, | ||
213 | .num_ports = 1, | ||
214 | .indat_endp_flip = 0, | ||
215 | .outdat_endp_flip = 1, | ||
216 | .indat_endpoints = {0x81}, | ||
217 | .outdat_endpoints = {0x01}, | ||
218 | .inack_endpoints = {0x85}, | ||
219 | .outcont_endpoints = {0x05}, | ||
220 | .instat_endpoint = 0x87, | ||
221 | .indat_endpoint = -1, | ||
222 | .glocont_endpoint = 0x07, | ||
223 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
224 | .baudclk = KEYSPAN_USA18X_BAUDCLK, | ||
225 | }; | ||
226 | |||
227 | static const struct keyspan_device_details usa19_device_details = { | ||
228 | .product_id = keyspan_usa19_product_id, | ||
229 | .msg_format = msg_usa28, | ||
230 | .num_ports = 1, | ||
231 | .indat_endp_flip = 1, | ||
232 | .outdat_endp_flip = 1, | ||
233 | .indat_endpoints = {0x81}, | ||
234 | .outdat_endpoints = {0x01}, | ||
235 | .inack_endpoints = {0x83}, | ||
236 | .outcont_endpoints = {0x03}, | ||
237 | .instat_endpoint = 0x84, | ||
238 | .indat_endpoint = -1, | ||
239 | .glocont_endpoint = -1, | ||
240 | .calculate_baud_rate = keyspan_usa19_calc_baud, | ||
241 | .baudclk = KEYSPAN_USA19_BAUDCLK, | ||
242 | }; | ||
243 | |||
244 | static const struct keyspan_device_details usa19qi_device_details = { | ||
245 | .product_id = keyspan_usa19qi_product_id, | ||
246 | .msg_format = msg_usa28, | ||
247 | .num_ports = 1, | ||
248 | .indat_endp_flip = 1, | ||
249 | .outdat_endp_flip = 1, | ||
250 | .indat_endpoints = {0x81}, | ||
251 | .outdat_endpoints = {0x01}, | ||
252 | .inack_endpoints = {0x83}, | ||
253 | .outcont_endpoints = {0x03}, | ||
254 | .instat_endpoint = 0x84, | ||
255 | .indat_endpoint = -1, | ||
256 | .glocont_endpoint = -1, | ||
257 | .calculate_baud_rate = keyspan_usa28_calc_baud, | ||
258 | .baudclk = KEYSPAN_USA19_BAUDCLK, | ||
259 | }; | ||
260 | |||
261 | static const struct keyspan_device_details mpr_device_details = { | ||
262 | .product_id = keyspan_mpr_product_id, | ||
263 | .msg_format = msg_usa28, | ||
264 | .num_ports = 1, | ||
265 | .indat_endp_flip = 1, | ||
266 | .outdat_endp_flip = 1, | ||
267 | .indat_endpoints = {0x81}, | ||
268 | .outdat_endpoints = {0x01}, | ||
269 | .inack_endpoints = {0x83}, | ||
270 | .outcont_endpoints = {0x03}, | ||
271 | .instat_endpoint = 0x84, | ||
272 | .indat_endpoint = -1, | ||
273 | .glocont_endpoint = -1, | ||
274 | .calculate_baud_rate = keyspan_usa28_calc_baud, | ||
275 | .baudclk = KEYSPAN_USA19_BAUDCLK, | ||
276 | }; | ||
277 | |||
278 | static const struct keyspan_device_details usa19qw_device_details = { | ||
279 | .product_id = keyspan_usa19qw_product_id, | ||
280 | .msg_format = msg_usa26, | ||
281 | .num_ports = 1, | ||
282 | .indat_endp_flip = 0, | ||
283 | .outdat_endp_flip = 1, | ||
284 | .indat_endpoints = {0x81}, | ||
285 | .outdat_endpoints = {0x01}, | ||
286 | .inack_endpoints = {0x85}, | ||
287 | .outcont_endpoints = {0x05}, | ||
288 | .instat_endpoint = 0x87, | ||
289 | .indat_endpoint = -1, | ||
290 | .glocont_endpoint = 0x07, | ||
291 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
292 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | ||
293 | }; | ||
294 | |||
295 | static const struct keyspan_device_details usa19w_device_details = { | ||
296 | .product_id = keyspan_usa19w_product_id, | ||
297 | .msg_format = msg_usa26, | ||
298 | .num_ports = 1, | ||
299 | .indat_endp_flip = 0, | ||
300 | .outdat_endp_flip = 1, | ||
301 | .indat_endpoints = {0x81}, | ||
302 | .outdat_endpoints = {0x01}, | ||
303 | .inack_endpoints = {0x85}, | ||
304 | .outcont_endpoints = {0x05}, | ||
305 | .instat_endpoint = 0x87, | ||
306 | .indat_endpoint = -1, | ||
307 | .glocont_endpoint = 0x07, | ||
308 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
309 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | ||
310 | }; | ||
311 | |||
312 | static const struct keyspan_device_details usa19hs_device_details = { | ||
313 | .product_id = keyspan_usa19hs_product_id, | ||
314 | .msg_format = msg_usa90, | ||
315 | .num_ports = 1, | ||
316 | .indat_endp_flip = 0, | ||
317 | .outdat_endp_flip = 0, | ||
318 | .indat_endpoints = {0x81}, | ||
319 | .outdat_endpoints = {0x01}, | ||
320 | .inack_endpoints = {-1}, | ||
321 | .outcont_endpoints = {0x02}, | ||
322 | .instat_endpoint = 0x82, | ||
323 | .indat_endpoint = -1, | ||
324 | .glocont_endpoint = -1, | ||
325 | .calculate_baud_rate = keyspan_usa19hs_calc_baud, | ||
326 | .baudclk = KEYSPAN_USA19HS_BAUDCLK, | ||
327 | }; | ||
328 | |||
329 | static const struct keyspan_device_details usa28_device_details = { | ||
330 | .product_id = keyspan_usa28_product_id, | ||
331 | .msg_format = msg_usa28, | ||
332 | .num_ports = 2, | ||
333 | .indat_endp_flip = 1, | ||
334 | .outdat_endp_flip = 1, | ||
335 | .indat_endpoints = {0x81, 0x83}, | ||
336 | .outdat_endpoints = {0x01, 0x03}, | ||
337 | .inack_endpoints = {0x85, 0x86}, | ||
338 | .outcont_endpoints = {0x05, 0x06}, | ||
339 | .instat_endpoint = 0x87, | ||
340 | .indat_endpoint = -1, | ||
341 | .glocont_endpoint = 0x07, | ||
342 | .calculate_baud_rate = keyspan_usa28_calc_baud, | ||
343 | .baudclk = KEYSPAN_USA28_BAUDCLK, | ||
344 | }; | ||
345 | |||
346 | static const struct keyspan_device_details usa28x_device_details = { | ||
347 | .product_id = keyspan_usa28x_product_id, | ||
348 | .msg_format = msg_usa26, | ||
349 | .num_ports = 2, | ||
350 | .indat_endp_flip = 0, | ||
351 | .outdat_endp_flip = 1, | ||
352 | .indat_endpoints = {0x81, 0x83}, | ||
353 | .outdat_endpoints = {0x01, 0x03}, | ||
354 | .inack_endpoints = {0x85, 0x86}, | ||
355 | .outcont_endpoints = {0x05, 0x06}, | ||
356 | .instat_endpoint = 0x87, | ||
357 | .indat_endpoint = -1, | ||
358 | .glocont_endpoint = 0x07, | ||
359 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
360 | .baudclk = KEYSPAN_USA28X_BAUDCLK, | ||
361 | }; | ||
362 | |||
363 | static const struct keyspan_device_details usa28xa_device_details = { | ||
364 | .product_id = keyspan_usa28xa_product_id, | ||
365 | .msg_format = msg_usa26, | ||
366 | .num_ports = 2, | ||
367 | .indat_endp_flip = 0, | ||
368 | .outdat_endp_flip = 1, | ||
369 | .indat_endpoints = {0x81, 0x83}, | ||
370 | .outdat_endpoints = {0x01, 0x03}, | ||
371 | .inack_endpoints = {0x85, 0x86}, | ||
372 | .outcont_endpoints = {0x05, 0x06}, | ||
373 | .instat_endpoint = 0x87, | ||
374 | .indat_endpoint = -1, | ||
375 | .glocont_endpoint = 0x07, | ||
376 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
377 | .baudclk = KEYSPAN_USA28X_BAUDCLK, | ||
378 | }; | ||
379 | |||
380 | static const struct keyspan_device_details usa28xg_device_details = { | ||
381 | .product_id = keyspan_usa28xg_product_id, | ||
382 | .msg_format = msg_usa67, | ||
383 | .num_ports = 2, | ||
384 | .indat_endp_flip = 0, | ||
385 | .outdat_endp_flip = 0, | ||
386 | .indat_endpoints = {0x84, 0x88}, | ||
387 | .outdat_endpoints = {0x02, 0x06}, | ||
388 | .inack_endpoints = {-1, -1}, | ||
389 | .outcont_endpoints = {-1, -1}, | ||
390 | .instat_endpoint = 0x81, | ||
391 | .indat_endpoint = -1, | ||
392 | .glocont_endpoint = 0x01, | ||
393 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
394 | .baudclk = KEYSPAN_USA28X_BAUDCLK, | ||
395 | }; | ||
396 | /* | ||
397 | * We don't need a separate entry for the usa28xb as it appears as a 28x | ||
398 | * anyway. | ||
399 | */ | ||
400 | |||
401 | static const struct keyspan_device_details usa49w_device_details = { | ||
402 | .product_id = keyspan_usa49w_product_id, | ||
403 | .msg_format = msg_usa49, | ||
404 | .num_ports = 4, | ||
405 | .indat_endp_flip = 0, | ||
406 | .outdat_endp_flip = 0, | ||
407 | .indat_endpoints = {0x81, 0x82, 0x83, 0x84}, | ||
408 | .outdat_endpoints = {0x01, 0x02, 0x03, 0x04}, | ||
409 | .inack_endpoints = {-1, -1, -1, -1}, | ||
410 | .outcont_endpoints = {-1, -1, -1, -1}, | ||
411 | .instat_endpoint = 0x87, | ||
412 | .indat_endpoint = -1, | ||
413 | .glocont_endpoint = 0x07, | ||
414 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
415 | .baudclk = KEYSPAN_USA49W_BAUDCLK, | ||
416 | }; | ||
417 | |||
418 | static const struct keyspan_device_details usa49wlc_device_details = { | ||
419 | .product_id = keyspan_usa49wlc_product_id, | ||
420 | .msg_format = msg_usa49, | ||
421 | .num_ports = 4, | ||
422 | .indat_endp_flip = 0, | ||
423 | .outdat_endp_flip = 0, | ||
424 | .indat_endpoints = {0x81, 0x82, 0x83, 0x84}, | ||
425 | .outdat_endpoints = {0x01, 0x02, 0x03, 0x04}, | ||
426 | .inack_endpoints = {-1, -1, -1, -1}, | ||
427 | .outcont_endpoints = {-1, -1, -1, -1}, | ||
428 | .instat_endpoint = 0x87, | ||
429 | .indat_endpoint = -1, | ||
430 | .glocont_endpoint = 0x07, | ||
431 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
432 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | ||
433 | }; | ||
434 | |||
435 | static const struct keyspan_device_details usa49wg_device_details = { | ||
436 | .product_id = keyspan_usa49wg_product_id, | ||
437 | .msg_format = msg_usa49, | ||
438 | .num_ports = 4, | ||
439 | .indat_endp_flip = 0, | ||
440 | .outdat_endp_flip = 0, | ||
441 | .indat_endpoints = {-1, -1, -1, -1}, /* single 'global' data in EP */ | ||
442 | .outdat_endpoints = {0x01, 0x02, 0x04, 0x06}, | ||
443 | .inack_endpoints = {-1, -1, -1, -1}, | ||
444 | .outcont_endpoints = {-1, -1, -1, -1}, | ||
445 | .instat_endpoint = 0x81, | ||
446 | .indat_endpoint = 0x88, | ||
447 | .glocont_endpoint = 0x00, /* uses control EP */ | ||
448 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
449 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | ||
450 | }; | ||
451 | |||
452 | static const struct keyspan_device_details *keyspan_devices[] = { | ||
453 | &usa18x_device_details, | ||
454 | &usa19_device_details, | ||
455 | &usa19qi_device_details, | ||
456 | &mpr_device_details, | ||
457 | &usa19qw_device_details, | ||
458 | &usa19w_device_details, | ||
459 | &usa19hs_device_details, | ||
460 | &usa28_device_details, | ||
461 | &usa28x_device_details, | ||
462 | &usa28xa_device_details, | ||
463 | &usa28xg_device_details, | ||
464 | /* 28xb not required as it renumerates as a 28x */ | ||
465 | &usa49w_device_details, | ||
466 | &usa49wlc_device_details, | ||
467 | &usa49wg_device_details, | ||
468 | NULL, | ||
469 | }; | ||
470 | |||
471 | static const struct usb_device_id keyspan_ids_combined[] = { | ||
472 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) }, | ||
473 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) }, | ||
474 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) }, | ||
475 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) }, | ||
476 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) }, | ||
477 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_pre_product_id) }, | ||
478 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) }, | ||
479 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) }, | ||
480 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) }, | ||
481 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_pre_product_id) }, | ||
482 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_pre_product_id) }, | ||
483 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_pre_product_id) }, | ||
484 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) }, | ||
485 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) }, | ||
486 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) }, | ||
487 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) }, | ||
488 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) }, | ||
489 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19hs_product_id) }, | ||
490 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) }, | ||
491 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, | ||
492 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, | ||
493 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) }, | ||
494 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xg_product_id) }, | ||
495 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id)}, | ||
496 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)}, | ||
497 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wg_product_id)}, | ||
498 | { } /* Terminating entry */ | ||
499 | }; | ||
500 | |||
501 | MODULE_DEVICE_TABLE(usb, keyspan_ids_combined); | ||
502 | |||
503 | /* usb_device_id table for the pre-firmware download keyspan devices */ | ||
504 | static const struct usb_device_id keyspan_pre_ids[] = { | ||
505 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) }, | ||
506 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) }, | ||
507 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) }, | ||
508 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) }, | ||
509 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) }, | ||
510 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_pre_product_id) }, | ||
511 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) }, | ||
512 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) }, | ||
513 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) }, | ||
514 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_pre_product_id) }, | ||
515 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_pre_product_id) }, | ||
516 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_pre_product_id) }, | ||
517 | { } /* Terminating entry */ | ||
518 | }; | ||
519 | |||
520 | static const struct usb_device_id keyspan_1port_ids[] = { | ||
521 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) }, | ||
522 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) }, | ||
523 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) }, | ||
524 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) }, | ||
525 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) }, | ||
526 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19hs_product_id) }, | ||
527 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) }, | ||
528 | { } /* Terminating entry */ | ||
529 | }; | ||
530 | |||
531 | static const struct usb_device_id keyspan_2port_ids[] = { | ||
532 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, | ||
533 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, | ||
534 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) }, | ||
535 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xg_product_id) }, | ||
536 | { } /* Terminating entry */ | ||
537 | }; | ||
538 | |||
539 | static const struct usb_device_id keyspan_4port_ids[] = { | ||
540 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id) }, | ||
541 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)}, | ||
542 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wg_product_id)}, | ||
543 | { } /* Terminating entry */ | ||
544 | }; | ||
545 | |||
49 | #define INSTAT_BUFLEN 32 | 546 | #define INSTAT_BUFLEN 32 |
50 | #define GLOCONT_BUFLEN 64 | 547 | #define GLOCONT_BUFLEN 64 |
51 | #define INDAT49W_BUFLEN 512 | 548 | #define INDAT49W_BUFLEN 512 |
@@ -126,8 +623,6 @@ struct keyspan_port_private { | |||
126 | #include "keyspan_usa67msg.h" | 623 | #include "keyspan_usa67msg.h" |
127 | 624 | ||
128 | 625 | ||
129 | module_usb_serial_driver(serial_drivers, keyspan_ids_combined); | ||
130 | |||
131 | static void keyspan_break_ctl(struct tty_struct *tty, int break_state) | 626 | static void keyspan_break_ctl(struct tty_struct *tty, int break_state) |
132 | { | 627 | { |
133 | struct usb_serial_port *port = tty->driver_data; | 628 | struct usb_serial_port *port = tty->driver_data; |
@@ -2523,6 +3018,97 @@ static int keyspan_port_remove(struct usb_serial_port *port) | |||
2523 | return 0; | 3018 | return 0; |
2524 | } | 3019 | } |
2525 | 3020 | ||
3021 | /* Structs for the devices, pre and post renumeration. */ | ||
3022 | static struct usb_serial_driver keyspan_pre_device = { | ||
3023 | .driver = { | ||
3024 | .owner = THIS_MODULE, | ||
3025 | .name = "keyspan_no_firm", | ||
3026 | }, | ||
3027 | .description = "Keyspan - (without firmware)", | ||
3028 | .id_table = keyspan_pre_ids, | ||
3029 | .num_ports = 1, | ||
3030 | .attach = keyspan_fake_startup, | ||
3031 | }; | ||
3032 | |||
3033 | static struct usb_serial_driver keyspan_1port_device = { | ||
3034 | .driver = { | ||
3035 | .owner = THIS_MODULE, | ||
3036 | .name = "keyspan_1", | ||
3037 | }, | ||
3038 | .description = "Keyspan 1 port adapter", | ||
3039 | .id_table = keyspan_1port_ids, | ||
3040 | .num_ports = 1, | ||
3041 | .open = keyspan_open, | ||
3042 | .close = keyspan_close, | ||
3043 | .dtr_rts = keyspan_dtr_rts, | ||
3044 | .write = keyspan_write, | ||
3045 | .write_room = keyspan_write_room, | ||
3046 | .set_termios = keyspan_set_termios, | ||
3047 | .break_ctl = keyspan_break_ctl, | ||
3048 | .tiocmget = keyspan_tiocmget, | ||
3049 | .tiocmset = keyspan_tiocmset, | ||
3050 | .attach = keyspan_startup, | ||
3051 | .disconnect = keyspan_disconnect, | ||
3052 | .release = keyspan_release, | ||
3053 | .port_probe = keyspan_port_probe, | ||
3054 | .port_remove = keyspan_port_remove, | ||
3055 | }; | ||
3056 | |||
3057 | static struct usb_serial_driver keyspan_2port_device = { | ||
3058 | .driver = { | ||
3059 | .owner = THIS_MODULE, | ||
3060 | .name = "keyspan_2", | ||
3061 | }, | ||
3062 | .description = "Keyspan 2 port adapter", | ||
3063 | .id_table = keyspan_2port_ids, | ||
3064 | .num_ports = 2, | ||
3065 | .open = keyspan_open, | ||
3066 | .close = keyspan_close, | ||
3067 | .dtr_rts = keyspan_dtr_rts, | ||
3068 | .write = keyspan_write, | ||
3069 | .write_room = keyspan_write_room, | ||
3070 | .set_termios = keyspan_set_termios, | ||
3071 | .break_ctl = keyspan_break_ctl, | ||
3072 | .tiocmget = keyspan_tiocmget, | ||
3073 | .tiocmset = keyspan_tiocmset, | ||
3074 | .attach = keyspan_startup, | ||
3075 | .disconnect = keyspan_disconnect, | ||
3076 | .release = keyspan_release, | ||
3077 | .port_probe = keyspan_port_probe, | ||
3078 | .port_remove = keyspan_port_remove, | ||
3079 | }; | ||
3080 | |||
3081 | static struct usb_serial_driver keyspan_4port_device = { | ||
3082 | .driver = { | ||
3083 | .owner = THIS_MODULE, | ||
3084 | .name = "keyspan_4", | ||
3085 | }, | ||
3086 | .description = "Keyspan 4 port adapter", | ||
3087 | .id_table = keyspan_4port_ids, | ||
3088 | .num_ports = 4, | ||
3089 | .open = keyspan_open, | ||
3090 | .close = keyspan_close, | ||
3091 | .dtr_rts = keyspan_dtr_rts, | ||
3092 | .write = keyspan_write, | ||
3093 | .write_room = keyspan_write_room, | ||
3094 | .set_termios = keyspan_set_termios, | ||
3095 | .break_ctl = keyspan_break_ctl, | ||
3096 | .tiocmget = keyspan_tiocmget, | ||
3097 | .tiocmset = keyspan_tiocmset, | ||
3098 | .attach = keyspan_startup, | ||
3099 | .disconnect = keyspan_disconnect, | ||
3100 | .release = keyspan_release, | ||
3101 | .port_probe = keyspan_port_probe, | ||
3102 | .port_remove = keyspan_port_remove, | ||
3103 | }; | ||
3104 | |||
3105 | static struct usb_serial_driver * const serial_drivers[] = { | ||
3106 | &keyspan_pre_device, &keyspan_1port_device, | ||
3107 | &keyspan_2port_device, &keyspan_4port_device, NULL | ||
3108 | }; | ||
3109 | |||
3110 | module_usb_serial_driver(serial_drivers, keyspan_ids_combined); | ||
3111 | |||
2526 | MODULE_AUTHOR(DRIVER_AUTHOR); | 3112 | MODULE_AUTHOR(DRIVER_AUTHOR); |
2527 | MODULE_DESCRIPTION(DRIVER_DESC); | 3113 | MODULE_DESCRIPTION(DRIVER_DESC); |
2528 | MODULE_LICENSE("GPL"); | 3114 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h deleted file mode 100644 index 0273dda303a4..000000000000 --- a/drivers/usb/serial/keyspan.h +++ /dev/null | |||
@@ -1,629 +0,0 @@ | |||
1 | /* | ||
2 | Keyspan USB to Serial Converter driver | ||
3 | |||
4 | (C) Copyright (C) 2000-2001 | ||
5 | Hugh Blemings <hugh@blemings.org> | ||
6 | |||
7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | See http://blemings.org/hugh/keyspan.html for more information. | ||
13 | |||
14 | Code in this driver inspired by and in a number of places taken | ||
15 | from Brian Warner's original Keyspan-PDA driver. | ||
16 | |||
17 | This driver has been put together with the support of Innosys, Inc. | ||
18 | and Keyspan, Inc the manufacturers of the Keyspan USB-serial products. | ||
19 | Thanks Guys :) | ||
20 | |||
21 | Thanks to Paulus for miscellaneous tidy ups, some largish chunks | ||
22 | of much nicer and/or completely new code and (perhaps most uniquely) | ||
23 | having the patience to sit down and explain why and where he'd changed | ||
24 | stuff. | ||
25 | |||
26 | Tip 'o the hat to IBM (and previously Linuxcare :) for supporting | ||
27 | staff in their work on open source projects. | ||
28 | |||
29 | See keyspan.c for update history. | ||
30 | |||
31 | */ | ||
32 | |||
33 | #ifndef __LINUX_USB_SERIAL_KEYSPAN_H | ||
34 | #define __LINUX_USB_SERIAL_KEYSPAN_H | ||
35 | |||
36 | |||
37 | /* Function prototypes for Keyspan serial converter */ | ||
38 | static int keyspan_open (struct tty_struct *tty, | ||
39 | struct usb_serial_port *port); | ||
40 | static void keyspan_close (struct usb_serial_port *port); | ||
41 | static void keyspan_dtr_rts (struct usb_serial_port *port, int on); | ||
42 | static int keyspan_startup (struct usb_serial *serial); | ||
43 | static void keyspan_disconnect (struct usb_serial *serial); | ||
44 | static void keyspan_release (struct usb_serial *serial); | ||
45 | static int keyspan_port_probe(struct usb_serial_port *port); | ||
46 | static int keyspan_port_remove(struct usb_serial_port *port); | ||
47 | static int keyspan_write_room (struct tty_struct *tty); | ||
48 | |||
49 | static int keyspan_write (struct tty_struct *tty, | ||
50 | struct usb_serial_port *port, | ||
51 | const unsigned char *buf, | ||
52 | int count); | ||
53 | |||
54 | static void keyspan_send_setup (struct usb_serial_port *port, | ||
55 | int reset_port); | ||
56 | |||
57 | |||
58 | static void keyspan_set_termios (struct tty_struct *tty, | ||
59 | struct usb_serial_port *port, | ||
60 | struct ktermios *old); | ||
61 | static void keyspan_break_ctl (struct tty_struct *tty, | ||
62 | int break_state); | ||
63 | static int keyspan_tiocmget (struct tty_struct *tty); | ||
64 | static int keyspan_tiocmset (struct tty_struct *tty, | ||
65 | unsigned int set, | ||
66 | unsigned int clear); | ||
67 | static int keyspan_fake_startup (struct usb_serial *serial); | ||
68 | |||
69 | static int keyspan_usa19_calc_baud (struct usb_serial_port *port, | ||
70 | u32 baud_rate, u32 baudclk, | ||
71 | u8 *rate_hi, u8 *rate_low, | ||
72 | u8 *prescaler, int portnum); | ||
73 | |||
74 | static int keyspan_usa19w_calc_baud (struct usb_serial_port *port, | ||
75 | u32 baud_rate, u32 baudclk, | ||
76 | u8 *rate_hi, u8 *rate_low, | ||
77 | u8 *prescaler, int portnum); | ||
78 | |||
79 | static int keyspan_usa28_calc_baud (struct usb_serial_port *port, | ||
80 | u32 baud_rate, u32 baudclk, | ||
81 | u8 *rate_hi, u8 *rate_low, | ||
82 | u8 *prescaler, int portnum); | ||
83 | |||
84 | static int keyspan_usa19hs_calc_baud (struct usb_serial_port *port, | ||
85 | u32 baud_rate, u32 baudclk, | ||
86 | u8 *rate_hi, u8 *rate_low, | ||
87 | u8 *prescaler, int portnum); | ||
88 | |||
89 | static int keyspan_usa28_send_setup (struct usb_serial *serial, | ||
90 | struct usb_serial_port *port, | ||
91 | int reset_port); | ||
92 | static int keyspan_usa26_send_setup (struct usb_serial *serial, | ||
93 | struct usb_serial_port *port, | ||
94 | int reset_port); | ||
95 | static int keyspan_usa49_send_setup (struct usb_serial *serial, | ||
96 | struct usb_serial_port *port, | ||
97 | int reset_port); | ||
98 | |||
99 | static int keyspan_usa90_send_setup (struct usb_serial *serial, | ||
100 | struct usb_serial_port *port, | ||
101 | int reset_port); | ||
102 | |||
103 | static int keyspan_usa67_send_setup (struct usb_serial *serial, | ||
104 | struct usb_serial_port *port, | ||
105 | int reset_port); | ||
106 | |||
107 | /* Values used for baud rate calculation - device specific */ | ||
108 | #define KEYSPAN_INVALID_BAUD_RATE (-1) | ||
109 | #define KEYSPAN_BAUD_RATE_OK (0) | ||
110 | #define KEYSPAN_USA18X_BAUDCLK (12000000L) /* a guess */ | ||
111 | #define KEYSPAN_USA19_BAUDCLK (12000000L) | ||
112 | #define KEYSPAN_USA19W_BAUDCLK (24000000L) | ||
113 | #define KEYSPAN_USA19HS_BAUDCLK (14769231L) | ||
114 | #define KEYSPAN_USA28_BAUDCLK (1843200L) | ||
115 | #define KEYSPAN_USA28X_BAUDCLK (12000000L) | ||
116 | #define KEYSPAN_USA49W_BAUDCLK (48000000L) | ||
117 | |||
118 | /* Some constants used to characterise each device. */ | ||
119 | #define KEYSPAN_MAX_NUM_PORTS (4) | ||
120 | #define KEYSPAN_MAX_FLIPS (2) | ||
121 | |||
122 | /* Device info for the Keyspan serial converter, used | ||
123 | by the overall usb-serial probe function */ | ||
124 | #define KEYSPAN_VENDOR_ID (0x06cd) | ||
125 | |||
126 | /* Product IDs for the products supported, pre-renumeration */ | ||
127 | #define keyspan_usa18x_pre_product_id 0x0105 | ||
128 | #define keyspan_usa19_pre_product_id 0x0103 | ||
129 | #define keyspan_usa19qi_pre_product_id 0x010b | ||
130 | #define keyspan_mpr_pre_product_id 0x011b | ||
131 | #define keyspan_usa19qw_pre_product_id 0x0118 | ||
132 | #define keyspan_usa19w_pre_product_id 0x0106 | ||
133 | #define keyspan_usa28_pre_product_id 0x0101 | ||
134 | #define keyspan_usa28x_pre_product_id 0x0102 | ||
135 | #define keyspan_usa28xa_pre_product_id 0x0114 | ||
136 | #define keyspan_usa28xb_pre_product_id 0x0113 | ||
137 | #define keyspan_usa49w_pre_product_id 0x0109 | ||
138 | #define keyspan_usa49wlc_pre_product_id 0x011a | ||
139 | |||
140 | /* Product IDs post-renumeration. Note that the 28x and 28xb | ||
141 | have the same id's post-renumeration but behave identically | ||
142 | so it's not an issue. As such, the 28xb is not listed in any | ||
143 | of the device tables. */ | ||
144 | #define keyspan_usa18x_product_id 0x0112 | ||
145 | #define keyspan_usa19_product_id 0x0107 | ||
146 | #define keyspan_usa19qi_product_id 0x010c | ||
147 | #define keyspan_usa19hs_product_id 0x0121 | ||
148 | #define keyspan_mpr_product_id 0x011c | ||
149 | #define keyspan_usa19qw_product_id 0x0119 | ||
150 | #define keyspan_usa19w_product_id 0x0108 | ||
151 | #define keyspan_usa28_product_id 0x010f | ||
152 | #define keyspan_usa28x_product_id 0x0110 | ||
153 | #define keyspan_usa28xa_product_id 0x0115 | ||
154 | #define keyspan_usa28xb_product_id 0x0110 | ||
155 | #define keyspan_usa28xg_product_id 0x0135 | ||
156 | #define keyspan_usa49w_product_id 0x010a | ||
157 | #define keyspan_usa49wlc_product_id 0x012a | ||
158 | #define keyspan_usa49wg_product_id 0x0131 | ||
159 | |||
160 | struct keyspan_device_details { | ||
161 | /* product ID value */ | ||
162 | int product_id; | ||
163 | |||
164 | enum {msg_usa26, msg_usa28, msg_usa49, msg_usa90, msg_usa67} msg_format; | ||
165 | |||
166 | /* Number of physical ports */ | ||
167 | int num_ports; | ||
168 | |||
169 | /* 1 if endpoint flipping used on input, 0 if not */ | ||
170 | int indat_endp_flip; | ||
171 | |||
172 | /* 1 if endpoint flipping used on output, 0 if not */ | ||
173 | int outdat_endp_flip; | ||
174 | |||
175 | /* Table mapping input data endpoint IDs to physical | ||
176 | port number and flip if used */ | ||
177 | int indat_endpoints[KEYSPAN_MAX_NUM_PORTS]; | ||
178 | |||
179 | /* Same for output endpoints */ | ||
180 | int outdat_endpoints[KEYSPAN_MAX_NUM_PORTS]; | ||
181 | |||
182 | /* Input acknowledge endpoints */ | ||
183 | int inack_endpoints[KEYSPAN_MAX_NUM_PORTS]; | ||
184 | |||
185 | /* Output control endpoints */ | ||
186 | int outcont_endpoints[KEYSPAN_MAX_NUM_PORTS]; | ||
187 | |||
188 | /* Endpoint used for input status */ | ||
189 | int instat_endpoint; | ||
190 | |||
191 | /* Endpoint used for input data 49WG only */ | ||
192 | int indat_endpoint; | ||
193 | |||
194 | /* Endpoint used for global control functions */ | ||
195 | int glocont_endpoint; | ||
196 | |||
197 | int (*calculate_baud_rate) (struct usb_serial_port *port, | ||
198 | u32 baud_rate, u32 baudclk, | ||
199 | u8 *rate_hi, u8 *rate_low, u8 *prescaler, int portnum); | ||
200 | u32 baudclk; | ||
201 | }; | ||
202 | |||
203 | /* Now for each device type we setup the device detail | ||
204 | structure with the appropriate information (provided | ||
205 | in Keyspan's documentation) */ | ||
206 | |||
207 | static const struct keyspan_device_details usa18x_device_details = { | ||
208 | .product_id = keyspan_usa18x_product_id, | ||
209 | .msg_format = msg_usa26, | ||
210 | .num_ports = 1, | ||
211 | .indat_endp_flip = 0, | ||
212 | .outdat_endp_flip = 1, | ||
213 | .indat_endpoints = {0x81}, | ||
214 | .outdat_endpoints = {0x01}, | ||
215 | .inack_endpoints = {0x85}, | ||
216 | .outcont_endpoints = {0x05}, | ||
217 | .instat_endpoint = 0x87, | ||
218 | .indat_endpoint = -1, | ||
219 | .glocont_endpoint = 0x07, | ||
220 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
221 | .baudclk = KEYSPAN_USA18X_BAUDCLK, | ||
222 | }; | ||
223 | |||
224 | static const struct keyspan_device_details usa19_device_details = { | ||
225 | .product_id = keyspan_usa19_product_id, | ||
226 | .msg_format = msg_usa28, | ||
227 | .num_ports = 1, | ||
228 | .indat_endp_flip = 1, | ||
229 | .outdat_endp_flip = 1, | ||
230 | .indat_endpoints = {0x81}, | ||
231 | .outdat_endpoints = {0x01}, | ||
232 | .inack_endpoints = {0x83}, | ||
233 | .outcont_endpoints = {0x03}, | ||
234 | .instat_endpoint = 0x84, | ||
235 | .indat_endpoint = -1, | ||
236 | .glocont_endpoint = -1, | ||
237 | .calculate_baud_rate = keyspan_usa19_calc_baud, | ||
238 | .baudclk = KEYSPAN_USA19_BAUDCLK, | ||
239 | }; | ||
240 | |||
241 | static const struct keyspan_device_details usa19qi_device_details = { | ||
242 | .product_id = keyspan_usa19qi_product_id, | ||
243 | .msg_format = msg_usa28, | ||
244 | .num_ports = 1, | ||
245 | .indat_endp_flip = 1, | ||
246 | .outdat_endp_flip = 1, | ||
247 | .indat_endpoints = {0x81}, | ||
248 | .outdat_endpoints = {0x01}, | ||
249 | .inack_endpoints = {0x83}, | ||
250 | .outcont_endpoints = {0x03}, | ||
251 | .instat_endpoint = 0x84, | ||
252 | .indat_endpoint = -1, | ||
253 | .glocont_endpoint = -1, | ||
254 | .calculate_baud_rate = keyspan_usa28_calc_baud, | ||
255 | .baudclk = KEYSPAN_USA19_BAUDCLK, | ||
256 | }; | ||
257 | |||
258 | static const struct keyspan_device_details mpr_device_details = { | ||
259 | .product_id = keyspan_mpr_product_id, | ||
260 | .msg_format = msg_usa28, | ||
261 | .num_ports = 1, | ||
262 | .indat_endp_flip = 1, | ||
263 | .outdat_endp_flip = 1, | ||
264 | .indat_endpoints = {0x81}, | ||
265 | .outdat_endpoints = {0x01}, | ||
266 | .inack_endpoints = {0x83}, | ||
267 | .outcont_endpoints = {0x03}, | ||
268 | .instat_endpoint = 0x84, | ||
269 | .indat_endpoint = -1, | ||
270 | .glocont_endpoint = -1, | ||
271 | .calculate_baud_rate = keyspan_usa28_calc_baud, | ||
272 | .baudclk = KEYSPAN_USA19_BAUDCLK, | ||
273 | }; | ||
274 | |||
275 | static const struct keyspan_device_details usa19qw_device_details = { | ||
276 | .product_id = keyspan_usa19qw_product_id, | ||
277 | .msg_format = msg_usa26, | ||
278 | .num_ports = 1, | ||
279 | .indat_endp_flip = 0, | ||
280 | .outdat_endp_flip = 1, | ||
281 | .indat_endpoints = {0x81}, | ||
282 | .outdat_endpoints = {0x01}, | ||
283 | .inack_endpoints = {0x85}, | ||
284 | .outcont_endpoints = {0x05}, | ||
285 | .instat_endpoint = 0x87, | ||
286 | .indat_endpoint = -1, | ||
287 | .glocont_endpoint = 0x07, | ||
288 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
289 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | ||
290 | }; | ||
291 | |||
292 | static const struct keyspan_device_details usa19w_device_details = { | ||
293 | .product_id = keyspan_usa19w_product_id, | ||
294 | .msg_format = msg_usa26, | ||
295 | .num_ports = 1, | ||
296 | .indat_endp_flip = 0, | ||
297 | .outdat_endp_flip = 1, | ||
298 | .indat_endpoints = {0x81}, | ||
299 | .outdat_endpoints = {0x01}, | ||
300 | .inack_endpoints = {0x85}, | ||
301 | .outcont_endpoints = {0x05}, | ||
302 | .instat_endpoint = 0x87, | ||
303 | .indat_endpoint = -1, | ||
304 | .glocont_endpoint = 0x07, | ||
305 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
306 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | ||
307 | }; | ||
308 | |||
309 | static const struct keyspan_device_details usa19hs_device_details = { | ||
310 | .product_id = keyspan_usa19hs_product_id, | ||
311 | .msg_format = msg_usa90, | ||
312 | .num_ports = 1, | ||
313 | .indat_endp_flip = 0, | ||
314 | .outdat_endp_flip = 0, | ||
315 | .indat_endpoints = {0x81}, | ||
316 | .outdat_endpoints = {0x01}, | ||
317 | .inack_endpoints = {-1}, | ||
318 | .outcont_endpoints = {0x02}, | ||
319 | .instat_endpoint = 0x82, | ||
320 | .indat_endpoint = -1, | ||
321 | .glocont_endpoint = -1, | ||
322 | .calculate_baud_rate = keyspan_usa19hs_calc_baud, | ||
323 | .baudclk = KEYSPAN_USA19HS_BAUDCLK, | ||
324 | }; | ||
325 | |||
326 | static const struct keyspan_device_details usa28_device_details = { | ||
327 | .product_id = keyspan_usa28_product_id, | ||
328 | .msg_format = msg_usa28, | ||
329 | .num_ports = 2, | ||
330 | .indat_endp_flip = 1, | ||
331 | .outdat_endp_flip = 1, | ||
332 | .indat_endpoints = {0x81, 0x83}, | ||
333 | .outdat_endpoints = {0x01, 0x03}, | ||
334 | .inack_endpoints = {0x85, 0x86}, | ||
335 | .outcont_endpoints = {0x05, 0x06}, | ||
336 | .instat_endpoint = 0x87, | ||
337 | .indat_endpoint = -1, | ||
338 | .glocont_endpoint = 0x07, | ||
339 | .calculate_baud_rate = keyspan_usa28_calc_baud, | ||
340 | .baudclk = KEYSPAN_USA28_BAUDCLK, | ||
341 | }; | ||
342 | |||
343 | static const struct keyspan_device_details usa28x_device_details = { | ||
344 | .product_id = keyspan_usa28x_product_id, | ||
345 | .msg_format = msg_usa26, | ||
346 | .num_ports = 2, | ||
347 | .indat_endp_flip = 0, | ||
348 | .outdat_endp_flip = 1, | ||
349 | .indat_endpoints = {0x81, 0x83}, | ||
350 | .outdat_endpoints = {0x01, 0x03}, | ||
351 | .inack_endpoints = {0x85, 0x86}, | ||
352 | .outcont_endpoints = {0x05, 0x06}, | ||
353 | .instat_endpoint = 0x87, | ||
354 | .indat_endpoint = -1, | ||
355 | .glocont_endpoint = 0x07, | ||
356 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
357 | .baudclk = KEYSPAN_USA28X_BAUDCLK, | ||
358 | }; | ||
359 | |||
360 | static const struct keyspan_device_details usa28xa_device_details = { | ||
361 | .product_id = keyspan_usa28xa_product_id, | ||
362 | .msg_format = msg_usa26, | ||
363 | .num_ports = 2, | ||
364 | .indat_endp_flip = 0, | ||
365 | .outdat_endp_flip = 1, | ||
366 | .indat_endpoints = {0x81, 0x83}, | ||
367 | .outdat_endpoints = {0x01, 0x03}, | ||
368 | .inack_endpoints = {0x85, 0x86}, | ||
369 | .outcont_endpoints = {0x05, 0x06}, | ||
370 | .instat_endpoint = 0x87, | ||
371 | .indat_endpoint = -1, | ||
372 | .glocont_endpoint = 0x07, | ||
373 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
374 | .baudclk = KEYSPAN_USA28X_BAUDCLK, | ||
375 | }; | ||
376 | |||
377 | static const struct keyspan_device_details usa28xg_device_details = { | ||
378 | .product_id = keyspan_usa28xg_product_id, | ||
379 | .msg_format = msg_usa67, | ||
380 | .num_ports = 2, | ||
381 | .indat_endp_flip = 0, | ||
382 | .outdat_endp_flip = 0, | ||
383 | .indat_endpoints = {0x84, 0x88}, | ||
384 | .outdat_endpoints = {0x02, 0x06}, | ||
385 | .inack_endpoints = {-1, -1}, | ||
386 | .outcont_endpoints = {-1, -1}, | ||
387 | .instat_endpoint = 0x81, | ||
388 | .indat_endpoint = -1, | ||
389 | .glocont_endpoint = 0x01, | ||
390 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
391 | .baudclk = KEYSPAN_USA28X_BAUDCLK, | ||
392 | }; | ||
393 | /* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */ | ||
394 | |||
395 | static const struct keyspan_device_details usa49w_device_details = { | ||
396 | .product_id = keyspan_usa49w_product_id, | ||
397 | .msg_format = msg_usa49, | ||
398 | .num_ports = 4, | ||
399 | .indat_endp_flip = 0, | ||
400 | .outdat_endp_flip = 0, | ||
401 | .indat_endpoints = {0x81, 0x82, 0x83, 0x84}, | ||
402 | .outdat_endpoints = {0x01, 0x02, 0x03, 0x04}, | ||
403 | .inack_endpoints = {-1, -1, -1, -1}, | ||
404 | .outcont_endpoints = {-1, -1, -1, -1}, | ||
405 | .instat_endpoint = 0x87, | ||
406 | .indat_endpoint = -1, | ||
407 | .glocont_endpoint = 0x07, | ||
408 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
409 | .baudclk = KEYSPAN_USA49W_BAUDCLK, | ||
410 | }; | ||
411 | |||
412 | static const struct keyspan_device_details usa49wlc_device_details = { | ||
413 | .product_id = keyspan_usa49wlc_product_id, | ||
414 | .msg_format = msg_usa49, | ||
415 | .num_ports = 4, | ||
416 | .indat_endp_flip = 0, | ||
417 | .outdat_endp_flip = 0, | ||
418 | .indat_endpoints = {0x81, 0x82, 0x83, 0x84}, | ||
419 | .outdat_endpoints = {0x01, 0x02, 0x03, 0x04}, | ||
420 | .inack_endpoints = {-1, -1, -1, -1}, | ||
421 | .outcont_endpoints = {-1, -1, -1, -1}, | ||
422 | .instat_endpoint = 0x87, | ||
423 | .indat_endpoint = -1, | ||
424 | .glocont_endpoint = 0x07, | ||
425 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
426 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | ||
427 | }; | ||
428 | |||
429 | static const struct keyspan_device_details usa49wg_device_details = { | ||
430 | .product_id = keyspan_usa49wg_product_id, | ||
431 | .msg_format = msg_usa49, | ||
432 | .num_ports = 4, | ||
433 | .indat_endp_flip = 0, | ||
434 | .outdat_endp_flip = 0, | ||
435 | .indat_endpoints = {-1, -1, -1, -1}, /* single 'global' data in EP */ | ||
436 | .outdat_endpoints = {0x01, 0x02, 0x04, 0x06}, | ||
437 | .inack_endpoints = {-1, -1, -1, -1}, | ||
438 | .outcont_endpoints = {-1, -1, -1, -1}, | ||
439 | .instat_endpoint = 0x81, | ||
440 | .indat_endpoint = 0x88, | ||
441 | .glocont_endpoint = 0x00, /* uses control EP */ | ||
442 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | ||
443 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | ||
444 | }; | ||
445 | |||
446 | static const struct keyspan_device_details *keyspan_devices[] = { | ||
447 | &usa18x_device_details, | ||
448 | &usa19_device_details, | ||
449 | &usa19qi_device_details, | ||
450 | &mpr_device_details, | ||
451 | &usa19qw_device_details, | ||
452 | &usa19w_device_details, | ||
453 | &usa19hs_device_details, | ||
454 | &usa28_device_details, | ||
455 | &usa28x_device_details, | ||
456 | &usa28xa_device_details, | ||
457 | &usa28xg_device_details, | ||
458 | /* 28xb not required as it renumerates as a 28x */ | ||
459 | &usa49w_device_details, | ||
460 | &usa49wlc_device_details, | ||
461 | &usa49wg_device_details, | ||
462 | NULL, | ||
463 | }; | ||
464 | |||
465 | static const struct usb_device_id keyspan_ids_combined[] = { | ||
466 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) }, | ||
467 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) }, | ||
468 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) }, | ||
469 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) }, | ||
470 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) }, | ||
471 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_pre_product_id) }, | ||
472 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) }, | ||
473 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) }, | ||
474 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) }, | ||
475 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_pre_product_id) }, | ||
476 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_pre_product_id) }, | ||
477 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_pre_product_id) }, | ||
478 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) }, | ||
479 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) }, | ||
480 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) }, | ||
481 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) }, | ||
482 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) }, | ||
483 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19hs_product_id) }, | ||
484 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) }, | ||
485 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, | ||
486 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, | ||
487 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) }, | ||
488 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xg_product_id) }, | ||
489 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id)}, | ||
490 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)}, | ||
491 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wg_product_id)}, | ||
492 | { } /* Terminating entry */ | ||
493 | }; | ||
494 | |||
495 | MODULE_DEVICE_TABLE(usb, keyspan_ids_combined); | ||
496 | |||
497 | /* usb_device_id table for the pre-firmware download keyspan devices */ | ||
498 | static const struct usb_device_id keyspan_pre_ids[] = { | ||
499 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) }, | ||
500 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) }, | ||
501 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) }, | ||
502 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) }, | ||
503 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) }, | ||
504 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_pre_product_id) }, | ||
505 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) }, | ||
506 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) }, | ||
507 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) }, | ||
508 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_pre_product_id) }, | ||
509 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_pre_product_id) }, | ||
510 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_pre_product_id) }, | ||
511 | { } /* Terminating entry */ | ||
512 | }; | ||
513 | |||
514 | static const struct usb_device_id keyspan_1port_ids[] = { | ||
515 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) }, | ||
516 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) }, | ||
517 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) }, | ||
518 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) }, | ||
519 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) }, | ||
520 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19hs_product_id) }, | ||
521 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) }, | ||
522 | { } /* Terminating entry */ | ||
523 | }; | ||
524 | |||
525 | static const struct usb_device_id keyspan_2port_ids[] = { | ||
526 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, | ||
527 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, | ||
528 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) }, | ||
529 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xg_product_id) }, | ||
530 | { } /* Terminating entry */ | ||
531 | }; | ||
532 | |||
533 | static const struct usb_device_id keyspan_4port_ids[] = { | ||
534 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id) }, | ||
535 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)}, | ||
536 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wg_product_id)}, | ||
537 | { } /* Terminating entry */ | ||
538 | }; | ||
539 | |||
540 | /* Structs for the devices, pre and post renumeration. */ | ||
541 | static struct usb_serial_driver keyspan_pre_device = { | ||
542 | .driver = { | ||
543 | .owner = THIS_MODULE, | ||
544 | .name = "keyspan_no_firm", | ||
545 | }, | ||
546 | .description = "Keyspan - (without firmware)", | ||
547 | .id_table = keyspan_pre_ids, | ||
548 | .num_ports = 1, | ||
549 | .attach = keyspan_fake_startup, | ||
550 | }; | ||
551 | |||
552 | static struct usb_serial_driver keyspan_1port_device = { | ||
553 | .driver = { | ||
554 | .owner = THIS_MODULE, | ||
555 | .name = "keyspan_1", | ||
556 | }, | ||
557 | .description = "Keyspan 1 port adapter", | ||
558 | .id_table = keyspan_1port_ids, | ||
559 | .num_ports = 1, | ||
560 | .open = keyspan_open, | ||
561 | .close = keyspan_close, | ||
562 | .dtr_rts = keyspan_dtr_rts, | ||
563 | .write = keyspan_write, | ||
564 | .write_room = keyspan_write_room, | ||
565 | .set_termios = keyspan_set_termios, | ||
566 | .break_ctl = keyspan_break_ctl, | ||
567 | .tiocmget = keyspan_tiocmget, | ||
568 | .tiocmset = keyspan_tiocmset, | ||
569 | .attach = keyspan_startup, | ||
570 | .disconnect = keyspan_disconnect, | ||
571 | .release = keyspan_release, | ||
572 | .port_probe = keyspan_port_probe, | ||
573 | .port_remove = keyspan_port_remove, | ||
574 | }; | ||
575 | |||
576 | static struct usb_serial_driver keyspan_2port_device = { | ||
577 | .driver = { | ||
578 | .owner = THIS_MODULE, | ||
579 | .name = "keyspan_2", | ||
580 | }, | ||
581 | .description = "Keyspan 2 port adapter", | ||
582 | .id_table = keyspan_2port_ids, | ||
583 | .num_ports = 2, | ||
584 | .open = keyspan_open, | ||
585 | .close = keyspan_close, | ||
586 | .dtr_rts = keyspan_dtr_rts, | ||
587 | .write = keyspan_write, | ||
588 | .write_room = keyspan_write_room, | ||
589 | .set_termios = keyspan_set_termios, | ||
590 | .break_ctl = keyspan_break_ctl, | ||
591 | .tiocmget = keyspan_tiocmget, | ||
592 | .tiocmset = keyspan_tiocmset, | ||
593 | .attach = keyspan_startup, | ||
594 | .disconnect = keyspan_disconnect, | ||
595 | .release = keyspan_release, | ||
596 | .port_probe = keyspan_port_probe, | ||
597 | .port_remove = keyspan_port_remove, | ||
598 | }; | ||
599 | |||
600 | static struct usb_serial_driver keyspan_4port_device = { | ||
601 | .driver = { | ||
602 | .owner = THIS_MODULE, | ||
603 | .name = "keyspan_4", | ||
604 | }, | ||
605 | .description = "Keyspan 4 port adapter", | ||
606 | .id_table = keyspan_4port_ids, | ||
607 | .num_ports = 4, | ||
608 | .open = keyspan_open, | ||
609 | .close = keyspan_close, | ||
610 | .dtr_rts = keyspan_dtr_rts, | ||
611 | .write = keyspan_write, | ||
612 | .write_room = keyspan_write_room, | ||
613 | .set_termios = keyspan_set_termios, | ||
614 | .break_ctl = keyspan_break_ctl, | ||
615 | .tiocmget = keyspan_tiocmget, | ||
616 | .tiocmset = keyspan_tiocmset, | ||
617 | .attach = keyspan_startup, | ||
618 | .disconnect = keyspan_disconnect, | ||
619 | .release = keyspan_release, | ||
620 | .port_probe = keyspan_port_probe, | ||
621 | .port_remove = keyspan_port_remove, | ||
622 | }; | ||
623 | |||
624 | static struct usb_serial_driver * const serial_drivers[] = { | ||
625 | &keyspan_pre_device, &keyspan_1port_device, | ||
626 | &keyspan_2port_device, &keyspan_4port_device, NULL | ||
627 | }; | ||
628 | |||
629 | #endif | ||
diff --git a/drivers/usb/serial/upd78f0730.c b/drivers/usb/serial/upd78f0730.c index 55b9a18b6c38..a028dd2310c9 100644 --- a/drivers/usb/serial/upd78f0730.c +++ b/drivers/usb/serial/upd78f0730.c | |||
@@ -17,7 +17,7 @@ | |||
17 | * - stop bits: 1 or 2 | 17 | * - stop bits: 1 or 2 |
18 | * - parity: even, odd or none | 18 | * - parity: even, odd or none |
19 | * - flow control: none | 19 | * - flow control: none |
20 | * - baud rates: 0, 2400, 4800, 9600, 19200, 38400, 57600, 115200 | 20 | * - baud rates: 0, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 153600 |
21 | * - signals: DTR, RTS and BREAK | 21 | * - signals: DTR, RTS and BREAK |
22 | */ | 22 | */ |
23 | 23 | ||
@@ -32,8 +32,9 @@ | |||
32 | #define DRIVER_AUTHOR "Maksim Salau <maksim.salau@gmail.com>" | 32 | #define DRIVER_AUTHOR "Maksim Salau <maksim.salau@gmail.com>" |
33 | 33 | ||
34 | static const struct usb_device_id id_table[] = { | 34 | static const struct usb_device_id id_table[] = { |
35 | { USB_DEVICE(0x045B, 0x0212) }, /* YRPBRL78G13, YRPBRL78G14 */ | ||
36 | { USB_DEVICE(0x0409, 0x0063) }, /* V850ESJX3-STICK */ | 35 | { USB_DEVICE(0x0409, 0x0063) }, /* V850ESJX3-STICK */ |
36 | { USB_DEVICE(0x045B, 0x0212) }, /* YRPBRL78G13, YRPBRL78G14 */ | ||
37 | { USB_DEVICE(0x064B, 0x7825) }, /* Analog Devices EVAL-ADXL362Z-DB */ | ||
37 | {} | 38 | {} |
38 | }; | 39 | }; |
39 | 40 | ||
@@ -288,7 +289,7 @@ static speed_t upd78f0730_get_baud_rate(struct tty_struct *tty) | |||
288 | { | 289 | { |
289 | const speed_t baud_rate = tty_get_baud_rate(tty); | 290 | const speed_t baud_rate = tty_get_baud_rate(tty); |
290 | const speed_t supported[] = { | 291 | const speed_t supported[] = { |
291 | 0, 2400, 4800, 9600, 19200, 38400, 57600, 115200 | 292 | 0, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 153600 |
292 | }; | 293 | }; |
293 | int i; | 294 | int i; |
294 | 295 | ||