Skip to content

Commit 7ad0731

Browse files
crorvicktiwai
authored andcommitted
staging: line6: Split out PODxt Live interfaces
The PODxt Live device has both a POD and a Variax interface. Add device type entries for each of these. Signed-off-by: Chris Rorvick <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 7b3e4d4 commit 7ad0731

File tree

4 files changed

+48
-81
lines changed

4 files changed

+48
-81
lines changed

drivers/staging/line6/driver.c

Lines changed: 44 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#define DRIVER_VERSION "0.9.1beta" DRIVER_REVISION
3232

3333
#define LINE6_DEVICE(prod) USB_DEVICE(0x0e41, prod)
34+
#define LINE6_IF_NUM(prod, n) USB_DEVICE_INTERFACE_NUMBER(0x0e41, prod, n)
3435

3536
/* table of devices that work with this driver */
3637
static const struct usb_device_id line6_id_table[] = {
@@ -46,7 +47,8 @@ static const struct usb_device_id line6_id_table[] = {
4647
{ LINE6_DEVICE(0x4150), .driver_info = LINE6_PODSTUDIO_UX1 },
4748
{ LINE6_DEVICE(0x4151), .driver_info = LINE6_PODSTUDIO_UX2 },
4849
{ LINE6_DEVICE(0x5044), .driver_info = LINE6_PODXT },
49-
{ LINE6_DEVICE(0x4650), .driver_info = LINE6_PODXTLIVE },
50+
{ LINE6_IF_NUM(0x4650, 0), .driver_info = LINE6_PODXTLIVE_POD },
51+
{ LINE6_IF_NUM(0x4650, 1), .driver_info = LINE6_PODXTLIVE_VARIAX },
5052
{ LINE6_DEVICE(0x5050), .driver_info = LINE6_PODXTPRO },
5153
{ LINE6_DEVICE(0x4147), .driver_info = LINE6_TONEPORT_GX },
5254
{ LINE6_DEVICE(0x4141), .driver_info = LINE6_TONEPORT_UX1 },
@@ -132,7 +134,14 @@ static const struct line6_properties line6_properties_table[] = {
132134
| LINE6_CAP_PCM
133135
| LINE6_CAP_HWMON,
134136
},
135-
[LINE6_PODXTLIVE] = {
137+
[LINE6_PODXTLIVE_POD] = {
138+
.id = "PODxtLive",
139+
.name = "PODxt Live",
140+
.capabilities = LINE6_CAP_CONTROL
141+
| LINE6_CAP_PCM
142+
| LINE6_CAP_HWMON,
143+
},
144+
[LINE6_PODXTLIVE_VARIAX] = {
136145
.id = "PODxtLive",
137146
.name = "PODxt Live",
138147
.capabilities = LINE6_CAP_CONTROL
@@ -445,24 +454,15 @@ static void line6_data_received(struct urb *urb)
445454
case LINE6_PODHD500:
446455
break; /* let userspace handle MIDI */
447456

448-
case LINE6_PODXTLIVE:
449-
switch (line6->interface_number) {
450-
case PODXTLIVE_INTERFACE_POD:
451-
line6_pod_process_message((struct usb_line6_pod
457+
case LINE6_PODXTLIVE_POD:
458+
line6_pod_process_message((struct usb_line6_pod
452459
*)line6);
453-
break;
454-
455-
case PODXTLIVE_INTERFACE_VARIAX:
456-
line6_variax_process_message((struct
457-
usb_line6_variax
458-
*)line6);
459-
break;
460-
461-
default:
462-
dev_err(line6->ifcdev,
463-
"PODxt Live interface %d not supported\n",
464-
line6->interface_number);
465-
}
460+
break;
461+
462+
case LINE6_PODXTLIVE_VARIAX:
463+
line6_variax_process_message((struct
464+
usb_line6_variax
465+
*)line6);
466466
break;
467467

468468
case LINE6_VARIAX:
@@ -722,7 +722,8 @@ static int line6_probe(struct usb_interface *interface,
722722

723723
switch (devtype) {
724724
case LINE6_BASSPODXTLIVE:
725-
case LINE6_PODXTLIVE:
725+
case LINE6_PODXTLIVE_POD:
726+
case LINE6_PODXTLIVE_VARIAX:
726727
case LINE6_VARIAX:
727728
alternate = 1;
728729
break;
@@ -841,24 +842,16 @@ static int line6_probe(struct usb_interface *interface,
841842
/* these don't have a control channel */
842843
break;
843844

844-
case LINE6_PODXTLIVE:
845-
switch (interface_number) {
846-
case PODXTLIVE_INTERFACE_POD:
847-
size = sizeof(struct usb_line6_pod);
848-
ep_read = 0x84;
849-
ep_write = 0x03;
850-
break;
851-
852-
case PODXTLIVE_INTERFACE_VARIAX:
853-
size = sizeof(struct usb_line6_variax);
854-
ep_read = 0x86;
855-
ep_write = 0x05;
856-
break;
845+
case LINE6_PODXTLIVE_POD:
846+
size = sizeof(struct usb_line6_pod);
847+
ep_read = 0x84;
848+
ep_write = 0x03;
849+
break;
857850

858-
default:
859-
ret = -ENODEV;
860-
goto err_put;
861-
}
851+
case LINE6_PODXTLIVE_VARIAX:
852+
size = sizeof(struct usb_line6_variax);
853+
ep_read = 0x86;
854+
ep_write = 0x05;
862855
break;
863856

864857
case LINE6_VARIAX:
@@ -887,7 +880,6 @@ static int line6_probe(struct usb_interface *interface,
887880
}
888881

889882
/* store basic data: */
890-
line6->interface_number = interface_number;
891883
line6->properties = properties;
892884
line6->usbdev = usbdev;
893885
line6->ifcdev = &interface->dev;
@@ -967,27 +959,16 @@ static int line6_probe(struct usb_interface *interface,
967959
(struct usb_line6_podhd *)line6);
968960
break;
969961

970-
case LINE6_PODXTLIVE:
971-
switch (interface_number) {
972-
case PODXTLIVE_INTERFACE_POD:
973-
ret =
974-
line6_pod_init(interface,
975-
(struct usb_line6_pod *)line6);
976-
break;
977-
978-
case PODXTLIVE_INTERFACE_VARIAX:
979-
ret =
980-
line6_variax_init(interface,
981-
(struct usb_line6_variax *)line6);
982-
break;
983-
984-
default:
985-
dev_err(&interface->dev,
986-
"PODxt Live interface %d not supported\n",
987-
interface_number);
988-
ret = -ENODEV;
989-
}
962+
case LINE6_PODXTLIVE_POD:
963+
ret =
964+
line6_pod_init(interface,
965+
(struct usb_line6_pod *)line6);
966+
break;
990967

968+
case LINE6_PODXTLIVE_VARIAX:
969+
ret =
970+
line6_variax_init(interface,
971+
(struct usb_line6_variax *)line6);
991972
break;
992973

993974
case LINE6_VARIAX:
@@ -1084,17 +1065,12 @@ static void line6_disconnect(struct usb_interface *interface)
10841065
line6_podhd_disconnect(interface);
10851066
break;
10861067

1087-
case LINE6_PODXTLIVE:
1088-
switch (interface_number) {
1089-
case PODXTLIVE_INTERFACE_POD:
1090-
line6_pod_disconnect(interface);
1091-
break;
1092-
1093-
case PODXTLIVE_INTERFACE_VARIAX:
1094-
line6_variax_disconnect(interface);
1095-
break;
1096-
}
1068+
case LINE6_PODXTLIVE_POD:
1069+
line6_pod_disconnect(interface);
1070+
break;
10971071

1072+
case LINE6_PODXTLIVE_VARIAX:
1073+
line6_variax_disconnect(interface);
10981074
break;
10991075

11001076
case LINE6_VARIAX:

drivers/staging/line6/driver.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ enum line6_device_type {
3333
LINE6_PODSTUDIO_UX1,
3434
LINE6_PODSTUDIO_UX2,
3535
LINE6_PODXT,
36-
LINE6_PODXTLIVE,
36+
LINE6_PODXTLIVE_POD,
37+
LINE6_PODXTLIVE_VARIAX,
3738
LINE6_PODXTPRO,
3839
LINE6_TONEPORT_GX,
3940
LINE6_TONEPORT_UX1,
@@ -135,11 +136,6 @@ struct usb_line6 {
135136
*/
136137
const struct line6_properties *properties;
137138

138-
/**
139-
Interface number.
140-
*/
141-
int interface_number;
142-
143139
/**
144140
Interval (ms).
145141
*/

drivers/staging/line6/pcm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ int line6_init_pcm(struct usb_line6 *line6,
433433
case LINE6_BASSPODXTLIVE:
434434
case LINE6_BASSPODXTPRO:
435435
case LINE6_PODXT:
436-
case LINE6_PODXTLIVE:
436+
case LINE6_PODXTLIVE_POD:
437+
case LINE6_PODXTLIVE_VARIAX:
437438
case LINE6_PODXTPRO:
438439
case LINE6_PODHD300:
439440
case LINE6_PODHD400:

drivers/staging/line6/pod.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020

2121
#include "driver.h"
2222

23-
/*
24-
PODxt Live interfaces
25-
*/
26-
#define PODXTLIVE_INTERFACE_POD 0
27-
#define PODXTLIVE_INTERFACE_VARIAX 1
28-
2923
/*
3024
Locate name in binary program dump
3125
*/

0 commit comments

Comments
 (0)