Commit 4c6fb5fc authored by Markus Grabner's avatar Markus Grabner Committed by Greg Kroah-Hartman

staging/line6: refactor device information and add POD HD 500

This patch refactors the device information code and adds preliminary support for the POD HD 500 device.
Signed-off-by: default avatarMarkus Grabner <grabner@icg.tugraz.at>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3b35de41
...@@ -38,6 +38,8 @@ static const struct usb_device_id line6_id_table[] = { ...@@ -38,6 +38,8 @@ static const struct usb_device_id line6_id_table[] = {
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_BASSPODXTPRO)}, {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_BASSPODXTPRO)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_GUITARPORT)}, {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_GUITARPORT)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_POCKETPOD)}, {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_POCKETPOD)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODHD300)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODHD500)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_GX)}, {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_GX)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_UX1)}, {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_UX1)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_UX2)}, {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_UX2)},
...@@ -50,7 +52,6 @@ static const struct usb_device_id line6_id_table[] = { ...@@ -50,7 +52,6 @@ static const struct usb_device_id line6_id_table[] = {
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_TONEPORT_UX1)}, {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_TONEPORT_UX1)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_TONEPORT_UX2)}, {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_TONEPORT_UX2)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_VARIAX)}, {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_VARIAX)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODHD300)},
{}, {},
}; };
...@@ -58,24 +59,25 @@ MODULE_DEVICE_TABLE(usb, line6_id_table); ...@@ -58,24 +59,25 @@ MODULE_DEVICE_TABLE(usb, line6_id_table);
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static struct line6_properties line6_properties_table[] = { static struct line6_properties line6_properties_table[] = {
{ "BassPODxt", "BassPODxt", LINE6_BIT_BASSPODXT, LINE6_BIT_CONTROL_PCM_HWMON }, { LINE6_BIT_BASSPODXT, "BassPODxt", "BassPODxt", LINE6_BIT_CONTROL_PCM_HWMON },
{ "BassPODxtLive", "BassPODxt Live", LINE6_BIT_BASSPODXTLIVE, LINE6_BIT_CONTROL_PCM_HWMON }, { LINE6_BIT_BASSPODXTLIVE, "BassPODxtLive", "BassPODxt Live", LINE6_BIT_CONTROL_PCM_HWMON },
{ "BassPODxtPro", "BassPODxt Pro", LINE6_BIT_BASSPODXTPRO, LINE6_BIT_CONTROL_PCM_HWMON }, { LINE6_BIT_BASSPODXTPRO, "BassPODxtPro", "BassPODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON },
{ "GuitarPort", "GuitarPort", LINE6_BIT_GUITARPORT, LINE6_BIT_PCM }, { LINE6_BIT_GUITARPORT, "GuitarPort", "GuitarPort", LINE6_BIT_PCM },
{ "PocketPOD", "Pocket POD", LINE6_BIT_POCKETPOD, LINE6_BIT_CONTROL }, { LINE6_BIT_POCKETPOD, "PocketPOD", "Pocket POD", LINE6_BIT_CONTROL },
{ "PODStudioGX", "POD Studio GX", LINE6_BIT_PODSTUDIO_GX, LINE6_BIT_PCM }, { LINE6_BIT_PODHD300, "PODHD300", "POD HD300", LINE6_BIT_CONTROL_PCM_HWMON },
{ "PODStudioUX1", "POD Studio UX1", LINE6_BIT_PODSTUDIO_UX1, LINE6_BIT_PCM }, { LINE6_BIT_PODHD500, "PODHD500", "POD HD500", LINE6_BIT_CONTROL_PCM_HWMON },
{ "PODStudioUX2", "POD Studio UX2", LINE6_BIT_PODSTUDIO_UX2, LINE6_BIT_PCM }, { LINE6_BIT_PODSTUDIO_GX, "PODStudioGX", "POD Studio GX", LINE6_BIT_PCM },
{ "PODX3", "POD X3", LINE6_BIT_PODX3, LINE6_BIT_PCM }, { LINE6_BIT_PODSTUDIO_UX1, "PODStudioUX1", "POD Studio UX1", LINE6_BIT_PCM },
{ "PODX3Live", "POD X3 Live", LINE6_BIT_PODX3LIVE, LINE6_BIT_PCM }, { LINE6_BIT_PODSTUDIO_UX2, "PODStudioUX2", "POD Studio UX2", LINE6_BIT_PCM },
{ "PODxt", "PODxt", LINE6_BIT_PODXT, LINE6_BIT_CONTROL_PCM_HWMON }, { LINE6_BIT_PODX3, "PODX3", "POD X3", LINE6_BIT_PCM },
{ "PODxtLive", "PODxt Live", LINE6_BIT_PODXTLIVE, LINE6_BIT_CONTROL_PCM_HWMON }, { LINE6_BIT_PODX3LIVE, "PODX3Live", "POD X3 Live", LINE6_BIT_PCM },
{ "PODxtPro", "PODxt Pro", LINE6_BIT_PODXTPRO, LINE6_BIT_CONTROL_PCM_HWMON }, { LINE6_BIT_PODXT, "PODxt", "PODxt", LINE6_BIT_CONTROL_PCM_HWMON },
{ "TonePortGX", "TonePort GX", LINE6_BIT_TONEPORT_GX, LINE6_BIT_PCM }, { LINE6_BIT_PODXTLIVE, "PODxtLive", "PODxt Live", LINE6_BIT_CONTROL_PCM_HWMON },
{ "TonePortUX1", "TonePort UX1", LINE6_BIT_TONEPORT_UX1, LINE6_BIT_PCM }, { LINE6_BIT_PODXTPRO, "PODxtPro", "PODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON },
{ "TonePortUX2", "TonePort UX2", LINE6_BIT_TONEPORT_UX2, LINE6_BIT_PCM }, { LINE6_BIT_TONEPORT_GX, "TonePortGX", "TonePort GX", LINE6_BIT_PCM },
{ "Variax", "Variax Workbench", LINE6_BIT_VARIAX, LINE6_BIT_CONTROL }, { LINE6_BIT_TONEPORT_UX1, "TonePortUX1", "TonePort UX1", LINE6_BIT_PCM },
{ "PODHD300", "POD HD300", LINE6_BIT_PODHD300, LINE6_BIT_CONTROL_PCM_HWMON }, { LINE6_BIT_TONEPORT_UX2, "TonePortUX2", "TonePort UX2", LINE6_BIT_PCM },
{ LINE6_BIT_VARIAX, "Variax", "Variax Workbench", LINE6_BIT_CONTROL },
}; };
/* *INDENT-ON* */ /* *INDENT-ON* */
...@@ -441,6 +443,7 @@ static void line6_data_received(struct urb *urb) ...@@ -441,6 +443,7 @@ static void line6_data_received(struct urb *urb)
break; break;
case LINE6_DEVID_PODHD300: case LINE6_DEVID_PODHD300:
case LINE6_DEVID_PODHD500:
break; /* let userspace handle MIDI */ break; /* let userspace handle MIDI */
case LINE6_DEVID_PODXTLIVE: case LINE6_DEVID_PODXTLIVE:
...@@ -800,6 +803,7 @@ static int line6_probe(struct usb_interface *interface, ...@@ -800,6 +803,7 @@ static int line6_probe(struct usb_interface *interface,
} }
break; break;
case LINE6_DEVID_PODHD500:
case LINE6_DEVID_PODX3: case LINE6_DEVID_PODX3:
case LINE6_DEVID_PODX3LIVE: case LINE6_DEVID_PODX3LIVE:
switch (interface_number) { switch (interface_number) {
...@@ -878,6 +882,12 @@ static int line6_probe(struct usb_interface *interface, ...@@ -878,6 +882,12 @@ static int line6_probe(struct usb_interface *interface,
ep_write = 0x03; ep_write = 0x03;
break; break;
case LINE6_DEVID_PODHD500:
size = sizeof(struct usb_line6_podhd);
ep_read = 0x81;
ep_write = 0x01;
break;
case LINE6_DEVID_POCKETPOD: case LINE6_DEVID_POCKETPOD:
size = sizeof(struct usb_line6_pod); size = sizeof(struct usb_line6_pod);
ep_read = 0x82; ep_read = 0x82;
...@@ -1031,6 +1041,7 @@ static int line6_probe(struct usb_interface *interface, ...@@ -1031,6 +1041,7 @@ static int line6_probe(struct usb_interface *interface,
break; break;
case LINE6_DEVID_PODHD300: case LINE6_DEVID_PODHD300:
case LINE6_DEVID_PODHD500:
ret = line6_podhd_init(interface, ret = line6_podhd_init(interface,
(struct usb_line6_podhd *)line6); (struct usb_line6_podhd *)line6);
break; break;
...@@ -1158,6 +1169,7 @@ static void line6_disconnect(struct usb_interface *interface) ...@@ -1158,6 +1169,7 @@ static void line6_disconnect(struct usb_interface *interface)
break; break;
case LINE6_DEVID_PODHD300: case LINE6_DEVID_PODHD300:
case LINE6_DEVID_PODHD500:
line6_podhd_disconnect(interface); line6_podhd_disconnect(interface);
break; break;
......
...@@ -87,6 +87,11 @@ static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4; ...@@ -87,6 +87,11 @@ static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4;
Common properties of Line6 devices. Common properties of Line6 devices.
*/ */
struct line6_properties { struct line6_properties {
/**
Bit identifying this device in the line6usb driver.
*/
int device_bit;
/** /**
Card id string (maximum 16 characters). Card id string (maximum 16 characters).
This can be used to address the device in ALSA programs as This can be used to address the device in ALSA programs as
...@@ -99,11 +104,6 @@ struct line6_properties { ...@@ -99,11 +104,6 @@ struct line6_properties {
*/ */
const char *name; const char *name;
/**
Bit identifying this device in the line6usb driver.
*/
int device_bit;
/** /**
Bit vector defining this device's capabilities in the Bit vector defining this device's capabilities in the
line6usb driver. line6usb driver.
......
...@@ -173,6 +173,7 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, ...@@ -173,6 +173,7 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data,
case LINE6_DEVID_VARIAX: case LINE6_DEVID_VARIAX:
case LINE6_DEVID_PODHD300: case LINE6_DEVID_PODHD300:
case LINE6_DEVID_PODHD500:
break; break;
default: default:
...@@ -404,8 +405,19 @@ int line6_init_midi(struct usb_line6 *line6) ...@@ -404,8 +405,19 @@ int line6_init_midi(struct usb_line6 *line6)
} }
line6midi->line6 = line6; line6midi->line6 = line6;
switch(line6->product) {
case LINE6_DEVID_PODHD300:
case LINE6_DEVID_PODHD500:
line6midi->midi_mask_transmit = 1;
line6midi->midi_mask_receive = 1;
break;
default:
line6midi->midi_mask_transmit = 1; line6midi->midi_mask_transmit = 1;
line6midi->midi_mask_receive = 4; line6midi->midi_mask_receive = 4;
}
line6->line6midi = line6midi; line6->line6midi = line6midi;
err = snd_device_new(line6->card, SNDRV_DEV_RAWMIDI, line6midi, err = snd_device_new(line6->card, SNDRV_DEV_RAWMIDI, line6midi,
......
...@@ -367,6 +367,7 @@ int line6_init_pcm(struct usb_line6 *line6, ...@@ -367,6 +367,7 @@ int line6_init_pcm(struct usb_line6 *line6,
ep_write = 0x01; ep_write = 0x01;
break; break;
case LINE6_DEVID_PODHD500:
case LINE6_DEVID_PODX3: case LINE6_DEVID_PODX3:
case LINE6_DEVID_PODX3LIVE: case LINE6_DEVID_PODX3LIVE:
ep_read = 0x86; ep_read = 0x86;
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#define LINE6_DEVID_BASSPODXTPRO 0x4252 #define LINE6_DEVID_BASSPODXTPRO 0x4252
#define LINE6_DEVID_GUITARPORT 0x4750 #define LINE6_DEVID_GUITARPORT 0x4750
#define LINE6_DEVID_POCKETPOD 0x5051 #define LINE6_DEVID_POCKETPOD 0x5051
#define LINE6_DEVID_PODHD300 0x5057
#define LINE6_DEVID_PODHD500 0x414D
#define LINE6_DEVID_PODSTUDIO_GX 0x4153 #define LINE6_DEVID_PODSTUDIO_GX 0x4153
#define LINE6_DEVID_PODSTUDIO_UX1 0x4150 #define LINE6_DEVID_PODSTUDIO_UX1 0x4150
#define LINE6_DEVID_PODSTUDIO_UX2 0x4151 #define LINE6_DEVID_PODSTUDIO_UX2 0x4151
...@@ -36,38 +38,59 @@ ...@@ -36,38 +38,59 @@
#define LINE6_DEVID_TONEPORT_UX1 0x4141 #define LINE6_DEVID_TONEPORT_UX1 0x4141
#define LINE6_DEVID_TONEPORT_UX2 0x4142 #define LINE6_DEVID_TONEPORT_UX2 0x4142
#define LINE6_DEVID_VARIAX 0x534d #define LINE6_DEVID_VARIAX 0x534d
#define LINE6_DEVID_PODHD300 0x5057
#define LINE6_BIT_BASSPODXT (1 << 0) enum {
#define LINE6_BIT_BASSPODXTLIVE (1 << 1) LINE6_ID_BASSPODXT,
#define LINE6_BIT_BASSPODXTPRO (1 << 2) LINE6_ID_BASSPODXTLIVE,
#define LINE6_BIT_GUITARPORT (1 << 3) LINE6_ID_BASSPODXTPRO,
#define LINE6_BIT_POCKETPOD (1 << 4) LINE6_ID_GUITARPORT,
#define LINE6_BIT_PODSTUDIO_GX (1 << 5) LINE6_ID_POCKETPOD,
#define LINE6_BIT_PODSTUDIO_UX1 (1 << 6) LINE6_ID_PODHD300,
#define LINE6_BIT_PODSTUDIO_UX2 (1 << 7) LINE6_ID_PODHD500,
#define LINE6_BIT_PODX3 (1 << 8) LINE6_ID_PODSTUDIO_GX,
#define LINE6_BIT_PODX3LIVE (1 << 9) LINE6_ID_PODSTUDIO_UX1,
#define LINE6_BIT_PODXT (1 << 10) LINE6_ID_PODSTUDIO_UX2,
#define LINE6_BIT_PODXTLIVE (1 << 11) LINE6_ID_PODX3,
#define LINE6_BIT_PODXTPRO (1 << 12) LINE6_ID_PODX3LIVE,
#define LINE6_BIT_TONEPORT_GX (1 << 13) LINE6_ID_PODXT,
#define LINE6_BIT_TONEPORT_UX1 (1 << 14) LINE6_ID_PODXTLIVE,
#define LINE6_BIT_TONEPORT_UX2 (1 << 15) LINE6_ID_PODXTPRO,
#define LINE6_BIT_VARIAX (1 << 16) LINE6_ID_TONEPORT_GX,
#define LINE6_BIT_PODHD300 (1 << 17) LINE6_ID_TONEPORT_UX1,
LINE6_ID_TONEPORT_UX2,
LINE6_ID_VARIAX
};
#define LINE6_BIT(x) LINE6_BIT_ ## x = 1 << LINE6_ID_ ## x
enum {
LINE6_BIT(BASSPODXT),
LINE6_BIT(BASSPODXTLIVE),
LINE6_BIT(BASSPODXTPRO),
LINE6_BIT(GUITARPORT),
LINE6_BIT(POCKETPOD),
LINE6_BIT(PODHD300),
LINE6_BIT(PODHD500),
LINE6_BIT(PODSTUDIO_GX),
LINE6_BIT(PODSTUDIO_UX1),
LINE6_BIT(PODSTUDIO_UX2),
LINE6_BIT(PODX3),
LINE6_BIT(PODX3LIVE),
LINE6_BIT(PODXT),
LINE6_BIT(PODXTLIVE),
LINE6_BIT(PODXTPRO),
LINE6_BIT(TONEPORT_GX),
LINE6_BIT(TONEPORT_UX1),
LINE6_BIT(TONEPORT_UX2),
LINE6_BIT(VARIAX),
#define LINE6_BITS_PRO (LINE6_BIT_BASSPODXTPRO | \ LINE6_BITS_PRO = LINE6_BIT_BASSPODXTPRO | LINE6_BIT_PODXTPRO,
LINE6_BIT_PODXTPRO) LINE6_BITS_LIVE = LINE6_BIT_BASSPODXTLIVE | LINE6_BIT_PODXTLIVE | LINE6_BIT_PODX3LIVE,
#define LINE6_BITS_LIVE (LINE6_BIT_BASSPODXTLIVE | \ LINE6_BITS_PODXTALL = LINE6_BIT_PODXT | LINE6_BIT_PODXTLIVE | LINE6_BIT_PODXTPRO,
LINE6_BIT_PODXTLIVE | \ LINE6_BITS_PODX3ALL = LINE6_BIT_PODX3 | LINE6_BIT_PODX3LIVE,
LINE6_BIT_PODX3LIVE) LINE6_BITS_PODHDALL = LINE6_BIT_PODHD300 | LINE6_BIT_PODHD500,
#define LINE6_BITS_PODXTALL (LINE6_BIT_PODXT | \ LINE6_BITS_BASSPODXTALL = LINE6_BIT_BASSPODXT | LINE6_BIT_BASSPODXTLIVE | LINE6_BIT_BASSPODXTPRO
LINE6_BIT_PODXTLIVE | \ };
LINE6_BIT_PODXTPRO)
#define LINE6_BITS_BASSPODXTALL (LINE6_BIT_BASSPODXT | \
LINE6_BIT_BASSPODXTLIVE | \
LINE6_BIT_BASSPODXTPRO)
/* device supports settings parameter via USB */ /* device supports settings parameter via USB */
#define LINE6_BIT_CONTROL (1 << 0) #define LINE6_BIT_CONTROL (1 << 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment