2009-02-28 03:43:04 +00:00
|
|
|
/*
|
2010-08-22 23:08:25 +00:00
|
|
|
* Line6 Linux USB driver - 0.9.1beta
|
2009-02-28 03:43:04 +00:00
|
|
|
*
|
2010-08-11 23:35:30 +00:00
|
|
|
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
|
2009-02-28 03:43:04 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation, version 2.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/module.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 08:04:11 +00:00
|
|
|
#include <linux/slab.h>
|
2009-02-28 03:43:04 +00:00
|
|
|
#include <linux/usb.h>
|
|
|
|
|
|
|
|
#include "audio.h"
|
|
|
|
#include "capture.h"
|
2010-08-11 23:35:30 +00:00
|
|
|
#include "driver.h"
|
2009-02-28 03:43:04 +00:00
|
|
|
#include "midi.h"
|
|
|
|
#include "playback.h"
|
|
|
|
#include "pod.h"
|
2011-11-23 08:20:42 +00:00
|
|
|
#include "podhd.h"
|
2009-02-28 03:43:04 +00:00
|
|
|
#include "revision.h"
|
|
|
|
#include "toneport.h"
|
|
|
|
#include "usbdefs.h"
|
|
|
|
#include "variax.h"
|
|
|
|
|
|
|
|
#define DRIVER_AUTHOR "Markus Grabner <grabner@icg.tugraz.at>"
|
|
|
|
#define DRIVER_DESC "Line6 USB Driver"
|
2010-08-22 23:08:25 +00:00
|
|
|
#define DRIVER_VERSION "0.9.1beta" DRIVER_REVISION
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2015-01-12 20:42:43 +00:00
|
|
|
#define LINE6_DEVICE(prod) USB_DEVICE(0x0e41, prod)
|
2015-01-12 20:42:48 +00:00
|
|
|
#define LINE6_IF_NUM(prod, n) USB_DEVICE_INTERFACE_NUMBER(0x0e41, prod, n)
|
2015-01-12 20:42:39 +00:00
|
|
|
|
2009-02-28 03:43:04 +00:00
|
|
|
/* table of devices that work with this driver */
|
2010-01-09 23:18:34 +00:00
|
|
|
static const struct usb_device_id line6_id_table[] = {
|
2015-01-12 20:42:43 +00:00
|
|
|
{ LINE6_DEVICE(0x4250), .driver_info = LINE6_BASSPODXT },
|
|
|
|
{ LINE6_DEVICE(0x4642), .driver_info = LINE6_BASSPODXTLIVE },
|
|
|
|
{ LINE6_DEVICE(0x4252), .driver_info = LINE6_BASSPODXTPRO },
|
|
|
|
{ LINE6_DEVICE(0x4750), .driver_info = LINE6_GUITARPORT },
|
2015-01-12 20:42:50 +00:00
|
|
|
{ LINE6_IF_NUM(0x5051, 1), .driver_info = LINE6_POCKETPOD },
|
2015-01-12 20:42:43 +00:00
|
|
|
{ LINE6_DEVICE(0x5057), .driver_info = LINE6_PODHD300 },
|
|
|
|
{ LINE6_DEVICE(0x5058), .driver_info = LINE6_PODHD400 },
|
2015-01-12 20:42:49 +00:00
|
|
|
{ LINE6_IF_NUM(0x414D, 0), .driver_info = LINE6_PODHD500_0 },
|
|
|
|
{ LINE6_IF_NUM(0x414D, 1), .driver_info = LINE6_PODHD500_1 },
|
2015-01-12 20:42:43 +00:00
|
|
|
{ LINE6_DEVICE(0x4153), .driver_info = LINE6_PODSTUDIO_GX },
|
|
|
|
{ LINE6_DEVICE(0x4150), .driver_info = LINE6_PODSTUDIO_UX1 },
|
2015-01-12 20:42:51 +00:00
|
|
|
{ LINE6_IF_NUM(0x4151, 0), .driver_info = LINE6_PODSTUDIO_UX2 },
|
2015-01-12 20:42:43 +00:00
|
|
|
{ LINE6_DEVICE(0x5044), .driver_info = LINE6_PODXT },
|
2015-01-12 20:42:48 +00:00
|
|
|
{ LINE6_IF_NUM(0x4650, 0), .driver_info = LINE6_PODXTLIVE_POD },
|
|
|
|
{ LINE6_IF_NUM(0x4650, 1), .driver_info = LINE6_PODXTLIVE_VARIAX },
|
2015-01-12 20:42:43 +00:00
|
|
|
{ LINE6_DEVICE(0x5050), .driver_info = LINE6_PODXTPRO },
|
|
|
|
{ LINE6_DEVICE(0x4147), .driver_info = LINE6_TONEPORT_GX },
|
|
|
|
{ LINE6_DEVICE(0x4141), .driver_info = LINE6_TONEPORT_UX1 },
|
2015-01-12 20:42:51 +00:00
|
|
|
{ LINE6_IF_NUM(0x4142, 0), .driver_info = LINE6_TONEPORT_UX2 },
|
2015-01-12 20:42:43 +00:00
|
|
|
{ LINE6_DEVICE(0x534d), .driver_info = LINE6_VARIAX },
|
2015-01-12 20:42:39 +00:00
|
|
|
{}
|
2009-02-28 03:43:04 +00:00
|
|
|
};
|
2010-08-22 23:08:25 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
MODULE_DEVICE_TABLE(usb, line6_id_table);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2014-03-17 02:34:41 +00:00
|
|
|
static const struct line6_properties line6_properties_table[] = {
|
2015-01-12 20:42:46 +00:00
|
|
|
[LINE6_BASSPODXT] = {
|
|
|
|
.id = "BassPODxt",
|
|
|
|
.name = "BassPODxt",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 5,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x84,
|
|
|
|
.ep_ctrl_w = 0x03,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_BASSPODXTLIVE] = {
|
|
|
|
.id = "BassPODxtLive",
|
|
|
|
.name = "BassPODxt Live",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 1,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x84,
|
|
|
|
.ep_ctrl_w = 0x03,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_BASSPODXTPRO] = {
|
|
|
|
.id = "BassPODxtPro",
|
|
|
|
.name = "BassPODxt Pro",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 5,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x84,
|
|
|
|
.ep_ctrl_w = 0x03,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_GUITARPORT] = {
|
|
|
|
.id = "GuitarPort",
|
|
|
|
.name = "GuitarPort",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_PCM,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 2, /* 1..4 seem to be ok */
|
2015-01-12 20:42:53 +00:00
|
|
|
/* no control channel */
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_POCKETPOD] = {
|
|
|
|
.id = "PocketPOD",
|
|
|
|
.name = "Pocket POD",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 0,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x82,
|
|
|
|
.ep_ctrl_w = 0x02,
|
2015-01-12 20:42:55 +00:00
|
|
|
/* no audio channel */
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_PODHD300] = {
|
|
|
|
.id = "PODHD300",
|
|
|
|
.name = "POD HD300",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 5,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x84,
|
|
|
|
.ep_ctrl_w = 0x03,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_PODHD400] = {
|
|
|
|
.id = "PODHD400",
|
|
|
|
.name = "POD HD400",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 5,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x84,
|
|
|
|
.ep_ctrl_w = 0x03,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
2015-01-12 20:42:49 +00:00
|
|
|
[LINE6_PODHD500_0] = {
|
|
|
|
.id = "PODHD500",
|
|
|
|
.name = "POD HD500",
|
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 1,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x81,
|
|
|
|
.ep_ctrl_w = 0x01,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x86,
|
|
|
|
.ep_audio_w = 0x02,
|
2015-01-12 20:42:49 +00:00
|
|
|
},
|
|
|
|
[LINE6_PODHD500_1] = {
|
2015-01-12 20:42:46 +00:00
|
|
|
.id = "PODHD500",
|
|
|
|
.name = "POD HD500",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 1,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x81,
|
|
|
|
.ep_ctrl_w = 0x01,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x86,
|
|
|
|
.ep_audio_w = 0x02,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_PODSTUDIO_GX] = {
|
|
|
|
.id = "PODStudioGX",
|
|
|
|
.name = "POD Studio GX",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_PCM,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 2, /* 1..4 seem to be ok */
|
2015-01-12 20:42:53 +00:00
|
|
|
/* no control channel */
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_PODSTUDIO_UX1] = {
|
|
|
|
.id = "PODStudioUX1",
|
|
|
|
.name = "POD Studio UX1",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_PCM,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 2, /* 1..4 seem to be ok */
|
2015-01-12 20:42:53 +00:00
|
|
|
/* no control channel */
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_PODSTUDIO_UX2] = {
|
|
|
|
.id = "PODStudioUX2",
|
|
|
|
.name = "POD Studio UX2",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_PCM,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 2, /* defaults to 44.1kHz, 16-bit */
|
2015-01-12 20:42:53 +00:00
|
|
|
/* no control channel */
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_PODXT] = {
|
|
|
|
.id = "PODxt",
|
|
|
|
.name = "PODxt",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 5,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x84,
|
|
|
|
.ep_ctrl_w = 0x03,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
2015-01-12 20:42:48 +00:00
|
|
|
[LINE6_PODXTLIVE_POD] = {
|
|
|
|
.id = "PODxtLive",
|
|
|
|
.name = "PODxt Live",
|
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 1,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x84,
|
|
|
|
.ep_ctrl_w = 0x03,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:48 +00:00
|
|
|
},
|
|
|
|
[LINE6_PODXTLIVE_VARIAX] = {
|
2015-01-12 20:42:46 +00:00
|
|
|
.id = "PODxtLive",
|
|
|
|
.name = "PODxt Live",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 1,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x86,
|
|
|
|
.ep_ctrl_w = 0x05,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_PODXTPRO] = {
|
|
|
|
.id = "PODxtPro",
|
|
|
|
.name = "PODxt Pro",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL
|
|
|
|
| LINE6_CAP_PCM
|
|
|
|
| LINE6_CAP_HWMON,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 5,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x84,
|
|
|
|
.ep_ctrl_w = 0x03,
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_TONEPORT_GX] = {
|
|
|
|
.id = "TonePortGX",
|
|
|
|
.name = "TonePort GX",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_PCM,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 2, /* 1..4 seem to be ok */
|
2015-01-12 20:42:53 +00:00
|
|
|
/* no control channel */
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_TONEPORT_UX1] = {
|
|
|
|
.id = "TonePortUX1",
|
|
|
|
.name = "TonePort UX1",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_PCM,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 2, /* 1..4 seem to be ok */
|
2015-01-12 20:42:53 +00:00
|
|
|
/* no control channel */
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_TONEPORT_UX2] = {
|
|
|
|
.id = "TonePortUX2",
|
|
|
|
.name = "TonePort UX2",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_PCM,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 2, /* defaults to 44.1kHz, 16-bit */
|
2015-01-12 20:42:53 +00:00
|
|
|
/* no control channel */
|
2015-01-12 20:42:55 +00:00
|
|
|
.ep_audio_r = 0x82,
|
|
|
|
.ep_audio_w = 0x01,
|
2015-01-12 20:42:46 +00:00
|
|
|
},
|
|
|
|
[LINE6_VARIAX] = {
|
|
|
|
.id = "Variax",
|
|
|
|
.name = "Variax Workbench",
|
2015-01-12 20:42:47 +00:00
|
|
|
.capabilities = LINE6_CAP_CONTROL,
|
2015-01-12 20:42:52 +00:00
|
|
|
.altsetting = 1,
|
2015-01-12 20:42:53 +00:00
|
|
|
.ep_ctrl_r = 0x82,
|
|
|
|
.ep_ctrl_w = 0x01,
|
2015-01-12 20:42:55 +00:00
|
|
|
/* no audio channel */
|
2015-01-12 20:42:46 +00:00
|
|
|
}
|
2009-02-28 03:43:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
This is Line6's MIDI manufacturer ID.
|
|
|
|
*/
|
2010-08-11 23:35:30 +00:00
|
|
|
const unsigned char line6_midi_id[] = {
|
|
|
|
0x00, 0x01, 0x0c
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
Code to request version of POD, Variax interface
|
|
|
|
(and maybe other devices).
|
|
|
|
*/
|
2012-04-23 23:09:56 +00:00
|
|
|
static const char line6_request_version[] = {
|
2010-08-11 23:35:30 +00:00
|
|
|
0xf0, 0x7e, 0x7f, 0x06, 0x01, 0xf7
|
|
|
|
};
|
|
|
|
|
2009-02-28 03:43:04 +00:00
|
|
|
/**
|
|
|
|
Class for asynchronous messages.
|
|
|
|
*/
|
2009-02-28 06:42:18 +00:00
|
|
|
struct message {
|
2009-02-28 03:43:04 +00:00
|
|
|
struct usb_line6 *line6;
|
|
|
|
const char *buffer;
|
|
|
|
int size;
|
|
|
|
int done;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
Forward declarations.
|
|
|
|
*/
|
2009-02-28 04:28:04 +00:00
|
|
|
static void line6_data_received(struct urb *urb);
|
2009-02-28 06:42:18 +00:00
|
|
|
static int line6_send_raw_message_async_part(struct message *msg,
|
|
|
|
struct urb *urb);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Start to listen on endpoint.
|
|
|
|
*/
|
|
|
|
static int line6_start_listen(struct usb_line6 *line6)
|
|
|
|
{
|
2010-08-11 23:35:30 +00:00
|
|
|
int err;
|
2014-03-24 22:46:31 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
usb_fill_int_urb(line6->urb_listen, line6->usbdev,
|
2015-01-12 20:42:53 +00:00
|
|
|
usb_rcvintpipe(line6->usbdev, line6->properties->ep_ctrl_r),
|
|
|
|
line6->buffer_listen, LINE6_BUFSIZE_LISTEN,
|
|
|
|
line6_data_received, line6, line6->interval);
|
2009-02-28 03:43:04 +00:00
|
|
|
line6->urb_listen->actual_length = 0;
|
2010-08-22 23:08:25 +00:00
|
|
|
err = usb_submit_urb(line6->urb_listen, GFP_ATOMIC);
|
2010-08-11 23:35:30 +00:00
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Stop listening on endpoint.
|
|
|
|
*/
|
|
|
|
static void line6_stop_listen(struct usb_line6 *line6)
|
|
|
|
{
|
|
|
|
usb_kill_urb(line6->urb_listen);
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2010-08-11 23:35:30 +00:00
|
|
|
Send raw message in pieces of wMaxPacketSize bytes.
|
2009-02-28 03:43:04 +00:00
|
|
|
*/
|
2009-02-28 06:42:18 +00:00
|
|
|
int line6_send_raw_message(struct usb_line6 *line6, const char *buffer,
|
|
|
|
int size)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
|
|
|
int i, done = 0;
|
|
|
|
|
2010-08-11 23:35:30 +00:00
|
|
|
for (i = 0; i < size; i += line6->max_packet_size) {
|
|
|
|
int partial;
|
2009-02-28 03:43:04 +00:00
|
|
|
const char *frag_buf = buffer + i;
|
|
|
|
int frag_size = min(line6->max_packet_size, size - i);
|
2009-02-28 06:42:18 +00:00
|
|
|
int retval;
|
|
|
|
|
|
|
|
retval = usb_interrupt_msg(line6->usbdev,
|
2014-03-17 02:34:41 +00:00
|
|
|
usb_sndintpipe(line6->usbdev,
|
2015-01-12 20:42:53 +00:00
|
|
|
line6->properties->ep_ctrl_w),
|
2014-03-17 02:34:41 +00:00
|
|
|
(char *)frag_buf, frag_size,
|
|
|
|
&partial, LINE6_TIMEOUT * HZ);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (retval) {
|
|
|
|
dev_err(line6->ifcdev,
|
|
|
|
"usb_interrupt_msg failed (%d)\n", retval);
|
2009-02-28 03:43:04 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-08-11 23:35:30 +00:00
|
|
|
done += frag_size;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return done;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Notification of completion of asynchronous request transmission.
|
|
|
|
*/
|
2009-02-28 04:28:04 +00:00
|
|
|
static void line6_async_request_sent(struct urb *urb)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
|
|
|
struct message *msg = (struct message *)urb->context;
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (msg->done >= msg->size) {
|
2009-02-28 03:43:04 +00:00
|
|
|
usb_free_urb(urb);
|
|
|
|
kfree(msg);
|
2009-02-28 06:42:18 +00:00
|
|
|
} else
|
2009-02-28 03:43:04 +00:00
|
|
|
line6_send_raw_message_async_part(msg, urb);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Asynchronously send part of a raw message.
|
|
|
|
*/
|
2009-02-28 06:42:18 +00:00
|
|
|
static int line6_send_raw_message_async_part(struct message *msg,
|
|
|
|
struct urb *urb)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
|
|
|
int retval;
|
|
|
|
struct usb_line6 *line6 = msg->line6;
|
|
|
|
int done = msg->done;
|
|
|
|
int bytes = min(msg->size - done, line6->max_packet_size);
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
usb_fill_int_urb(urb, line6->usbdev,
|
2015-01-12 20:42:53 +00:00
|
|
|
usb_sndintpipe(line6->usbdev, line6->properties->ep_ctrl_w),
|
|
|
|
(char *)msg->buffer + done, bytes,
|
|
|
|
line6_async_request_sent, msg, line6->interval);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
|
|
|
msg->done += bytes;
|
|
|
|
retval = usb_submit_urb(urb, GFP_ATOMIC);
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (retval < 0) {
|
|
|
|
dev_err(line6->ifcdev, "%s: usb_submit_urb failed (%d)\n",
|
|
|
|
__func__, retval);
|
2009-02-28 03:43:04 +00:00
|
|
|
usb_free_urb(urb);
|
|
|
|
kfree(msg);
|
2013-10-19 16:31:22 +00:00
|
|
|
return retval;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-08-11 23:35:30 +00:00
|
|
|
/*
|
|
|
|
Setup and start timer.
|
|
|
|
*/
|
|
|
|
void line6_start_timer(struct timer_list *timer, unsigned int msecs,
|
2014-02-27 15:35:18 +00:00
|
|
|
void (*function)(unsigned long), unsigned long data)
|
2010-08-11 23:35:30 +00:00
|
|
|
{
|
|
|
|
setup_timer(timer, function, data);
|
2015-01-19 10:44:40 +00:00
|
|
|
mod_timer(timer, jiffies + msecs * HZ / 1000);
|
2010-08-11 23:35:30 +00:00
|
|
|
}
|
|
|
|
|
2009-02-28 03:43:04 +00:00
|
|
|
/*
|
|
|
|
Asynchronously send raw message.
|
|
|
|
*/
|
2009-02-28 06:42:18 +00:00
|
|
|
int line6_send_raw_message_async(struct usb_line6 *line6, const char *buffer,
|
|
|
|
int size)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
|
|
|
struct message *msg;
|
|
|
|
struct urb *urb;
|
|
|
|
|
|
|
|
/* create message: */
|
|
|
|
msg = kmalloc(sizeof(struct message), GFP_ATOMIC);
|
2013-02-11 17:41:29 +00:00
|
|
|
if (msg == NULL)
|
2009-02-28 03:43:04 +00:00
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
/* create URB: */
|
|
|
|
urb = usb_alloc_urb(0, GFP_ATOMIC);
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (urb == NULL) {
|
2009-02-28 03:43:04 +00:00
|
|
|
kfree(msg);
|
|
|
|
dev_err(line6->ifcdev, "Out of memory\n");
|
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set message data: */
|
|
|
|
msg->line6 = line6;
|
|
|
|
msg->buffer = buffer;
|
|
|
|
msg->size = size;
|
|
|
|
msg->done = 0;
|
|
|
|
|
|
|
|
/* start sending: */
|
|
|
|
return line6_send_raw_message_async_part(msg, urb);
|
|
|
|
}
|
|
|
|
|
2010-08-11 23:35:30 +00:00
|
|
|
/*
|
|
|
|
Send asynchronous device version request.
|
|
|
|
*/
|
|
|
|
int line6_version_request_async(struct usb_line6 *line6)
|
|
|
|
{
|
2012-04-23 23:09:56 +00:00
|
|
|
char *buffer;
|
|
|
|
int retval;
|
|
|
|
|
2012-12-03 13:20:25 +00:00
|
|
|
buffer = kmemdup(line6_request_version,
|
|
|
|
sizeof(line6_request_version), GFP_ATOMIC);
|
2012-04-23 23:09:56 +00:00
|
|
|
if (buffer == NULL) {
|
|
|
|
dev_err(line6->ifcdev, "Out of memory");
|
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
retval = line6_send_raw_message_async(line6, buffer,
|
|
|
|
sizeof(line6_request_version));
|
|
|
|
kfree(buffer);
|
|
|
|
return retval;
|
2010-08-11 23:35:30 +00:00
|
|
|
}
|
|
|
|
|
2009-02-28 03:43:04 +00:00
|
|
|
/*
|
|
|
|
Send sysex message in pieces of wMaxPacketSize bytes.
|
|
|
|
*/
|
2009-02-28 06:42:18 +00:00
|
|
|
int line6_send_sysex_message(struct usb_line6 *line6, const char *buffer,
|
|
|
|
int size)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
2010-08-22 23:08:25 +00:00
|
|
|
return line6_send_raw_message(line6, buffer,
|
|
|
|
size + SYSEX_EXTRA_SIZE) -
|
|
|
|
SYSEX_EXTRA_SIZE;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Allocate buffer for sysex message and prepare header.
|
|
|
|
@param code sysex message code
|
|
|
|
@param size number of bytes between code and sysex end
|
|
|
|
*/
|
2009-02-28 06:42:18 +00:00
|
|
|
char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2,
|
|
|
|
int size)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
2010-08-11 23:35:30 +00:00
|
|
|
char *buffer = kmalloc(size + SYSEX_EXTRA_SIZE, GFP_ATOMIC);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2013-02-11 17:41:29 +00:00
|
|
|
if (!buffer)
|
2009-02-28 04:49:46 +00:00
|
|
|
return NULL;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
|
|
|
buffer[0] = LINE6_SYSEX_BEGIN;
|
|
|
|
memcpy(buffer + 1, line6_midi_id, sizeof(line6_midi_id));
|
|
|
|
buffer[sizeof(line6_midi_id) + 1] = code1;
|
|
|
|
buffer[sizeof(line6_midi_id) + 2] = code2;
|
|
|
|
buffer[sizeof(line6_midi_id) + 3 + size] = LINE6_SYSEX_END;
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Notification of data received from the Line6 device.
|
|
|
|
*/
|
2009-02-28 04:28:04 +00:00
|
|
|
static void line6_data_received(struct urb *urb)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
|
|
|
struct usb_line6 *line6 = (struct usb_line6 *)urb->context;
|
2013-01-11 22:08:09 +00:00
|
|
|
struct midi_buffer *mb = &line6->line6midi->midibuf_in;
|
2009-02-28 03:43:04 +00:00
|
|
|
int done;
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (urb->status == -ESHUTDOWN)
|
2009-02-28 03:43:04 +00:00
|
|
|
return;
|
|
|
|
|
2010-08-22 23:08:25 +00:00
|
|
|
done =
|
|
|
|
line6_midibuf_write(mb, urb->transfer_buffer, urb->actual_length);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (done < urb->actual_length) {
|
2010-08-11 23:35:30 +00:00
|
|
|
line6_midibuf_ignore(mb, done);
|
2012-11-11 12:52:24 +00:00
|
|
|
dev_dbg(line6->ifcdev, "%d %d buffer overflow - message skipped\n",
|
|
|
|
done, urb->actual_length);
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
for (;;) {
|
2010-08-22 23:08:25 +00:00
|
|
|
done =
|
|
|
|
line6_midibuf_read(mb, line6->buffer_message,
|
|
|
|
LINE6_MESSAGE_MAXLEN);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (done == 0)
|
2009-02-28 03:43:04 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
line6->message_length = done;
|
|
|
|
line6_midi_receive(line6, line6->buffer_message, done);
|
|
|
|
|
2015-01-12 20:42:58 +00:00
|
|
|
if (line6->process_message)
|
|
|
|
line6->process_message(line6);
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
line6_start_listen(line6);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Send channel number (i.e., switch to a different sound).
|
|
|
|
*/
|
2012-06-27 19:25:58 +00:00
|
|
|
int line6_send_program(struct usb_line6 *line6, u8 value)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
2010-08-11 23:35:30 +00:00
|
|
|
int retval;
|
2009-02-28 03:43:04 +00:00
|
|
|
unsigned char *buffer;
|
2010-08-11 23:35:30 +00:00
|
|
|
int partial;
|
|
|
|
|
|
|
|
buffer = kmalloc(2, GFP_KERNEL);
|
2013-02-11 17:41:29 +00:00
|
|
|
if (!buffer)
|
2009-02-28 03:43:04 +00:00
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
buffer[0] = LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST;
|
|
|
|
buffer[1] = value;
|
|
|
|
|
2010-08-11 23:35:30 +00:00
|
|
|
retval = usb_interrupt_msg(line6->usbdev,
|
|
|
|
usb_sndintpipe(line6->usbdev,
|
2015-01-12 20:42:53 +00:00
|
|
|
line6->properties->ep_ctrl_w),
|
2010-08-11 23:35:30 +00:00
|
|
|
buffer, 2, &partial, LINE6_TIMEOUT * HZ);
|
|
|
|
|
|
|
|
if (retval)
|
2010-08-22 23:08:25 +00:00
|
|
|
dev_err(line6->ifcdev, "usb_interrupt_msg failed (%d)\n",
|
|
|
|
retval);
|
2010-08-11 23:35:30 +00:00
|
|
|
|
|
|
|
kfree(buffer);
|
|
|
|
return retval;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Transmit Line6 control parameter.
|
|
|
|
*/
|
2012-06-27 19:25:55 +00:00
|
|
|
int line6_transmit_parameter(struct usb_line6 *line6, int param, u8 value)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
2010-08-11 23:35:30 +00:00
|
|
|
int retval;
|
2009-02-28 03:43:04 +00:00
|
|
|
unsigned char *buffer;
|
2010-08-11 23:35:30 +00:00
|
|
|
int partial;
|
|
|
|
|
|
|
|
buffer = kmalloc(3, GFP_KERNEL);
|
2013-02-11 17:41:29 +00:00
|
|
|
if (!buffer)
|
2009-02-28 03:43:04 +00:00
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
buffer[0] = LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST;
|
|
|
|
buffer[1] = param;
|
|
|
|
buffer[2] = value;
|
|
|
|
|
2010-08-11 23:35:30 +00:00
|
|
|
retval = usb_interrupt_msg(line6->usbdev,
|
2010-08-22 23:08:25 +00:00
|
|
|
usb_sndintpipe(line6->usbdev,
|
2015-01-12 20:42:53 +00:00
|
|
|
line6->properties->ep_ctrl_w),
|
2010-08-11 23:35:30 +00:00
|
|
|
buffer, 3, &partial, LINE6_TIMEOUT * HZ);
|
|
|
|
|
|
|
|
if (retval)
|
2010-08-22 23:08:25 +00:00
|
|
|
dev_err(line6->ifcdev, "usb_interrupt_msg failed (%d)\n",
|
|
|
|
retval);
|
2010-08-11 23:35:30 +00:00
|
|
|
|
|
|
|
kfree(buffer);
|
|
|
|
return retval;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Read data from device.
|
|
|
|
*/
|
2010-08-22 23:08:25 +00:00
|
|
|
int line6_read_data(struct usb_line6 *line6, int address, void *data,
|
|
|
|
size_t datalen)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
|
|
|
struct usb_device *usbdev = line6->usbdev;
|
|
|
|
int ret;
|
|
|
|
unsigned char len;
|
|
|
|
|
|
|
|
/* query the serial number: */
|
|
|
|
ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67,
|
2010-08-11 23:35:30 +00:00
|
|
|
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
|
|
|
|
(datalen << 8) | 0x21, address,
|
|
|
|
NULL, 0, LINE6_TIMEOUT * HZ);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (ret < 0) {
|
2009-02-28 03:43:04 +00:00
|
|
|
dev_err(line6->ifcdev, "read request failed (error %d)\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-01-11 22:08:10 +00:00
|
|
|
/* Wait for data length. We'll get 0xff until length arrives. */
|
2009-02-28 03:43:04 +00:00
|
|
|
do {
|
|
|
|
ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67,
|
2009-02-28 06:42:18 +00:00
|
|
|
USB_TYPE_VENDOR | USB_RECIP_DEVICE |
|
|
|
|
USB_DIR_IN,
|
|
|
|
0x0012, 0x0000, &len, 1,
|
|
|
|
LINE6_TIMEOUT * HZ);
|
|
|
|
if (ret < 0) {
|
|
|
|
dev_err(line6->ifcdev,
|
|
|
|
"receive length failed (error %d)\n", ret);
|
2009-02-28 03:43:04 +00:00
|
|
|
return ret;
|
|
|
|
}
|
2009-09-15 09:29:43 +00:00
|
|
|
} while (len == 0xff);
|
2009-02-28 06:42:18 +00:00
|
|
|
|
|
|
|
if (len != datalen) {
|
|
|
|
/* should be equal or something went wrong */
|
|
|
|
dev_err(line6->ifcdev,
|
|
|
|
"length mismatch (expected %d, got %d)\n",
|
|
|
|
(int)datalen, (int)len);
|
2009-02-28 03:43:04 +00:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* receive the result: */
|
|
|
|
ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67,
|
2009-02-28 06:42:18 +00:00
|
|
|
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
|
|
|
|
0x0013, 0x0000, data, datalen,
|
|
|
|
LINE6_TIMEOUT * HZ);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (ret < 0) {
|
2009-02-28 03:43:04 +00:00
|
|
|
dev_err(line6->ifcdev, "read failed (error %d)\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Write data to device.
|
|
|
|
*/
|
2009-02-28 06:42:18 +00:00
|
|
|
int line6_write_data(struct usb_line6 *line6, int address, void *data,
|
|
|
|
size_t datalen)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
|
|
|
struct usb_device *usbdev = line6->usbdev;
|
|
|
|
int ret;
|
|
|
|
unsigned char status;
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67,
|
|
|
|
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
|
|
|
|
0x0022, address, data, datalen,
|
|
|
|
LINE6_TIMEOUT * HZ);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (ret < 0) {
|
|
|
|
dev_err(line6->ifcdev,
|
|
|
|
"write request failed (error %d)\n", ret);
|
2009-02-28 03:43:04 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
do {
|
2009-02-28 06:42:18 +00:00
|
|
|
ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
|
|
|
|
0x67,
|
|
|
|
USB_TYPE_VENDOR | USB_RECIP_DEVICE |
|
|
|
|
USB_DIR_IN,
|
|
|
|
0x0012, 0x0000,
|
|
|
|
&status, 1, LINE6_TIMEOUT * HZ);
|
|
|
|
|
|
|
|
if (ret < 0) {
|
|
|
|
dev_err(line6->ifcdev,
|
|
|
|
"receiving status failed (error %d)\n", ret);
|
2009-02-28 03:43:04 +00:00
|
|
|
return ret;
|
|
|
|
}
|
2010-09-21 23:58:00 +00:00
|
|
|
} while (status == 0xff);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (status != 0) {
|
2009-02-28 03:43:04 +00:00
|
|
|
dev_err(line6->ifcdev, "write failed (error %d)\n", ret);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Read Line6 device serial number.
|
|
|
|
(POD, TonePort, GuitarPort)
|
|
|
|
*/
|
|
|
|
int line6_read_serial_number(struct usb_line6 *line6, int *serial_number)
|
|
|
|
{
|
2010-08-22 23:08:25 +00:00
|
|
|
return line6_read_data(line6, 0x80d0, serial_number,
|
|
|
|
sizeof(*serial_number));
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
No operation (i.e., unsupported).
|
|
|
|
*/
|
2009-02-28 04:25:43 +00:00
|
|
|
ssize_t line6_nop_read(struct device *dev, struct device_attribute *attr,
|
|
|
|
char *buf)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Generic destructor.
|
|
|
|
*/
|
|
|
|
static void line6_destruct(struct usb_interface *interface)
|
|
|
|
{
|
|
|
|
struct usb_line6 *line6;
|
2009-02-28 06:42:18 +00:00
|
|
|
|
|
|
|
if (interface == NULL)
|
|
|
|
return;
|
2009-02-28 03:43:04 +00:00
|
|
|
line6 = usb_get_intfdata(interface);
|
2009-02-28 06:42:18 +00:00
|
|
|
if (line6 == NULL)
|
|
|
|
return;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
|
|
|
/* free buffer memory first: */
|
2009-02-28 06:42:18 +00:00
|
|
|
kfree(line6->buffer_message);
|
|
|
|
kfree(line6->buffer_listen);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
|
|
|
/* then free URBs: */
|
2009-02-28 06:42:18 +00:00
|
|
|
usb_free_urb(line6->urb_listen);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
|
|
|
/* make sure the device isn't destructed twice: */
|
|
|
|
usb_set_intfdata(interface, NULL);
|
|
|
|
|
|
|
|
/* free interface data: */
|
|
|
|
kfree(line6);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Probe USB device.
|
|
|
|
*/
|
2010-08-22 23:08:25 +00:00
|
|
|
static int line6_probe(struct usb_interface *interface,
|
|
|
|
const struct usb_device_id *id)
|
2009-02-28 03:43:04 +00:00
|
|
|
{
|
2015-01-12 20:42:41 +00:00
|
|
|
enum line6_device_type devtype;
|
2011-11-30 08:43:41 +00:00
|
|
|
struct usb_device *usbdev;
|
|
|
|
struct usb_line6 *line6;
|
2009-02-28 03:43:04 +00:00
|
|
|
const struct line6_properties *properties;
|
2015-01-12 20:42:52 +00:00
|
|
|
int interface_number;
|
2009-02-28 03:43:04 +00:00
|
|
|
int size = 0;
|
|
|
|
int ret;
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (interface == NULL)
|
|
|
|
return -ENODEV;
|
2009-02-28 03:43:04 +00:00
|
|
|
usbdev = interface_to_usbdev(interface);
|
2009-02-28 06:42:18 +00:00
|
|
|
if (usbdev == NULL)
|
|
|
|
return -ENODEV;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
|
|
|
/* we don't handle multiple configurations */
|
2010-07-13 11:22:46 +00:00
|
|
|
if (usbdev->descriptor.bNumConfigurations != 1) {
|
|
|
|
ret = -ENODEV;
|
|
|
|
goto err_put;
|
|
|
|
}
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2015-01-12 20:42:41 +00:00
|
|
|
devtype = id->driver_info;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
|
|
|
/* initialize device info: */
|
|
|
|
properties = &line6_properties_table[devtype];
|
|
|
|
dev_info(&interface->dev, "Line6 %s found\n", properties->name);
|
|
|
|
|
|
|
|
/* query interface number */
|
|
|
|
interface_number = interface->cur_altsetting->desc.bInterfaceNumber;
|
|
|
|
|
2015-01-12 20:42:52 +00:00
|
|
|
ret = usb_set_interface(usbdev, interface_number,
|
|
|
|
properties->altsetting);
|
2009-02-28 06:42:18 +00:00
|
|
|
if (ret < 0) {
|
2009-02-28 03:43:04 +00:00
|
|
|
dev_err(&interface->dev, "set_interface failed\n");
|
2010-07-13 11:22:46 +00:00
|
|
|
goto err_put;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
2015-01-12 20:42:42 +00:00
|
|
|
/* initialize device data based on device: */
|
|
|
|
switch (devtype) {
|
|
|
|
case LINE6_BASSPODXT:
|
|
|
|
case LINE6_BASSPODXTLIVE:
|
|
|
|
case LINE6_BASSPODXTPRO:
|
|
|
|
case LINE6_PODXT:
|
|
|
|
case LINE6_PODXTPRO:
|
2009-02-28 03:43:04 +00:00
|
|
|
size = sizeof(struct usb_line6_pod);
|
|
|
|
break;
|
|
|
|
|
2015-01-12 20:42:42 +00:00
|
|
|
case LINE6_PODHD300:
|
|
|
|
case LINE6_PODHD400:
|
2011-11-23 08:20:42 +00:00
|
|
|
size = sizeof(struct usb_line6_podhd);
|
|
|
|
break;
|
|
|
|
|
2015-01-12 20:42:49 +00:00
|
|
|
case LINE6_PODHD500_0:
|
|
|
|
case LINE6_PODHD500_1:
|
2011-12-05 22:51:53 +00:00
|
|
|
size = sizeof(struct usb_line6_podhd);
|
|
|
|
break;
|
|
|
|
|
2015-01-12 20:42:42 +00:00
|
|
|
case LINE6_POCKETPOD:
|
2010-08-11 23:35:30 +00:00
|
|
|
size = sizeof(struct usb_line6_pod);
|
|
|
|
break;
|
|
|
|
|
2015-01-12 20:42:42 +00:00
|
|
|
case LINE6_PODSTUDIO_GX:
|
|
|
|
case LINE6_PODSTUDIO_UX1:
|
|
|
|
case LINE6_PODSTUDIO_UX2:
|
|
|
|
case LINE6_TONEPORT_GX:
|
|
|
|
case LINE6_TONEPORT_UX1:
|
|
|
|
case LINE6_TONEPORT_UX2:
|
|
|
|
case LINE6_GUITARPORT:
|
2009-02-28 03:43:04 +00:00
|
|
|
size = sizeof(struct usb_line6_toneport);
|
|
|
|
break;
|
|
|
|
|
2015-01-12 20:42:48 +00:00
|
|
|
case LINE6_PODXTLIVE_POD:
|
|
|
|
size = sizeof(struct usb_line6_pod);
|
|
|
|
break;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2015-01-12 20:42:48 +00:00
|
|
|
case LINE6_PODXTLIVE_VARIAX:
|
|
|
|
size = sizeof(struct usb_line6_variax);
|
2009-02-28 03:43:04 +00:00
|
|
|
break;
|
|
|
|
|
2015-01-12 20:42:42 +00:00
|
|
|
case LINE6_VARIAX:
|
2009-02-28 03:43:04 +00:00
|
|
|
size = sizeof(struct usb_line6_variax);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
MISSING_CASE;
|
2010-07-13 11:22:46 +00:00
|
|
|
ret = -ENODEV;
|
|
|
|
goto err_put;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (size == 0) {
|
2011-11-30 08:43:41 +00:00
|
|
|
dev_err(&interface->dev,
|
2010-08-22 23:08:25 +00:00
|
|
|
"driver bug: interface data size not set\n");
|
2010-07-13 11:22:46 +00:00
|
|
|
ret = -ENODEV;
|
|
|
|
goto err_put;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
line6 = kzalloc(size, GFP_KERNEL);
|
2009-02-28 06:42:18 +00:00
|
|
|
if (line6 == NULL) {
|
2010-07-13 11:22:46 +00:00
|
|
|
ret = -ENODEV;
|
|
|
|
goto err_put;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* store basic data: */
|
|
|
|
line6->properties = properties;
|
|
|
|
line6->usbdev = usbdev;
|
|
|
|
line6->ifcdev = &interface->dev;
|
2015-01-12 20:42:42 +00:00
|
|
|
line6->type = devtype;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
|
|
|
/* get data from endpoint descriptor (see usb_maxpacket): */
|
|
|
|
{
|
|
|
|
struct usb_host_endpoint *ep;
|
2015-01-12 20:42:53 +00:00
|
|
|
unsigned pipe = usb_rcvintpipe(usbdev, properties->ep_ctrl_r);
|
|
|
|
unsigned epnum = usb_pipeendpoint(pipe);
|
2009-02-28 03:43:04 +00:00
|
|
|
ep = usbdev->ep_in[epnum];
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (ep != NULL) {
|
2009-02-28 03:43:04 +00:00
|
|
|
line6->interval = ep->desc.bInterval;
|
2010-08-22 23:08:25 +00:00
|
|
|
line6->max_packet_size =
|
|
|
|
le16_to_cpu(ep->desc.wMaxPacketSize);
|
2009-02-28 06:42:18 +00:00
|
|
|
} else {
|
2009-02-28 03:43:04 +00:00
|
|
|
line6->interval = LINE6_FALLBACK_INTERVAL;
|
|
|
|
line6->max_packet_size = LINE6_FALLBACK_MAXPACKETSIZE;
|
2010-08-22 23:08:25 +00:00
|
|
|
dev_err(line6->ifcdev,
|
|
|
|
"endpoint not available, using fallback values");
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
usb_set_intfdata(interface, line6);
|
|
|
|
|
2015-01-12 20:42:45 +00:00
|
|
|
if (properties->capabilities & LINE6_CAP_CONTROL) {
|
2009-02-28 03:43:04 +00:00
|
|
|
/* initialize USB buffers: */
|
2010-08-22 23:08:25 +00:00
|
|
|
line6->buffer_listen =
|
|
|
|
kmalloc(LINE6_BUFSIZE_LISTEN, GFP_KERNEL);
|
2009-02-28 06:42:18 +00:00
|
|
|
if (line6->buffer_listen == NULL) {
|
2010-07-13 11:22:46 +00:00
|
|
|
ret = -ENOMEM;
|
|
|
|
goto err_destruct;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
2010-08-22 23:08:25 +00:00
|
|
|
line6->buffer_message =
|
|
|
|
kmalloc(LINE6_MESSAGE_MAXLEN, GFP_KERNEL);
|
2009-02-28 06:42:18 +00:00
|
|
|
if (line6->buffer_message == NULL) {
|
2010-07-13 11:22:46 +00:00
|
|
|
ret = -ENOMEM;
|
|
|
|
goto err_destruct;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
line6->urb_listen = usb_alloc_urb(0, GFP_KERNEL);
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (line6->urb_listen == NULL) {
|
2009-02-28 03:43:04 +00:00
|
|
|
dev_err(&interface->dev, "Out of memory\n");
|
|
|
|
line6_destruct(interface);
|
2010-07-13 11:22:46 +00:00
|
|
|
ret = -ENOMEM;
|
|
|
|
goto err_destruct;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
ret = line6_start_listen(line6);
|
|
|
|
if (ret < 0) {
|
|
|
|
dev_err(&interface->dev, "%s: usb_submit_urb failed\n",
|
|
|
|
__func__);
|
2010-07-13 11:22:46 +00:00
|
|
|
goto err_destruct;
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-12 20:42:42 +00:00
|
|
|
/* initialize device data based on device: */
|
|
|
|
switch (devtype) {
|
|
|
|
case LINE6_BASSPODXT:
|
|
|
|
case LINE6_BASSPODXTLIVE:
|
|
|
|
case LINE6_BASSPODXTPRO:
|
|
|
|
case LINE6_POCKETPOD:
|
|
|
|
case LINE6_PODXT:
|
|
|
|
case LINE6_PODXTPRO:
|
2015-01-12 20:42:56 +00:00
|
|
|
ret = line6_pod_init(interface, line6);
|
2009-02-28 03:43:04 +00:00
|
|
|
break;
|
|
|
|
|
2015-01-12 20:42:42 +00:00
|
|
|
case LINE6_PODHD300:
|
|
|
|
case LINE6_PODHD400:
|
2015-01-12 20:42:49 +00:00
|
|
|
case LINE6_PODHD500_0:
|
|
|
|
case LINE6_PODHD500_1:
|
2015-01-12 20:42:56 +00:00
|
|
|
ret = line6_podhd_init(interface, line6);
|
2011-11-23 08:20:42 +00:00
|
|
|
break;
|
|
|
|
|
2015-01-12 20:42:48 +00:00
|
|
|
case LINE6_PODXTLIVE_POD:
|
2015-01-12 20:42:56 +00:00
|
|
|
ret = line6_pod_init(interface, line6);
|
2015-01-12 20:42:48 +00:00
|
|
|
break;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2015-01-12 20:42:48 +00:00
|
|
|
case LINE6_PODXTLIVE_VARIAX:
|
2015-01-12 20:42:56 +00:00
|
|
|
ret = line6_variax_init(interface, line6);
|
2009-02-28 03:43:04 +00:00
|
|
|
break;
|
|
|
|
|
2015-01-12 20:42:42 +00:00
|
|
|
case LINE6_VARIAX:
|
2015-01-12 20:42:56 +00:00
|
|
|
ret = line6_variax_init(interface, line6);
|
2009-02-28 03:43:04 +00:00
|
|
|
break;
|
|
|
|
|
2015-01-12 20:42:42 +00:00
|
|
|
case LINE6_PODSTUDIO_GX:
|
|
|
|
case LINE6_PODSTUDIO_UX1:
|
|
|
|
case LINE6_PODSTUDIO_UX2:
|
|
|
|
case LINE6_TONEPORT_GX:
|
|
|
|
case LINE6_TONEPORT_UX1:
|
|
|
|
case LINE6_TONEPORT_UX2:
|
|
|
|
case LINE6_GUITARPORT:
|
2015-01-12 20:42:56 +00:00
|
|
|
ret = line6_toneport_init(interface, line6);
|
2009-02-28 03:43:04 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
MISSING_CASE;
|
|
|
|
ret = -ENODEV;
|
|
|
|
}
|
|
|
|
|
2010-07-13 11:22:46 +00:00
|
|
|
if (ret < 0)
|
|
|
|
goto err_destruct;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
ret = sysfs_create_link(&interface->dev.kobj, &usbdev->dev.kobj,
|
|
|
|
"usb_device");
|
2010-07-13 11:22:46 +00:00
|
|
|
if (ret < 0)
|
|
|
|
goto err_destruct;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2010-08-11 23:35:30 +00:00
|
|
|
/* creation of additional special files should go here */
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
dev_info(&interface->dev, "Line6 %s now attached\n",
|
|
|
|
line6->properties->name);
|
2010-08-11 23:35:30 +00:00
|
|
|
|
|
|
|
/* increment reference counters: */
|
|
|
|
usb_get_intf(interface);
|
|
|
|
usb_get_dev(usbdev);
|
|
|
|
|
2010-07-13 11:22:46 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
err_destruct:
|
|
|
|
line6_destruct(interface);
|
|
|
|
err_put:
|
2009-02-28 03:43:04 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Line6 device disconnected.
|
|
|
|
*/
|
|
|
|
static void line6_disconnect(struct usb_interface *interface)
|
|
|
|
{
|
|
|
|
struct usb_line6 *line6;
|
|
|
|
struct usb_device *usbdev;
|
2012-10-15 18:26:46 +00:00
|
|
|
int interface_number;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (interface == NULL)
|
|
|
|
return;
|
2009-02-28 03:43:04 +00:00
|
|
|
usbdev = interface_to_usbdev(interface);
|
2009-02-28 06:42:18 +00:00
|
|
|
if (usbdev == NULL)
|
|
|
|
return;
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2010-08-11 23:35:30 +00:00
|
|
|
/* removal of additional special files should go here */
|
|
|
|
|
2009-02-28 03:43:04 +00:00
|
|
|
sysfs_remove_link(&interface->dev.kobj, "usb_device");
|
|
|
|
|
|
|
|
interface_number = interface->cur_altsetting->desc.bInterfaceNumber;
|
|
|
|
line6 = usb_get_intfdata(interface);
|
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (line6 != NULL) {
|
|
|
|
if (line6->urb_listen != NULL)
|
2010-08-11 23:35:30 +00:00
|
|
|
line6_stop_listen(line6);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2009-02-28 06:42:18 +00:00
|
|
|
if (usbdev != line6->usbdev)
|
|
|
|
dev_err(line6->ifcdev,
|
|
|
|
"driver bug: inconsistent usb device\n");
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2015-01-12 20:42:59 +00:00
|
|
|
line6->disconnect(interface);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2010-08-22 23:08:25 +00:00
|
|
|
dev_info(&interface->dev, "Line6 %s now disconnected\n",
|
|
|
|
line6->properties->name);
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
line6_destruct(interface);
|
|
|
|
|
|
|
|
/* decrement reference counters: */
|
|
|
|
usb_put_intf(interface);
|
|
|
|
usb_put_dev(usbdev);
|
2010-08-11 23:35:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_PM
|
|
|
|
|
|
|
|
/*
|
|
|
|
Suspend Line6 device.
|
|
|
|
*/
|
|
|
|
static int line6_suspend(struct usb_interface *interface, pm_message_t message)
|
|
|
|
{
|
|
|
|
struct usb_line6 *line6 = usb_get_intfdata(interface);
|
|
|
|
struct snd_line6_pcm *line6pcm = line6->line6pcm;
|
|
|
|
|
|
|
|
snd_power_change_state(line6->card, SNDRV_CTL_POWER_D3hot);
|
|
|
|
|
2015-01-12 20:42:45 +00:00
|
|
|
if (line6->properties->capabilities & LINE6_CAP_CONTROL)
|
2010-08-11 23:35:30 +00:00
|
|
|
line6_stop_listen(line6);
|
|
|
|
|
|
|
|
if (line6pcm != NULL) {
|
|
|
|
snd_pcm_suspend_all(line6pcm->pcm);
|
|
|
|
line6_pcm_disconnect(line6pcm);
|
|
|
|
line6pcm->flags = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Resume Line6 device.
|
|
|
|
*/
|
|
|
|
static int line6_resume(struct usb_interface *interface)
|
|
|
|
{
|
|
|
|
struct usb_line6 *line6 = usb_get_intfdata(interface);
|
|
|
|
|
2015-01-12 20:42:45 +00:00
|
|
|
if (line6->properties->capabilities & LINE6_CAP_CONTROL)
|
2010-08-11 23:35:30 +00:00
|
|
|
line6_start_listen(line6);
|
|
|
|
|
|
|
|
snd_power_change_state(line6->card, SNDRV_CTL_POWER_D0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Resume Line6 device after reset.
|
|
|
|
*/
|
|
|
|
static int line6_reset_resume(struct usb_interface *interface)
|
|
|
|
{
|
|
|
|
struct usb_line6 *line6 = usb_get_intfdata(interface);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
2015-01-12 20:42:42 +00:00
|
|
|
switch (line6->type) {
|
|
|
|
case LINE6_PODSTUDIO_GX:
|
|
|
|
case LINE6_PODSTUDIO_UX1:
|
|
|
|
case LINE6_PODSTUDIO_UX2:
|
|
|
|
case LINE6_TONEPORT_GX:
|
|
|
|
case LINE6_TONEPORT_UX1:
|
|
|
|
case LINE6_TONEPORT_UX2:
|
|
|
|
case LINE6_GUITARPORT:
|
2010-08-11 23:35:30 +00:00
|
|
|
line6_toneport_reset_resume((struct usb_line6_toneport *)line6);
|
2015-01-12 20:42:42 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2010-08-11 23:35:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return line6_resume(interface);
|
2009-02-28 03:43:04 +00:00
|
|
|
}
|
|
|
|
|
2010-08-22 23:08:25 +00:00
|
|
|
#endif /* CONFIG_PM */
|
2010-08-11 23:35:30 +00:00
|
|
|
|
2009-02-28 03:43:04 +00:00
|
|
|
static struct usb_driver line6_driver = {
|
|
|
|
.name = DRIVER_NAME,
|
|
|
|
.probe = line6_probe,
|
|
|
|
.disconnect = line6_disconnect,
|
2010-08-11 23:35:30 +00:00
|
|
|
#ifdef CONFIG_PM
|
|
|
|
.suspend = line6_suspend,
|
|
|
|
.resume = line6_resume,
|
|
|
|
.reset_resume = line6_reset_resume,
|
|
|
|
#endif
|
2009-02-28 03:43:04 +00:00
|
|
|
.id_table = line6_id_table,
|
|
|
|
};
|
|
|
|
|
2012-04-23 23:13:19 +00:00
|
|
|
module_usb_driver(line6_driver);
|
2009-02-28 03:43:04 +00:00
|
|
|
|
|
|
|
MODULE_AUTHOR(DRIVER_AUTHOR);
|
|
|
|
MODULE_DESCRIPTION(DRIVER_DESC);
|
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
MODULE_VERSION(DRIVER_VERSION);
|