aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Rorvick <chris@rorvick.com>2015-01-12 15:42:48 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-12 16:24:04 -0500
commit7ad07310d57dec80d32572479f58decb6a8529e0 (patch)
tree43c4fc9bbdc9019421b231463f46bac252918d90
parent7b3e4d47ca372c4e54f0a1f2e7cffca0b9f9c070 (diff)
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 <chris@rorvick.com> Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--drivers/staging/line6/driver.c112
-rw-r--r--drivers/staging/line6/driver.h8
-rw-r--r--drivers/staging/line6/pcm.c3
-rw-r--r--drivers/staging/line6/pod.h6
4 files changed, 48 insertions, 81 deletions
diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 6fecc1b94e5c..cb9602941207 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -31,6 +31,7 @@
31#define DRIVER_VERSION "0.9.1beta" DRIVER_REVISION 31#define DRIVER_VERSION "0.9.1beta" DRIVER_REVISION
32 32
33#define LINE6_DEVICE(prod) USB_DEVICE(0x0e41, prod) 33#define LINE6_DEVICE(prod) USB_DEVICE(0x0e41, prod)
34#define LINE6_IF_NUM(prod, n) USB_DEVICE_INTERFACE_NUMBER(0x0e41, prod, n)
34 35
35/* table of devices that work with this driver */ 36/* table of devices that work with this driver */
36static const struct usb_device_id line6_id_table[] = { 37static const struct usb_device_id line6_id_table[] = {
@@ -46,7 +47,8 @@ static const struct usb_device_id line6_id_table[] = {
46 { LINE6_DEVICE(0x4150), .driver_info = LINE6_PODSTUDIO_UX1 }, 47 { LINE6_DEVICE(0x4150), .driver_info = LINE6_PODSTUDIO_UX1 },
47 { LINE6_DEVICE(0x4151), .driver_info = LINE6_PODSTUDIO_UX2 }, 48 { LINE6_DEVICE(0x4151), .driver_info = LINE6_PODSTUDIO_UX2 },
48 { LINE6_DEVICE(0x5044), .driver_info = LINE6_PODXT }, 49 { 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 },
50 { LINE6_DEVICE(0x5050), .driver_info = LINE6_PODXTPRO }, 52 { LINE6_DEVICE(0x5050), .driver_info = LINE6_PODXTPRO },
51 { LINE6_DEVICE(0x4147), .driver_info = LINE6_TONEPORT_GX }, 53 { LINE6_DEVICE(0x4147), .driver_info = LINE6_TONEPORT_GX },
52 { LINE6_DEVICE(0x4141), .driver_info = LINE6_TONEPORT_UX1 }, 54 { LINE6_DEVICE(0x4141), .driver_info = LINE6_TONEPORT_UX1 },
@@ -132,7 +134,14 @@ static const struct line6_properties line6_properties_table[] = {
132 | LINE6_CAP_PCM 134 | LINE6_CAP_PCM
133 | LINE6_CAP_HWMON, 135 | LINE6_CAP_HWMON,
134 }, 136 },
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] = {
136 .id = "PODxtLive", 145 .id = "PODxtLive",
137 .name = "PODxt Live", 146 .name = "PODxt Live",
138 .capabilities = LINE6_CAP_CONTROL 147 .capabilities = LINE6_CAP_CONTROL
@@ -445,24 +454,15 @@ static void line6_data_received(struct urb *urb)
445 case LINE6_PODHD500: 454 case LINE6_PODHD500:
446 break; /* let userspace handle MIDI */ 455 break; /* let userspace handle MIDI */
447 456
448 case LINE6_PODXTLIVE: 457 case LINE6_PODXTLIVE_POD:
449 switch (line6->interface_number) { 458 line6_pod_process_message((struct usb_line6_pod
450 case PODXTLIVE_INTERFACE_POD:
451 line6_pod_process_message((struct usb_line6_pod
452 *)line6); 459 *)line6);
453 break; 460 break;
454 461
455 case PODXTLIVE_INTERFACE_VARIAX: 462 case LINE6_PODXTLIVE_VARIAX:
456 line6_variax_process_message((struct 463 line6_variax_process_message((struct
457 usb_line6_variax 464 usb_line6_variax
458 *)line6); 465 *)line6);
459 break;
460
461 default:
462 dev_err(line6->ifcdev,
463 "PODxt Live interface %d not supported\n",
464 line6->interface_number);
465 }
466 break; 466 break;
467 467
468 case LINE6_VARIAX: 468 case LINE6_VARIAX:
@@ -722,7 +722,8 @@ static int line6_probe(struct usb_interface *interface,
722 722
723 switch (devtype) { 723 switch (devtype) {
724 case LINE6_BASSPODXTLIVE: 724 case LINE6_BASSPODXTLIVE:
725 case LINE6_PODXTLIVE: 725 case LINE6_PODXTLIVE_POD:
726 case LINE6_PODXTLIVE_VARIAX:
726 case LINE6_VARIAX: 727 case LINE6_VARIAX:
727 alternate = 1; 728 alternate = 1;
728 break; 729 break;
@@ -841,24 +842,16 @@ static int line6_probe(struct usb_interface *interface,
841 /* these don't have a control channel */ 842 /* these don't have a control channel */
842 break; 843 break;
843 844
844 case LINE6_PODXTLIVE: 845 case LINE6_PODXTLIVE_POD:
845 switch (interface_number) { 846 size = sizeof(struct usb_line6_pod);
846 case PODXTLIVE_INTERFACE_POD: 847 ep_read = 0x84;
847 size = sizeof(struct usb_line6_pod); 848 ep_write = 0x03;
848 ep_read = 0x84; 849 break;
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;
857 850
858 default: 851 case LINE6_PODXTLIVE_VARIAX:
859 ret = -ENODEV; 852 size = sizeof(struct usb_line6_variax);
860 goto err_put; 853 ep_read = 0x86;
861 } 854 ep_write = 0x05;
862 break; 855 break;
863 856
864 case LINE6_VARIAX: 857 case LINE6_VARIAX:
@@ -887,7 +880,6 @@ static int line6_probe(struct usb_interface *interface,
887 } 880 }
888 881
889 /* store basic data: */ 882 /* store basic data: */
890 line6->interface_number = interface_number;
891 line6->properties = properties; 883 line6->properties = properties;
892 line6->usbdev = usbdev; 884 line6->usbdev = usbdev;
893 line6->ifcdev = &interface->dev; 885 line6->ifcdev = &interface->dev;
@@ -967,27 +959,16 @@ static int line6_probe(struct usb_interface *interface,
967 (struct usb_line6_podhd *)line6); 959 (struct usb_line6_podhd *)line6);
968 break; 960 break;
969 961
970 case LINE6_PODXTLIVE: 962 case LINE6_PODXTLIVE_POD:
971 switch (interface_number) { 963 ret =
972 case PODXTLIVE_INTERFACE_POD: 964 line6_pod_init(interface,
973 ret = 965 (struct usb_line6_pod *)line6);
974 line6_pod_init(interface, 966 break;
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 }
990 967
968 case LINE6_PODXTLIVE_VARIAX:
969 ret =
970 line6_variax_init(interface,
971 (struct usb_line6_variax *)line6);
991 break; 972 break;
992 973
993 case LINE6_VARIAX: 974 case LINE6_VARIAX:
@@ -1084,17 +1065,12 @@ static void line6_disconnect(struct usb_interface *interface)
1084 line6_podhd_disconnect(interface); 1065 line6_podhd_disconnect(interface);
1085 break; 1066 break;
1086 1067
1087 case LINE6_PODXTLIVE: 1068 case LINE6_PODXTLIVE_POD:
1088 switch (interface_number) { 1069 line6_pod_disconnect(interface);
1089 case PODXTLIVE_INTERFACE_POD: 1070 break;
1090 line6_pod_disconnect(interface);
1091 break;
1092
1093 case PODXTLIVE_INTERFACE_VARIAX:
1094 line6_variax_disconnect(interface);
1095 break;
1096 }
1097 1071
1072 case LINE6_PODXTLIVE_VARIAX:
1073 line6_variax_disconnect(interface);
1098 break; 1074 break;
1099 1075
1100 case LINE6_VARIAX: 1076 case LINE6_VARIAX:
diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h
index c5367951a22c..085aa44da64c 100644
--- a/drivers/staging/line6/driver.h
+++ b/drivers/staging/line6/driver.h
@@ -33,7 +33,8 @@ enum line6_device_type {
33 LINE6_PODSTUDIO_UX1, 33 LINE6_PODSTUDIO_UX1,
34 LINE6_PODSTUDIO_UX2, 34 LINE6_PODSTUDIO_UX2,
35 LINE6_PODXT, 35 LINE6_PODXT,
36 LINE6_PODXTLIVE, 36 LINE6_PODXTLIVE_POD,
37 LINE6_PODXTLIVE_VARIAX,
37 LINE6_PODXTPRO, 38 LINE6_PODXTPRO,
38 LINE6_TONEPORT_GX, 39 LINE6_TONEPORT_GX,
39 LINE6_TONEPORT_UX1, 40 LINE6_TONEPORT_UX1,
@@ -136,11 +137,6 @@ struct usb_line6 {
136 const struct line6_properties *properties; 137 const struct line6_properties *properties;
137 138
138 /** 139 /**
139 Interface number.
140 */
141 int interface_number;
142
143 /**
144 Interval (ms). 140 Interval (ms).
145 */ 141 */
146 int interval; 142 int interval;
diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c
index e09772f609b8..d09d1eae8f9e 100644
--- a/drivers/staging/line6/pcm.c
+++ b/drivers/staging/line6/pcm.c
@@ -433,7 +433,8 @@ int line6_init_pcm(struct usb_line6 *line6,
433 case LINE6_BASSPODXTLIVE: 433 case LINE6_BASSPODXTLIVE:
434 case LINE6_BASSPODXTPRO: 434 case LINE6_BASSPODXTPRO:
435 case LINE6_PODXT: 435 case LINE6_PODXT:
436 case LINE6_PODXTLIVE: 436 case LINE6_PODXTLIVE_POD:
437 case LINE6_PODXTLIVE_VARIAX:
437 case LINE6_PODXTPRO: 438 case LINE6_PODXTPRO:
438 case LINE6_PODHD300: 439 case LINE6_PODHD300:
439 case LINE6_PODHD400: 440 case LINE6_PODHD400:
diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h
index 397d94c559f7..91fd4c58f63c 100644
--- a/drivers/staging/line6/pod.h
+++ b/drivers/staging/line6/pod.h
@@ -21,12 +21,6 @@
21#include "driver.h" 21#include "driver.h"
22 22
23/* 23/*
24 PODxt Live interfaces
25*/
26#define PODXTLIVE_INTERFACE_POD 0
27#define PODXTLIVE_INTERFACE_VARIAX 1
28
29/*
30 Locate name in binary program dump 24 Locate name in binary program dump
31*/ 25*/
32#define POD_NAME_OFFSET 0 26#define POD_NAME_OFFSET 0