@@ -67,121 +67,141 @@ static const struct line6_properties line6_properties_table[] = {
67
67
.capabilities = LINE6_CAP_CONTROL
68
68
| LINE6_CAP_PCM
69
69
| LINE6_CAP_HWMON ,
70
+ .altsetting = 5 ,
70
71
},
71
72
[LINE6_BASSPODXTLIVE ] = {
72
73
.id = "BassPODxtLive" ,
73
74
.name = "BassPODxt Live" ,
74
75
.capabilities = LINE6_CAP_CONTROL
75
76
| LINE6_CAP_PCM
76
77
| LINE6_CAP_HWMON ,
78
+ .altsetting = 1 ,
77
79
},
78
80
[LINE6_BASSPODXTPRO ] = {
79
81
.id = "BassPODxtPro" ,
80
82
.name = "BassPODxt Pro" ,
81
83
.capabilities = LINE6_CAP_CONTROL
82
84
| LINE6_CAP_PCM
83
85
| LINE6_CAP_HWMON ,
86
+ .altsetting = 5 ,
84
87
},
85
88
[LINE6_GUITARPORT ] = {
86
89
.id = "GuitarPort" ,
87
90
.name = "GuitarPort" ,
88
91
.capabilities = LINE6_CAP_PCM ,
92
+ .altsetting = 2 , /* 1..4 seem to be ok */
89
93
},
90
94
[LINE6_POCKETPOD ] = {
91
95
.id = "PocketPOD" ,
92
96
.name = "Pocket POD" ,
93
97
.capabilities = LINE6_CAP_CONTROL ,
98
+ .altsetting = 0 ,
94
99
},
95
100
[LINE6_PODHD300 ] = {
96
101
.id = "PODHD300" ,
97
102
.name = "POD HD300" ,
98
103
.capabilities = LINE6_CAP_CONTROL
99
104
| LINE6_CAP_PCM
100
105
| LINE6_CAP_HWMON ,
106
+ .altsetting = 5 ,
101
107
},
102
108
[LINE6_PODHD400 ] = {
103
109
.id = "PODHD400" ,
104
110
.name = "POD HD400" ,
105
111
.capabilities = LINE6_CAP_CONTROL
106
112
| LINE6_CAP_PCM
107
113
| LINE6_CAP_HWMON ,
114
+ .altsetting = 5 ,
108
115
},
109
116
[LINE6_PODHD500_0 ] = {
110
117
.id = "PODHD500" ,
111
118
.name = "POD HD500" ,
112
119
.capabilities = LINE6_CAP_CONTROL
113
120
| LINE6_CAP_PCM
114
121
| LINE6_CAP_HWMON ,
122
+ .altsetting = 1 ,
115
123
},
116
124
[LINE6_PODHD500_1 ] = {
117
125
.id = "PODHD500" ,
118
126
.name = "POD HD500" ,
119
127
.capabilities = LINE6_CAP_CONTROL
120
128
| LINE6_CAP_PCM
121
129
| LINE6_CAP_HWMON ,
130
+ .altsetting = 1 ,
122
131
},
123
132
[LINE6_PODSTUDIO_GX ] = {
124
133
.id = "PODStudioGX" ,
125
134
.name = "POD Studio GX" ,
126
135
.capabilities = LINE6_CAP_PCM ,
136
+ .altsetting = 2 , /* 1..4 seem to be ok */
127
137
},
128
138
[LINE6_PODSTUDIO_UX1 ] = {
129
139
.id = "PODStudioUX1" ,
130
140
.name = "POD Studio UX1" ,
131
141
.capabilities = LINE6_CAP_PCM ,
142
+ .altsetting = 2 , /* 1..4 seem to be ok */
132
143
},
133
144
[LINE6_PODSTUDIO_UX2 ] = {
134
145
.id = "PODStudioUX2" ,
135
146
.name = "POD Studio UX2" ,
136
147
.capabilities = LINE6_CAP_PCM ,
148
+ .altsetting = 2 , /* defaults to 44.1kHz, 16-bit */
137
149
},
138
150
[LINE6_PODXT ] = {
139
151
.id = "PODxt" ,
140
152
.name = "PODxt" ,
141
153
.capabilities = LINE6_CAP_CONTROL
142
154
| LINE6_CAP_PCM
143
155
| LINE6_CAP_HWMON ,
156
+ .altsetting = 5 ,
144
157
},
145
158
[LINE6_PODXTLIVE_POD ] = {
146
159
.id = "PODxtLive" ,
147
160
.name = "PODxt Live" ,
148
161
.capabilities = LINE6_CAP_CONTROL
149
162
| LINE6_CAP_PCM
150
163
| LINE6_CAP_HWMON ,
164
+ .altsetting = 1 ,
151
165
},
152
166
[LINE6_PODXTLIVE_VARIAX ] = {
153
167
.id = "PODxtLive" ,
154
168
.name = "PODxt Live" ,
155
169
.capabilities = LINE6_CAP_CONTROL
156
170
| LINE6_CAP_PCM
157
171
| LINE6_CAP_HWMON ,
172
+ .altsetting = 1 ,
158
173
},
159
174
[LINE6_PODXTPRO ] = {
160
175
.id = "PODxtPro" ,
161
176
.name = "PODxt Pro" ,
162
177
.capabilities = LINE6_CAP_CONTROL
163
178
| LINE6_CAP_PCM
164
179
| LINE6_CAP_HWMON ,
180
+ .altsetting = 5 ,
165
181
},
166
182
[LINE6_TONEPORT_GX ] = {
167
183
.id = "TonePortGX" ,
168
184
.name = "TonePort GX" ,
169
185
.capabilities = LINE6_CAP_PCM ,
186
+ .altsetting = 2 , /* 1..4 seem to be ok */
170
187
},
171
188
[LINE6_TONEPORT_UX1 ] = {
172
189
.id = "TonePortUX1" ,
173
190
.name = "TonePort UX1" ,
174
191
.capabilities = LINE6_CAP_PCM ,
192
+ .altsetting = 2 , /* 1..4 seem to be ok */
175
193
},
176
194
[LINE6_TONEPORT_UX2 ] = {
177
195
.id = "TonePortUX2" ,
178
196
.name = "TonePort UX2" ,
179
197
.capabilities = LINE6_CAP_PCM ,
198
+ .altsetting = 2 , /* defaults to 44.1kHz, 16-bit */
180
199
},
181
200
[LINE6_VARIAX ] = {
182
201
.id = "Variax" ,
183
202
.name = "Variax Workbench" ,
184
203
.capabilities = LINE6_CAP_CONTROL ,
204
+ .altsetting = 1 ,
185
205
}
186
206
};
187
207
@@ -703,7 +723,7 @@ static int line6_probe(struct usb_interface *interface,
703
723
struct usb_device * usbdev ;
704
724
struct usb_line6 * line6 ;
705
725
const struct line6_properties * properties ;
706
- int interface_number , alternate = 0 ;
726
+ int interface_number ;
707
727
int size = 0 ;
708
728
int ep_read = 0 , ep_write = 0 ;
709
729
int ret ;
@@ -729,56 +749,8 @@ static int line6_probe(struct usb_interface *interface,
729
749
/* query interface number */
730
750
interface_number = interface -> cur_altsetting -> desc .bInterfaceNumber ;
731
751
732
- switch (devtype ) {
733
- case LINE6_BASSPODXTLIVE :
734
- case LINE6_PODXTLIVE_POD :
735
- case LINE6_PODXTLIVE_VARIAX :
736
- case LINE6_VARIAX :
737
- alternate = 1 ;
738
- break ;
739
-
740
- case LINE6_POCKETPOD :
741
- alternate = 0 ;
742
- break ;
743
-
744
- case LINE6_PODHD500_0 :
745
- alternate = 1 ;
746
- break ;
747
-
748
- case LINE6_PODHD500_1 :
749
- alternate = 0 ;
750
- break ;
751
-
752
- case LINE6_BASSPODXT :
753
- case LINE6_BASSPODXTPRO :
754
- case LINE6_PODXT :
755
- case LINE6_PODXTPRO :
756
- case LINE6_PODHD300 :
757
- case LINE6_PODHD400 :
758
- alternate = 5 ;
759
- break ;
760
-
761
- case LINE6_GUITARPORT :
762
- case LINE6_PODSTUDIO_GX :
763
- case LINE6_PODSTUDIO_UX1 :
764
- case LINE6_TONEPORT_GX :
765
- case LINE6_TONEPORT_UX1 :
766
- alternate = 2 ; /* 1..4 seem to be ok */
767
- break ;
768
-
769
- case LINE6_TONEPORT_UX2 :
770
- case LINE6_PODSTUDIO_UX2 :
771
- /* defaults to 44.1kHz, 16-bit */
772
- alternate = 2 ;
773
- break ;
774
-
775
- default :
776
- MISSING_CASE ;
777
- ret = - ENODEV ;
778
- goto err_put ;
779
- }
780
-
781
- ret = usb_set_interface (usbdev , interface_number , alternate );
752
+ ret = usb_set_interface (usbdev , interface_number ,
753
+ properties -> altsetting );
782
754
if (ret < 0 ) {
783
755
dev_err (& interface -> dev , "set_interface failed\n" );
784
756
goto err_put ;
0 commit comments