Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 1 | /* |
Chris Rorvick | c078a4a | 2015-01-20 02:20:50 -0600 | [diff] [blame] | 2 | * Line 6 Linux USB driver |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 3 | * |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 4 | * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at) |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation, version 2. |
| 9 | * |
| 10 | */ |
| 11 | |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 12 | #include <linux/slab.h> |
Takashi Iwai | ccddbe4 | 2015-01-15 08:22:31 +0100 | [diff] [blame] | 13 | #include <linux/spinlock.h> |
| 14 | #include <linux/usb.h> |
| 15 | #include <linux/wait.h> |
| 16 | #include <linux/module.h> |
| 17 | #include <sound/core.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 18 | |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 19 | #include "driver.h" |
Takashi Iwai | ccddbe4 | 2015-01-15 08:22:31 +0100 | [diff] [blame] | 20 | |
| 21 | #define VARIAX_STARTUP_DELAY1 1000 |
| 22 | #define VARIAX_STARTUP_DELAY3 100 |
| 23 | #define VARIAX_STARTUP_DELAY4 100 |
| 24 | |
| 25 | /* |
| 26 | Stages of Variax startup procedure |
| 27 | */ |
| 28 | enum { |
| 29 | VARIAX_STARTUP_INIT = 1, |
| 30 | VARIAX_STARTUP_VERSIONREQ, |
| 31 | VARIAX_STARTUP_WAIT, |
| 32 | VARIAX_STARTUP_ACTIVATE, |
| 33 | VARIAX_STARTUP_WORKQUEUE, |
| 34 | VARIAX_STARTUP_SETUP, |
| 35 | VARIAX_STARTUP_LAST = VARIAX_STARTUP_SETUP - 1 |
| 36 | }; |
| 37 | |
| 38 | enum { |
| 39 | LINE6_PODXTLIVE_VARIAX, |
| 40 | LINE6_VARIAX |
| 41 | }; |
| 42 | |
| 43 | struct usb_line6_variax { |
Takashi Iwai | cddbd4f | 2015-01-28 14:43:11 +0100 | [diff] [blame] | 44 | /* Generic Line 6 USB data */ |
Takashi Iwai | ccddbe4 | 2015-01-15 08:22:31 +0100 | [diff] [blame] | 45 | struct usb_line6 line6; |
| 46 | |
Takashi Iwai | cddbd4f | 2015-01-28 14:43:11 +0100 | [diff] [blame] | 47 | /* Buffer for activation code */ |
Takashi Iwai | ccddbe4 | 2015-01-15 08:22:31 +0100 | [diff] [blame] | 48 | unsigned char *buffer_activate; |
| 49 | |
Takashi Iwai | cddbd4f | 2015-01-28 14:43:11 +0100 | [diff] [blame] | 50 | /* Handler for device initialization */ |
Takashi Iwai | ccddbe4 | 2015-01-15 08:22:31 +0100 | [diff] [blame] | 51 | struct work_struct startup_work; |
| 52 | |
Takashi Iwai | cddbd4f | 2015-01-28 14:43:11 +0100 | [diff] [blame] | 53 | /* Timers for device initialization */ |
Takashi Iwai | ccddbe4 | 2015-01-15 08:22:31 +0100 | [diff] [blame] | 54 | struct timer_list startup_timer1; |
| 55 | struct timer_list startup_timer2; |
| 56 | |
Takashi Iwai | cddbd4f | 2015-01-28 14:43:11 +0100 | [diff] [blame] | 57 | /* Current progress in startup procedure */ |
Takashi Iwai | ccddbe4 | 2015-01-15 08:22:31 +0100 | [diff] [blame] | 58 | int startup_progress; |
| 59 | }; |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 60 | |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 61 | #define VARIAX_OFFSET_ACTIVATE 7 |
| 62 | |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 63 | /* |
| 64 | This message is sent by the device during initialization and identifies |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 65 | the connected guitar version. |
| 66 | */ |
| 67 | static const char variax_init_version[] = { |
| 68 | 0xf0, 0x7e, 0x7f, 0x06, 0x02, 0x00, 0x01, 0x0c, |
| 69 | 0x07, 0x00, 0x00, 0x00 |
| 70 | }; |
| 71 | |
| 72 | /* |
| 73 | This message is the last one sent by the device during initialization. |
| 74 | */ |
| 75 | static const char variax_init_done[] = { |
| 76 | 0xf0, 0x00, 0x01, 0x0c, 0x07, 0x00, 0x6b |
| 77 | }; |
| 78 | |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 79 | static const char variax_activate[] = { |
| 80 | 0xf0, 0x00, 0x01, 0x0c, 0x07, 0x00, 0x2a, 0x01, |
| 81 | 0xf7 |
| 82 | }; |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 83 | |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 84 | /* forward declarations: */ |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 85 | static void variax_startup2(unsigned long data); |
| 86 | static void variax_startup4(unsigned long data); |
| 87 | static void variax_startup5(unsigned long data); |
| 88 | |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 89 | static void variax_activate_async(struct usb_line6_variax *variax, int a) |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 90 | { |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 91 | variax->buffer_activate[VARIAX_OFFSET_ACTIVATE] = a; |
Greg Kroah-Hartman | 9cd57f7 | 2009-02-27 22:43:57 -0800 | [diff] [blame] | 92 | line6_send_raw_message_async(&variax->line6, variax->buffer_activate, |
| 93 | sizeof(variax_activate)); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | /* |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 97 | Variax startup procedure. |
| 98 | This is a sequence of functions with special requirements (e.g., must |
| 99 | not run immediately after initialization, must not run in interrupt |
| 100 | context). After the last one has finished, the device is ready to use. |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 101 | */ |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 102 | |
| 103 | static void variax_startup1(struct usb_line6_variax *variax) |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 104 | { |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 105 | CHECK_STARTUP_PROGRESS(variax->startup_progress, VARIAX_STARTUP_INIT); |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 106 | |
| 107 | /* delay startup procedure: */ |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 108 | line6_start_timer(&variax->startup_timer1, VARIAX_STARTUP_DELAY1, |
| 109 | variax_startup2, (unsigned long)variax); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 110 | } |
| 111 | |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 112 | static void variax_startup2(unsigned long data) |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 113 | { |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 114 | struct usb_line6_variax *variax = (struct usb_line6_variax *)data; |
| 115 | struct usb_line6 *line6 = &variax->line6; |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 116 | |
| 117 | /* schedule another startup procedure until startup is complete: */ |
| 118 | if (variax->startup_progress >= VARIAX_STARTUP_LAST) |
| 119 | return; |
| 120 | |
| 121 | variax->startup_progress = VARIAX_STARTUP_VERSIONREQ; |
| 122 | line6_start_timer(&variax->startup_timer1, VARIAX_STARTUP_DELAY1, |
| 123 | variax_startup2, (unsigned long)variax); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 124 | |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 125 | /* request firmware version: */ |
| 126 | line6_version_request_async(line6); |
| 127 | } |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 128 | |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 129 | static void variax_startup3(struct usb_line6_variax *variax) |
| 130 | { |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 131 | CHECK_STARTUP_PROGRESS(variax->startup_progress, VARIAX_STARTUP_WAIT); |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 132 | |
| 133 | /* delay startup procedure: */ |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 134 | line6_start_timer(&variax->startup_timer2, VARIAX_STARTUP_DELAY3, |
| 135 | variax_startup4, (unsigned long)variax); |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | static void variax_startup4(unsigned long data) |
| 139 | { |
| 140 | struct usb_line6_variax *variax = (struct usb_line6_variax *)data; |
Jerry Snitselaar | f3c5261 | 2014-04-24 00:31:48 -0700 | [diff] [blame] | 141 | |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 142 | CHECK_STARTUP_PROGRESS(variax->startup_progress, |
| 143 | VARIAX_STARTUP_ACTIVATE); |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 144 | |
| 145 | /* activate device: */ |
| 146 | variax_activate_async(variax, 1); |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 147 | line6_start_timer(&variax->startup_timer2, VARIAX_STARTUP_DELAY4, |
| 148 | variax_startup5, (unsigned long)variax); |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | static void variax_startup5(unsigned long data) |
| 152 | { |
| 153 | struct usb_line6_variax *variax = (struct usb_line6_variax *)data; |
Jerry Snitselaar | f3c5261 | 2014-04-24 00:31:48 -0700 | [diff] [blame] | 154 | |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 155 | CHECK_STARTUP_PROGRESS(variax->startup_progress, |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 156 | VARIAX_STARTUP_WORKQUEUE); |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 157 | |
| 158 | /* schedule work for global work queue: */ |
| 159 | schedule_work(&variax->startup_work); |
| 160 | } |
| 161 | |
Stefan Hajnoczi | 323246b | 2012-11-22 20:49:23 +0100 | [diff] [blame] | 162 | static void variax_startup6(struct work_struct *work) |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 163 | { |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 164 | struct usb_line6_variax *variax = |
| 165 | container_of(work, struct usb_line6_variax, startup_work); |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 166 | |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 167 | CHECK_STARTUP_PROGRESS(variax->startup_progress, VARIAX_STARTUP_SETUP); |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 168 | |
| 169 | /* ALSA audio interface: */ |
Takashi Iwai | 85a9339 | 2015-01-19 15:54:00 +0100 | [diff] [blame] | 170 | snd_card_register(variax->line6.card); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | /* |
| 174 | Process a completely received message. |
| 175 | */ |
Chris Rorvick | 01f6b2b | 2015-01-12 12:42:58 -0800 | [diff] [blame] | 176 | static void line6_variax_process_message(struct usb_line6 *line6) |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 177 | { |
Chris Rorvick | 1cad3e8 | 2015-01-12 12:42:57 -0800 | [diff] [blame] | 178 | struct usb_line6_variax *variax = (struct usb_line6_variax *) line6; |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 179 | const unsigned char *buf = variax->line6.buffer_message; |
| 180 | |
Greg Kroah-Hartman | 9cd57f7 | 2009-02-27 22:43:57 -0800 | [diff] [blame] | 181 | switch (buf[0]) { |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 182 | case LINE6_RESET: |
| 183 | dev_info(variax->line6.ifcdev, "VARIAX reset\n"); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 184 | break; |
| 185 | |
| 186 | case LINE6_SYSEX_BEGIN: |
Stefan Hajnoczi | 323246b | 2012-11-22 20:49:23 +0100 | [diff] [blame] | 187 | if (memcmp(buf + 1, variax_init_version + 1, |
| 188 | sizeof(variax_init_version) - 1) == 0) { |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 189 | variax_startup3(variax); |
| 190 | } else if (memcmp(buf + 1, variax_init_done + 1, |
| 191 | sizeof(variax_init_done) - 1) == 0) { |
| 192 | /* notify of complete initialization: */ |
| 193 | variax_startup4((unsigned long)variax); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 194 | } |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 195 | break; |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 196 | } |
| 197 | } |
| 198 | |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 199 | /* |
| 200 | Variax destructor. |
| 201 | */ |
Takashi Iwai | f66fd99 | 2015-01-25 18:22:58 +0100 | [diff] [blame] | 202 | static void line6_variax_disconnect(struct usb_line6 *line6) |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 203 | { |
Takashi Iwai | f66fd99 | 2015-01-25 18:22:58 +0100 | [diff] [blame] | 204 | struct usb_line6_variax *variax = (struct usb_line6_variax *)line6; |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 205 | |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 206 | del_timer(&variax->startup_timer1); |
| 207 | del_timer(&variax->startup_timer2); |
| 208 | cancel_work_sync(&variax->startup_work); |
| 209 | |
Greg Kroah-Hartman | 9cd57f7 | 2009-02-27 22:43:57 -0800 | [diff] [blame] | 210 | kfree(variax->buffer_activate); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 211 | } |
| 212 | |
| 213 | /* |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 214 | Try to init workbench device. |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 215 | */ |
Takashi Iwai | f66fd99 | 2015-01-25 18:22:58 +0100 | [diff] [blame] | 216 | static int variax_init(struct usb_line6 *line6, |
| 217 | const struct usb_device_id *id) |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 218 | { |
Chris Rorvick | a221dd4 | 2015-01-12 12:42:56 -0800 | [diff] [blame] | 219 | struct usb_line6_variax *variax = (struct usb_line6_variax *) line6; |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 220 | int err; |
| 221 | |
Chris Rorvick | 01f6b2b | 2015-01-12 12:42:58 -0800 | [diff] [blame] | 222 | line6->process_message = line6_variax_process_message; |
Chris Rorvick | a46c467 | 2015-01-12 12:42:59 -0800 | [diff] [blame] | 223 | line6->disconnect = line6_variax_disconnect; |
Chris Rorvick | 01f6b2b | 2015-01-12 12:42:58 -0800 | [diff] [blame] | 224 | |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 225 | init_timer(&variax->startup_timer1); |
| 226 | init_timer(&variax->startup_timer2); |
Stefan Hajnoczi | 323246b | 2012-11-22 20:49:23 +0100 | [diff] [blame] | 227 | INIT_WORK(&variax->startup_work, variax_startup6); |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 228 | |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 229 | /* initialize USB buffers: */ |
Julia Lawall | 94002c0 | 2010-05-15 23:21:43 +0200 | [diff] [blame] | 230 | variax->buffer_activate = kmemdup(variax_activate, |
| 231 | sizeof(variax_activate), GFP_KERNEL); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 232 | |
Takashi Iwai | a019f5e | 2015-01-19 15:05:10 +0100 | [diff] [blame] | 233 | if (variax->buffer_activate == NULL) |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 234 | return -ENOMEM; |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 235 | |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 236 | /* initialize MIDI subsystem: */ |
Greg Kroah-Hartman | 9cd57f7 | 2009-02-27 22:43:57 -0800 | [diff] [blame] | 237 | err = line6_init_midi(&variax->line6); |
Greg Kroah-Hartman | 027360c | 2010-09-21 16:58:00 -0700 | [diff] [blame] | 238 | if (err < 0) |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 239 | return err; |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 240 | |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 241 | /* initiate startup procedure: */ |
| 242 | variax_startup1(variax); |
| 243 | return 0; |
| 244 | } |
| 245 | |
Takashi Iwai | ccddbe4 | 2015-01-15 08:22:31 +0100 | [diff] [blame] | 246 | #define LINE6_DEVICE(prod) USB_DEVICE(0x0e41, prod) |
| 247 | #define LINE6_IF_NUM(prod, n) USB_DEVICE_INTERFACE_NUMBER(0x0e41, prod, n) |
| 248 | |
| 249 | /* table of devices that work with this driver */ |
| 250 | static const struct usb_device_id variax_id_table[] = { |
| 251 | { LINE6_IF_NUM(0x4650, 1), .driver_info = LINE6_PODXTLIVE_VARIAX }, |
| 252 | { LINE6_DEVICE(0x534d), .driver_info = LINE6_VARIAX }, |
| 253 | {} |
| 254 | }; |
| 255 | |
| 256 | MODULE_DEVICE_TABLE(usb, variax_id_table); |
| 257 | |
| 258 | static const struct line6_properties variax_properties_table[] = { |
| 259 | [LINE6_PODXTLIVE_VARIAX] = { |
| 260 | .id = "PODxtLive", |
| 261 | .name = "PODxt Live", |
Takashi Iwai | 72f18d0 | 2015-01-28 15:03:31 +0100 | [diff] [blame] | 262 | .capabilities = LINE6_CAP_CONTROL, |
Takashi Iwai | ccddbe4 | 2015-01-15 08:22:31 +0100 | [diff] [blame] | 263 | .altsetting = 1, |
| 264 | .ep_ctrl_r = 0x86, |
| 265 | .ep_ctrl_w = 0x05, |
| 266 | .ep_audio_r = 0x82, |
| 267 | .ep_audio_w = 0x01, |
| 268 | }, |
| 269 | [LINE6_VARIAX] = { |
| 270 | .id = "Variax", |
| 271 | .name = "Variax Workbench", |
| 272 | .capabilities = LINE6_CAP_CONTROL, |
| 273 | .altsetting = 1, |
| 274 | .ep_ctrl_r = 0x82, |
| 275 | .ep_ctrl_w = 0x01, |
| 276 | /* no audio channel */ |
| 277 | } |
| 278 | }; |
| 279 | |
| 280 | /* |
| 281 | Probe USB device. |
| 282 | */ |
| 283 | static int variax_probe(struct usb_interface *interface, |
| 284 | const struct usb_device_id *id) |
| 285 | { |
Chris Rorvick | 12865ca | 2015-02-07 10:43:19 -0600 | [diff] [blame] | 286 | return line6_probe(interface, id, "Line6-Variax", |
Takashi Iwai | 85a9339 | 2015-01-19 15:54:00 +0100 | [diff] [blame] | 287 | &variax_properties_table[id->driver_info], |
Takashi Iwai | aca514b | 2015-01-25 18:36:29 +0100 | [diff] [blame] | 288 | variax_init, sizeof(struct usb_line6_variax)); |
Takashi Iwai | ccddbe4 | 2015-01-15 08:22:31 +0100 | [diff] [blame] | 289 | } |
| 290 | |
| 291 | static struct usb_driver variax_driver = { |
| 292 | .name = KBUILD_MODNAME, |
| 293 | .probe = variax_probe, |
| 294 | .disconnect = line6_disconnect, |
| 295 | #ifdef CONFIG_PM |
| 296 | .suspend = line6_suspend, |
| 297 | .resume = line6_resume, |
| 298 | .reset_resume = line6_resume, |
| 299 | #endif |
| 300 | .id_table = variax_id_table, |
| 301 | }; |
| 302 | |
| 303 | module_usb_driver(variax_driver); |
| 304 | |
| 305 | MODULE_DESCRIPTION("Vairax Workbench USB driver"); |
| 306 | MODULE_LICENSE("GPL"); |