43
43
*/
44
44
static u64 parse_audio_format_i_type (struct snd_usb_audio * chip ,
45
45
struct audioformat * fp ,
46
- unsigned int format , void * _fmt ,
47
- int protocol )
46
+ unsigned int format , void * _fmt )
48
47
{
49
48
int sample_width , sample_bytes ;
50
49
u64 pcm_formats = 0 ;
51
50
52
- switch (protocol ) {
51
+ switch (fp -> protocol ) {
53
52
case UAC_VERSION_1 :
54
53
default : {
55
54
struct uac_format_type_i_discrete_descriptor * fmt = _fmt ;
@@ -360,11 +359,8 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip,
360
359
*/
361
360
static int parse_audio_format_i (struct snd_usb_audio * chip ,
362
361
struct audioformat * fp , unsigned int format ,
363
- struct uac_format_type_i_continuous_descriptor * fmt ,
364
- struct usb_host_interface * iface )
362
+ struct uac_format_type_i_continuous_descriptor * fmt )
365
363
{
366
- struct usb_interface_descriptor * altsd = get_iface_desc (iface );
367
- int protocol = altsd -> bInterfaceProtocol ;
368
364
snd_pcm_format_t pcm_format ;
369
365
int ret ;
370
366
@@ -387,8 +383,7 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
387
383
}
388
384
fp -> formats = pcm_format_to_bits (pcm_format );
389
385
} else {
390
- fp -> formats = parse_audio_format_i_type (chip , fp , format ,
391
- fmt , protocol );
386
+ fp -> formats = parse_audio_format_i_type (chip , fp , format , fmt );
392
387
if (!fp -> formats )
393
388
return - EINVAL ;
394
389
}
@@ -398,11 +393,8 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
398
393
* proprietary class specific descriptor.
399
394
* audio class v2 uses class specific EP0 range requests for that.
400
395
*/
401
- switch (protocol ) {
396
+ switch (fp -> protocol ) {
402
397
default :
403
- snd_printdd (KERN_WARNING "%d:%u:%d : invalid protocol version %d, assuming v1\n" ,
404
- chip -> dev -> devnum , fp -> iface , fp -> altsetting , protocol );
405
- /* fall through */
406
398
case UAC_VERSION_1 :
407
399
fp -> channels = fmt -> bNrChannels ;
408
400
ret = parse_audio_format_rates_v1 (chip , fp , (unsigned char * ) fmt , 7 );
@@ -427,12 +419,9 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
427
419
*/
428
420
static int parse_audio_format_ii (struct snd_usb_audio * chip ,
429
421
struct audioformat * fp ,
430
- int format , void * _fmt ,
431
- struct usb_host_interface * iface )
422
+ int format , void * _fmt )
432
423
{
433
424
int brate , framesize , ret ;
434
- struct usb_interface_descriptor * altsd = get_iface_desc (iface );
435
- int protocol = altsd -> bInterfaceProtocol ;
436
425
437
426
switch (format ) {
438
427
case UAC_FORMAT_TYPE_II_AC3 :
@@ -452,11 +441,8 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
452
441
453
442
fp -> channels = 1 ;
454
443
455
- switch (protocol ) {
444
+ switch (fp -> protocol ) {
456
445
default :
457
- snd_printdd (KERN_WARNING "%d:%u:%d : invalid protocol version %d, assuming v1\n" ,
458
- chip -> dev -> devnum , fp -> iface , fp -> altsetting , protocol );
459
- /* fall through */
460
446
case UAC_VERSION_1 : {
461
447
struct uac_format_type_ii_discrete_descriptor * fmt = _fmt ;
462
448
brate = le16_to_cpu (fmt -> wMaxBitRate );
@@ -483,17 +469,17 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
483
469
int snd_usb_parse_audio_format (struct snd_usb_audio * chip ,
484
470
struct audioformat * fp , unsigned int format ,
485
471
struct uac_format_type_i_continuous_descriptor * fmt ,
486
- int stream , struct usb_host_interface * iface )
472
+ int stream )
487
473
{
488
474
int err ;
489
475
490
476
switch (fmt -> bFormatType ) {
491
477
case UAC_FORMAT_TYPE_I :
492
478
case UAC_FORMAT_TYPE_III :
493
- err = parse_audio_format_i (chip , fp , format , fmt , iface );
479
+ err = parse_audio_format_i (chip , fp , format , fmt );
494
480
break ;
495
481
case UAC_FORMAT_TYPE_II :
496
- err = parse_audio_format_ii (chip , fp , format , fmt , iface );
482
+ err = parse_audio_format_ii (chip , fp , format , fmt );
497
483
break ;
498
484
default :
499
485
snd_printd (KERN_INFO "%d:%u:%d : format type %d is not supported yet\n" ,
0 commit comments