Merge branch 'topic/misc' into for-linus

+1071 -692
+6 -161
Documentation/kernel-parameters.txt
··· 280 no: ACPI OperationRegions are not marked as reserved, 281 no further checks are performed. 282 283 - ad1848= [HW,OSS] 284 - Format: <io>,<irq>,<dma>,<dma2>,<type> 285 - 286 add_efi_memmap [EFI; X86] Include EFI memory map in 287 kernel's map of available physical RAM. 288 289 advansys= [HW,SCSI] 290 See header of drivers/scsi/advansys.c. 291 - 292 - aedsp16= [HW,OSS] Audio Excel DSP 16 293 - Format: <io>,<irq>,<dma>,<mss_io>,<mpu_io>,<mpu_irq> 294 - See also header of sound/oss/aedsp16.c. 295 296 agp= [AGP] 297 { off | try_unsupported } ··· 303 304 aic79xx= [HW,SCSI] 305 See Documentation/scsi/aic79xx.txt. 306 307 alignment= [KNL,ARM] 308 Allow the default userspace alignment fault handler ··· 650 disable_timer_pin_1 [X86] 651 Disable PIN 1 of APIC timer 652 Can be useful to work around chipset bugs. 653 - 654 - dmasound= [HW,OSS] Sound subsystem buffers 655 656 dma_debug=off If the kernel is compiled with DMA_API_DEBUG support, 657 this option disables the debugging code at boot. ··· 1517 that the amount of memory usable for all allocations 1518 is not too small. 1519 1520 - mpu401= [HW,OSS] 1521 - Format: <io>,<irq> 1522 - 1523 MTD_Partition= [MTD] 1524 Format: <name>,<region-number>,<size>,<offset> 1525 ··· 1840 For example, to override I2C bus2: 1841 omap_mux=i2c2_scl.i2c2_scl=0x100,i2c2_sda.i2c2_sda=0x100 1842 1843 - opl3= [HW,OSS] 1844 - Format: <io> 1845 - 1846 oprofile.timer= [HW] 1847 Use timer interrupt instead of performance counters 1848 ··· 1850 arch_perfmon: [X86] Force use of architectural 1851 perfmon on Intel CPUs instead of the 1852 CPU specific event set. 1853 1854 osst= [HW,SCSI] SCSI Tape Driver 1855 Format: <buffer_size>,<write_threshold> ··· 1889 up parallel port mode and sets it to spp. 1890 Currently this function knows 686a and 8231 chips. 1891 Format: [spp|ps2|epp|ecp|ecpepp] 1892 - 1893 - pas2= [HW,OSS] Format: 1894 - <io>,<irq>,<dma>,<dma16>,<sb_io>,<sb_irq>,<sb_dma>,<sb_dma16> 1895 1896 pas16= [HW,SCSI] 1897 See header of drivers/scsi/pas16.c. ··· 2159 [HW,MOUSE] Controls Logitech smartscroll autorepeat. 2160 0 = disabled, 1 = enabled (default). 2161 2162 - pss= [HW,OSS] Personal Sound System (ECHO ESC614) 2163 - Format: 2164 - <io>,<mss_io>,<mss_irq>,<mss_dma>,<mpu_io>,<mpu_irq> 2165 - 2166 pt. [PARIDE] 2167 See Documentation/blockdev/paride.txt. 2168 ··· 2367 1: Fast pin select (default) 2368 2: ATC IRMode 2369 2370 - snd-ad1816a= [HW,ALSA] 2371 - 2372 - snd-ad1848= [HW,ALSA] 2373 - 2374 - snd-ali5451= [HW,ALSA] 2375 - 2376 - snd-als100= [HW,ALSA] 2377 - 2378 - snd-als4000= [HW,ALSA] 2379 - 2380 - snd-azt2320= [HW,ALSA] 2381 - 2382 - snd-cmi8330= [HW,ALSA] 2383 - 2384 - snd-cmipci= [HW,ALSA] 2385 - 2386 - snd-cs4231= [HW,ALSA] 2387 - 2388 - snd-cs4232= [HW,ALSA] 2389 - 2390 - snd-cs4236= [HW,ALSA] 2391 - 2392 - snd-cs4281= [HW,ALSA] 2393 - 2394 - snd-cs46xx= [HW,ALSA] 2395 - 2396 - snd-dt019x= [HW,ALSA] 2397 - 2398 - snd-dummy= [HW,ALSA] 2399 - 2400 - snd-emu10k1= [HW,ALSA] 2401 - 2402 - snd-ens1370= [HW,ALSA] 2403 - 2404 - snd-ens1371= [HW,ALSA] 2405 - 2406 - snd-es968= [HW,ALSA] 2407 - 2408 - snd-es1688= [HW,ALSA] 2409 - 2410 - snd-es18xx= [HW,ALSA] 2411 - 2412 - snd-es1938= [HW,ALSA] 2413 - 2414 - snd-es1968= [HW,ALSA] 2415 - 2416 - snd-fm801= [HW,ALSA] 2417 - 2418 - snd-gusclassic= [HW,ALSA] 2419 - 2420 - snd-gusextreme= [HW,ALSA] 2421 - 2422 - snd-gusmax= [HW,ALSA] 2423 - 2424 - snd-hdsp= [HW,ALSA] 2425 - 2426 - snd-ice1712= [HW,ALSA] 2427 - 2428 - snd-intel8x0= [HW,ALSA] 2429 - 2430 - snd-interwave= [HW,ALSA] 2431 - 2432 - snd-interwave-stb= 2433 - [HW,ALSA] 2434 - 2435 - snd-korg1212= [HW,ALSA] 2436 - 2437 - snd-maestro3= [HW,ALSA] 2438 - 2439 - snd-mpu401= [HW,ALSA] 2440 - 2441 - snd-mtpav= [HW,ALSA] 2442 - 2443 - snd-nm256= [HW,ALSA] 2444 - 2445 - snd-opl3sa2= [HW,ALSA] 2446 - 2447 - snd-opti92x-ad1848= 2448 - [HW,ALSA] 2449 - 2450 - snd-opti92x-cs4231= 2451 - [HW,ALSA] 2452 - 2453 - snd-opti93x= [HW,ALSA] 2454 - 2455 - snd-pmac= [HW,ALSA] 2456 - 2457 - snd-rme32= [HW,ALSA] 2458 - 2459 - snd-rme96= [HW,ALSA] 2460 - 2461 - snd-rme9652= [HW,ALSA] 2462 - 2463 - snd-sb8= [HW,ALSA] 2464 - 2465 - snd-sb16= [HW,ALSA] 2466 - 2467 - snd-sbawe= [HW,ALSA] 2468 - 2469 - snd-serial= [HW,ALSA] 2470 - 2471 - snd-sgalaxy= [HW,ALSA] 2472 - 2473 - snd-sonicvibes= [HW,ALSA] 2474 - 2475 - snd-sun-amd7930= 2476 - [HW,ALSA] 2477 - 2478 - snd-sun-cs4231= [HW,ALSA] 2479 - 2480 - snd-trident= [HW,ALSA] 2481 - 2482 - snd-usb-audio= [HW,ALSA,USB] 2483 - 2484 - snd-via82xx= [HW,ALSA] 2485 - 2486 - snd-virmidi= [HW,ALSA] 2487 - 2488 - snd-wavefront= [HW,ALSA] 2489 - 2490 - snd-ymfpci= [HW,ALSA] 2491 - 2492 softlockup_panic= 2493 [KNL] Should the soft-lockup detector generate panics. 2494 ··· 2380 spia_fio_base= 2381 spia_pedr= 2382 spia_peddr= 2383 - 2384 - sscape= [HW,OSS] 2385 - Format: <io>,<irq>,<dma>,<mpu_io>,<mpu_irq> 2386 2387 st= [HW,SCSI] SCSI tape parameters (buffers, etc.) 2388 See Documentation/scsi/st.txt. ··· 2520 to facilitate early boot debugging. 2521 See also Documentation/trace/events.txt 2522 2523 - trix= [HW,OSS] MediaTrix AudioTrix Pro 2524 - Format: 2525 - <io>,<irq>,<dma>,<dma2>,<sb_io>,<sb_irq>,<sb_dma>,<mpu_io>,<mpu_irq> 2526 - 2527 tsc= Disable clocksource-must-verify flag for TSC. 2528 Format: <string> 2529 [x86] reliable: mark tsc clocksource as reliable, this ··· 2535 2536 u14-34f= [HW,SCSI] UltraStor 14F/34F SCSI host adapter 2537 See header of drivers/scsi/u14-34f.c. 2538 - 2539 - uart401= [HW,OSS] 2540 - Format: <io>,<irq> 2541 - 2542 - uart6850= [HW,OSS] 2543 - Format: <io>,<irq> 2544 2545 uhash_entries= [KNL,NET] 2546 Set number of hash buckets for UDP/UDP-Lite connections ··· 2701 overridden by individual drivers. 0 will hide 2702 cursors, 1 will display them. 2703 2704 - waveartist= [HW,OSS] 2705 - Format: <io>,<irq>,<dma>,<dma2> 2706 - 2707 wd33c93= [HW,SCSI] 2708 See header of drivers/scsi/wd33c93.c. 2709 ··· 2733 2734 TODO: 2735 2736 - Add documentation for ALSA options. 2737 Add more DRM drivers.
··· 280 no: ACPI OperationRegions are not marked as reserved, 281 no further checks are performed. 282 283 add_efi_memmap [EFI; X86] Include EFI memory map in 284 kernel's map of available physical RAM. 285 286 advansys= [HW,SCSI] 287 See header of drivers/scsi/advansys.c. 288 289 agp= [AGP] 290 { off | try_unsupported } ··· 310 311 aic79xx= [HW,SCSI] 312 See Documentation/scsi/aic79xx.txt. 313 + 314 + ALSA [HW,ALSA] 315 + See Documentation/sound/alsa/alsa-parameters.txt 316 317 alignment= [KNL,ARM] 318 Allow the default userspace alignment fault handler ··· 654 disable_timer_pin_1 [X86] 655 Disable PIN 1 of APIC timer 656 Can be useful to work around chipset bugs. 657 658 dma_debug=off If the kernel is compiled with DMA_API_DEBUG support, 659 this option disables the debugging code at boot. ··· 1523 that the amount of memory usable for all allocations 1524 is not too small. 1525 1526 MTD_Partition= [MTD] 1527 Format: <name>,<region-number>,<size>,<offset> 1528 ··· 1849 For example, to override I2C bus2: 1850 omap_mux=i2c2_scl.i2c2_scl=0x100,i2c2_sda.i2c2_sda=0x100 1851 1852 oprofile.timer= [HW] 1853 Use timer interrupt instead of performance counters 1854 ··· 1862 arch_perfmon: [X86] Force use of architectural 1863 perfmon on Intel CPUs instead of the 1864 CPU specific event set. 1865 + 1866 + OSS [HW,OSS] 1867 + See Documentation/sound/oss/oss-parameters.txt 1868 1869 osst= [HW,SCSI] SCSI Tape Driver 1870 Format: <buffer_size>,<write_threshold> ··· 1898 up parallel port mode and sets it to spp. 1899 Currently this function knows 686a and 8231 chips. 1900 Format: [spp|ps2|epp|ecp|ecpepp] 1901 1902 pas16= [HW,SCSI] 1903 See header of drivers/scsi/pas16.c. ··· 2171 [HW,MOUSE] Controls Logitech smartscroll autorepeat. 2172 0 = disabled, 1 = enabled (default). 2173 2174 pt. [PARIDE] 2175 See Documentation/blockdev/paride.txt. 2176 ··· 2383 1: Fast pin select (default) 2384 2: ATC IRMode 2385 2386 softlockup_panic= 2387 [KNL] Should the soft-lockup detector generate panics. 2388 ··· 2518 spia_fio_base= 2519 spia_pedr= 2520 spia_peddr= 2521 2522 st= [HW,SCSI] SCSI tape parameters (buffers, etc.) 2523 See Documentation/scsi/st.txt. ··· 2661 to facilitate early boot debugging. 2662 See also Documentation/trace/events.txt 2663 2664 tsc= Disable clocksource-must-verify flag for TSC. 2665 Format: <string> 2666 [x86] reliable: mark tsc clocksource as reliable, this ··· 2680 2681 u14-34f= [HW,SCSI] UltraStor 14F/34F SCSI host adapter 2682 See header of drivers/scsi/u14-34f.c. 2683 2684 uhash_entries= [KNL,NET] 2685 Set number of hash buckets for UDP/UDP-Lite connections ··· 2852 overridden by individual drivers. 0 will hide 2853 cursors, 1 will display them. 2854 2855 wd33c93= [HW,SCSI] 2856 See header of drivers/scsi/wd33c93.c. 2857 ··· 2887 2888 TODO: 2889 2890 Add more DRM drivers.
+8
Documentation/sound/alsa/Procfile.txt
··· 103 bit 2 = Enable additional jiffies check 104 bit 3 = Log hwptr update at each period interrupt 105 bit 4 = Log hwptr update at each snd_pcm_update_hw_ptr() 106 107 When the bit 0 is set, the driver will show the messages to 108 kernel log when an xrun is detected. The debug message is ··· 123 124 Bits 3 and 4 are for logging the hwptr records. Note that 125 these will give flood of kernel messages. 126 127 card*/pcm*/sub*/info 128 The general information of this PCM sub-stream.
··· 103 bit 2 = Enable additional jiffies check 104 bit 3 = Log hwptr update at each period interrupt 105 bit 4 = Log hwptr update at each snd_pcm_update_hw_ptr() 106 + bit 5 = Show last 10 positions on error 107 + bit 6 = Do above only once 108 109 When the bit 0 is set, the driver will show the messages to 110 kernel log when an xrun is detected. The debug message is ··· 121 122 Bits 3 and 4 are for logging the hwptr records. Note that 123 these will give flood of kernel messages. 124 + 125 + When bit 5 is set, the driver logs the last 10 xrun errors and 126 + the proc file shows each jiffies, position, period_size, 127 + buffer_size, old_hw_ptr, and hw_ptr_base values. 128 + 129 + When bit 6 is set, the full xrun log is shown only once. 130 131 card*/pcm*/sub*/info 132 The general information of this PCM sub-stream.
+135
Documentation/sound/alsa/alsa-parameters.txt
···
··· 1 + ALSA Kernel Parameters 2 + ~~~~~~~~~~~~~~~~~~~~~~ 3 + 4 + See Documentation/kernel-parameters.txt for general information on 5 + specifying module parameters. 6 + 7 + This document may not be entirely up to date and comprehensive. The command 8 + "modinfo -p ${modulename}" shows a current list of all parameters of a loadable 9 + module. Loadable modules, after being loaded into the running kernel, also 10 + reveal their parameters in /sys/module/${modulename}/parameters/. Some of these 11 + parameters may be changed at runtime by the command 12 + "echo -n ${value} > /sys/module/${modulename}/parameters/${parm}". 13 + 14 + 15 + snd-ad1816a= [HW,ALSA] 16 + 17 + snd-ad1848= [HW,ALSA] 18 + 19 + snd-ali5451= [HW,ALSA] 20 + 21 + snd-als100= [HW,ALSA] 22 + 23 + snd-als4000= [HW,ALSA] 24 + 25 + snd-azt2320= [HW,ALSA] 26 + 27 + snd-cmi8330= [HW,ALSA] 28 + 29 + snd-cmipci= [HW,ALSA] 30 + 31 + snd-cs4231= [HW,ALSA] 32 + 33 + snd-cs4232= [HW,ALSA] 34 + 35 + snd-cs4236= [HW,ALSA] 36 + 37 + snd-cs4281= [HW,ALSA] 38 + 39 + snd-cs46xx= [HW,ALSA] 40 + 41 + snd-dt019x= [HW,ALSA] 42 + 43 + snd-dummy= [HW,ALSA] 44 + 45 + snd-emu10k1= [HW,ALSA] 46 + 47 + snd-ens1370= [HW,ALSA] 48 + 49 + snd-ens1371= [HW,ALSA] 50 + 51 + snd-es968= [HW,ALSA] 52 + 53 + snd-es1688= [HW,ALSA] 54 + 55 + snd-es18xx= [HW,ALSA] 56 + 57 + snd-es1938= [HW,ALSA] 58 + 59 + snd-es1968= [HW,ALSA] 60 + 61 + snd-fm801= [HW,ALSA] 62 + 63 + snd-gusclassic= [HW,ALSA] 64 + 65 + snd-gusextreme= [HW,ALSA] 66 + 67 + snd-gusmax= [HW,ALSA] 68 + 69 + snd-hdsp= [HW,ALSA] 70 + 71 + snd-ice1712= [HW,ALSA] 72 + 73 + snd-intel8x0= [HW,ALSA] 74 + 75 + snd-interwave= [HW,ALSA] 76 + 77 + snd-interwave-stb= 78 + [HW,ALSA] 79 + 80 + snd-korg1212= [HW,ALSA] 81 + 82 + snd-maestro3= [HW,ALSA] 83 + 84 + snd-mpu401= [HW,ALSA] 85 + 86 + snd-mtpav= [HW,ALSA] 87 + 88 + snd-nm256= [HW,ALSA] 89 + 90 + snd-opl3sa2= [HW,ALSA] 91 + 92 + snd-opti92x-ad1848= 93 + [HW,ALSA] 94 + 95 + snd-opti92x-cs4231= 96 + [HW,ALSA] 97 + 98 + snd-opti93x= [HW,ALSA] 99 + 100 + snd-pmac= [HW,ALSA] 101 + 102 + snd-rme32= [HW,ALSA] 103 + 104 + snd-rme96= [HW,ALSA] 105 + 106 + snd-rme9652= [HW,ALSA] 107 + 108 + snd-sb8= [HW,ALSA] 109 + 110 + snd-sb16= [HW,ALSA] 111 + 112 + snd-sbawe= [HW,ALSA] 113 + 114 + snd-serial= [HW,ALSA] 115 + 116 + snd-sgalaxy= [HW,ALSA] 117 + 118 + snd-sonicvibes= [HW,ALSA] 119 + 120 + snd-sun-amd7930= 121 + [HW,ALSA] 122 + 123 + snd-sun-cs4231= [HW,ALSA] 124 + 125 + snd-trident= [HW,ALSA] 126 + 127 + snd-usb-audio= [HW,ALSA,USB] 128 + 129 + snd-via82xx= [HW,ALSA] 130 + 131 + snd-virmidi= [HW,ALSA] 132 + 133 + snd-wavefront= [HW,ALSA] 134 + 135 + snd-ymfpci= [HW,ALSA]
+51
Documentation/sound/oss/oss-parameters.txt
···
··· 1 + OSS Kernel Parameters 2 + ~~~~~~~~~~~~~~~~~~~~~ 3 + 4 + See Documentation/kernel-parameters.txt for general information on 5 + specifying module parameters. 6 + 7 + This document may not be entirely up to date and comprehensive. The command 8 + "modinfo -p ${modulename}" shows a current list of all parameters of a loadable 9 + module. Loadable modules, after being loaded into the running kernel, also 10 + reveal their parameters in /sys/module/${modulename}/parameters/. Some of these 11 + parameters may be changed at runtime by the command 12 + "echo -n ${value} > /sys/module/${modulename}/parameters/${parm}". 13 + 14 + 15 + ad1848= [HW,OSS] 16 + Format: <io>,<irq>,<dma>,<dma2>,<type> 17 + 18 + aedsp16= [HW,OSS] Audio Excel DSP 16 19 + Format: <io>,<irq>,<dma>,<mss_io>,<mpu_io>,<mpu_irq> 20 + See also header of sound/oss/aedsp16.c. 21 + 22 + dmasound= [HW,OSS] Sound subsystem buffers 23 + 24 + mpu401= [HW,OSS] 25 + Format: <io>,<irq> 26 + 27 + opl3= [HW,OSS] 28 + Format: <io> 29 + 30 + pas2= [HW,OSS] Format: 31 + <io>,<irq>,<dma>,<dma16>,<sb_io>,<sb_irq>,<sb_dma>,<sb_dma16> 32 + 33 + pss= [HW,OSS] Personal Sound System (ECHO ESC614) 34 + Format: 35 + <io>,<mss_io>,<mss_irq>,<mss_dma>,<mpu_io>,<mpu_irq> 36 + 37 + sscape= [HW,OSS] 38 + Format: <io>,<irq>,<dma>,<mpu_io>,<mpu_irq> 39 + 40 + trix= [HW,OSS] MediaTrix AudioTrix Pro 41 + Format: 42 + <io>,<irq>,<dma>,<dma2>,<sb_io>,<sb_irq>,<sb_dma>,<mpu_io>,<mpu_irq> 43 + 44 + uart401= [HW,OSS] 45 + Format: <io>,<irq> 46 + 47 + uart6850= [HW,OSS] 48 + Format: <io>,<irq> 49 + 50 + waveartist= [HW,OSS] 51 + Format: <io>,<irq>,<dma>,<dma2>
+6
arch/um/drivers/hostaudio_kern.c
··· 8 #include "linux/slab.h" 9 #include "linux/sound.h" 10 #include "linux/soundcard.h" 11 #include "asm/uaccess.h" 12 #include "init.h" 13 #include "os.h" ··· 199 if (file->f_mode & FMODE_WRITE) 200 w = 1; 201 202 ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0); 203 if (ret < 0) { 204 kfree(state); 205 return ret; ··· 258 if (file->f_mode & FMODE_WRITE) 259 w = 1; 260 261 ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0); 262 263 if (ret < 0) { 264 printk(KERN_ERR "hostaudio_open_mixdev failed to open '%s', "
··· 8 #include "linux/slab.h" 9 #include "linux/sound.h" 10 #include "linux/soundcard.h" 11 + #include "linux/smp_lock.h" 12 #include "asm/uaccess.h" 13 #include "init.h" 14 #include "os.h" ··· 198 if (file->f_mode & FMODE_WRITE) 199 w = 1; 200 201 + lock_kernel(); 202 ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0); 203 + unlock_kernel(); 204 + 205 if (ret < 0) { 206 kfree(state); 207 return ret; ··· 254 if (file->f_mode & FMODE_WRITE) 255 w = 1; 256 257 + lock_kernel(); 258 ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0); 259 + unlock_kernel(); 260 261 if (ret < 0) { 262 printk(KERN_ERR "hostaudio_open_mixdev failed to open '%s', "
+3 -3
drivers/usb/gadget/f_audio.c
··· 61 #define UAC_DT_TOTAL_LENGTH (UAC_DT_AC_HEADER_LENGTH + UAC_DT_INPUT_TERMINAL_SIZE \ 62 + UAC_DT_OUTPUT_TERMINAL_SIZE + UAC_DT_FEATURE_UNIT_SIZE(0)) 63 /* B.3.2 Class-Specific AC Interface Descriptor */ 64 - static struct uac_ac_header_descriptor_v1_2 ac_header_desc = { 65 .bLength = UAC_DT_AC_HEADER_LENGTH, 66 .bDescriptorType = USB_DT_CS_INTERFACE, 67 .bDescriptorSubtype = UAC_HEADER, ··· 125 }; 126 127 #define OUTPUT_TERMINAL_ID 3 128 - static struct uac_output_terminal_descriptor_v1 output_terminal_desc = { 129 .bLength = UAC_DT_OUTPUT_TERMINAL_SIZE, 130 .bDescriptorType = USB_DT_CS_INTERFACE, 131 .bDescriptorSubtype = UAC_OUTPUT_TERMINAL, ··· 155 }; 156 157 /* B.4.2 Class-Specific AS Interface Descriptor */ 158 - static struct uac_as_header_descriptor_v1 as_header_desc = { 159 .bLength = UAC_DT_AS_HEADER_SIZE, 160 .bDescriptorType = USB_DT_CS_INTERFACE, 161 .bDescriptorSubtype = UAC_AS_GENERAL,
··· 61 #define UAC_DT_TOTAL_LENGTH (UAC_DT_AC_HEADER_LENGTH + UAC_DT_INPUT_TERMINAL_SIZE \ 62 + UAC_DT_OUTPUT_TERMINAL_SIZE + UAC_DT_FEATURE_UNIT_SIZE(0)) 63 /* B.3.2 Class-Specific AC Interface Descriptor */ 64 + static struct uac1_ac_header_descriptor_2 ac_header_desc = { 65 .bLength = UAC_DT_AC_HEADER_LENGTH, 66 .bDescriptorType = USB_DT_CS_INTERFACE, 67 .bDescriptorSubtype = UAC_HEADER, ··· 125 }; 126 127 #define OUTPUT_TERMINAL_ID 3 128 + static struct uac1_output_terminal_descriptor output_terminal_desc = { 129 .bLength = UAC_DT_OUTPUT_TERMINAL_SIZE, 130 .bDescriptorType = USB_DT_CS_INTERFACE, 131 .bDescriptorSubtype = UAC_OUTPUT_TERMINAL, ··· 155 }; 156 157 /* B.4.2 Class-Specific AS Interface Descriptor */ 158 + static struct uac1_as_header_descriptor as_header_desc = { 159 .bLength = UAC_DT_AS_HEADER_SIZE, 160 .bDescriptorType = USB_DT_CS_INTERFACE, 161 .bDescriptorSubtype = UAC_AS_GENERAL,
+1 -1
drivers/usb/gadget/gmidi.c
··· 238 }; 239 240 /* B.3.2 Class-Specific AC Interface Descriptor */ 241 - static const struct uac_ac_header_descriptor_v1_1 ac_header_desc = { 242 .bLength = UAC_DT_AC_HEADER_SIZE(1), 243 .bDescriptorType = USB_DT_CS_INTERFACE, 244 .bDescriptorSubtype = USB_MS_HEADER,
··· 238 }; 239 240 /* B.3.2 Class-Specific AC Interface Descriptor */ 241 + static const struct uac1_ac_header_descriptor_1 ac_header_desc = { 242 .bLength = UAC_DT_AC_HEADER_SIZE(1), 243 .bDescriptorType = USB_DT_CS_INTERFACE, 244 .bDescriptorSubtype = USB_MS_HEADER,
+16 -1
include/linux/usb/audio-v2.h
··· 18 /* v1.0 and v2.0 of this standard have many things in common. For the rest 19 * of the definitions, please refer to audio.h */ 20 21 static inline bool uac2_control_is_readable(u32 bmControls, u8 control) 22 { 23 return (bmControls >> (control * 2)) & 0x1; ··· 136 137 /* 4.9.2 Class-Specific AS Interface Descriptor */ 138 139 - struct uac_as_header_descriptor_v2 { 140 __u8 bLength; 141 __u8 bDescriptorType; 142 __u8 bDescriptorSubtype;
··· 18 /* v1.0 and v2.0 of this standard have many things in common. For the rest 19 * of the definitions, please refer to audio.h */ 20 21 + /* 22 + * bmControl field decoders 23 + * 24 + * From the USB Audio spec v2.0: 25 + * 26 + * bmaControls() is a (ch+1)-element array of 4-byte bitmaps, 27 + * each containing a set of bit pairs. If a Control is present, 28 + * it must be Host readable. If a certain Control is not 29 + * present then the bit pair must be set to 0b00. 30 + * If a Control is present but read-only, the bit pair must be 31 + * set to 0b01. If a Control is also Host programmable, the bit 32 + * pair must be set to 0b11. The value 0b10 is not allowed. 33 + * 34 + */ 35 + 36 static inline bool uac2_control_is_readable(u32 bmControls, u8 control) 37 { 38 return (bmControls >> (control * 2)) & 0x1; ··· 121 122 /* 4.9.2 Class-Specific AS Interface Descriptor */ 123 124 + struct uac2_as_header_descriptor { 125 __u8 bLength; 126 __u8 bDescriptorType; 127 __u8 bDescriptorSubtype;
+6 -6
include/linux/usb/audio.h
··· 39 #define UAC_MIXER_UNIT 0x04 40 #define UAC_SELECTOR_UNIT 0x05 41 #define UAC_FEATURE_UNIT 0x06 42 - #define UAC_PROCESSING_UNIT_V1 0x07 43 - #define UAC_EXTENSION_UNIT_V1 0x08 44 45 /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ 46 #define UAC_AS_GENERAL 0x01 ··· 151 152 /* Terminal Control Selectors */ 153 /* 4.3.2 Class-Specific AC Interface Descriptor */ 154 - struct uac_ac_header_descriptor_v1 { 155 __u8 bLength; /* 8 + n */ 156 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 157 __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ ··· 165 166 /* As above, but more useful for defining your own descriptors: */ 167 #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ 168 - struct uac_ac_header_descriptor_v1_##n { \ 169 __u8 bLength; \ 170 __u8 bDescriptorType; \ 171 __u8 bDescriptorSubtype; \ ··· 205 #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 206 207 /* 4.3.2.2 Output Terminal Descriptor */ 208 - struct uac_output_terminal_descriptor_v1 { 209 __u8 bLength; /* in bytes: 9 */ 210 __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ 211 __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ ··· 395 } 396 397 /* 4.5.2 Class-Specific AS Interface Descriptor */ 398 - struct uac_as_header_descriptor_v1 { 399 __u8 bLength; /* in bytes: 7 */ 400 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 401 __u8 bDescriptorSubtype; /* AS_GENERAL */
··· 39 #define UAC_MIXER_UNIT 0x04 40 #define UAC_SELECTOR_UNIT 0x05 41 #define UAC_FEATURE_UNIT 0x06 42 + #define UAC1_PROCESSING_UNIT 0x07 43 + #define UAC1_EXTENSION_UNIT 0x08 44 45 /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ 46 #define UAC_AS_GENERAL 0x01 ··· 151 152 /* Terminal Control Selectors */ 153 /* 4.3.2 Class-Specific AC Interface Descriptor */ 154 + struct uac1_ac_header_descriptor { 155 __u8 bLength; /* 8 + n */ 156 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 157 __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ ··· 165 166 /* As above, but more useful for defining your own descriptors: */ 167 #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ 168 + struct uac1_ac_header_descriptor_##n { \ 169 __u8 bLength; \ 170 __u8 bDescriptorType; \ 171 __u8 bDescriptorSubtype; \ ··· 205 #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 206 207 /* 4.3.2.2 Output Terminal Descriptor */ 208 + struct uac1_output_terminal_descriptor { 209 __u8 bLength; /* in bytes: 9 */ 210 __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ 211 __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ ··· 395 } 396 397 /* 4.5.2 Class-Specific AS Interface Descriptor */ 398 + struct uac1_as_header_descriptor { 399 __u8 bLength; /* in bytes: 7 */ 400 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 401 __u8 bDescriptorSubtype; /* AS_GENERAL */
+5 -1
include/sound/asound.h
··· 212 #define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */ 213 #define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */ 214 #define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */ 215 - #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_U18_3BE 216 217 #ifdef SNDRV_LITTLE_ENDIAN 218 #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
··· 212 #define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */ 213 #define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */ 214 #define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */ 215 + #define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44) /* 8 samples in 3 bytes */ 216 + #define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */ 217 + #define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */ 218 + #define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */ 219 + #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B 220 221 #ifdef SNDRV_LITTLE_ENDIAN 222 #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
+5 -1
include/sound/pcm.h
··· 174 #define SNDRV_PCM_FMTBIT_U18_3LE (1ULL << SNDRV_PCM_FORMAT_U18_3LE) 175 #define SNDRV_PCM_FMTBIT_S18_3BE (1ULL << SNDRV_PCM_FORMAT_S18_3BE) 176 #define SNDRV_PCM_FMTBIT_U18_3BE (1ULL << SNDRV_PCM_FORMAT_U18_3BE) 177 178 #ifdef SNDRV_LITTLE_ENDIAN 179 #define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE ··· 317 struct snd_pcm_mmap_control *control; 318 319 /* -- locking / scheduling -- */ 320 - unsigned int twake: 1; /* do transfer (!poll) wakeup */ 321 wait_queue_head_t sleep; /* poll sleep */ 322 wait_queue_head_t tsleep; /* transfer sleep */ 323 struct fasync_struct *fasync;
··· 174 #define SNDRV_PCM_FMTBIT_U18_3LE (1ULL << SNDRV_PCM_FORMAT_U18_3LE) 175 #define SNDRV_PCM_FMTBIT_S18_3BE (1ULL << SNDRV_PCM_FORMAT_S18_3BE) 176 #define SNDRV_PCM_FMTBIT_U18_3BE (1ULL << SNDRV_PCM_FORMAT_U18_3BE) 177 + #define SNDRV_PCM_FMTBIT_G723_24 (1ULL << SNDRV_PCM_FORMAT_G723_24) 178 + #define SNDRV_PCM_FMTBIT_G723_24_1B (1ULL << SNDRV_PCM_FORMAT_G723_24_1B) 179 + #define SNDRV_PCM_FMTBIT_G723_40 (1ULL << SNDRV_PCM_FORMAT_G723_40) 180 + #define SNDRV_PCM_FMTBIT_G723_40_1B (1ULL << SNDRV_PCM_FORMAT_G723_40_1B) 181 182 #ifdef SNDRV_LITTLE_ENDIAN 183 #define SNDRV_PCM_FMTBIT_S16 SNDRV_PCM_FMTBIT_S16_LE ··· 313 struct snd_pcm_mmap_control *control; 314 315 /* -- locking / scheduling -- */ 316 + snd_pcm_uframes_t twake; /* do transfer (!poll) wakeup if non-zero */ 317 wait_queue_head_t sleep; /* poll sleep */ 318 wait_queue_head_t tsleep; /* transfer sleep */ 319 struct fasync_struct *fasync;
+17 -8
sound/core/pcm_lib.c
··· 67 } else { 68 if (new_hw_ptr == ULONG_MAX) { /* initialization */ 69 snd_pcm_sframes_t avail = snd_pcm_playback_hw_avail(runtime); 70 runtime->silence_filled = avail > 0 ? avail : 0; 71 runtime->silence_start = (runtime->status->hw_ptr + 72 runtime->silence_filled) % ··· 289 return -EPIPE; 290 } 291 } 292 - if (avail >= runtime->control->avail_min) 293 - wake_up(runtime->twake ? &runtime->tsleep : &runtime->sleep); 294 return 0; 295 } 296 ··· 1712 * The available space is stored on availp. When err = 0 and avail = 0 1713 * on the capture stream, it indicates the stream is in DRAINING state. 1714 */ 1715 - static int wait_for_avail_min(struct snd_pcm_substream *substream, 1716 snd_pcm_uframes_t *availp) 1717 { 1718 struct snd_pcm_runtime *runtime = substream->runtime; ··· 1762 avail = snd_pcm_playback_avail(runtime); 1763 else 1764 avail = snd_pcm_capture_avail(runtime); 1765 - if (avail >= runtime->control->avail_min) 1766 break; 1767 } 1768 _endloop: ··· 1825 goto _end_unlock; 1826 } 1827 1828 - runtime->twake = 1; 1829 while (size > 0) { 1830 snd_pcm_uframes_t frames, appl_ptr, appl_ofs; 1831 snd_pcm_uframes_t avail; ··· 1838 err = -EAGAIN; 1839 goto _end_unlock; 1840 } 1841 - err = wait_for_avail_min(substream, &avail); 1842 if (err < 0) 1843 goto _end_unlock; 1844 } ··· 2049 goto _end_unlock; 2050 } 2051 2052 - runtime->twake = 1; 2053 while (size > 0) { 2054 snd_pcm_uframes_t frames, appl_ptr, appl_ofs; 2055 snd_pcm_uframes_t avail; ··· 2067 err = -EAGAIN; 2068 goto _end_unlock; 2069 } 2070 - err = wait_for_avail_min(substream, &avail); 2071 if (err < 0) 2072 goto _end_unlock; 2073 if (!avail)
··· 67 } else { 68 if (new_hw_ptr == ULONG_MAX) { /* initialization */ 69 snd_pcm_sframes_t avail = snd_pcm_playback_hw_avail(runtime); 70 + if (avail > runtime->buffer_size) 71 + avail = runtime->buffer_size; 72 runtime->silence_filled = avail > 0 ? avail : 0; 73 runtime->silence_start = (runtime->status->hw_ptr + 74 runtime->silence_filled) % ··· 287 return -EPIPE; 288 } 289 } 290 + if (runtime->twake) { 291 + if (avail >= runtime->twake) 292 + wake_up(&runtime->tsleep); 293 + } else if (avail >= runtime->control->avail_min) 294 + wake_up(&runtime->sleep); 295 return 0; 296 } 297 ··· 1707 * The available space is stored on availp. When err = 0 and avail = 0 1708 * on the capture stream, it indicates the stream is in DRAINING state. 1709 */ 1710 + static int wait_for_avail(struct snd_pcm_substream *substream, 1711 snd_pcm_uframes_t *availp) 1712 { 1713 struct snd_pcm_runtime *runtime = substream->runtime; ··· 1757 avail = snd_pcm_playback_avail(runtime); 1758 else 1759 avail = snd_pcm_capture_avail(runtime); 1760 + if (avail >= runtime->twake) 1761 break; 1762 } 1763 _endloop: ··· 1820 goto _end_unlock; 1821 } 1822 1823 + runtime->twake = runtime->control->avail_min ? : 1; 1824 while (size > 0) { 1825 snd_pcm_uframes_t frames, appl_ptr, appl_ofs; 1826 snd_pcm_uframes_t avail; ··· 1833 err = -EAGAIN; 1834 goto _end_unlock; 1835 } 1836 + runtime->twake = min_t(snd_pcm_uframes_t, size, 1837 + runtime->control->avail_min ? : 1); 1838 + err = wait_for_avail(substream, &avail); 1839 if (err < 0) 1840 goto _end_unlock; 1841 } ··· 2042 goto _end_unlock; 2043 } 2044 2045 + runtime->twake = runtime->control->avail_min ? : 1; 2046 while (size > 0) { 2047 snd_pcm_uframes_t frames, appl_ptr, appl_ofs; 2048 snd_pcm_uframes_t avail; ··· 2060 err = -EAGAIN; 2061 goto _end_unlock; 2062 } 2063 + runtime->twake = min_t(snd_pcm_uframes_t, size, 2064 + runtime->control->avail_min ? : 1); 2065 + err = wait_for_avail(substream, &avail); 2066 if (err < 0) 2067 goto _end_unlock; 2068 if (!avail)
+16
sound/core/pcm_misc.c
··· 128 .width = 4, .phys = 4, .le = -1, .signd = -1, 129 .silence = {}, 130 }, 131 /* FIXME: the following three formats are not defined properly yet */ 132 [SNDRV_PCM_FORMAT_MPEG] = { 133 .le = -1, .signd = -1, ··· 193 [SNDRV_PCM_FORMAT_U18_3BE] = { 194 .width = 18, .phys = 24, .le = 0, .signd = 0, 195 .silence = { 0x02, 0x00, 0x00 }, 196 }, 197 }; 198
··· 128 .width = 4, .phys = 4, .le = -1, .signd = -1, 129 .silence = {}, 130 }, 131 + [SNDRV_PCM_FORMAT_G723_24] = { 132 + .width = 3, .phys = 3, .le = -1, .signd = -1, 133 + .silence = {}, 134 + }, 135 + [SNDRV_PCM_FORMAT_G723_40] = { 136 + .width = 5, .phys = 5, .le = -1, .signd = -1, 137 + .silence = {}, 138 + }, 139 /* FIXME: the following three formats are not defined properly yet */ 140 [SNDRV_PCM_FORMAT_MPEG] = { 141 .le = -1, .signd = -1, ··· 185 [SNDRV_PCM_FORMAT_U18_3BE] = { 186 .width = 18, .phys = 24, .le = 0, .signd = 0, 187 .silence = { 0x02, 0x00, 0x00 }, 188 + }, 189 + [SNDRV_PCM_FORMAT_G723_24_1B] = { 190 + .width = 3, .phys = 8, .le = -1, .signd = -1, 191 + .silence = {}, 192 + }, 193 + [SNDRV_PCM_FORMAT_G723_40_1B] = { 194 + .width = 5, .phys = 8, .le = -1, .signd = -1, 195 + .silence = {}, 196 }, 197 }; 198
+21 -3
sound/drivers/Kconfig
··· 170 AC97 codecs. In this mode, the power-mode is dynamically 171 controlled at each open/close. 172 173 - The mode is activated by passing power_save=1 option to 174 - snd-ac97-codec driver. You can toggle it dynamically over 175 - sysfs, too. 176 177 config SND_AC97_POWER_SAVE_DEFAULT 178 int "Default time-out for AC97 power-save mode" ··· 197 help 198 The default time-out value in seconds for AC97 automatic 199 power-save mode. 0 means to disable the power-save mode. 200 201 endif # SND_DRIVERS
··· 170 AC97 codecs. In this mode, the power-mode is dynamically 171 controlled at each open/close. 172 173 + The mode is activated by passing 'power_save=X' to the 174 + snd-ac97-codec driver module, where 'X' is the time-out 175 + value, a nonnegative integer that specifies how many 176 + seconds of idle time the driver must count before it may 177 + put the AC97 into power-save mode; a value of 0 (zero) 178 + disables the use of this power-save mode. 179 + 180 + After the snd-ac97-codec driver module has been loaded, 181 + the 'power_save' parameter can be set via sysfs as follows: 182 + 183 + echo 10 > /sys/module/snd_ac97_codec/parameters/power_save 184 + 185 + In this case, the time-out is set to 10 seconds; setting 186 + the time-out to 1 second (the minimum activation value) 187 + isn't recommended because many applications try to reopen 188 + the device frequently. A value of 10 seconds would be a 189 + good choice for normal operations. 190 + 191 + See Documentation/sound/alsa/powersave.txt for more details. 192 193 config SND_AC97_POWER_SAVE_DEFAULT 194 int "Default time-out for AC97 power-save mode" ··· 181 help 182 The default time-out value in seconds for AC97 automatic 183 power-save mode. 0 means to disable the power-save mode. 184 + 185 + See SND_AC97_POWER_SAVE for more details. 186 187 endif # SND_DRIVERS
+4 -1
sound/isa/msnd/msnd_pinnacle.c
··· 549 printk(KERN_ERR LOGNAME ": Couldn't grab IRQ %d\n", chip->irq); 550 return err; 551 } 552 - request_region(chip->io, DSP_NUMIO, card->shortname); 553 554 if (!request_mem_region(chip->base, BUFFSIZE, card->shortname)) { 555 printk(KERN_ERR LOGNAME
··· 549 printk(KERN_ERR LOGNAME ": Couldn't grab IRQ %d\n", chip->irq); 550 return err; 551 } 552 + if (request_region(chip->io, DSP_NUMIO, card->shortname) == NULL) { 553 + free_irq(chip->irq, chip); 554 + return -EBUSY; 555 + } 556 557 if (!request_mem_region(chip->base, BUFFSIZE, card->shortname)) { 558 printk(KERN_ERR LOGNAME
+6 -3
sound/isa/sb/emu8000_pcm.c
··· 433 while (count > 0) { 434 unsigned short sval; 435 CHECK_SCHEDULER(); 436 - get_user(sval, buf); 437 EMU8000_SMLD_WRITE(emu, sval); 438 buf++; 439 count--; ··· 526 while (count-- > 0) { 527 unsigned short sval; 528 CHECK_SCHEDULER(); 529 - get_user(sval, buf); 530 EMU8000_SMLD_WRITE(emu, sval); 531 buf++; 532 if (rec->voices > 1) { 533 CHECK_SCHEDULER(); 534 - get_user(sval, buf); 535 EMU8000_SMRD_WRITE(emu, sval); 536 buf++; 537 }
··· 433 while (count > 0) { 434 unsigned short sval; 435 CHECK_SCHEDULER(); 436 + if (get_user(sval, buf)) 437 + return -EFAULT; 438 EMU8000_SMLD_WRITE(emu, sval); 439 buf++; 440 count--; ··· 525 while (count-- > 0) { 526 unsigned short sval; 527 CHECK_SCHEDULER(); 528 + if (get_user(sval, buf)) 529 + return -EFAULT; 530 EMU8000_SMLD_WRITE(emu, sval); 531 buf++; 532 if (rec->voices > 1) { 533 CHECK_SCHEDULER(); 534 + if (get_user(sval, buf)) 535 + return -EFAULT; 536 EMU8000_SMRD_WRITE(emu, sval); 537 buf++; 538 }
+52 -39
sound/oss/au1550_ac97.c
··· 43 #include <linux/sound.h> 44 #include <linux/slab.h> 45 #include <linux/soundcard.h> 46 #include <linux/init.h> 47 #include <linux/interrupt.h> 48 #include <linux/kernel.h> ··· 163 static void 164 au1550_delay(int msec) 165 { 166 - unsigned long tmo; 167 - signed long tmo2; 168 - 169 if (in_interrupt()) 170 return; 171 172 - tmo = jiffies + (msec * HZ) / 1000; 173 - for (;;) { 174 - tmo2 = tmo - jiffies; 175 - if (tmo2 <= 0) 176 - break; 177 - schedule_timeout(tmo2); 178 - } 179 } 180 181 static u16 ··· 799 static int 800 au1550_open_mixdev(struct inode *inode, struct file *file) 801 { 802 file->private_data = &au1550_state; 803 return 0; 804 } 805 ··· 818 return codec->mixer_ioctl(codec, cmd, arg); 819 } 820 821 - static int 822 - au1550_ioctl_mixdev(struct inode *inode, struct file *file, 823 - unsigned int cmd, unsigned long arg) 824 { 825 struct au1550_state *s = (struct au1550_state *)file->private_data; 826 struct ac97_codec *codec = s->codec; 827 828 - return mixdev_ioctl(codec, cmd, arg); 829 } 830 831 static /*const */ struct file_operations au1550_mixer_fops = { 832 - owner:THIS_MODULE, 833 - llseek:au1550_llseek, 834 - ioctl:au1550_ioctl_mixdev, 835 - open:au1550_open_mixdev, 836 - release:au1550_release_mixdev, 837 }; 838 839 static int ··· 1341 1342 1343 static int 1344 - au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 1345 - unsigned long arg) 1346 { 1347 struct au1550_state *s = (struct au1550_state *)file->private_data; 1348 unsigned long flags; ··· 1777 return mixdev_ioctl(s->codec, cmd, arg); 1778 } 1779 1780 1781 static int 1782 au1550_open(struct inode *inode, struct file *file) ··· 1805 #endif 1806 1807 file->private_data = s; 1808 /* wait for device to become free */ 1809 mutex_lock(&s->open_mutex); 1810 while (s->open_mode & file->f_mode) { 1811 - if (file->f_flags & O_NONBLOCK) { 1812 - mutex_unlock(&s->open_mutex); 1813 - return -EBUSY; 1814 - } 1815 add_wait_queue(&s->open_wait, &wait); 1816 __set_current_state(TASK_INTERRUPTIBLE); 1817 mutex_unlock(&s->open_mutex); 1818 schedule(); 1819 remove_wait_queue(&s->open_wait, &wait); 1820 set_current_state(TASK_RUNNING); 1821 if (signal_pending(current)) 1822 - return -ERESTARTSYS; 1823 mutex_lock(&s->open_mutex); 1824 } 1825 ··· 1849 1850 if (file->f_mode & FMODE_READ) { 1851 if ((ret = prog_dmabuf_adc(s))) 1852 - return ret; 1853 } 1854 if (file->f_mode & FMODE_WRITE) { 1855 if ((ret = prog_dmabuf_dac(s))) 1856 - return ret; 1857 } 1858 1859 s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE); 1860 - mutex_unlock(&s->open_mutex); 1861 mutex_init(&s->sem); 1862 - return 0; 1863 } 1864 1865 static int ··· 1898 } 1899 1900 static /*const */ struct file_operations au1550_audio_fops = { 1901 - owner: THIS_MODULE, 1902 - llseek: au1550_llseek, 1903 - read: au1550_read, 1904 - write: au1550_write, 1905 - poll: au1550_poll, 1906 - ioctl: au1550_ioctl, 1907 - mmap: au1550_mmap, 1908 - open: au1550_open, 1909 - release: au1550_release, 1910 }; 1911 1912 MODULE_AUTHOR("Advanced Micro Devices (AMD), dan@embeddededge.com");
··· 43 #include <linux/sound.h> 44 #include <linux/slab.h> 45 #include <linux/soundcard.h> 46 + #include <linux/smp_lock.h> 47 #include <linux/init.h> 48 #include <linux/interrupt.h> 49 #include <linux/kernel.h> ··· 162 static void 163 au1550_delay(int msec) 164 { 165 if (in_interrupt()) 166 return; 167 168 + schedule_timeout_uninterruptible(msecs_to_jiffies(msec)); 169 } 170 171 static u16 ··· 807 static int 808 au1550_open_mixdev(struct inode *inode, struct file *file) 809 { 810 + lock_kernel(); 811 file->private_data = &au1550_state; 812 + unlock_kernel(); 813 return 0; 814 } 815 ··· 824 return codec->mixer_ioctl(codec, cmd, arg); 825 } 826 827 + static long 828 + au1550_ioctl_mixdev(struct file *file, unsigned int cmd, unsigned long arg) 829 { 830 struct au1550_state *s = (struct au1550_state *)file->private_data; 831 struct ac97_codec *codec = s->codec; 832 + int ret; 833 834 + lock_kernel(); 835 + ret = mixdev_ioctl(codec, cmd, arg); 836 + unlock_kernel(); 837 + 838 + return ret; 839 } 840 841 static /*const */ struct file_operations au1550_mixer_fops = { 842 + .owner = THIS_MODULE, 843 + .llseek = au1550_llseek, 844 + .unlocked_ioctl = au1550_ioctl_mixdev, 845 + .open = au1550_open_mixdev, 846 + .release = au1550_release_mixdev, 847 }; 848 849 static int ··· 1343 1344 1345 static int 1346 + au1550_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 1347 { 1348 struct au1550_state *s = (struct au1550_state *)file->private_data; 1349 unsigned long flags; ··· 1780 return mixdev_ioctl(s->codec, cmd, arg); 1781 } 1782 1783 + static long 1784 + au1550_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 1785 + { 1786 + int ret; 1787 + 1788 + lock_kernel(); 1789 + ret = au1550_ioctl(file, cmd, arg); 1790 + unlock_kernel(); 1791 + 1792 + return ret; 1793 + } 1794 1795 static int 1796 au1550_open(struct inode *inode, struct file *file) ··· 1797 #endif 1798 1799 file->private_data = s; 1800 + lock_kernel(); 1801 /* wait for device to become free */ 1802 mutex_lock(&s->open_mutex); 1803 while (s->open_mode & file->f_mode) { 1804 + ret = -EBUSY; 1805 + if (file->f_flags & O_NONBLOCK) 1806 + goto out; 1807 add_wait_queue(&s->open_wait, &wait); 1808 __set_current_state(TASK_INTERRUPTIBLE); 1809 mutex_unlock(&s->open_mutex); 1810 schedule(); 1811 remove_wait_queue(&s->open_wait, &wait); 1812 set_current_state(TASK_RUNNING); 1813 + ret = -ERESTARTSYS; 1814 if (signal_pending(current)) 1815 + goto out2; 1816 mutex_lock(&s->open_mutex); 1817 } 1818 ··· 1840 1841 if (file->f_mode & FMODE_READ) { 1842 if ((ret = prog_dmabuf_adc(s))) 1843 + goto out; 1844 } 1845 if (file->f_mode & FMODE_WRITE) { 1846 if ((ret = prog_dmabuf_dac(s))) 1847 + goto out; 1848 } 1849 1850 s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE); 1851 mutex_init(&s->sem); 1852 + ret = 0; 1853 + out: 1854 + mutex_unlock(&s->open_mutex); 1855 + out2: 1856 + unlock_kernel(); 1857 + return ret; 1858 } 1859 1860 static int ··· 1885 } 1886 1887 static /*const */ struct file_operations au1550_audio_fops = { 1888 + .owner = THIS_MODULE, 1889 + .llseek = au1550_llseek, 1890 + .read = au1550_read, 1891 + .write = au1550_write, 1892 + .poll = au1550_poll, 1893 + .unlocked_ioctl = au1550_unlocked_ioctl, 1894 + .mmap = au1550_mmap, 1895 + .open = au1550_open, 1896 + .release = au1550_release, 1897 }; 1898 1899 MODULE_AUTHOR("Advanced Micro Devices (AMD), dan@embeddededge.com");
+50 -13
sound/oss/dmasound/dmasound_core.c
··· 323 324 static int mixer_open(struct inode *inode, struct file *file) 325 { 326 - if (!try_module_get(dmasound.mach.owner)) 327 return -ENODEV; 328 mixer.busy = 1; 329 return 0; 330 } 331 ··· 341 unlock_kernel(); 342 return 0; 343 } 344 - static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd, 345 - u_long arg) 346 { 347 if (_SIOC_DIR(cmd) & _SIOC_WRITE) 348 mixer.modify_counter++; ··· 366 return -EINVAL; 367 } 368 369 static const struct file_operations mixer_fops = 370 { 371 .owner = THIS_MODULE, 372 .llseek = no_llseek, 373 - .ioctl = mixer_ioctl, 374 .open = mixer_open, 375 .release = mixer_release, 376 }; ··· 752 { 753 int rc; 754 755 - if (!try_module_get(dmasound.mach.owner)) 756 return -ENODEV; 757 758 rc = write_sq_open(file); /* checks the f_mode */ 759 if (rc) ··· 799 sound_set_format(AFMT_MU_LAW); 800 } 801 #endif 802 - 803 return 0; 804 out: 805 module_put(dmasound.mach.owner); 806 return rc; 807 } 808 ··· 974 return 0 ; 975 } 976 977 - static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd, 978 - u_long arg) 979 { 980 int val, result; 981 u_long fmt; ··· 1132 return IOCTL_OUT(arg,val); 1133 1134 default: 1135 - return mixer_ioctl(inode, file, cmd, arg); 1136 } 1137 return -EINVAL; 1138 } 1139 1140 static const struct file_operations sq_fops = ··· 1154 .llseek = no_llseek, 1155 .write = sq_write, 1156 .poll = sq_poll, 1157 - .ioctl = sq_ioctl, 1158 .open = sq_open, 1159 .release = sq_release, 1160 }; ··· 1255 { 1256 char *buffer = state.buf; 1257 int len = 0; 1258 1259 if (state.busy) 1260 - return -EBUSY; 1261 1262 if (!try_module_get(dmasound.mach.owner)) 1263 - return -ENODEV; 1264 state.ptr = 0; 1265 state.busy = 1; 1266 ··· 1327 printk(KERN_ERR "dmasound_core: stat buffer overflowed!\n"); 1328 1329 state.len = len; 1330 - return 0; 1331 } 1332 1333 static int state_release(struct inode *inode, struct file *file)
··· 323 324 static int mixer_open(struct inode *inode, struct file *file) 325 { 326 + lock_kernel(); 327 + if (!try_module_get(dmasound.mach.owner)) { 328 + unlock_kernel(); 329 return -ENODEV; 330 + } 331 mixer.busy = 1; 332 + unlock_kernel(); 333 return 0; 334 } 335 ··· 337 unlock_kernel(); 338 return 0; 339 } 340 + 341 + static int mixer_ioctl(struct file *file, u_int cmd, u_long arg) 342 { 343 if (_SIOC_DIR(cmd) & _SIOC_WRITE) 344 mixer.modify_counter++; ··· 362 return -EINVAL; 363 } 364 365 + static long mixer_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) 366 + { 367 + int ret; 368 + 369 + lock_kernel(); 370 + ret = mixer_ioctl(file, cmd, arg); 371 + unlock_kernel(); 372 + 373 + return ret; 374 + } 375 + 376 static const struct file_operations mixer_fops = 377 { 378 .owner = THIS_MODULE, 379 .llseek = no_llseek, 380 + .unlocked_ioctl = mixer_unlocked_ioctl, 381 .open = mixer_open, 382 .release = mixer_release, 383 }; ··· 737 { 738 int rc; 739 740 + lock_kernel(); 741 + if (!try_module_get(dmasound.mach.owner)) { 742 + unlock_kernel(); 743 return -ENODEV; 744 + } 745 746 rc = write_sq_open(file); /* checks the f_mode */ 747 if (rc) ··· 781 sound_set_format(AFMT_MU_LAW); 782 } 783 #endif 784 + unlock_kernel(); 785 return 0; 786 out: 787 module_put(dmasound.mach.owner); 788 + unlock_kernel(); 789 return rc; 790 } 791 ··· 955 return 0 ; 956 } 957 958 + static int sq_ioctl(struct file *file, u_int cmd, u_long arg) 959 { 960 int val, result; 961 u_long fmt; ··· 1114 return IOCTL_OUT(arg,val); 1115 1116 default: 1117 + return mixer_ioctl(file, cmd, arg); 1118 } 1119 return -EINVAL; 1120 + } 1121 + 1122 + static long sq_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) 1123 + { 1124 + int ret; 1125 + 1126 + lock_kernel(); 1127 + ret = sq_ioctl(file, cmd, arg); 1128 + unlock_kernel(); 1129 + 1130 + return ret; 1131 } 1132 1133 static const struct file_operations sq_fops = ··· 1125 .llseek = no_llseek, 1126 .write = sq_write, 1127 .poll = sq_poll, 1128 + .unlocked_ioctl = sq_unlocked_ioctl, 1129 .open = sq_open, 1130 .release = sq_release, 1131 }; ··· 1226 { 1227 char *buffer = state.buf; 1228 int len = 0; 1229 + int ret; 1230 1231 + lock_kernel(); 1232 + ret = -EBUSY; 1233 if (state.busy) 1234 + goto out; 1235 1236 + ret = -ENODEV; 1237 if (!try_module_get(dmasound.mach.owner)) 1238 + goto out; 1239 + 1240 state.ptr = 0; 1241 state.busy = 1; 1242 ··· 1293 printk(KERN_ERR "dmasound_core: stat buffer overflowed!\n"); 1294 1295 state.len = len; 1296 + ret = 0; 1297 + out: 1298 + unlock_kernel(); 1299 + return ret; 1300 } 1301 1302 static int state_release(struct inode *inode, struct file *file)
+3 -1
sound/oss/midi_synth.c
··· 523 { 524 unsigned char data; 525 526 - get_user(*(unsigned char *) &data, (unsigned char __user *) &((addr)[hdr_size + i])); 527 528 eox_seen = (i > 0 && data & 0x80); /* End of sysex */ 529
··· 523 { 524 unsigned char data; 525 526 + if (get_user(data, 527 + (unsigned char __user *)(addr + hdr_size + i))) 528 + return -EFAULT; 529 530 eox_seen = (i > 0 && data & 0x80); /* End of sysex */ 531
+26 -13
sound/oss/msnd_pinnacle.c
··· 639 return -EINVAL; 640 } 641 642 - static int dev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 643 { 644 - int minor = iminor(inode); 645 646 if (cmd == OSS_GETVERSION) { 647 int sound_version = SOUND_VERSION; 648 return put_user(sound_version, (int __user *)arg); 649 } 650 651 - if (minor == dev.dsp_minor) 652 - return dsp_ioctl(file, cmd, arg); 653 - else if (minor == dev.mixer_minor) 654 - return mixer_ioctl(cmd, arg); 655 656 - return -EINVAL; 657 } 658 659 static void dsp_write_flush(void) ··· 761 int minor = iminor(inode); 762 int err = 0; 763 764 if (minor == dev.dsp_minor) { 765 if ((file->f_mode & FMODE_WRITE && 766 test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) || 767 (file->f_mode & FMODE_READ && 768 - test_bit(F_AUDIO_READ_INUSE, &dev.flags))) 769 - return -EBUSY; 770 771 if ((err = dsp_open(file)) >= 0) { 772 dev.nresets = 0; ··· 790 /* nothing */ 791 } else 792 err = -EINVAL; 793 - 794 return err; 795 } 796 ··· 1114 .owner = THIS_MODULE, 1115 .read = dev_read, 1116 .write = dev_write, 1117 - .ioctl = dev_ioctl, 1118 .open = dev_open, 1119 .release = dev_release, 1120 }; ··· 1400 printk(KERN_ERR LOGNAME ": Couldn't grab IRQ %d\n", dev.irq); 1401 return err; 1402 } 1403 - request_region(dev.io, dev.numio, dev.name); 1404 1405 - if ((err = dsp_full_reset()) < 0) { 1406 release_region(dev.io, dev.numio); 1407 free_irq(dev.irq, &dev); 1408 return err;
··· 639 return -EINVAL; 640 } 641 642 + static long dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 643 { 644 + int minor = iminor(file->f_path.dentry->d_inode); 645 + int ret; 646 647 if (cmd == OSS_GETVERSION) { 648 int sound_version = SOUND_VERSION; 649 return put_user(sound_version, (int __user *)arg); 650 } 651 652 + ret = -EINVAL; 653 654 + lock_kernel(); 655 + if (minor == dev.dsp_minor) 656 + ret = dsp_ioctl(file, cmd, arg); 657 + else if (minor == dev.mixer_minor) 658 + ret = mixer_ioctl(cmd, arg); 659 + unlock_kernel(); 660 + 661 + return ret; 662 } 663 664 static void dsp_write_flush(void) ··· 756 int minor = iminor(inode); 757 int err = 0; 758 759 + lock_kernel(); 760 if (minor == dev.dsp_minor) { 761 if ((file->f_mode & FMODE_WRITE && 762 test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) || 763 (file->f_mode & FMODE_READ && 764 + test_bit(F_AUDIO_READ_INUSE, &dev.flags))) { 765 + err = -EBUSY; 766 + goto out; 767 + } 768 769 if ((err = dsp_open(file)) >= 0) { 770 dev.nresets = 0; ··· 782 /* nothing */ 783 } else 784 err = -EINVAL; 785 + out: 786 + unlock_kernel(); 787 return err; 788 } 789 ··· 1105 .owner = THIS_MODULE, 1106 .read = dev_read, 1107 .write = dev_write, 1108 + .unlocked_ioctl = dev_ioctl, 1109 .open = dev_open, 1110 .release = dev_release, 1111 }; ··· 1391 printk(KERN_ERR LOGNAME ": Couldn't grab IRQ %d\n", dev.irq); 1392 return err; 1393 } 1394 + if (request_region(dev.io, dev.numio, dev.name) == NULL) { 1395 + free_irq(dev.irq, &dev); 1396 + return -EBUSY; 1397 + } 1398 1399 + err = dsp_full_reset(); 1400 + if (err < 0) { 1401 release_region(dev.io, dev.numio); 1402 free_irq(dev.irq, &dev); 1403 return err;
+22 -5
sound/oss/sh_dac_audio.c
··· 15 #include <linux/linkage.h> 16 #include <linux/slab.h> 17 #include <linux/fs.h> 18 #include <linux/sound.h> 19 #include <linux/soundcard.h> 20 #include <linux/interrupt.h> 21 #include <linux/hrtimer.h> ··· 94 wakeups_per_second = ktime_set(0, 1000000000 / rate); 95 } 96 97 - static int dac_audio_ioctl(struct inode *inode, struct file *file, 98 unsigned int cmd, unsigned long arg) 99 { 100 int val; ··· 160 return -EINVAL; 161 } 162 163 static ssize_t dac_audio_write(struct file *file, const char *buf, size_t count, 164 loff_t * ppos) 165 { ··· 229 { 230 if (file->f_mode & FMODE_READ) 231 return -ENODEV; 232 - if (in_use) 233 return -EBUSY; 234 235 in_use = 1; 236 237 dac_audio_start(); 238 - 239 return 0; 240 } 241 ··· 254 255 const struct file_operations dac_audio_fops = { 256 .read = dac_audio_read, 257 - .write = dac_audio_write, 258 - .ioctl = dac_audio_ioctl, 259 .open = dac_audio_open, 260 .release = dac_audio_release, 261 };
··· 15 #include <linux/linkage.h> 16 #include <linux/slab.h> 17 #include <linux/fs.h> 18 + #include <linux/smp_lock.h> 19 #include <linux/sound.h> 20 + #include <linux/smp_lock.h> 21 #include <linux/soundcard.h> 22 #include <linux/interrupt.h> 23 #include <linux/hrtimer.h> ··· 92 wakeups_per_second = ktime_set(0, 1000000000 / rate); 93 } 94 95 + static int dac_audio_ioctl(struct file *file, 96 unsigned int cmd, unsigned long arg) 97 { 98 int val; ··· 158 return -EINVAL; 159 } 160 161 + static long dac_audio_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) 162 + { 163 + int ret; 164 + 165 + lock_kernel(); 166 + ret = dac_audio_ioctl(file, cmd, arg); 167 + unlock_kernel(); 168 + 169 + return ret; 170 + } 171 + 172 static ssize_t dac_audio_write(struct file *file, const char *buf, size_t count, 173 loff_t * ppos) 174 { ··· 216 { 217 if (file->f_mode & FMODE_READ) 218 return -ENODEV; 219 + 220 + lock_kernel(); 221 + if (in_use) { 222 + unlock_kernel(); 223 return -EBUSY; 224 + } 225 226 in_use = 1; 227 228 dac_audio_start(); 229 + unlock_kernel(); 230 return 0; 231 } 232 ··· 237 238 const struct file_operations dac_audio_fops = { 239 .read = dac_audio_read, 240 + .write = dac_audio_write, 241 + .unlocked_ioctl = dac_audio_unlocked_ioctl, 242 .open = dac_audio_open, 243 .release = dac_audio_release, 244 };
+11 -9
sound/oss/soundcard.c
··· 210 printk(KERN_ERR "Invalid minor device %d\n", dev); 211 return -ENXIO; 212 } 213 switch (dev & 0x0f) { 214 case SND_DEV_CTL: 215 dev >>= 4; 216 if (dev >= 0 && dev < MAX_MIXER_DEV && mixer_devs[dev] == NULL) { 217 request_module("mixer%d", dev); 218 } 219 if (dev && (dev >= num_mixers || mixer_devs[dev] == NULL)) 220 - return -ENXIO; 221 222 if (!try_module_get(mixer_devs[dev]->owner)) 223 - return -ENXIO; 224 break; 225 226 case SND_DEV_SEQ: 227 case SND_DEV_SEQ2: 228 - if ((retval = sequencer_open(dev, file)) < 0) 229 - return retval; 230 break; 231 232 case SND_DEV_MIDIN: 233 - if ((retval = MIDIbuf_open(dev, file)) < 0) 234 - return retval; 235 break; 236 237 case SND_DEV_DSP: 238 case SND_DEV_DSP16: 239 case SND_DEV_AUDIO: 240 - if ((retval = audio_open(dev, file)) < 0) 241 - return retval; 242 break; 243 244 default: 245 printk(KERN_ERR "Invalid minor device %d\n", dev); 246 - return -ENXIO; 247 } 248 249 return 0; 250 } 251
··· 210 printk(KERN_ERR "Invalid minor device %d\n", dev); 211 return -ENXIO; 212 } 213 + lock_kernel(); 214 switch (dev & 0x0f) { 215 case SND_DEV_CTL: 216 dev >>= 4; 217 if (dev >= 0 && dev < MAX_MIXER_DEV && mixer_devs[dev] == NULL) { 218 request_module("mixer%d", dev); 219 } 220 + retval = -ENXIO; 221 if (dev && (dev >= num_mixers || mixer_devs[dev] == NULL)) 222 + break; 223 224 if (!try_module_get(mixer_devs[dev]->owner)) 225 + break; 226 + 227 + retval = 0; 228 break; 229 230 case SND_DEV_SEQ: 231 case SND_DEV_SEQ2: 232 + retval = sequencer_open(dev, file); 233 break; 234 235 case SND_DEV_MIDIN: 236 + retval = MIDIbuf_open(dev, file); 237 break; 238 239 case SND_DEV_DSP: 240 case SND_DEV_DSP16: 241 case SND_DEV_AUDIO: 242 + retval = audio_open(dev, file); 243 break; 244 245 default: 246 printk(KERN_ERR "Invalid minor device %d\n", dev); 247 + retval = -ENXIO; 248 } 249 250 + unlock_kernel(); 251 return 0; 252 } 253
+35 -6
sound/oss/swarm_cs4297a.c
··· 68 #include <linux/delay.h> 69 #include <linux/sound.h> 70 #include <linux/slab.h> 71 #include <linux/soundcard.h> 72 #include <linux/ac97_codec.h> 73 #include <linux/pci.h> ··· 1535 CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4, 1536 printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()+\n")); 1537 1538 list_for_each(entry, &cs4297a_devs) 1539 { 1540 s = list_entry(entry, struct cs4297a_state, list); ··· 1546 { 1547 CS_DBGOUT(CS_FUNCTION | CS_OPEN | CS_ERROR, 2, 1548 printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- -ENODEV\n")); 1549 return -ENODEV; 1550 } 1551 VALIDATE_STATE(s); ··· 1555 1556 CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4, 1557 printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- 0\n")); 1558 1559 return nonseekable_open(inode, file); 1560 } ··· 1571 } 1572 1573 1574 - static int cs4297a_ioctl_mixdev(struct inode *inode, struct file *file, 1575 unsigned int cmd, unsigned long arg) 1576 { 1577 - return mixer_ioctl((struct cs4297a_state *) file->private_data, cmd, 1578 arg); 1579 } 1580 1581 ··· 1589 static const struct file_operations cs4297a_mixer_fops = { 1590 .owner = THIS_MODULE, 1591 .llseek = no_llseek, 1592 - .ioctl = cs4297a_ioctl_mixdev, 1593 .open = cs4297a_open_mixdev, 1594 .release = cs4297a_release_mixdev, 1595 }; ··· 1953 } 1954 1955 1956 - static int cs4297a_ioctl(struct inode *inode, struct file *file, 1957 unsigned int cmd, unsigned long arg) 1958 { 1959 struct cs4297a_state *s = ··· 2346 return mixer_ioctl(s, cmd, arg); 2347 } 2348 2349 2350 static int cs4297a_release(struct inode *inode, struct file *file) 2351 { ··· 2388 return 0; 2389 } 2390 2391 - static int cs4297a_open(struct inode *inode, struct file *file) 2392 { 2393 int minor = iminor(inode); 2394 struct cs4297a_state *s=NULL; ··· 2505 return nonseekable_open(inode, file); 2506 } 2507 2508 2509 // ****************************************************************************************** 2510 // Wave (audio) file operations struct. ··· 2525 .read = cs4297a_read, 2526 .write = cs4297a_write, 2527 .poll = cs4297a_poll, 2528 - .ioctl = cs4297a_ioctl, 2529 .mmap = cs4297a_mmap, 2530 .open = cs4297a_open, 2531 .release = cs4297a_release,
··· 68 #include <linux/delay.h> 69 #include <linux/sound.h> 70 #include <linux/slab.h> 71 + #include <linux/smp_lock.h> 72 #include <linux/soundcard.h> 73 #include <linux/ac97_codec.h> 74 #include <linux/pci.h> ··· 1534 CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4, 1535 printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()+\n")); 1536 1537 + lock_kernel(); 1538 list_for_each(entry, &cs4297a_devs) 1539 { 1540 s = list_entry(entry, struct cs4297a_state, list); ··· 1544 { 1545 CS_DBGOUT(CS_FUNCTION | CS_OPEN | CS_ERROR, 2, 1546 printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- -ENODEV\n")); 1547 + 1548 + unlock_kernel(); 1549 return -ENODEV; 1550 } 1551 VALIDATE_STATE(s); ··· 1551 1552 CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4, 1553 printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- 0\n")); 1554 + unlock_kernel(); 1555 1556 return nonseekable_open(inode, file); 1557 } ··· 1566 } 1567 1568 1569 + static int cs4297a_ioctl_mixdev(struct file *file, 1570 unsigned int cmd, unsigned long arg) 1571 { 1572 + int ret; 1573 + lock_kernel(); 1574 + ret = mixer_ioctl((struct cs4297a_state *) file->private_data, cmd, 1575 arg); 1576 + unlock_kernel(); 1577 + return ret; 1578 } 1579 1580 ··· 1580 static const struct file_operations cs4297a_mixer_fops = { 1581 .owner = THIS_MODULE, 1582 .llseek = no_llseek, 1583 + .unlocked_ioctl = cs4297a_ioctl_mixdev, 1584 .open = cs4297a_open_mixdev, 1585 .release = cs4297a_release_mixdev, 1586 }; ··· 1944 } 1945 1946 1947 + static int cs4297a_ioctl(struct file *file, 1948 unsigned int cmd, unsigned long arg) 1949 { 1950 struct cs4297a_state *s = ··· 2337 return mixer_ioctl(s, cmd, arg); 2338 } 2339 2340 + static long cs4297a_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) 2341 + { 2342 + int ret; 2343 + 2344 + lock_kernel(); 2345 + ret = cs4297a_ioctl(file, cmd, arg); 2346 + unlock_kernel(); 2347 + 2348 + return ret; 2349 + } 2350 2351 static int cs4297a_release(struct inode *inode, struct file *file) 2352 { ··· 2369 return 0; 2370 } 2371 2372 + static int cs4297a_locked_open(struct inode *inode, struct file *file) 2373 { 2374 int minor = iminor(inode); 2375 struct cs4297a_state *s=NULL; ··· 2486 return nonseekable_open(inode, file); 2487 } 2488 2489 + static int cs4297a_open(struct inode *inode, struct file *file) 2490 + { 2491 + int ret; 2492 + 2493 + lock_kernel(); 2494 + ret = cs4297a_open(inode, file); 2495 + unlock_kernel(); 2496 + 2497 + return ret; 2498 + } 2499 2500 // ****************************************************************************************** 2501 // Wave (audio) file operations struct. ··· 2496 .read = cs4297a_read, 2497 .write = cs4297a_write, 2498 .poll = cs4297a_poll, 2499 + .unlocked_ioctl = cs4297a_unlocked_ioctl, 2500 .mmap = cs4297a_mmap, 2501 .open = cs4297a_open, 2502 .release = cs4297a_release,
-3
sound/oss/vidc.c
··· 491 vidc_adev = adev; 492 vidc_mixer_set(SOUND_MIXER_VOLUME, (85 | 85 << 8)); 493 494 - #if defined(CONFIG_SOUND_SOFTOSS) || defined(CONFIG_SOUND_SOFTOSS_MODULE) 495 - softoss_dev = adev; 496 - #endif 497 return; 498 499 irq_failed:
··· 491 vidc_adev = adev; 492 vidc_mixer_set(SOUND_MIXER_VOLUME, (85 | 85 << 8)); 493 494 return; 495 496 irq_failed:
+21 -11
sound/oss/vwsnd.c
··· 2429 return mask; 2430 } 2431 2432 - static int vwsnd_audio_do_ioctl(struct inode *inode, 2433 - struct file *file, 2434 unsigned int cmd, 2435 unsigned long arg) 2436 { ··· 2445 int ival; 2446 2447 2448 - DBGEV("(inode=0x%p, file=0x%p, cmd=0x%x, arg=0x%lx)\n", 2449 - inode, file, cmd, arg); 2450 switch (cmd) { 2451 case OSS_GETVERSION: /* _SIOR ('M', 118, int) */ 2452 DBGX("OSS_GETVERSION\n"); ··· 2884 return -EINVAL; 2885 } 2886 2887 - static int vwsnd_audio_ioctl(struct inode *inode, 2888 - struct file *file, 2889 unsigned int cmd, 2890 unsigned long arg) 2891 { 2892 vwsnd_dev_t *devc = (vwsnd_dev_t *) file->private_data; 2893 int ret; 2894 2895 mutex_lock(&devc->io_mutex); 2896 - ret = vwsnd_audio_do_ioctl(inode, file, cmd, arg); 2897 mutex_unlock(&devc->io_mutex); 2898 return ret; 2899 } 2900 ··· 2922 2923 DBGE("(inode=0x%p, file=0x%p)\n", inode, file); 2924 2925 INC_USE_COUNT; 2926 for (devc = vwsnd_dev_list; devc; devc = devc->next_dev) 2927 if ((devc->audio_minor & ~0x0F) == (minor & ~0x0F)) ··· 2930 2931 if (devc == NULL) { 2932 DEC_USE_COUNT; 2933 return -ENODEV; 2934 } 2935 ··· 2939 mutex_unlock(&devc->open_mutex); 2940 if (file->f_flags & O_NONBLOCK) { 2941 DEC_USE_COUNT; 2942 return -EBUSY; 2943 } 2944 interruptible_sleep_on(&devc->open_wait); 2945 if (signal_pending(current)) { 2946 DEC_USE_COUNT; 2947 return -ERESTARTSYS; 2948 } 2949 mutex_lock(&devc->open_mutex); ··· 2998 2999 file->private_data = devc; 3000 DBGRV(); 3001 return 0; 3002 } 3003 ··· 3050 .read = vwsnd_audio_read, 3051 .write = vwsnd_audio_write, 3052 .poll = vwsnd_audio_poll, 3053 - .ioctl = vwsnd_audio_ioctl, 3054 .mmap = vwsnd_audio_mmap, 3055 .open = vwsnd_audio_open, 3056 .release = vwsnd_audio_release, ··· 3068 DBGEV("(inode=0x%p, file=0x%p)\n", inode, file); 3069 3070 INC_USE_COUNT; 3071 for (devc = vwsnd_dev_list; devc; devc = devc->next_dev) 3072 if (devc->mixer_minor == iminor(inode)) 3073 break; 3074 3075 if (devc == NULL) { 3076 DEC_USE_COUNT; 3077 return -ENODEV; 3078 } 3079 file->private_data = devc; 3080 return 0; 3081 } 3082 ··· 3212 3213 /* This is the ioctl entry to the mixer driver. */ 3214 3215 - static int vwsnd_mixer_ioctl(struct inode *ioctl, 3216 - struct file *file, 3217 unsigned int cmd, 3218 unsigned long arg) 3219 { ··· 3223 3224 DBGEV("(devc=0x%p, cmd=0x%x, arg=0x%lx)\n", devc, cmd, arg); 3225 3226 mutex_lock(&devc->mix_mutex); 3227 { 3228 if ((cmd & ~nrmask) == MIXER_READ(0)) ··· 3234 retval = -EINVAL; 3235 } 3236 mutex_unlock(&devc->mix_mutex); 3237 return retval; 3238 } 3239 3240 static const struct file_operations vwsnd_mixer_fops = { 3241 .owner = THIS_MODULE, 3242 .llseek = no_llseek, 3243 - .ioctl = vwsnd_mixer_ioctl, 3244 .open = vwsnd_mixer_open, 3245 .release = vwsnd_mixer_release, 3246 };
··· 2429 return mask; 2430 } 2431 2432 + static int vwsnd_audio_do_ioctl(struct file *file, 2433 unsigned int cmd, 2434 unsigned long arg) 2435 { ··· 2446 int ival; 2447 2448 2449 + DBGEV("(file=0x%p, cmd=0x%x, arg=0x%lx)\n", 2450 + file, cmd, arg); 2451 switch (cmd) { 2452 case OSS_GETVERSION: /* _SIOR ('M', 118, int) */ 2453 DBGX("OSS_GETVERSION\n"); ··· 2885 return -EINVAL; 2886 } 2887 2888 + static long vwsnd_audio_ioctl(struct file *file, 2889 unsigned int cmd, 2890 unsigned long arg) 2891 { 2892 vwsnd_dev_t *devc = (vwsnd_dev_t *) file->private_data; 2893 int ret; 2894 2895 + lock_kernel(); 2896 mutex_lock(&devc->io_mutex); 2897 + ret = vwsnd_audio_do_ioctl(file, cmd, arg); 2898 mutex_unlock(&devc->io_mutex); 2899 + unlock_kernel(); 2900 + 2901 return ret; 2902 } 2903 ··· 2921 2922 DBGE("(inode=0x%p, file=0x%p)\n", inode, file); 2923 2924 + lock_kernel(); 2925 INC_USE_COUNT; 2926 for (devc = vwsnd_dev_list; devc; devc = devc->next_dev) 2927 if ((devc->audio_minor & ~0x0F) == (minor & ~0x0F)) ··· 2928 2929 if (devc == NULL) { 2930 DEC_USE_COUNT; 2931 + unlock_kernel(); 2932 return -ENODEV; 2933 } 2934 ··· 2936 mutex_unlock(&devc->open_mutex); 2937 if (file->f_flags & O_NONBLOCK) { 2938 DEC_USE_COUNT; 2939 + unlock_kernel(); 2940 return -EBUSY; 2941 } 2942 interruptible_sleep_on(&devc->open_wait); 2943 if (signal_pending(current)) { 2944 DEC_USE_COUNT; 2945 + unlock_kernel(); 2946 return -ERESTARTSYS; 2947 } 2948 mutex_lock(&devc->open_mutex); ··· 2993 2994 file->private_data = devc; 2995 DBGRV(); 2996 + unlock_kernel(); 2997 return 0; 2998 } 2999 ··· 3044 .read = vwsnd_audio_read, 3045 .write = vwsnd_audio_write, 3046 .poll = vwsnd_audio_poll, 3047 + .unlocked_ioctl = vwsnd_audio_ioctl, 3048 .mmap = vwsnd_audio_mmap, 3049 .open = vwsnd_audio_open, 3050 .release = vwsnd_audio_release, ··· 3062 DBGEV("(inode=0x%p, file=0x%p)\n", inode, file); 3063 3064 INC_USE_COUNT; 3065 + lock_kernel(); 3066 for (devc = vwsnd_dev_list; devc; devc = devc->next_dev) 3067 if (devc->mixer_minor == iminor(inode)) 3068 break; 3069 3070 if (devc == NULL) { 3071 DEC_USE_COUNT; 3072 + unlock_kernel(); 3073 return -ENODEV; 3074 } 3075 file->private_data = devc; 3076 + unlock_kernel(); 3077 return 0; 3078 } 3079 ··· 3203 3204 /* This is the ioctl entry to the mixer driver. */ 3205 3206 + static long vwsnd_mixer_ioctl(struct file *file, 3207 unsigned int cmd, 3208 unsigned long arg) 3209 { ··· 3215 3216 DBGEV("(devc=0x%p, cmd=0x%x, arg=0x%lx)\n", devc, cmd, arg); 3217 3218 + lock_kernel(); 3219 mutex_lock(&devc->mix_mutex); 3220 { 3221 if ((cmd & ~nrmask) == MIXER_READ(0)) ··· 3225 retval = -EINVAL; 3226 } 3227 mutex_unlock(&devc->mix_mutex); 3228 + unlock_kernel(); 3229 return retval; 3230 } 3231 3232 static const struct file_operations vwsnd_mixer_fops = { 3233 .owner = THIS_MODULE, 3234 .llseek = no_llseek, 3235 + .unlocked_ioctl = vwsnd_mixer_ioctl, 3236 .open = vwsnd_mixer_open, 3237 .release = vwsnd_mixer_release, 3238 };
+2 -8
sound/oss/waveartist.c
··· 184 static inline int 185 waveartist_sleep(int timeout_ms) 186 { 187 - unsigned int timeout = timeout_ms * 10 * HZ / 100; 188 - 189 - do { 190 - set_current_state(TASK_INTERRUPTIBLE); 191 - timeout = schedule_timeout(timeout); 192 - } while (timeout); 193 - 194 - return 0; 195 } 196 197 static int
··· 184 static inline int 185 waveartist_sleep(int timeout_ms) 186 { 187 + unsigned int timeout = msecs_to_jiffies(timeout_ms*100); 188 + return schedule_timeout_interruptible(timeout); 189 } 190 191 static int
+2 -2
sound/pci/als4000.c
··· 763 /* SPECS_PAGE: 39 */ 764 for (i = ALS4K_GCR91_DMA0_ADDR; i <= ALS4K_GCR96_DMA3_MODE_COUNT; ++i) 765 snd_als4k_gcr_write(chip, i, 0); 766 - 767 snd_als4k_gcr_write(chip, ALS4K_GCR99_DMA_EMULATION_CTRL, 768 - snd_als4k_gcr_read(chip, ALS4K_GCR99_DMA_EMULATION_CTRL)); 769 spin_unlock_irq(&chip->reg_lock); 770 } 771
··· 763 /* SPECS_PAGE: 39 */ 764 for (i = ALS4K_GCR91_DMA0_ADDR; i <= ALS4K_GCR96_DMA3_MODE_COUNT; ++i) 765 snd_als4k_gcr_write(chip, i, 0); 766 + /* enable burst mode to prevent dropouts during high PCI bus usage */ 767 snd_als4k_gcr_write(chip, ALS4K_GCR99_DMA_EMULATION_CTRL, 768 + (snd_als4k_gcr_read(chip, ALS4K_GCR99_DMA_EMULATION_CTRL) & ~0x07) | 0x04); 769 spin_unlock_irq(&chip->reg_lock); 770 } 771
+9 -7
sound/pci/asihpi/asihpi.c
··· 460 struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); 461 int err; 462 u16 format; 463 unsigned int bytes_per_sec; 464 465 print_hwparams(params); ··· 513 dpcm->hpi_buffer_attached); 514 } 515 bytes_per_sec = params_rate(params) * params_channels(params); 516 - bytes_per_sec *= snd_pcm_format_width(params_format(params)); 517 bytes_per_sec /= 8; 518 - if (bytes_per_sec <= 0) 519 return -EINVAL; 520 521 dpcm->bytes_per_sec = bytes_per_sec; ··· 1385 1386 compile_time_assert( 1387 (ARRAY_SIZE(asihpi_src_names) == 1388 - (HPI_SOURCENODE_LAST_INDEX-HPI_SOURCENODE_BASE+1)), 1389 assert_src_names_size); 1390 1391 #if ASI_STYLE_NAMES ··· 1416 1417 compile_time_assert( 1418 (ARRAY_SIZE(asihpi_dst_names) == 1419 - (HPI_DESTNODE_LAST_INDEX-HPI_DESTNODE_BASE+1)), 1420 assert_dst_names_size); 1421 1422 static inline int ctl_add(struct snd_card *card, struct snd_kcontrol_new *ctl, ··· 2173 &src_node_type, &src_node_index); 2174 2175 sprintf(uinfo->value.enumerated.name, "%s %d", 2176 - asihpi_src_names[src_node_type - HPI_SOURCENODE_BASE], 2177 src_node_index); 2178 return 0; 2179 } ··· 2605 2606 } 2607 2608 - hpi_ctl.src_node_type -= HPI_SOURCENODE_BASE; 2609 - hpi_ctl.dst_node_type -= HPI_DESTNODE_BASE; 2610 2611 /* ASI50xx in SSX mode has multiple meters on the same node. 2612 Use subindex to create distinct ALSA controls
··· 460 struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); 461 int err; 462 u16 format; 463 + int width; 464 unsigned int bytes_per_sec; 465 466 print_hwparams(params); ··· 512 dpcm->hpi_buffer_attached); 513 } 514 bytes_per_sec = params_rate(params) * params_channels(params); 515 + width = snd_pcm_format_width(params_format(params)); 516 + bytes_per_sec *= width; 517 bytes_per_sec /= 8; 518 + if (width < 0 || bytes_per_sec == 0) 519 return -EINVAL; 520 521 dpcm->bytes_per_sec = bytes_per_sec; ··· 1383 1384 compile_time_assert( 1385 (ARRAY_SIZE(asihpi_src_names) == 1386 + (HPI_SOURCENODE_LAST_INDEX-HPI_SOURCENODE_NONE+1)), 1387 assert_src_names_size); 1388 1389 #if ASI_STYLE_NAMES ··· 1414 1415 compile_time_assert( 1416 (ARRAY_SIZE(asihpi_dst_names) == 1417 + (HPI_DESTNODE_LAST_INDEX-HPI_DESTNODE_NONE+1)), 1418 assert_dst_names_size); 1419 1420 static inline int ctl_add(struct snd_card *card, struct snd_kcontrol_new *ctl, ··· 2171 &src_node_type, &src_node_index); 2172 2173 sprintf(uinfo->value.enumerated.name, "%s %d", 2174 + asihpi_src_names[src_node_type - HPI_SOURCENODE_NONE], 2175 src_node_index); 2176 return 0; 2177 } ··· 2603 2604 } 2605 2606 + hpi_ctl.src_node_type -= HPI_SOURCENODE_NONE; 2607 + hpi_ctl.dst_node_type -= HPI_DESTNODE_NONE; 2608 2609 /* ASI50xx in SSX mode has multiple meters on the same node. 2610 Use subindex to create distinct ALSA controls
+48 -20
sound/pci/asihpi/hpi.h
··· 50 #define HPI_VER_RELEASE(v) ((int)(v & 0xFF)) 51 52 /* Use single digits for versions less that 10 to avoid octal. */ 53 - #define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 3, 25) 54 55 /* Library version as documented in hpi-api-versions.txt */ 56 #define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(9, 0, 0) ··· 204 exists on a destination node can be searched for using a source 205 node value of either 0, or HPI_SOURCENODE_NONE */ 206 HPI_SOURCENODE_NONE = 100, 207 - /** \deprecated Use HPI_SOURCENODE_NONE instead. */ 208 - HPI_SOURCENODE_BASE = 100, 209 /** Out Stream (Play) node. */ 210 HPI_SOURCENODE_OSTREAM = 101, 211 /** Line in node - could be analog, AES/EBU or network. */ ··· 234 exists on a source node can be searched for using a destination 235 node value of either 0, or HPI_DESTNODE_NONE */ 236 HPI_DESTNODE_NONE = 200, 237 - /** \deprecated Use HPI_DESTNODE_NONE instead. */ 238 - HPI_DESTNODE_BASE = 200, 239 /** In Stream (Record) node. */ 240 HPI_DESTNODE_ISTREAM = 201, 241 HPI_DESTNODE_LINEOUT = 202, /**< line out node. */ ··· 429 Property 1 - adapter can do samplerate conversion (MRX) 430 Property 2 - adapter can do timestretch (TSX) 431 */ 432 - HPI_ADAPTER_PROPERTY_CAPS2 = 269 433 }; 434 435 /** Adapter mode commands ··· 821 /** The sampleclock output is derived from its local samplerate generator. 822 The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */ 823 HPI_SAMPLECLOCK_SOURCE_LOCAL = 1, 824 - /** \deprecated Use HPI_SAMPLECLOCK_SOURCE_LOCAL instead */ 825 - HPI_SAMPLECLOCK_SOURCE_ADAPTER = 1, 826 /** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/ 827 HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2, 828 /** From external wordclock connector */ ··· 831 HPI_SAMPLECLOCK_SOURCE_SMPTE = 5, 832 /** One of the aesebu inputs */ 833 HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6, 834 - /** \deprecated The first aesebu input with a valid signal 835 - Superseded by separate Auto enable flag 836 - */ 837 - HPI_SAMPLECLOCK_SOURCE_AESEBU_AUTO = 7, 838 /** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */ 839 HPI_SAMPLECLOCK_SOURCE_NETWORK = 8, 840 /** From previous adjacent module (ASI2416 only)*/ ··· 1017 HPI_ERROR_CONTROL_DISABLED = 404, 1018 /** I2C transaction failed due to a missing ACK. */ 1019 HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405, 1020 - /** Control attribute is valid, but not supported by this hardware. */ 1021 - HPI_ERROR_UNSUPPORTED_CONTROL_ATTRIBUTE = 406, 1022 /** Control is busy, or coming out of 1023 reset and cannot be accessed at this time. */ 1024 HPI_ERROR_CONTROL_NOT_READY = 407, ··· 1827 Compressor Expander control 1828 *******************************/ 1829 1830 - u16 hpi_compander_set(const struct hpi_hsubsys *ph_subsys, u32 h_control, 1831 - u16 attack, u16 decay, short ratio100, short threshold0_01dB, 1832 - short makeup_gain0_01dB); 1833 1834 - u16 hpi_compander_get(const struct hpi_hsubsys *ph_subsys, u32 h_control, 1835 - u16 *pw_attack, u16 *pw_decay, short *pw_ratio100, 1836 - short *pn_threshold0_01dB, short *pn_makeup_gain0_01dB); 1837 1838 /******************************* 1839 Cobranet HMI control
··· 50 #define HPI_VER_RELEASE(v) ((int)(v & 0xFF)) 51 52 /* Use single digits for versions less that 10 to avoid octal. */ 53 + #define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 4, 1) 54 + #define HPI_VER_STRING "4.04.01" 55 56 /* Library version as documented in hpi-api-versions.txt */ 57 #define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(9, 0, 0) ··· 203 exists on a destination node can be searched for using a source 204 node value of either 0, or HPI_SOURCENODE_NONE */ 205 HPI_SOURCENODE_NONE = 100, 206 /** Out Stream (Play) node. */ 207 HPI_SOURCENODE_OSTREAM = 101, 208 /** Line in node - could be analog, AES/EBU or network. */ ··· 235 exists on a source node can be searched for using a destination 236 node value of either 0, or HPI_DESTNODE_NONE */ 237 HPI_DESTNODE_NONE = 200, 238 /** In Stream (Record) node. */ 239 HPI_DESTNODE_ISTREAM = 201, 240 HPI_DESTNODE_LINEOUT = 202, /**< line out node. */ ··· 432 Property 1 - adapter can do samplerate conversion (MRX) 433 Property 2 - adapter can do timestretch (TSX) 434 */ 435 + HPI_ADAPTER_PROPERTY_CAPS2 = 269, 436 + 437 + /** Readonly adapter sync header connection count. 438 + */ 439 + HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270, 440 + /** Readonly supports SSX2 property. 441 + Indicates the adapter supports SSX2 in some mode setting. The 442 + return value is true (1) or false (0). If the current adapter 443 + mode is MONO SSX2 is disabled, even though this property will 444 + return true. 445 + */ 446 + HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271 447 }; 448 449 /** Adapter mode commands ··· 813 /** The sampleclock output is derived from its local samplerate generator. 814 The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */ 815 HPI_SAMPLECLOCK_SOURCE_LOCAL = 1, 816 /** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/ 817 HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2, 818 /** From external wordclock connector */ ··· 825 HPI_SAMPLECLOCK_SOURCE_SMPTE = 5, 826 /** One of the aesebu inputs */ 827 HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6, 828 /** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */ 829 HPI_SAMPLECLOCK_SOURCE_NETWORK = 8, 830 /** From previous adjacent module (ASI2416 only)*/ ··· 1015 HPI_ERROR_CONTROL_DISABLED = 404, 1016 /** I2C transaction failed due to a missing ACK. */ 1017 HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405, 1018 /** Control is busy, or coming out of 1019 reset and cannot be accessed at this time. */ 1020 HPI_ERROR_CONTROL_NOT_READY = 407, ··· 1827 Compressor Expander control 1828 *******************************/ 1829 1830 + u16 hpi_compander_set_enable(const struct hpi_hsubsys *ph_subsys, 1831 + u32 h_control, u32 on); 1832 1833 + u16 hpi_compander_get_enable(const struct hpi_hsubsys *ph_subsys, 1834 + u32 h_control, u32 *pon); 1835 + 1836 + u16 hpi_compander_set_makeup_gain(const struct hpi_hsubsys *ph_subsys, 1837 + u32 h_control, short makeup_gain0_01dB); 1838 + 1839 + u16 hpi_compander_get_makeup_gain(const struct hpi_hsubsys *ph_subsys, 1840 + u32 h_control, short *pn_makeup_gain0_01dB); 1841 + 1842 + u16 hpi_compander_set_attack_time_constant(const struct hpi_hsubsys 1843 + *ph_subsys, u32 h_control, u32 index, u32 attack); 1844 + 1845 + u16 hpi_compander_get_attack_time_constant(const struct hpi_hsubsys 1846 + *ph_subsys, u32 h_control, u32 index, u32 *pw_attack); 1847 + 1848 + u16 hpi_compander_set_decay_time_constant(const struct hpi_hsubsys *ph_subsys, 1849 + u32 h_control, u32 index, u32 decay); 1850 + 1851 + u16 hpi_compander_get_decay_time_constant(const struct hpi_hsubsys *ph_subsys, 1852 + u32 h_control, u32 index, u32 *pw_decay); 1853 + 1854 + u16 hpi_compander_set_threshold(const struct hpi_hsubsys *ph_subsys, 1855 + u32 h_control, u32 index, short threshold0_01dB); 1856 + 1857 + u16 hpi_compander_get_threshold(const struct hpi_hsubsys *ph_subsys, 1858 + u32 h_control, u32 index, short *pn_threshold0_01dB); 1859 + 1860 + u16 hpi_compander_set_ratio(const struct hpi_hsubsys *ph_subsys, 1861 + u32 h_control, u32 index, u32 ratio100); 1862 + 1863 + u16 hpi_compander_get_ratio(const struct hpi_hsubsys *ph_subsys, 1864 + u32 h_control, u32 index, u32 *pw_ratio100); 1865 1866 /******************************* 1867 Cobranet HMI control
+7
sound/pci/asihpi/hpi6000.c
··· 687 switch (pao->pci.subsys_device_id) { 688 case 0x5100: 689 case 0x5110: /* ASI5100 revB or higher with C6711D */ 690 case 0x6100: 691 case 0x6200: 692 boot_load_family = HPI_ADAPTER_FAMILY_ASI(0x6200); ··· 1133 if (HPI_ADAPTER_FAMILY_ASI(pao->pci. 1134 subsys_device_id) == 1135 HPI_ADAPTER_FAMILY_ASI(0x5100)) 1136 mask = 0x00000000L; 1137 break; 1138 case HPI_ADAPTER_FAMILY_ASI(0x8800):
··· 687 switch (pao->pci.subsys_device_id) { 688 case 0x5100: 689 case 0x5110: /* ASI5100 revB or higher with C6711D */ 690 + case 0x5200: /* ASI5200 PC_ie version of ASI5100 */ 691 case 0x6100: 692 case 0x6200: 693 boot_load_family = HPI_ADAPTER_FAMILY_ASI(0x6200); ··· 1132 if (HPI_ADAPTER_FAMILY_ASI(pao->pci. 1133 subsys_device_id) == 1134 HPI_ADAPTER_FAMILY_ASI(0x5100)) 1135 + mask = 0x00000000L; 1136 + /* ASI5200 uses AX6 code, */ 1137 + /* but has no PLD r/w register to test */ 1138 + if (HPI_ADAPTER_FAMILY_ASI(pao->pci. 1139 + subsys_device_id) == 1140 + HPI_ADAPTER_FAMILY_ASI(0x5200)) 1141 mask = 0x00000000L; 1142 break; 1143 case HPI_ADAPTER_FAMILY_ASI(0x8800):
+22 -18
sound/pci/asihpi/hpi_internal.h
··· 104 #define STR_ROLE_FIELD_MAX 255U 105 106 struct hpi_entity_str { 107 - uint16_t size; 108 - uint8_t type; 109 - uint8_t role; 110 }; 111 112 #if defined(_MSC_VER) ··· 119 #if ! defined(HPI_OS_DSP_C6000) || (defined(HPI_OS_DSP_C6000) && (__TI_COMPILER_VERSION__ > 6000008)) 120 /* DSP C6000 compiler v6.0.8 and lower 121 do not support flexible array member */ 122 - uint8_t value[]; 123 #else 124 /* NOTE! Using sizeof(struct hpi_entity) will give erroneous results */ 125 #define HPI_INTERNAL_WARN_ABOUT_ENTITY_VALUE 126 - uint8_t value[1]; 127 #endif 128 }; 129 ··· 142 /******************************************* CONTROL ATTRIBUTES ****/ 143 /* (in order of control type ID */ 144 145 - /* This allows for 255 control types, 256 unique attributes each */ 146 #define HPI_CTL_ATTR(ctl, ai) (HPI_CONTROL_##ctl * 0x100 + ai) 147 148 /* Get the sub-index of the attribute for a control type */ 149 #define HPI_CTL_ATTR_INDEX(i) (i&0xff) 150 151 /* Generic control attributes. */ 152 ··· 314 /* Microphone control attributes */ 315 #define HPI_MICROPHONE_PHANTOM_POWER HPI_CTL_ATTR(MICROPHONE, 1) 316 317 - /** Equalizer control attributes 318 - */ 319 /** Used to get number of filters in an EQ. (Can't set) */ 320 #define HPI_EQUALIZER_NUM_FILTERS HPI_CTL_ATTR(EQUALIZER, 1) 321 /** Set/get the filter by type, freq, Q, gain */ ··· 322 /** Get the biquad coefficients */ 323 #define HPI_EQUALIZER_COEFFICIENTS HPI_CTL_ATTR(EQUALIZER, 3) 324 325 - #define HPI_COMPANDER_PARAMS HPI_CTL_ATTR(COMPANDER, 1) 326 327 - /* Cobranet control attributes. 328 - MUST be distinct from all other control attributes. 329 - This is so that host side processing can easily identify a Cobranet control 330 - and apply additional host side operations (like copying data) as required. 331 - */ 332 #define HPI_COBRANET_SET HPI_CTL_ATTR(COBRANET, 1) 333 #define HPI_COBRANET_GET HPI_CTL_ATTR(COBRANET, 2) 334 #define HPI_COBRANET_SET_DATA HPI_CTL_ATTR(COBRANET, 3) ··· 1516 struct hpi_control_cache_info i; 1517 union { 1518 struct { /* volume */ 1519 - u16 an_log[2]; 1520 } v; 1521 struct { /* peak meter */ 1522 - u16 an_log_peak[2]; 1523 - u16 an_logRMS[2]; 1524 } p; 1525 struct { /* channel mode */ 1526 u16 mode; ··· 1530 u16 source_node_index; 1531 } x; 1532 struct { /* level/trim */ 1533 - u16 an_log[2]; 1534 } l; 1535 struct { /* tuner - partial caching. 1536 some attributes go to the DSP. */
··· 104 #define STR_ROLE_FIELD_MAX 255U 105 106 struct hpi_entity_str { 107 + u16 size; 108 + u8 type; 109 + u8 role; 110 }; 111 112 #if defined(_MSC_VER) ··· 119 #if ! defined(HPI_OS_DSP_C6000) || (defined(HPI_OS_DSP_C6000) && (__TI_COMPILER_VERSION__ > 6000008)) 120 /* DSP C6000 compiler v6.0.8 and lower 121 do not support flexible array member */ 122 + u8 value[]; 123 #else 124 /* NOTE! Using sizeof(struct hpi_entity) will give erroneous results */ 125 #define HPI_INTERNAL_WARN_ABOUT_ENTITY_VALUE 126 + u8 value[1]; 127 #endif 128 }; 129 ··· 142 /******************************************* CONTROL ATTRIBUTES ****/ 143 /* (in order of control type ID */ 144 145 + /* This allows for 255 control types, 256 unique attributes each */ 146 #define HPI_CTL_ATTR(ctl, ai) (HPI_CONTROL_##ctl * 0x100 + ai) 147 148 /* Get the sub-index of the attribute for a control type */ 149 #define HPI_CTL_ATTR_INDEX(i) (i&0xff) 150 + 151 + /* Extract the control from the control attribute */ 152 + #define HPI_CTL_ATTR_CONTROL(i) (i>>8) 153 154 /* Generic control attributes. */ 155 ··· 311 /* Microphone control attributes */ 312 #define HPI_MICROPHONE_PHANTOM_POWER HPI_CTL_ATTR(MICROPHONE, 1) 313 314 + /** Equalizer control attributes */ 315 /** Used to get number of filters in an EQ. (Can't set) */ 316 #define HPI_EQUALIZER_NUM_FILTERS HPI_CTL_ATTR(EQUALIZER, 1) 317 /** Set/get the filter by type, freq, Q, gain */ ··· 320 /** Get the biquad coefficients */ 321 #define HPI_EQUALIZER_COEFFICIENTS HPI_CTL_ATTR(EQUALIZER, 3) 322 323 + /* Note compander also uses HPI_GENERIC_ENABLE */ 324 + #define HPI_COMPANDER_PARAMS HPI_CTL_ATTR(COMPANDER, 1) 325 + #define HPI_COMPANDER_MAKEUPGAIN HPI_CTL_ATTR(COMPANDER, 2) 326 + #define HPI_COMPANDER_THRESHOLD HPI_CTL_ATTR(COMPANDER, 3) 327 + #define HPI_COMPANDER_RATIO HPI_CTL_ATTR(COMPANDER, 4) 328 + #define HPI_COMPANDER_ATTACK HPI_CTL_ATTR(COMPANDER, 5) 329 + #define HPI_COMPANDER_DECAY HPI_CTL_ATTR(COMPANDER, 6) 330 331 + /* Cobranet control attributes. */ 332 #define HPI_COBRANET_SET HPI_CTL_ATTR(COBRANET, 1) 333 #define HPI_COBRANET_GET HPI_CTL_ATTR(COBRANET, 2) 334 #define HPI_COBRANET_SET_DATA HPI_CTL_ATTR(COBRANET, 3) ··· 1512 struct hpi_control_cache_info i; 1513 union { 1514 struct { /* volume */ 1515 + short an_log[2]; 1516 } v; 1517 struct { /* peak meter */ 1518 + short an_log_peak[2]; 1519 + short an_logRMS[2]; 1520 } p; 1521 struct { /* channel mode */ 1522 u16 mode; ··· 1526 u16 source_node_index; 1527 } x; 1528 struct { /* level/trim */ 1529 + short an_log[2]; 1530 } l; 1531 struct { /* tuner - partial caching. 1532 some attributes go to the DSP. */
+8 -2
sound/pci/asihpi/hpicmn.c
··· 353 phr->u.c.param1 = pC->u.t.band; 354 else if ((phm->u.c.attribute == HPI_TUNER_LEVEL) 355 && (phm->u.c.param1 == HPI_TUNER_LEVEL_AVERAGE)) 356 - phr->u.c.param1 = pC->u.t.level; 357 else 358 found = 0; 359 break; ··· 402 if (pC->u.clk.source_index == 403 HPI_ERROR_ILLEGAL_CACHE_VALUE) { 404 phr->u.c.param1 = 0; 405 - phr->error = HPI_ERROR_INVALID_OPERATION; 406 } else 407 phr->u.c.param1 = pC->u.clk.source_index; 408 } else if (phm->u.c.attribute == HPI_SAMPLECLOCK_SAMPLERATE)
··· 353 phr->u.c.param1 = pC->u.t.band; 354 else if ((phm->u.c.attribute == HPI_TUNER_LEVEL) 355 && (phm->u.c.param1 == HPI_TUNER_LEVEL_AVERAGE)) 356 + if (pC->u.t.level == HPI_ERROR_ILLEGAL_CACHE_VALUE) { 357 + phr->u.c.param1 = 0; 358 + phr->error = 359 + HPI_ERROR_INVALID_CONTROL_ATTRIBUTE; 360 + } else 361 + phr->u.c.param1 = pC->u.t.level; 362 else 363 found = 0; 364 break; ··· 397 if (pC->u.clk.source_index == 398 HPI_ERROR_ILLEGAL_CACHE_VALUE) { 399 phr->u.c.param1 = 0; 400 + phr->error = 401 + HPI_ERROR_INVALID_CONTROL_ATTRIBUTE; 402 } else 403 phr->u.c.param1 = pC->u.clk.source_index; 404 } else if (phm->u.c.attribute == HPI_SAMPLECLOCK_SAMPLERATE)
+1 -1
sound/pci/asihpi/hpidebug.c
··· 111 &hpi_profile_strings,\ 112 &hpi_control_strings, \ 113 &hpi_asyncevent_strings \ 114 - }; 115 make_treenode_from_array(hpi_function_strings, HPI_FUNCTION_STRINGS) 116 117 compile_time_assert(HPI_OBJ_MAXINDEX == 14, obj_list_doesnt_match);
··· 111 &hpi_profile_strings,\ 112 &hpi_control_strings, \ 113 &hpi_asyncevent_strings \ 114 + } 115 make_treenode_from_array(hpi_function_strings, HPI_FUNCTION_STRINGS) 116 117 compile_time_assert(HPI_OBJ_MAXINDEX == 14, obj_list_doesnt_match);
+2 -2
sound/pci/asihpi/hpidebug.h
··· 356 "HPI_SOURCENODE_ADAPTER" \ 357 } 358 359 - compile_time_assert((HPI_SOURCENODE_LAST_INDEX - HPI_SOURCENODE_BASE + 1) == 360 (12), sourcenode_strings_match_defs); 361 362 #define HPI_DESTNODE_STRINGS \ ··· 370 "HPI_DESTNODE_COBRANET", \ 371 "HPI_DESTNODE_ANALOG" \ 372 } 373 - compile_time_assert((HPI_DESTNODE_LAST_INDEX - HPI_DESTNODE_BASE + 1) == (8), 374 destnode_strings_match_defs); 375 376 #define HPI_CONTROL_CHANNEL_MODE_STRINGS \
··· 356 "HPI_SOURCENODE_ADAPTER" \ 357 } 358 359 + compile_time_assert((HPI_SOURCENODE_LAST_INDEX - HPI_SOURCENODE_NONE + 1) == 360 (12), sourcenode_strings_match_defs); 361 362 #define HPI_DESTNODE_STRINGS \ ··· 370 "HPI_DESTNODE_COBRANET", \ 371 "HPI_DESTNODE_ANALOG" \ 372 } 373 + compile_time_assert((HPI_DESTNODE_LAST_INDEX - HPI_DESTNODE_NONE + 1) == (8), 374 destnode_strings_match_defs); 375 376 #define HPI_CONTROL_CHANNEL_MODE_STRINGS \
+196 -133
sound/pci/asihpi/hpifunc.c
··· 96 97 static struct hpi_hsubsys gh_subsys; 98 99 - struct hpi_hsubsys *hpi_subsys_create(void 100 - ) 101 { 102 struct hpi_message hm; 103 struct hpi_response hr; ··· 301 { 302 struct hpi_message hm; 303 struct hpi_response hr; 304 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER, 305 HPI_ADAPTER_SET_MODE); 306 hm.adapter_index = adapter_index; ··· 510 hm.adapter_index = adapter_index; 511 hm.u.ax.debug_read.dsp_address = dsp_address; 512 513 - if (*count_bytes > sizeof(hr.u.bytes)) 514 *count_bytes = sizeof(hr.u.bytes); 515 516 hm.u.ax.debug_read.count_bytes = *count_bytes; ··· 976 { 977 struct hpi_message hm; 978 struct hpi_response hr; 979 hpi_init_message_response(&hm, &hr, HPI_OBJ_OSTREAM, 980 HPI_OSTREAM_ANC_READ); 981 u32TOINDEXES(h_outstream, &hm.adapter_index, &hm.obj_index); ··· 1582 { 1583 struct hpi_message hm; 1584 struct hpi_response hr; 1585 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 1586 HPI_CONTROL_SET_STATE); 1587 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 1588 hm.u.c.attribute = attrib; 1589 hm.u.c.param1 = param1; 1590 hm.u.c.param2 = param2; 1591 hpi_send_recv(&hm, &hr); 1592 return hr.error; 1593 } ··· 1616 { 1617 struct hpi_message hm; 1618 struct hpi_response hr; 1619 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 1620 HPI_CONTROL_GET_STATE); 1621 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 1624 hm.u.c.param1 = param1; 1625 hm.u.c.param2 = param2; 1626 hpi_send_recv(&hm, &hr); 1627 - if (pparam1) 1628 - *pparam1 = hr.u.c.param1; 1629 if (pparam2) 1630 *pparam2 = hr.u.c.param2; 1631 ··· 1636 hpi_control_param_get(s, h, a, 0, 0, p1, NULL) 1637 #define hpi_control_param2_get(s, h, a, p1, p2) \ 1638 hpi_control_param_get(s, h, a, 0, 0, p1, p2) 1639 - #define hpi_control_ex_param1_get(s, h, a, p1) \ 1640 - hpi_control_ex_param_get(s, h, a, 0, 0, p1, NULL) 1641 - #define hpi_control_ex_param2_get(s, h, a, p1, p2) \ 1642 - hpi_control_ex_param_get(s, h, a, 0, 0, p1, p2) 1643 1644 static 1645 u16 hpi_control_query(const struct hpi_hsubsys *ph_subsys, ··· 1661 { 1662 struct hpi_message hm; 1663 struct hpi_response hr; 1664 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 1665 HPI_CONTROL_GET_INFO); 1666 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 1676 return hr.error; 1677 } 1678 1679 - static u16 hpi_control_get_string(const struct hpi_hsubsys *ph_subsys, 1680 - const u32 h_control, const u16 attribute, char *psz_string, 1681 - const u32 string_length) 1682 { 1683 unsigned int sub_string_index = 0, j = 0; 1684 char c = 0; ··· 1948 { 1949 struct hpi_message hm; 1950 struct hpi_response hr; 1951 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROLEX, 1952 HPI_CONTROL_SET_STATE); 1953 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 1974 { 1975 struct hpi_message hm; 1976 struct hpi_response hr; 1977 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROLEX, 1978 HPI_CONTROL_GET_STATE); 1979 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2014 { 2015 struct hpi_message hm; 2016 struct hpi_response hr; 2017 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROLEX, 2018 HPI_CONTROL_GET_STATE); 2019 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2041 u32 byte_count; 2042 u32 iP; 2043 u16 error; 2044 error = hpi_cobranet_hmi_read(ph_subsys, h_control, 2045 HPI_COBRANET_HMI_cobra_ip_mon_currentIP, 4, &byte_count, 2046 (u8 *)&iP); ··· 2118 u32 byte_count; 2119 u16 error; 2120 u32 mAC; 2121 error = hpi_cobranet_hmi_read(ph_subsys, h_control, 2122 HPI_COBRANET_HMI_cobra_if_phy_address, 4, &byte_count, 2123 (u8 *)&mAC); ··· 2140 return error; 2141 } 2142 2143 - u16 hpi_compander_set(const struct hpi_hsubsys *ph_subsys, u32 h_control, 2144 - u16 attack, u16 decay, short ratio100, short threshold0_01dB, 2145 - short makeup_gain0_01dB) 2146 { 2147 struct hpi_message hm; 2148 struct hpi_response hr; 2149 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2150 HPI_CONTROL_SET_STATE); 2151 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 2152 - 2153 - hm.u.c.param1 = attack + ((u32)ratio100 << 16); 2154 - hm.u.c.param2 = (decay & 0xFFFFL); 2155 hm.u.c.an_log_value[0] = threshold0_01dB; 2156 - hm.u.c.an_log_value[1] = makeup_gain0_01dB; 2157 - hm.u.c.attribute = HPI_COMPANDER_PARAMS; 2158 2159 hpi_send_recv(&hm, &hr); 2160 2161 return hr.error; 2162 } 2163 2164 - u16 hpi_compander_get(const struct hpi_hsubsys *ph_subsys, u32 h_control, 2165 - u16 *pw_attack, u16 *pw_decay, short *pw_ratio100, 2166 - short *pn_threshold0_01dB, short *pn_makeup_gain0_01dB) 2167 { 2168 struct hpi_message hm; 2169 struct hpi_response hr; 2170 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2171 HPI_CONTROL_GET_STATE); 2172 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 2173 - hm.u.c.attribute = HPI_COMPANDER_PARAMS; 2174 2175 hpi_send_recv(&hm, &hr); 2176 - 2177 - if (pw_attack) 2178 - *pw_attack = (short)(hr.u.c.param1 & 0xFFFF); 2179 - if (pw_decay) 2180 - *pw_decay = (short)(hr.u.c.param2 & 0xFFFF); 2181 - if (pw_ratio100) 2182 - *pw_ratio100 = (short)(hr.u.c.param1 >> 16); 2183 - 2184 - if (pn_threshold0_01dB) 2185 - *pn_threshold0_01dB = hr.u.c.an_log_value[0]; 2186 - if (pn_makeup_gain0_01dB) 2187 - *pn_makeup_gain0_01dB = hr.u.c.an_log_value[1]; 2188 2189 return hr.error; 2190 } 2191 2192 u16 hpi_level_query_range(const struct hpi_hsubsys *ph_subsys, u32 h_control, ··· 2252 { 2253 struct hpi_message hm; 2254 struct hpi_response hr; 2255 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2256 HPI_CONTROL_GET_STATE); 2257 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2277 short an_gain0_01dB[HPI_MAX_CHANNELS] 2278 ) 2279 { 2280 - struct hpi_message hm; 2281 - struct hpi_response hr; 2282 - 2283 - hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2284 - HPI_CONTROL_SET_STATE); 2285 - u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 2286 - memcpy(hm.u.c.an_log_value, an_gain0_01dB, 2287 - sizeof(short) * HPI_MAX_CHANNELS); 2288 - hm.u.c.attribute = HPI_LEVEL_GAIN; 2289 - 2290 - hpi_send_recv(&hm, &hr); 2291 - 2292 - return hr.error; 2293 } 2294 2295 u16 hpi_level_get_gain(const struct hpi_hsubsys *ph_subsys, u32 h_control, 2296 short an_gain0_01dB[HPI_MAX_CHANNELS] 2297 ) 2298 { 2299 - struct hpi_message hm; 2300 - struct hpi_response hr; 2301 - hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2302 - HPI_CONTROL_GET_STATE); 2303 - u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 2304 - hm.u.c.attribute = HPI_LEVEL_GAIN; 2305 - 2306 - hpi_send_recv(&hm, &hr); 2307 - 2308 - memcpy(an_gain0_01dB, hr.u.c.an_log_value, 2309 - sizeof(short) * HPI_MAX_CHANNELS); 2310 - return hr.error; 2311 } 2312 2313 u16 hpi_meter_query_channels(const struct hpi_hsubsys *ph_subsys, ··· 2488 { 2489 struct hpi_message hm; 2490 struct hpi_response hr; 2491 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2492 HPI_CONTROL_GET_STATE); 2493 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2515 { 2516 struct hpi_message hm; 2517 struct hpi_response hr; 2518 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2519 HPI_CONTROL_SET_STATE); 2520 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2537 { 2538 struct hpi_message hm; 2539 struct hpi_response hr; 2540 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2541 HPI_CONTROL_GET_STATE); 2542 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2701 u16 hpi_tone_detector_get_state(const struct hpi_hsubsys *ph_subsys, 2702 u32 h_control, u32 *state) 2703 { 2704 - return hpi_control_param_get(ph_subsys, h_control, 2705 - HPI_TONEDETECTOR_STATE, 0, 0, (u32 *)state, NULL); 2706 } 2707 2708 u16 hpi_tone_detector_set_enable(const struct hpi_hsubsys *ph_subsys, ··· 2715 u16 hpi_tone_detector_get_enable(const struct hpi_hsubsys *ph_subsys, 2716 u32 h_control, u32 *enable) 2717 { 2718 - return hpi_control_param_get(ph_subsys, h_control, HPI_GENERIC_ENABLE, 2719 - 0, 0, (u32 *)enable, NULL); 2720 } 2721 2722 u16 hpi_tone_detector_set_event_enable(const struct hpi_hsubsys *ph_subsys, ··· 2729 u16 hpi_tone_detector_get_event_enable(const struct hpi_hsubsys *ph_subsys, 2730 u32 h_control, u32 *event_enable) 2731 { 2732 - return hpi_control_param_get(ph_subsys, h_control, 2733 - HPI_GENERIC_EVENT_ENABLE, 0, 0, (u32 *)event_enable, NULL); 2734 } 2735 2736 u16 hpi_tone_detector_set_threshold(const struct hpi_hsubsys *ph_subsys, ··· 2743 u16 hpi_tone_detector_get_threshold(const struct hpi_hsubsys *ph_subsys, 2744 u32 h_control, int *threshold) 2745 { 2746 - return hpi_control_param_get(ph_subsys, h_control, 2747 - HPI_TONEDETECTOR_THRESHOLD, 0, 0, (u32 *)threshold, NULL); 2748 } 2749 2750 u16 hpi_silence_detector_get_state(const struct hpi_hsubsys *ph_subsys, 2751 u32 h_control, u32 *state) 2752 { 2753 - return hpi_control_param_get(ph_subsys, h_control, 2754 - HPI_SILENCEDETECTOR_STATE, 0, 0, (u32 *)state, NULL); 2755 } 2756 2757 u16 hpi_silence_detector_set_enable(const struct hpi_hsubsys *ph_subsys, ··· 2764 u16 hpi_silence_detector_get_enable(const struct hpi_hsubsys *ph_subsys, 2765 u32 h_control, u32 *enable) 2766 { 2767 - return hpi_control_param_get(ph_subsys, h_control, HPI_GENERIC_ENABLE, 2768 - 0, 0, (u32 *)enable, NULL); 2769 } 2770 2771 u16 hpi_silence_detector_set_event_enable(const struct hpi_hsubsys *ph_subsys, 2772 u32 h_control, u32 event_enable) 2773 { 2774 return hpi_control_param_set(ph_subsys, h_control, 2775 - HPI_GENERIC_EVENT_ENABLE, (u32)event_enable, 0); 2776 } 2777 2778 u16 hpi_silence_detector_get_event_enable(const struct hpi_hsubsys *ph_subsys, 2779 u32 h_control, u32 *event_enable) 2780 { 2781 - return hpi_control_param_get(ph_subsys, h_control, 2782 - HPI_GENERIC_EVENT_ENABLE, 0, 0, (u32 *)event_enable, NULL); 2783 } 2784 2785 u16 hpi_silence_detector_set_delay(const struct hpi_hsubsys *ph_subsys, 2786 u32 h_control, u32 delay) 2787 { 2788 return hpi_control_param_set(ph_subsys, h_control, 2789 - HPI_SILENCEDETECTOR_DELAY, (u32)delay, 0); 2790 } 2791 2792 u16 hpi_silence_detector_get_delay(const struct hpi_hsubsys *ph_subsys, 2793 u32 h_control, u32 *delay) 2794 { 2795 - return hpi_control_param_get(ph_subsys, h_control, 2796 - HPI_SILENCEDETECTOR_DELAY, 0, 0, (u32 *)delay, NULL); 2797 } 2798 2799 u16 hpi_silence_detector_set_threshold(const struct hpi_hsubsys *ph_subsys, 2800 u32 h_control, int threshold) 2801 { 2802 return hpi_control_param_set(ph_subsys, h_control, 2803 - HPI_SILENCEDETECTOR_THRESHOLD, (u32)threshold, 0); 2804 } 2805 2806 u16 hpi_silence_detector_get_threshold(const struct hpi_hsubsys *ph_subsys, 2807 u32 h_control, int *threshold) 2808 { 2809 - return hpi_control_param_get(ph_subsys, h_control, 2810 - HPI_SILENCEDETECTOR_THRESHOLD, 0, 0, (u32 *)threshold, NULL); 2811 } 2812 2813 u16 hpi_tuner_query_band(const struct hpi_hsubsys *ph_subsys, ··· 2900 { 2901 struct hpi_message hm; 2902 struct hpi_response hr; 2903 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2904 HPI_CONTROL_GET_STATE); 2905 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2917 { 2918 struct hpi_message hm; 2919 struct hpi_response hr; 2920 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2921 HPI_CONTROL_GET_STATE); 2922 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2974 u16 hpi_tuner_get_hd_radio_dsp_version(const struct hpi_hsubsys *ph_subsys, 2975 u32 h_control, char *psz_dsp_version, const u32 string_size) 2976 { 2977 - return hpi_control_get_string(ph_subsys, h_control, 2978 HPI_TUNER_HDRADIO_DSP_VERSION, psz_dsp_version, string_size); 2979 } 2980 2981 u16 hpi_tuner_get_hd_radio_sdk_version(const struct hpi_hsubsys *ph_subsys, 2982 u32 h_control, char *psz_sdk_version, const u32 string_size) 2983 { 2984 - return hpi_control_get_string(ph_subsys, h_control, 2985 HPI_TUNER_HDRADIO_SDK_VERSION, psz_sdk_version, string_size); 2986 } 2987 ··· 3022 u16 hpi_tuner_get_hd_radio_signal_quality(const struct hpi_hsubsys *ph_subsys, 3023 u32 h_control, u32 *pquality) 3024 { 3025 - return hpi_control_param_get(ph_subsys, h_control, 3026 - HPI_TUNER_HDRADIO_SIGNAL_QUALITY, 0, 0, pquality, NULL); 3027 } 3028 3029 u16 hpi_tuner_get_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys, 3030 u32 h_control, u32 *pblend) 3031 { 3032 - return hpi_control_param_get(ph_subsys, h_control, 3033 - HPI_TUNER_HDRADIO_BLEND, 0, 0, pblend, NULL); 3034 } 3035 3036 u16 hpi_tuner_set_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys, ··· 3045 { 3046 struct hpi_message hm; 3047 struct hpi_response hr; 3048 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 3049 HPI_CONTROL_GET_STATE); 3050 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 3062 u16 HPI_PAD__get_channel_name(const struct hpi_hsubsys *ph_subsys, 3063 u32 h_control, char *psz_string, const u32 data_length) 3064 { 3065 - return hpi_control_get_string(ph_subsys, h_control, 3066 - HPI_PAD_CHANNEL_NAME, psz_string, data_length); 3067 } 3068 3069 u16 HPI_PAD__get_artist(const struct hpi_hsubsys *ph_subsys, u32 h_control, 3070 char *psz_string, const u32 data_length) 3071 { 3072 - return hpi_control_get_string(ph_subsys, h_control, HPI_PAD_ARTIST, 3073 - psz_string, data_length); 3074 } 3075 3076 u16 HPI_PAD__get_title(const struct hpi_hsubsys *ph_subsys, u32 h_control, 3077 char *psz_string, const u32 data_length) 3078 { 3079 - return hpi_control_get_string(ph_subsys, h_control, HPI_PAD_TITLE, 3080 - psz_string, data_length); 3081 } 3082 3083 u16 HPI_PAD__get_comment(const struct hpi_hsubsys *ph_subsys, u32 h_control, 3084 char *psz_string, const u32 data_length) 3085 { 3086 - return hpi_control_get_string(ph_subsys, h_control, HPI_PAD_COMMENT, 3087 - psz_string, data_length); 3088 } 3089 3090 u16 HPI_PAD__get_program_type(const struct hpi_hsubsys *ph_subsys, 3091 u32 h_control, u32 *ppTY) 3092 { 3093 - return hpi_control_param_get(ph_subsys, h_control, 3094 - HPI_PAD_PROGRAM_TYPE, 0, 0, ppTY, NULL); 3095 } 3096 3097 u16 HPI_PAD__get_rdsPI(const struct hpi_hsubsys *ph_subsys, u32 h_control, 3098 u32 *ppI) 3099 { 3100 - return hpi_control_param_get(ph_subsys, h_control, HPI_PAD_PROGRAM_ID, 3101 - 0, 0, ppI, NULL); 3102 } 3103 3104 u16 hpi_volume_query_channels(const struct hpi_hsubsys *ph_subsys, ··· 3112 short an_log_gain[HPI_MAX_CHANNELS] 3113 ) 3114 { 3115 - struct hpi_message hm; 3116 - struct hpi_response hr; 3117 - hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 3118 - HPI_CONTROL_SET_STATE); 3119 - u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 3120 - memcpy(hm.u.c.an_log_value, an_log_gain, 3121 - sizeof(short) * HPI_MAX_CHANNELS); 3122 - hm.u.c.attribute = HPI_VOLUME_GAIN; 3123 - 3124 - hpi_send_recv(&hm, &hr); 3125 - 3126 - return hr.error; 3127 } 3128 3129 u16 hpi_volume_get_gain(const struct hpi_hsubsys *ph_subsys, u32 h_control, 3130 short an_log_gain[HPI_MAX_CHANNELS] 3131 ) 3132 { 3133 - struct hpi_message hm; 3134 - struct hpi_response hr; 3135 - hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 3136 - HPI_CONTROL_GET_STATE); 3137 - u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 3138 - hm.u.c.attribute = HPI_VOLUME_GAIN; 3139 - 3140 - hpi_send_recv(&hm, &hr); 3141 - 3142 - memcpy(an_log_gain, hr.u.c.an_log_value, 3143 - sizeof(short) * HPI_MAX_CHANNELS); 3144 - return hr.error; 3145 } 3146 3147 u16 hpi_volume_query_range(const struct hpi_hsubsys *ph_subsys, u32 h_control, ··· 3129 { 3130 struct hpi_message hm; 3131 struct hpi_response hr; 3132 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 3133 HPI_CONTROL_GET_STATE); 3134 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 3156 { 3157 struct hpi_message hm; 3158 struct hpi_response hr; 3159 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 3160 HPI_CONTROL_SET_STATE); 3161 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 3233 6 * sizeof(char), 3234 }; 3235 3236 - inline size_t hpi_entity_size(struct hpi_entity *entity_ptr) 3237 { 3238 return entity_ptr->header.size; 3239 } 3240 3241 - inline size_t hpi_entity_header_size(struct hpi_entity *entity_ptr) 3242 { 3243 return sizeof(entity_ptr->header); 3244 } 3245 3246 - inline size_t hpi_entity_value_size(struct hpi_entity *entity_ptr) 3247 { 3248 return hpi_entity_size(entity_ptr) - 3249 hpi_entity_header_size(entity_ptr); 3250 } 3251 3252 - inline size_t hpi_entity_item_count(struct hpi_entity *entity_ptr) 3253 { 3254 return hpi_entity_value_size(entity_ptr) / 3255 entity_type_to_size[entity_ptr->header.type]; 3256 } 3257 3258 - inline struct hpi_entity *hpi_entity_ptr_to_next(struct hpi_entity 3259 *entity_ptr) 3260 { 3261 - return (void *)(((uint8_t *) entity_ptr) + 3262 - hpi_entity_size(entity_ptr)); 3263 } 3264 3265 - inline u16 hpi_entity_check_type(const enum e_entity_type t) 3266 { 3267 if (t >= 0 && t < STR_TYPE_FIELD_MAX) 3268 return 0; 3269 return HPI_ERROR_ENTITY_TYPE_INVALID; 3270 } 3271 3272 - inline u16 hpi_entity_check_role(const enum e_entity_role r) 3273 { 3274 if (r >= 0 && r < STR_ROLE_FIELD_MAX) 3275 return 0; ··· 3686 u16 maximum_events, struct hpi_async_event *p_events, 3687 u16 *pw_number_returned) 3688 { 3689 return 0; 3690 } 3691
··· 96 97 static struct hpi_hsubsys gh_subsys; 98 99 + struct hpi_hsubsys *hpi_subsys_create(void) 100 { 101 struct hpi_message hm; 102 struct hpi_response hr; ··· 302 { 303 struct hpi_message hm; 304 struct hpi_response hr; 305 + 306 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER, 307 HPI_ADAPTER_SET_MODE); 308 hm.adapter_index = adapter_index; ··· 510 hm.adapter_index = adapter_index; 511 hm.u.ax.debug_read.dsp_address = dsp_address; 512 513 + if (*count_bytes > (int)sizeof(hr.u.bytes)) 514 *count_bytes = sizeof(hr.u.bytes); 515 516 hm.u.ax.debug_read.count_bytes = *count_bytes; ··· 976 { 977 struct hpi_message hm; 978 struct hpi_response hr; 979 + 980 hpi_init_message_response(&hm, &hr, HPI_OBJ_OSTREAM, 981 HPI_OSTREAM_ANC_READ); 982 u32TOINDEXES(h_outstream, &hm.adapter_index, &hm.obj_index); ··· 1581 { 1582 struct hpi_message hm; 1583 struct hpi_response hr; 1584 + 1585 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 1586 HPI_CONTROL_SET_STATE); 1587 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 1588 hm.u.c.attribute = attrib; 1589 hm.u.c.param1 = param1; 1590 hm.u.c.param2 = param2; 1591 + hpi_send_recv(&hm, &hr); 1592 + return hr.error; 1593 + } 1594 + 1595 + static u16 hpi_control_log_set2(u32 h_control, u16 attrib, short sv0, 1596 + short sv1) 1597 + { 1598 + struct hpi_message hm; 1599 + struct hpi_response hr; 1600 + 1601 + hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 1602 + HPI_CONTROL_SET_STATE); 1603 + u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 1604 + hm.u.c.attribute = attrib; 1605 + hm.u.c.an_log_value[0] = sv0; 1606 + hm.u.c.an_log_value[1] = sv1; 1607 hpi_send_recv(&hm, &hr); 1608 return hr.error; 1609 } ··· 1598 { 1599 struct hpi_message hm; 1600 struct hpi_response hr; 1601 + 1602 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 1603 HPI_CONTROL_GET_STATE); 1604 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 1605 hm.u.c.param1 = param1; 1606 hm.u.c.param2 = param2; 1607 hpi_send_recv(&hm, &hr); 1608 + 1609 + *pparam1 = hr.u.c.param1; 1610 if (pparam2) 1611 *pparam2 = hr.u.c.param2; 1612 ··· 1617 hpi_control_param_get(s, h, a, 0, 0, p1, NULL) 1618 #define hpi_control_param2_get(s, h, a, p1, p2) \ 1619 hpi_control_param_get(s, h, a, 0, 0, p1, p2) 1620 + 1621 + static u16 hpi_control_log_get2(const struct hpi_hsubsys *ph_subsys, 1622 + u32 h_control, u16 attrib, short *sv0, short *sv1) 1623 + { 1624 + struct hpi_message hm; 1625 + struct hpi_response hr; 1626 + hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 1627 + HPI_CONTROL_GET_STATE); 1628 + u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 1629 + hm.u.c.attribute = attrib; 1630 + 1631 + hpi_send_recv(&hm, &hr); 1632 + *sv0 = hr.u.c.an_log_value[0]; 1633 + if (sv1) 1634 + *sv1 = hr.u.c.an_log_value[1]; 1635 + return hr.error; 1636 + } 1637 1638 static 1639 u16 hpi_control_query(const struct hpi_hsubsys *ph_subsys, ··· 1629 { 1630 struct hpi_message hm; 1631 struct hpi_response hr; 1632 + 1633 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 1634 HPI_CONTROL_GET_INFO); 1635 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 1643 return hr.error; 1644 } 1645 1646 + static u16 hpi_control_get_string(const u32 h_control, const u16 attribute, 1647 + char *psz_string, const u32 string_length) 1648 { 1649 unsigned int sub_string_index = 0, j = 0; 1650 char c = 0; ··· 1916 { 1917 struct hpi_message hm; 1918 struct hpi_response hr; 1919 + 1920 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROLEX, 1921 HPI_CONTROL_SET_STATE); 1922 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 1941 { 1942 struct hpi_message hm; 1943 struct hpi_response hr; 1944 + 1945 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROLEX, 1946 HPI_CONTROL_GET_STATE); 1947 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 1980 { 1981 struct hpi_message hm; 1982 struct hpi_response hr; 1983 + 1984 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROLEX, 1985 HPI_CONTROL_GET_STATE); 1986 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2006 u32 byte_count; 2007 u32 iP; 2008 u16 error; 2009 + 2010 error = hpi_cobranet_hmi_read(ph_subsys, h_control, 2011 HPI_COBRANET_HMI_cobra_ip_mon_currentIP, 4, &byte_count, 2012 (u8 *)&iP); ··· 2082 u32 byte_count; 2083 u16 error; 2084 u32 mAC; 2085 + 2086 error = hpi_cobranet_hmi_read(ph_subsys, h_control, 2087 HPI_COBRANET_HMI_cobra_if_phy_address, 4, &byte_count, 2088 (u8 *)&mAC); ··· 2103 return error; 2104 } 2105 2106 + u16 hpi_compander_set_enable(const struct hpi_hsubsys *ph_subsys, 2107 + u32 h_control, u32 enable) 2108 + { 2109 + return hpi_control_param_set(ph_subsys, h_control, HPI_GENERIC_ENABLE, 2110 + enable, 0); 2111 + } 2112 + 2113 + u16 hpi_compander_get_enable(const struct hpi_hsubsys *ph_subsys, 2114 + u32 h_control, u32 *enable) 2115 + { 2116 + return hpi_control_param1_get(ph_subsys, h_control, 2117 + HPI_GENERIC_ENABLE, enable); 2118 + } 2119 + 2120 + u16 hpi_compander_set_makeup_gain(const struct hpi_hsubsys *ph_subsys, 2121 + u32 h_control, short makeup_gain0_01dB) 2122 + { 2123 + return hpi_control_log_set2(h_control, HPI_COMPANDER_MAKEUPGAIN, 2124 + makeup_gain0_01dB, 0); 2125 + } 2126 + 2127 + u16 hpi_compander_get_makeup_gain(const struct hpi_hsubsys *ph_subsys, 2128 + u32 h_control, short *makeup_gain0_01dB) 2129 + { 2130 + return hpi_control_log_get2(ph_subsys, h_control, 2131 + HPI_COMPANDER_MAKEUPGAIN, makeup_gain0_01dB, NULL); 2132 + } 2133 + 2134 + u16 hpi_compander_set_attack_time_constant(const struct hpi_hsubsys 2135 + *ph_subsys, u32 h_control, unsigned int index, u32 attack) 2136 + { 2137 + return hpi_control_param_set(ph_subsys, h_control, 2138 + HPI_COMPANDER_ATTACK, attack, index); 2139 + } 2140 + 2141 + u16 hpi_compander_get_attack_time_constant(const struct hpi_hsubsys 2142 + *ph_subsys, u32 h_control, unsigned int index, u32 *attack) 2143 + { 2144 + return hpi_control_param_get(ph_subsys, h_control, 2145 + HPI_COMPANDER_ATTACK, 0, index, attack, NULL); 2146 + } 2147 + 2148 + u16 hpi_compander_set_decay_time_constant(const struct hpi_hsubsys *ph_subsys, 2149 + u32 h_control, unsigned int index, u32 decay) 2150 + { 2151 + return hpi_control_param_set(ph_subsys, h_control, 2152 + HPI_COMPANDER_DECAY, decay, index); 2153 + } 2154 + 2155 + u16 hpi_compander_get_decay_time_constant(const struct hpi_hsubsys *ph_subsys, 2156 + u32 h_control, unsigned int index, u32 *decay) 2157 + { 2158 + return hpi_control_param_get(ph_subsys, h_control, 2159 + HPI_COMPANDER_DECAY, 0, index, decay, NULL); 2160 + 2161 + } 2162 + 2163 + u16 hpi_compander_set_threshold(const struct hpi_hsubsys *ph_subsys, 2164 + u32 h_control, unsigned int index, short threshold0_01dB) 2165 { 2166 struct hpi_message hm; 2167 struct hpi_response hr; 2168 + 2169 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2170 HPI_CONTROL_SET_STATE); 2171 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 2172 + hm.u.c.attribute = HPI_COMPANDER_THRESHOLD; 2173 + hm.u.c.param2 = index; 2174 hm.u.c.an_log_value[0] = threshold0_01dB; 2175 2176 hpi_send_recv(&hm, &hr); 2177 2178 return hr.error; 2179 } 2180 2181 + u16 hpi_compander_get_threshold(const struct hpi_hsubsys *ph_subsys, 2182 + u32 h_control, unsigned int index, short *threshold0_01dB) 2183 { 2184 struct hpi_message hm; 2185 struct hpi_response hr; 2186 + 2187 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2188 HPI_CONTROL_GET_STATE); 2189 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); 2190 + hm.u.c.attribute = HPI_COMPANDER_THRESHOLD; 2191 + hm.u.c.param2 = index; 2192 2193 hpi_send_recv(&hm, &hr); 2194 + *threshold0_01dB = hr.u.c.an_log_value[0]; 2195 2196 return hr.error; 2197 + } 2198 + 2199 + u16 hpi_compander_set_ratio(const struct hpi_hsubsys *ph_subsys, 2200 + u32 h_control, u32 index, u32 ratio100) 2201 + { 2202 + return hpi_control_param_set(ph_subsys, h_control, 2203 + HPI_COMPANDER_RATIO, ratio100, index); 2204 + } 2205 + 2206 + u16 hpi_compander_get_ratio(const struct hpi_hsubsys *ph_subsys, 2207 + u32 h_control, u32 index, u32 *ratio100) 2208 + { 2209 + return hpi_control_param_get(ph_subsys, h_control, 2210 + HPI_COMPANDER_RATIO, 0, index, ratio100, NULL); 2211 } 2212 2213 u16 hpi_level_query_range(const struct hpi_hsubsys *ph_subsys, u32 h_control, ··· 2157 { 2158 struct hpi_message hm; 2159 struct hpi_response hr; 2160 + 2161 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2162 HPI_CONTROL_GET_STATE); 2163 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2181 short an_gain0_01dB[HPI_MAX_CHANNELS] 2182 ) 2183 { 2184 + return hpi_control_log_set2(h_control, HPI_LEVEL_GAIN, 2185 + an_gain0_01dB[0], an_gain0_01dB[1]); 2186 } 2187 2188 u16 hpi_level_get_gain(const struct hpi_hsubsys *ph_subsys, u32 h_control, 2189 short an_gain0_01dB[HPI_MAX_CHANNELS] 2190 ) 2191 { 2192 + return hpi_control_log_get2(ph_subsys, h_control, HPI_LEVEL_GAIN, 2193 + &an_gain0_01dB[0], &an_gain0_01dB[1]); 2194 } 2195 2196 u16 hpi_meter_query_channels(const struct hpi_hsubsys *ph_subsys, ··· 2413 { 2414 struct hpi_message hm; 2415 struct hpi_response hr; 2416 + 2417 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2418 HPI_CONTROL_GET_STATE); 2419 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2439 { 2440 struct hpi_message hm; 2441 struct hpi_response hr; 2442 + 2443 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2444 HPI_CONTROL_SET_STATE); 2445 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2460 { 2461 struct hpi_message hm; 2462 struct hpi_response hr; 2463 + 2464 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2465 HPI_CONTROL_GET_STATE); 2466 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2623 u16 hpi_tone_detector_get_state(const struct hpi_hsubsys *ph_subsys, 2624 u32 h_control, u32 *state) 2625 { 2626 + return hpi_control_param1_get(ph_subsys, h_control, 2627 + HPI_TONEDETECTOR_STATE, state); 2628 } 2629 2630 u16 hpi_tone_detector_set_enable(const struct hpi_hsubsys *ph_subsys, ··· 2637 u16 hpi_tone_detector_get_enable(const struct hpi_hsubsys *ph_subsys, 2638 u32 h_control, u32 *enable) 2639 { 2640 + return hpi_control_param1_get(ph_subsys, h_control, 2641 + HPI_GENERIC_ENABLE, enable); 2642 } 2643 2644 u16 hpi_tone_detector_set_event_enable(const struct hpi_hsubsys *ph_subsys, ··· 2651 u16 hpi_tone_detector_get_event_enable(const struct hpi_hsubsys *ph_subsys, 2652 u32 h_control, u32 *event_enable) 2653 { 2654 + return hpi_control_param1_get(ph_subsys, h_control, 2655 + HPI_GENERIC_EVENT_ENABLE, event_enable); 2656 } 2657 2658 u16 hpi_tone_detector_set_threshold(const struct hpi_hsubsys *ph_subsys, ··· 2665 u16 hpi_tone_detector_get_threshold(const struct hpi_hsubsys *ph_subsys, 2666 u32 h_control, int *threshold) 2667 { 2668 + return hpi_control_param1_get(ph_subsys, h_control, 2669 + HPI_TONEDETECTOR_THRESHOLD, (u32 *)threshold); 2670 } 2671 2672 u16 hpi_silence_detector_get_state(const struct hpi_hsubsys *ph_subsys, 2673 u32 h_control, u32 *state) 2674 { 2675 + return hpi_control_param1_get(ph_subsys, h_control, 2676 + HPI_SILENCEDETECTOR_STATE, state); 2677 } 2678 2679 u16 hpi_silence_detector_set_enable(const struct hpi_hsubsys *ph_subsys, ··· 2686 u16 hpi_silence_detector_get_enable(const struct hpi_hsubsys *ph_subsys, 2687 u32 h_control, u32 *enable) 2688 { 2689 + return hpi_control_param1_get(ph_subsys, h_control, 2690 + HPI_GENERIC_ENABLE, enable); 2691 } 2692 2693 u16 hpi_silence_detector_set_event_enable(const struct hpi_hsubsys *ph_subsys, 2694 u32 h_control, u32 event_enable) 2695 { 2696 return hpi_control_param_set(ph_subsys, h_control, 2697 + HPI_GENERIC_EVENT_ENABLE, event_enable, 0); 2698 } 2699 2700 u16 hpi_silence_detector_get_event_enable(const struct hpi_hsubsys *ph_subsys, 2701 u32 h_control, u32 *event_enable) 2702 { 2703 + return hpi_control_param1_get(ph_subsys, h_control, 2704 + HPI_GENERIC_EVENT_ENABLE, event_enable); 2705 } 2706 2707 u16 hpi_silence_detector_set_delay(const struct hpi_hsubsys *ph_subsys, 2708 u32 h_control, u32 delay) 2709 { 2710 return hpi_control_param_set(ph_subsys, h_control, 2711 + HPI_SILENCEDETECTOR_DELAY, delay, 0); 2712 } 2713 2714 u16 hpi_silence_detector_get_delay(const struct hpi_hsubsys *ph_subsys, 2715 u32 h_control, u32 *delay) 2716 { 2717 + return hpi_control_param1_get(ph_subsys, h_control, 2718 + HPI_SILENCEDETECTOR_DELAY, delay); 2719 } 2720 2721 u16 hpi_silence_detector_set_threshold(const struct hpi_hsubsys *ph_subsys, 2722 u32 h_control, int threshold) 2723 { 2724 return hpi_control_param_set(ph_subsys, h_control, 2725 + HPI_SILENCEDETECTOR_THRESHOLD, threshold, 0); 2726 } 2727 2728 u16 hpi_silence_detector_get_threshold(const struct hpi_hsubsys *ph_subsys, 2729 u32 h_control, int *threshold) 2730 { 2731 + return hpi_control_param1_get(ph_subsys, h_control, 2732 + HPI_SILENCEDETECTOR_THRESHOLD, (u32 *)threshold); 2733 } 2734 2735 u16 hpi_tuner_query_band(const struct hpi_hsubsys *ph_subsys, ··· 2822 { 2823 struct hpi_message hm; 2824 struct hpi_response hr; 2825 + 2826 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2827 HPI_CONTROL_GET_STATE); 2828 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2838 { 2839 struct hpi_message hm; 2840 struct hpi_response hr; 2841 + 2842 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2843 HPI_CONTROL_GET_STATE); 2844 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2894 u16 hpi_tuner_get_hd_radio_dsp_version(const struct hpi_hsubsys *ph_subsys, 2895 u32 h_control, char *psz_dsp_version, const u32 string_size) 2896 { 2897 + return hpi_control_get_string(h_control, 2898 HPI_TUNER_HDRADIO_DSP_VERSION, psz_dsp_version, string_size); 2899 } 2900 2901 u16 hpi_tuner_get_hd_radio_sdk_version(const struct hpi_hsubsys *ph_subsys, 2902 u32 h_control, char *psz_sdk_version, const u32 string_size) 2903 { 2904 + return hpi_control_get_string(h_control, 2905 HPI_TUNER_HDRADIO_SDK_VERSION, psz_sdk_version, string_size); 2906 } 2907 ··· 2942 u16 hpi_tuner_get_hd_radio_signal_quality(const struct hpi_hsubsys *ph_subsys, 2943 u32 h_control, u32 *pquality) 2944 { 2945 + return hpi_control_param1_get(ph_subsys, h_control, 2946 + HPI_TUNER_HDRADIO_SIGNAL_QUALITY, pquality); 2947 } 2948 2949 u16 hpi_tuner_get_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys, 2950 u32 h_control, u32 *pblend) 2951 { 2952 + return hpi_control_param1_get(ph_subsys, h_control, 2953 + HPI_TUNER_HDRADIO_BLEND, pblend); 2954 } 2955 2956 u16 hpi_tuner_set_hd_radio_signal_blend(const struct hpi_hsubsys *ph_subsys, ··· 2965 { 2966 struct hpi_message hm; 2967 struct hpi_response hr; 2968 + 2969 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 2970 HPI_CONTROL_GET_STATE); 2971 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 2981 u16 HPI_PAD__get_channel_name(const struct hpi_hsubsys *ph_subsys, 2982 u32 h_control, char *psz_string, const u32 data_length) 2983 { 2984 + return hpi_control_get_string(h_control, HPI_PAD_CHANNEL_NAME, 2985 + psz_string, data_length); 2986 } 2987 2988 u16 HPI_PAD__get_artist(const struct hpi_hsubsys *ph_subsys, u32 h_control, 2989 char *psz_string, const u32 data_length) 2990 { 2991 + return hpi_control_get_string(h_control, HPI_PAD_ARTIST, psz_string, 2992 + data_length); 2993 } 2994 2995 u16 HPI_PAD__get_title(const struct hpi_hsubsys *ph_subsys, u32 h_control, 2996 char *psz_string, const u32 data_length) 2997 { 2998 + return hpi_control_get_string(h_control, HPI_PAD_TITLE, psz_string, 2999 + data_length); 3000 } 3001 3002 u16 HPI_PAD__get_comment(const struct hpi_hsubsys *ph_subsys, u32 h_control, 3003 char *psz_string, const u32 data_length) 3004 { 3005 + return hpi_control_get_string(h_control, HPI_PAD_COMMENT, psz_string, 3006 + data_length); 3007 } 3008 3009 u16 HPI_PAD__get_program_type(const struct hpi_hsubsys *ph_subsys, 3010 u32 h_control, u32 *ppTY) 3011 { 3012 + return hpi_control_param1_get(ph_subsys, h_control, 3013 + HPI_PAD_PROGRAM_TYPE, ppTY); 3014 } 3015 3016 u16 HPI_PAD__get_rdsPI(const struct hpi_hsubsys *ph_subsys, u32 h_control, 3017 u32 *ppI) 3018 { 3019 + return hpi_control_param1_get(ph_subsys, h_control, 3020 + HPI_PAD_PROGRAM_ID, ppI); 3021 } 3022 3023 u16 hpi_volume_query_channels(const struct hpi_hsubsys *ph_subsys, ··· 3031 short an_log_gain[HPI_MAX_CHANNELS] 3032 ) 3033 { 3034 + return hpi_control_log_set2(h_control, HPI_VOLUME_GAIN, 3035 + an_log_gain[0], an_log_gain[1]); 3036 } 3037 3038 u16 hpi_volume_get_gain(const struct hpi_hsubsys *ph_subsys, u32 h_control, 3039 short an_log_gain[HPI_MAX_CHANNELS] 3040 ) 3041 { 3042 + return hpi_control_log_get2(ph_subsys, h_control, HPI_VOLUME_GAIN, 3043 + &an_log_gain[0], &an_log_gain[1]); 3044 } 3045 3046 u16 hpi_volume_query_range(const struct hpi_hsubsys *ph_subsys, u32 h_control, ··· 3068 { 3069 struct hpi_message hm; 3070 struct hpi_response hr; 3071 + 3072 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 3073 HPI_CONTROL_GET_STATE); 3074 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 3094 { 3095 struct hpi_message hm; 3096 struct hpi_response hr; 3097 + 3098 hpi_init_message_response(&hm, &hr, HPI_OBJ_CONTROL, 3099 HPI_CONTROL_SET_STATE); 3100 u32TOINDEXES(h_control, &hm.adapter_index, &hm.obj_index); ··· 3170 6 * sizeof(char), 3171 }; 3172 3173 + static inline size_t hpi_entity_size(struct hpi_entity *entity_ptr) 3174 { 3175 return entity_ptr->header.size; 3176 } 3177 3178 + static inline size_t hpi_entity_header_size(struct hpi_entity *entity_ptr) 3179 { 3180 return sizeof(entity_ptr->header); 3181 } 3182 3183 + static inline size_t hpi_entity_value_size(struct hpi_entity *entity_ptr) 3184 { 3185 return hpi_entity_size(entity_ptr) - 3186 hpi_entity_header_size(entity_ptr); 3187 } 3188 3189 + static inline size_t hpi_entity_item_count(struct hpi_entity *entity_ptr) 3190 { 3191 return hpi_entity_value_size(entity_ptr) / 3192 entity_type_to_size[entity_ptr->header.type]; 3193 } 3194 3195 + static inline struct hpi_entity *hpi_entity_ptr_to_next(struct hpi_entity 3196 *entity_ptr) 3197 { 3198 + return (void *)(((u8 *)entity_ptr) + hpi_entity_size(entity_ptr)); 3199 } 3200 3201 + static inline u16 hpi_entity_check_type(const enum e_entity_type t) 3202 { 3203 if (t >= 0 && t < STR_TYPE_FIELD_MAX) 3204 return 0; 3205 return HPI_ERROR_ENTITY_TYPE_INVALID; 3206 } 3207 3208 + static inline u16 hpi_entity_check_role(const enum e_entity_role r) 3209 { 3210 if (r >= 0 && r < STR_ROLE_FIELD_MAX) 3211 return 0; ··· 3624 u16 maximum_events, struct hpi_async_event *p_events, 3625 u16 *pw_number_returned) 3626 { 3627 + 3628 return 0; 3629 } 3630
+1 -1
sound/pci/asihpi/hpimsgx.c
··· 741 hpi_init_response(&hr, HPI_OBJ_SUBSYSTEM, 742 HPI_SUBSYS_FIND_ADAPTERS, 0); 743 memcpy(&gRESP_HPI_SUBSYS_FIND_ADAPTERS, &hr, 744 - sizeof(&gRESP_HPI_SUBSYS_FIND_ADAPTERS)); 745 746 for (adapter = 0; adapter < HPI_MAX_ADAPTERS; adapter++) { 747
··· 741 hpi_init_response(&hr, HPI_OBJ_SUBSYSTEM, 742 HPI_SUBSYS_FIND_ADAPTERS, 0); 743 memcpy(&gRESP_HPI_SUBSYS_FIND_ADAPTERS, &hr, 744 + sizeof(gRESP_HPI_SUBSYS_FIND_ADAPTERS)); 745 746 for (adapter = 0; adapter < HPI_MAX_ADAPTERS; adapter++) { 747
+14 -7
sound/pci/asihpi/hpioctl.c
··· 121 phpi_ioctl_data = (struct hpi_ioctl_linux __user *)arg; 122 123 /* Read the message and response pointers from user space. */ 124 - get_user(puhm, &phpi_ioctl_data->phm); 125 - get_user(puhr, &phpi_ioctl_data->phr); 126 127 /* Now read the message size and data from user space. */ 128 - get_user(hm->h.size, (u16 __user *)puhm); 129 if (hm->h.size > sizeof(*hm)) 130 hm->h.size = sizeof(*hm); 131 ··· 144 goto out; 145 } 146 147 - get_user(res_max_size, (u16 __user *)puhr); 148 /* printk(KERN_INFO "user response size %d\n", res_max_size); */ 149 if (res_max_size < sizeof(struct hpi_response_header)) { 150 HPI_DEBUG_LOG(WARNING, "small res size %d\n", res_max_size); ··· 473 474 memset(adapters, 0, sizeof(adapters)); 475 476 - printk(KERN_INFO "ASIHPI driver %d.%02d.%02d\n", 477 - HPI_VER_MAJOR(HPI_VER), HPI_VER_MINOR(HPI_VER), 478 - HPI_VER_RELEASE(HPI_VER)); 479 480 hpi_init_message_response(&hm, &hr, HPI_OBJ_SUBSYSTEM, 481 HPI_SUBSYS_DRIVER_LOAD);
··· 121 phpi_ioctl_data = (struct hpi_ioctl_linux __user *)arg; 122 123 /* Read the message and response pointers from user space. */ 124 + if (get_user(puhm, &phpi_ioctl_data->phm) || 125 + get_user(puhr, &phpi_ioctl_data->phr)) { 126 + err = -EFAULT; 127 + goto out; 128 + } 129 130 /* Now read the message size and data from user space. */ 131 + if (get_user(hm->h.size, (u16 __user *)puhm)) { 132 + err = -EFAULT; 133 + goto out; 134 + } 135 if (hm->h.size > sizeof(*hm)) 136 hm->h.size = sizeof(*hm); 137 ··· 138 goto out; 139 } 140 141 + if (get_user(res_max_size, (u16 __user *)puhr)) { 142 + err = -EFAULT; 143 + goto out; 144 + } 145 /* printk(KERN_INFO "user response size %d\n", res_max_size); */ 146 if (res_max_size < sizeof(struct hpi_response_header)) { 147 HPI_DEBUG_LOG(WARNING, "small res size %d\n", res_max_size); ··· 464 465 memset(adapters, 0, sizeof(adapters)); 466 467 + printk(KERN_INFO "ASIHPI driver " HPI_VER_STRING "\n"); 468 469 hpi_init_message_response(&hm, &hr, HPI_OBJ_SUBSYSTEM, 470 HPI_SUBSYS_DRIVER_LOAD);
+2
sound/pci/echoaudio/echoaudio.c
··· 2250 DE_INIT(("resume start\n")); 2251 pci_restore_state(pci); 2252 commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL); 2253 commpage = chip->comm_page; 2254 memcpy(commpage_bak, commpage, sizeof(struct comm_page)); 2255
··· 2250 DE_INIT(("resume start\n")); 2251 pci_restore_state(pci); 2252 commpage_bak = kmalloc(sizeof(struct echoaudio), GFP_KERNEL); 2253 + if (commpage_bak == NULL) 2254 + return -ENOMEM; 2255 commpage = chip->comm_page; 2256 memcpy(commpage_bak, commpage, sizeof(struct comm_page)); 2257
+6 -4
sound/pci/hda/hda_codec.c
··· 733 total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid); 734 for (i = 0; i < total_nodes; i++, nid++) { 735 function_id = snd_hda_param_read(codec, nid, 736 - AC_PAR_FUNCTION_TYPE) & 0xff; 737 - switch (function_id) { 738 case AC_GRP_AUDIO_FUNCTION: 739 codec->afg = nid; 740 - codec->function_id = function_id; 741 break; 742 case AC_GRP_MODEM_FUNCTION: 743 codec->mfg = nid; 744 - codec->function_id = function_id; 745 break; 746 default: 747 break;
··· 733 total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid); 734 for (i = 0; i < total_nodes; i++, nid++) { 735 function_id = snd_hda_param_read(codec, nid, 736 + AC_PAR_FUNCTION_TYPE); 737 + switch (function_id & 0xff) { 738 case AC_GRP_AUDIO_FUNCTION: 739 codec->afg = nid; 740 + codec->afg_function_id = function_id & 0xff; 741 + codec->afg_unsol = (function_id >> 8) & 1; 742 break; 743 case AC_GRP_MODEM_FUNCTION: 744 codec->mfg = nid; 745 + codec->mfg_function_id = function_id & 0xff; 746 + codec->mfg_unsol = (function_id >> 8) & 1; 747 break; 748 default: 749 break;
+4 -1
sound/pci/hda/hda_codec.h
··· 784 hda_nid_t mfg; /* MFG node id */ 785 786 /* ids */ 787 - u32 function_id; 788 u32 vendor_id; 789 u32 subsystem_id; 790 u32 revision_id;
··· 784 hda_nid_t mfg; /* MFG node id */ 785 786 /* ids */ 787 + u8 afg_function_id; 788 + u8 mfg_function_id; 789 + u8 afg_unsol; 790 + u8 mfg_unsol; 791 u32 vendor_id; 792 u32 subsystem_id; 793 u32 revision_id;
+6 -1
sound/pci/hda/hda_proc.c
··· 557 else 558 snd_iprintf(buffer, "Not Set\n"); 559 snd_iprintf(buffer, "Address: %d\n", codec->addr); 560 - snd_iprintf(buffer, "Function Id: 0x%x\n", codec->function_id); 561 snd_iprintf(buffer, "Vendor Id: 0x%08x\n", codec->vendor_id); 562 snd_iprintf(buffer, "Subsystem Id: 0x%08x\n", codec->subsystem_id); 563 snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
··· 557 else 558 snd_iprintf(buffer, "Not Set\n"); 559 snd_iprintf(buffer, "Address: %d\n", codec->addr); 560 + if (codec->afg) 561 + snd_iprintf(buffer, "AFG Function Id: 0x%x (unsol %u)\n", 562 + codec->afg_function_id, codec->afg_unsol); 563 + if (codec->mfg) 564 + snd_iprintf(buffer, "MFG Function Id: 0x%x (unsol %u)\n", 565 + codec->mfg_function_id, codec->mfg_unsol); 566 snd_iprintf(buffer, "Vendor Id: 0x%08x\n", codec->vendor_id); 567 snd_iprintf(buffer, "Subsystem Id: 0x%08x\n", codec->subsystem_id); 568 snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
+12 -6
sound/pci/riptide/riptide.c
··· 97 #include <linux/gameport.h> 98 #include <linux/device.h> 99 #include <linux/firmware.h> 100 #include <asm/io.h> 101 #include <sound/core.h> 102 #include <sound/info.h> ··· 668 unsigned char c; 669 670 while (len) { 671 c = in[len - 1]; 672 - if ((c >= '0') && (c <= '9')) 673 - sum += mult * (c - '0'); 674 - else if ((c >= 'A') && (c <= 'F')) 675 - sum += mult * (c - ('A' - 10)); 676 - else if ((c >= 'a') && (c <= 'f')) 677 - sum += mult * (c - ('a' - 10)); 678 mult *= 16; 679 --len; 680 } ··· 1615 1616 chip->playback_substream[sub_num] = substream; 1617 runtime->hw = snd_riptide_playback; 1618 data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); 1619 data->paths = lbus_play_paths[sub_num]; 1620 data->id = play_ids[sub_num]; 1621 data->source = play_sources[sub_num]; ··· 1638 1639 chip->capture_substream = substream; 1640 runtime->hw = snd_riptide_capture; 1641 data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); 1642 data->paths = lbus_rec_path; 1643 data->id = PADC; 1644 data->source = ACLNK2PADC;
··· 97 #include <linux/gameport.h> 98 #include <linux/device.h> 99 #include <linux/firmware.h> 100 + #include <linux/kernel.h> 101 #include <asm/io.h> 102 #include <sound/core.h> 103 #include <sound/info.h> ··· 667 unsigned char c; 668 669 while (len) { 670 + int value; 671 + 672 c = in[len - 1]; 673 + value = hex_to_bin(c); 674 + if (value >= 0) 675 + sum += mult * value; 676 mult *= 16; 677 --len; 678 } ··· 1615 1616 chip->playback_substream[sub_num] = substream; 1617 runtime->hw = snd_riptide_playback; 1618 + 1619 data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); 1620 + if (data == NULL) 1621 + return -ENOMEM; 1622 data->paths = lbus_play_paths[sub_num]; 1623 data->id = play_ids[sub_num]; 1624 data->source = play_sources[sub_num]; ··· 1635 1636 chip->capture_substream = substream; 1637 runtime->hw = snd_riptide_capture; 1638 + 1639 data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL); 1640 + if (data == NULL) 1641 + return -ENOMEM; 1642 data->paths = lbus_rec_path; 1643 data->id = PADC; 1644 data->source = ACLNK2PADC;
+9 -7
sound/pci/sis7019.c
··· 264 * if using small periods. 265 * 266 * If we're less than 9 samples behind, we're on target. 267 */ 268 if (sync > -9) 269 voice->vperiod = voice->sync_period_size + 1; 270 else 271 - voice->vperiod = voice->sync_period_size - 4; 272 273 if (voice->vperiod < voice->buffer_size) { 274 sis_update_sso(voice, voice->vperiod); ··· 738 period_size = buffer_size; 739 740 /* Initially, we want to interrupt just a bit behind the end of 741 - * the period we're clocking out. 10 samples seems to give a good 742 * delay. 743 * 744 * We want to spread our interrupts throughout the virtual period, ··· 749 * 750 * This is all moot if we don't need to use virtual periods. 751 */ 752 - vperiod = runtime->period_size + 10; 753 if (vperiod > period_size) { 754 u16 tail = vperiod % period_size; 755 u16 quarter_period = period_size / 4; ··· 778 */ 779 timing->flags |= VOICE_SYNC_TIMING; 780 timing->sync_base = voice->ctrl_base; 781 - timing->sync_cso = runtime->period_size - 1; 782 timing->sync_period_size = runtime->period_size; 783 timing->sync_buffer_size = runtime->buffer_size; 784 timing->period_size = period_size; ··· 1049 /* Reset the chip, and disable all interrputs. 1050 */ 1051 outl(SIS_GCR_SOFTWARE_RESET, sis->ioport + SIS_GCR); 1052 - udelay(10); 1053 outl(0, sis->ioport + SIS_GCR); 1054 outl(0, sis->ioport + SIS_GIER); 1055 ··· 1085 /* Reset the audio controller 1086 */ 1087 outl(SIS_GCR_SOFTWARE_RESET, io + SIS_GCR); 1088 - udelay(10); 1089 outl(0, io + SIS_GCR); 1090 1091 /* Get the AC-link semaphore, and reset the codecs ··· 1098 return -EIO; 1099 1100 outl(SIS_AC97_CMD_CODEC_COLD_RESET, io + SIS_AC97_CMD); 1101 - udelay(10); 1102 1103 count = 0xffff; 1104 while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count)
··· 264 * if using small periods. 265 * 266 * If we're less than 9 samples behind, we're on target. 267 + * Otherwise, shorten the next vperiod by the amount we've 268 + * been delayed. 269 */ 270 if (sync > -9) 271 voice->vperiod = voice->sync_period_size + 1; 272 else 273 + voice->vperiod = voice->sync_period_size + sync + 10; 274 275 if (voice->vperiod < voice->buffer_size) { 276 sis_update_sso(voice, voice->vperiod); ··· 736 period_size = buffer_size; 737 738 /* Initially, we want to interrupt just a bit behind the end of 739 + * the period we're clocking out. 12 samples seems to give a good 740 * delay. 741 * 742 * We want to spread our interrupts throughout the virtual period, ··· 747 * 748 * This is all moot if we don't need to use virtual periods. 749 */ 750 + vperiod = runtime->period_size + 12; 751 if (vperiod > period_size) { 752 u16 tail = vperiod % period_size; 753 u16 quarter_period = period_size / 4; ··· 776 */ 777 timing->flags |= VOICE_SYNC_TIMING; 778 timing->sync_base = voice->ctrl_base; 779 + timing->sync_cso = runtime->period_size; 780 timing->sync_period_size = runtime->period_size; 781 timing->sync_buffer_size = runtime->buffer_size; 782 timing->period_size = period_size; ··· 1047 /* Reset the chip, and disable all interrputs. 1048 */ 1049 outl(SIS_GCR_SOFTWARE_RESET, sis->ioport + SIS_GCR); 1050 + udelay(25); 1051 outl(0, sis->ioport + SIS_GCR); 1052 outl(0, sis->ioport + SIS_GIER); 1053 ··· 1083 /* Reset the audio controller 1084 */ 1085 outl(SIS_GCR_SOFTWARE_RESET, io + SIS_GCR); 1086 + udelay(25); 1087 outl(0, io + SIS_GCR); 1088 1089 /* Get the AC-link semaphore, and reset the codecs ··· 1096 return -EIO; 1097 1098 outl(SIS_AC97_CMD_CODEC_COLD_RESET, io + SIS_AC97_CMD); 1099 + udelay(250); 1100 1101 count = 0xffff; 1102 while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count)
+7 -2
sound/pci/via82xx.c
··· 85 static int ac97_clock = 48000; 86 static char *ac97_quirk; 87 static int dxs_support; 88 static int nodelay; 89 90 module_param(index, int, 0444); ··· 104 MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); 105 module_param(dxs_support, int, 0444); 106 MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA, 5 = enable any sample rate)"); 107 module_param(nodelay, int, 0444); 108 MODULE_PARM_DESC(nodelay, "Disable 500ms init delay"); 109 ··· 1248 return err; 1249 stream = viadev->reg_offset / 0x10; 1250 if (chip->dxs_controls[stream]) { 1251 - chip->playback_volume[stream][0] = 0; 1252 - chip->playback_volume[stream][1] = 0; 1253 chip->dxs_controls[stream]->vd[0].access &= 1254 ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; 1255 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE |
··· 85 static int ac97_clock = 48000; 86 static char *ac97_quirk; 87 static int dxs_support; 88 + static int dxs_init_volume = 31; 89 static int nodelay; 90 91 module_param(index, int, 0444); ··· 103 MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); 104 module_param(dxs_support, int, 0444); 105 MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA, 5 = enable any sample rate)"); 106 + module_param(dxs_init_volume, int, 0644); 107 + MODULE_PARM_DESC(dxs_init_volume, "initial DXS volume (0-31)"); 108 module_param(nodelay, int, 0444); 109 MODULE_PARM_DESC(nodelay, "Disable 500ms init delay"); 110 ··· 1245 return err; 1246 stream = viadev->reg_offset / 0x10; 1247 if (chip->dxs_controls[stream]) { 1248 + chip->playback_volume[stream][0] = 1249 + VIA_DXS_MAX_VOLUME - (dxs_init_volume & 31); 1250 + chip->playback_volume[stream][1] = 1251 + VIA_DXS_MAX_VOLUME - (dxs_init_volume & 31); 1252 chip->dxs_controls[stream]->vd[0].access &= 1253 ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; 1254 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE |
+4 -5
sound/sound_core.c
··· 576 struct sound_unit *s; 577 const struct file_operations *new_fops = NULL; 578 579 - lock_kernel (); 580 - 581 chain=unit&0x0F; 582 if(chain==4 || chain==5) /* dsp/audio/dsp16 */ 583 { ··· 628 const struct file_operations *old_fops = file->f_op; 629 file->f_op = new_fops; 630 spin_unlock(&sound_loader_lock); 631 - if(file->f_op->open) 632 err = file->f_op->open(inode,file); 633 if (err) { 634 fops_put(file->f_op); 635 file->f_op = fops_get(old_fops); 636 } 637 fops_put(old_fops); 638 - unlock_kernel(); 639 return err; 640 } 641 spin_unlock(&sound_loader_lock); 642 - unlock_kernel(); 643 return -ENODEV; 644 } 645
··· 576 struct sound_unit *s; 577 const struct file_operations *new_fops = NULL; 578 579 chain=unit&0x0F; 580 if(chain==4 || chain==5) /* dsp/audio/dsp16 */ 581 { ··· 630 const struct file_operations *old_fops = file->f_op; 631 file->f_op = new_fops; 632 spin_unlock(&sound_loader_lock); 633 + 634 + if (file->f_op->open) 635 err = file->f_op->open(inode,file); 636 + 637 if (err) { 638 fops_put(file->f_op); 639 file->f_op = fops_get(old_fops); 640 } 641 + 642 fops_put(old_fops); 643 return err; 644 } 645 spin_unlock(&sound_loader_lock); 646 return -ENODEV; 647 } 648
+1 -1
sound/usb/card.c
··· 217 218 switch (protocol) { 219 case UAC_VERSION_1: { 220 - struct uac_ac_header_descriptor_v1 *h1 = control_header; 221 222 if (!h1->bInCollection) { 223 snd_printk(KERN_INFO "skipping empty audio interface (v1)\n");
··· 217 218 switch (protocol) { 219 case UAC_VERSION_1: { 220 + struct uac1_ac_header_descriptor *h1 = control_header; 221 222 if (!h1->bInCollection) { 223 snd_printk(KERN_INFO "skipping empty audio interface (v1)\n");
+25 -34
sound/usb/clock.c
··· 19 20 #include <linux/bitops.h> 21 #include <linux/init.h> 22 - #include <linux/list.h> 23 - #include <linux/slab.h> 24 #include <linux/string.h> 25 #include <linux/usb.h> 26 - #include <linux/moduleparam.h> 27 - #include <linux/mutex.h> 28 #include <linux/usb/audio.h> 29 #include <linux/usb/audio-v2.h> 30 31 #include <sound/core.h> 32 #include <sound/info.h> 33 #include <sound/pcm.h> 34 - #include <sound/pcm_params.h> 35 - #include <sound/initval.h> 36 37 #include "usbaudio.h" 38 #include "card.h" 39 - #include "midi.h" 40 - #include "mixer.h" 41 - #include "proc.h" 42 - #include "quirks.h" 43 - #include "endpoint.h" 44 #include "helper.h" 45 - #include "debug.h" 46 - #include "pcm.h" 47 - #include "urb.h" 48 - #include "format.h" 49 50 static struct uac_clock_source_descriptor * 51 snd_usb_find_clock_source(struct usb_host_interface *ctrl_iface, ··· 120 return !!data; 121 } 122 123 - /* Try to find the clock source ID of a given clock entity */ 124 - 125 static int __uac_clock_find_source(struct snd_usb_audio *chip, 126 - struct usb_host_interface *host_iface, 127 int entity_id, unsigned long *visited) 128 { 129 struct uac_clock_source_descriptor *source; ··· 137 } 138 139 /* first, see if the ID we're looking for is a clock source already */ 140 - source = snd_usb_find_clock_source(host_iface, entity_id); 141 if (source) 142 return source->bClockID; 143 144 - selector = snd_usb_find_clock_selector(host_iface, entity_id); 145 if (selector) { 146 int ret; 147 ··· 151 if (ret < 0) 152 return ret; 153 154 if (ret > selector->bNrInPins || ret < 1) { 155 printk(KERN_ERR 156 "%s(): selector reported illegal value, id %d, ret %d\n", ··· 161 return -EINVAL; 162 } 163 164 - return __uac_clock_find_source(chip, host_iface, 165 - selector->baCSourceID[ret-1], 166 visited); 167 } 168 169 /* FIXME: multipliers only act as pass-thru element for now */ 170 - multiplier = snd_usb_find_clock_multiplier(host_iface, entity_id); 171 if (multiplier) 172 - return __uac_clock_find_source(chip, host_iface, 173 - multiplier->bCSourceID, visited); 174 175 return -EINVAL; 176 } 177 178 - int snd_usb_clock_find_source(struct snd_usb_audio *chip, 179 - struct usb_host_interface *host_iface, 180 - int entity_id) 181 { 182 DECLARE_BITMAP(visited, 256); 183 memset(visited, 0, sizeof(visited)); 184 - return __uac_clock_find_source(chip, host_iface, entity_id, visited); 185 } 186 187 static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface, ··· 204 ep = get_endpoint(alts, 0)->bEndpointAddress; 205 206 /* if endpoint doesn't have sampling rate control, bail out */ 207 - if (!(fmt->attributes & UAC_EP_CS_ATTR_SAMPLE_RATE)) { 208 - snd_printk(KERN_WARNING "%d:%d:%d: endpoint lacks sample rate attribute bit, cannot set.\n", 209 - dev->devnum, iface, fmt->altsetting); 210 return 0; 211 - } 212 213 data[0] = rate; 214 data[1] = rate >> 8; ··· 244 struct usb_device *dev = chip->dev; 245 unsigned char data[4]; 246 int err, crate; 247 - int clock = snd_usb_clock_find_source(chip, chip->ctrl_intf, fmt->clock); 248 249 if (clock < 0) 250 return clock; 251 252 if (!uac_clock_source_is_valid(chip, clock)) { 253 snd_printk(KERN_ERR "%d:%d:%d: clock source %d is not valid, cannot use\n", 254 dev->devnum, iface, fmt->altsetting, clock); 255 return -ENXIO;
··· 19 20 #include <linux/bitops.h> 21 #include <linux/init.h> 22 #include <linux/string.h> 23 #include <linux/usb.h> 24 #include <linux/usb/audio.h> 25 #include <linux/usb/audio-v2.h> 26 27 #include <sound/core.h> 28 #include <sound/info.h> 29 #include <sound/pcm.h> 30 31 #include "usbaudio.h" 32 #include "card.h" 33 #include "helper.h" 34 + #include "clock.h" 35 36 static struct uac_clock_source_descriptor * 37 snd_usb_find_clock_source(struct usb_host_interface *ctrl_iface, ··· 134 return !!data; 135 } 136 137 static int __uac_clock_find_source(struct snd_usb_audio *chip, 138 int entity_id, unsigned long *visited) 139 { 140 struct uac_clock_source_descriptor *source; ··· 154 } 155 156 /* first, see if the ID we're looking for is a clock source already */ 157 + source = snd_usb_find_clock_source(chip->ctrl_intf, entity_id); 158 if (source) 159 return source->bClockID; 160 161 + selector = snd_usb_find_clock_selector(chip->ctrl_intf, entity_id); 162 if (selector) { 163 int ret; 164 ··· 168 if (ret < 0) 169 return ret; 170 171 + /* Selector values are one-based */ 172 + 173 if (ret > selector->bNrInPins || ret < 1) { 174 printk(KERN_ERR 175 "%s(): selector reported illegal value, id %d, ret %d\n", ··· 176 return -EINVAL; 177 } 178 179 + return __uac_clock_find_source(chip, selector->baCSourceID[ret-1], 180 visited); 181 } 182 183 /* FIXME: multipliers only act as pass-thru element for now */ 184 + multiplier = snd_usb_find_clock_multiplier(chip->ctrl_intf, entity_id); 185 if (multiplier) 186 + return __uac_clock_find_source(chip, multiplier->bCSourceID, 187 + visited); 188 189 return -EINVAL; 190 } 191 192 + /* 193 + * For all kinds of sample rate settings and other device queries, 194 + * the clock source (end-leaf) must be used. However, clock selectors, 195 + * clock multipliers and sample rate converters may be specified as 196 + * clock source input to terminal. This functions walks the clock path 197 + * to its end and tries to find the source. 198 + * 199 + * The 'visited' bitfield is used internally to detect recursive loops. 200 + * 201 + * Returns the clock source UnitID (>=0) on success, or an error. 202 + */ 203 + int snd_usb_clock_find_source(struct snd_usb_audio *chip, int entity_id) 204 { 205 DECLARE_BITMAP(visited, 256); 206 memset(visited, 0, sizeof(visited)); 207 + return __uac_clock_find_source(chip, entity_id, visited); 208 } 209 210 static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface, ··· 211 ep = get_endpoint(alts, 0)->bEndpointAddress; 212 213 /* if endpoint doesn't have sampling rate control, bail out */ 214 + if (!(fmt->attributes & UAC_EP_CS_ATTR_SAMPLE_RATE)) 215 return 0; 216 217 data[0] = rate; 218 data[1] = rate >> 8; ··· 254 struct usb_device *dev = chip->dev; 255 unsigned char data[4]; 256 int err, crate; 257 + int clock = snd_usb_clock_find_source(chip, fmt->clock); 258 259 if (clock < 0) 260 return clock; 261 262 if (!uac_clock_source_is_valid(chip, clock)) { 263 + /* TODO: should we try to find valid clock setups by ourself? */ 264 snd_printk(KERN_ERR "%d:%d:%d: clock source %d is not valid, cannot use\n", 265 dev->devnum, iface, fmt->altsetting, clock); 266 return -ENXIO;
+1 -3
sound/usb/clock.h
··· 5 struct usb_host_interface *alts, 6 struct audioformat *fmt, int rate); 7 8 - int snd_usb_clock_find_source(struct snd_usb_audio *chip, 9 - struct usb_host_interface *host_iface, 10 - int entity_id); 11 12 #endif /* __USBAUDIO_CLOCK_H */
··· 5 struct usb_host_interface *alts, 6 struct audioformat *fmt, int rate); 7 8 + int snd_usb_clock_find_source(struct snd_usb_audio *chip, int entity_id); 9 10 #endif /* __USBAUDIO_CLOCK_H */
+3 -2
sound/usb/endpoint.c
··· 33 #include "pcm.h" 34 #include "helper.h" 35 #include "format.h" 36 37 /* 38 * free a substream ··· 276 /* get audio formats */ 277 switch (protocol) { 278 case UAC_VERSION_1: { 279 - struct uac_as_header_descriptor_v1 *as = 280 snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); 281 282 if (!as) { ··· 298 case UAC_VERSION_2: { 299 struct uac2_input_terminal_descriptor *input_term; 300 struct uac2_output_terminal_descriptor *output_term; 301 - struct uac_as_header_descriptor_v2 *as = 302 snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); 303 304 if (!as) {
··· 33 #include "pcm.h" 34 #include "helper.h" 35 #include "format.h" 36 + #include "clock.h" 37 38 /* 39 * free a substream ··· 275 /* get audio formats */ 276 switch (protocol) { 277 case UAC_VERSION_1: { 278 + struct uac1_as_header_descriptor *as = 279 snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); 280 281 if (!as) { ··· 297 case UAC_VERSION_2: { 298 struct uac2_input_terminal_descriptor *input_term; 299 struct uac2_output_terminal_descriptor *output_term; 300 + struct uac2_as_header_descriptor *as = 301 snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); 302 303 if (!as) {
+4 -5
sound/usb/format.c
··· 264 * on the audioformat table (audio class v2). 265 */ 266 static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, 267 - struct audioformat *fp, 268 - struct usb_host_interface *iface) 269 { 270 struct usb_device *dev = chip->dev; 271 unsigned char tmp[2], *data; 272 int nr_triplets, data_size, ret = 0; 273 - int clock = snd_usb_clock_find_source(chip, chip->ctrl_intf, fp->clock); 274 275 if (clock < 0) { 276 snd_printk(KERN_ERR "%s(): unable to find clock source (clock %d)\n", ··· 390 break; 391 case UAC_VERSION_2: 392 /* fp->channels is already set in this case */ 393 - ret = parse_audio_format_rates_v2(chip, fp, iface); 394 break; 395 } 396 ··· 449 framesize = le16_to_cpu(fmt->wSamplesPerFrame); 450 snd_printd(KERN_INFO "found format II with max.bitrate = %d, frame size=%d\n", brate, framesize); 451 fp->frame_size = framesize; 452 - ret = parse_audio_format_rates_v2(chip, fp, iface); 453 break; 454 } 455 }
··· 264 * on the audioformat table (audio class v2). 265 */ 266 static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, 267 + struct audioformat *fp) 268 { 269 struct usb_device *dev = chip->dev; 270 unsigned char tmp[2], *data; 271 int nr_triplets, data_size, ret = 0; 272 + int clock = snd_usb_clock_find_source(chip, fp->clock); 273 274 if (clock < 0) { 275 snd_printk(KERN_ERR "%s(): unable to find clock source (clock %d)\n", ··· 391 break; 392 case UAC_VERSION_2: 393 /* fp->channels is already set in this case */ 394 + ret = parse_audio_format_rates_v2(chip, fp); 395 break; 396 } 397 ··· 450 framesize = le16_to_cpu(fmt->wSamplesPerFrame); 451 snd_printd(KERN_INFO "found format II with max.bitrate = %d, frame size=%d\n", brate, framesize); 452 fp->frame_size = framesize; 453 + ret = parse_audio_format_rates_v2(chip, fp); 454 break; 455 } 456 }
+7 -7
sound/usb/midi.c
··· 434 u8 cin = buffer[i] & 0x0f; 435 struct usbmidi_in_port *port = &ep->ports[cable]; 436 int length; 437 - 438 length = snd_usbmidi_cin_length[cin]; 439 if (cin == 0xf && buffer[i + 1] >= 0xf8) 440 ; /* realtime msg: no running status change */ ··· 628 629 static struct usb_protocol_ops snd_usbmidi_midiman_ops = { 630 .input = snd_usbmidi_midiman_input, 631 - .output = snd_usbmidi_standard_output, 632 .output_packet = snd_usbmidi_output_midiman_packet, 633 }; 634 635 static struct usb_protocol_ops snd_usbmidi_maudio_broken_running_status_ops = { 636 .input = snd_usbmidi_maudio_broken_running_status_input, 637 - .output = snd_usbmidi_standard_output, 638 .output_packet = snd_usbmidi_output_standard_packet, 639 }; 640 ··· 1248 */ 1249 static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi, 1250 struct snd_usb_midi_endpoint_info* ep_info, 1251 - struct snd_usb_midi_endpoint* rep) 1252 { 1253 struct snd_usb_midi_out_endpoint* ep; 1254 unsigned int i; ··· 1398 } 1399 1400 static struct snd_rawmidi_substream *snd_usbmidi_find_substream(struct snd_usb_midi* umidi, 1401 - int stream, int number) 1402 { 1403 struct list_head* list; 1404 ··· 1811 snd_usbmidi_switch_roland_altsetting(umidi); 1812 1813 if (endpoint[0].out_ep || endpoint[0].in_ep) 1814 - return 0; 1815 1816 intf = umidi->iface; 1817 if (!intf || intf->num_altsetting < 1) ··· 1849 struct snd_usb_midi_endpoint_info* endpoints) 1850 { 1851 int err, i; 1852 - 1853 err = snd_usbmidi_detect_endpoints(umidi, endpoints, MIDI_MAX_ENDPOINTS); 1854 for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { 1855 if (endpoints[i].out_ep)
··· 434 u8 cin = buffer[i] & 0x0f; 435 struct usbmidi_in_port *port = &ep->ports[cable]; 436 int length; 437 + 438 length = snd_usbmidi_cin_length[cin]; 439 if (cin == 0xf && buffer[i + 1] >= 0xf8) 440 ; /* realtime msg: no running status change */ ··· 628 629 static struct usb_protocol_ops snd_usbmidi_midiman_ops = { 630 .input = snd_usbmidi_midiman_input, 631 + .output = snd_usbmidi_standard_output, 632 .output_packet = snd_usbmidi_output_midiman_packet, 633 }; 634 635 static struct usb_protocol_ops snd_usbmidi_maudio_broken_running_status_ops = { 636 .input = snd_usbmidi_maudio_broken_running_status_input, 637 + .output = snd_usbmidi_standard_output, 638 .output_packet = snd_usbmidi_output_standard_packet, 639 }; 640 ··· 1248 */ 1249 static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi, 1250 struct snd_usb_midi_endpoint_info* ep_info, 1251 + struct snd_usb_midi_endpoint* rep) 1252 { 1253 struct snd_usb_midi_out_endpoint* ep; 1254 unsigned int i; ··· 1398 } 1399 1400 static struct snd_rawmidi_substream *snd_usbmidi_find_substream(struct snd_usb_midi* umidi, 1401 + int stream, int number) 1402 { 1403 struct list_head* list; 1404 ··· 1811 snd_usbmidi_switch_roland_altsetting(umidi); 1812 1813 if (endpoint[0].out_ep || endpoint[0].in_ep) 1814 + return 0; 1815 1816 intf = umidi->iface; 1817 if (!intf || intf->num_altsetting < 1) ··· 1849 struct snd_usb_midi_endpoint_info* endpoints) 1850 { 1851 int err, i; 1852 + 1853 err = snd_usbmidi_detect_endpoints(umidi, endpoints, MIDI_MAX_ENDPOINTS); 1854 for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { 1855 if (endpoints[i].out_ep)
+42 -35
sound/usb/mixer.c
··· 26 * 27 */ 28 29 #include <linux/bitops.h> 30 #include <linux/init.h> 31 #include <linux/list.h> ··· 291 292 static int get_ctl_value_v1(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret) 293 { 294 unsigned char buf[2]; 295 int val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1; 296 int timeout = 10; 297 298 while (timeout-- > 0) { 299 - if (snd_usb_ctl_msg(cval->mixer->chip->dev, 300 - usb_rcvctrlpipe(cval->mixer->chip->dev, 0), 301 - request, 302 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, 303 - validx, cval->mixer->ctrlif | (cval->id << 8), 304 buf, val_len, 100) >= val_len) { 305 *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len)); 306 return 0; 307 } 308 } 309 snd_printdd(KERN_ERR "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", 310 - request, validx, cval->mixer->ctrlif | (cval->id << 8), cval->val_type); 311 return -EINVAL; 312 } 313 314 static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret) 315 { 316 unsigned char buf[2 + 3*sizeof(__u16)]; /* enough space for one range */ 317 unsigned char *val; 318 int ret, size; ··· 328 329 memset(buf, 0, sizeof(buf)); 330 331 - ret = snd_usb_ctl_msg(cval->mixer->chip->dev, 332 - usb_rcvctrlpipe(cval->mixer->chip->dev, 0), 333 - bRequest, 334 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, 335 - validx, cval->mixer->ctrlif | (cval->id << 8), 336 buf, size, 1000); 337 338 if (ret < 0) { 339 snd_printk(KERN_ERR "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", 340 - request, validx, cval->mixer->ctrlif | (cval->id << 8), cval->val_type); 341 return ret; 342 } 343 ··· 411 int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval, 412 int request, int validx, int value_set) 413 { 414 unsigned char buf[2]; 415 int val_len, timeout = 10; 416 ··· 434 buf[0] = value_set & 0xff; 435 buf[1] = (value_set >> 8) & 0xff; 436 while (timeout-- > 0) 437 - if (snd_usb_ctl_msg(cval->mixer->chip->dev, 438 - usb_sndctrlpipe(cval->mixer->chip->dev, 0), 439 - request, 440 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT, 441 - validx, cval->mixer->ctrlif | (cval->id << 8), 442 buf, val_len, 100) >= 0) 443 return 0; 444 snd_printdd(KERN_ERR "cannot set ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d, data = %#x/%#x\n", 445 - request, validx, cval->mixer->ctrlif | (cval->id << 8), cval->val_type, buf[0], buf[1]); 446 return -EINVAL; 447 } 448 ··· 596 switch (iterm->type >> 16) { 597 case UAC_SELECTOR_UNIT: 598 strcpy(name, "Selector"); return 8; 599 - case UAC_PROCESSING_UNIT_V1: 600 strcpy(name, "Process Unit"); return 12; 601 - case UAC_EXTENSION_UNIT_V1: 602 strcpy(name, "Ext Unit"); return 8; 603 case UAC_MIXER_UNIT: 604 strcpy(name, "Mixer"); return 5; ··· 686 term->name = uac_selector_unit_iSelector(d); 687 return 0; 688 } 689 - case UAC_PROCESSING_UNIT_V1: 690 - case UAC_EXTENSION_UNIT_V1: { 691 struct uac_processing_unit_descriptor *d = p1; 692 if (d->bNrInPins) { 693 id = d->baSourceID[0]; ··· 759 */ 760 static int get_min_max(struct usb_mixer_elem_info *cval, int default_min) 761 { 762 /* for failsafe */ 763 cval->min = default_min; 764 cval->max = cval->min + 1; ··· 783 if (get_ctl_value(cval, UAC_GET_MAX, (cval->control << 8) | minchn, &cval->max) < 0 || 784 get_ctl_value(cval, UAC_GET_MIN, (cval->control << 8) | minchn, &cval->min) < 0) { 785 snd_printd(KERN_ERR "%d:%d: cannot get min/max values for control %d (id %d)\n", 786 - cval->id, cval->mixer->ctrlif, cval->control, cval->id); 787 return -EINVAL; 788 } 789 if (get_ctl_value(cval, UAC_GET_RES, (cval->control << 8) | minchn, &cval->res) < 0) { ··· 1215 } 1216 } else { /* UAC_VERSION_2 */ 1217 for (i = 0; i < 30/2; i++) { 1218 - /* From the USB Audio spec v2.0: 1219 - bmaControls() is a (ch+1)-element array of 4-byte bitmaps, 1220 - each containing a set of bit pairs. If a Control is present, 1221 - it must be Host readable. If a certain Control is not 1222 - present then the bit pair must be set to 0b00. 1223 - If a Control is present but read-only, the bit pair must be 1224 - set to 0b01. If a Control is also Host programmable, the bit 1225 - pair must be set to 0b11. The value 0b10 is not allowed. */ 1226 unsigned int ch_bits = 0; 1227 unsigned int ch_read_only = 0; 1228 ··· 1863 return parse_audio_selector_unit(state, unitid, p1); 1864 case UAC_FEATURE_UNIT: 1865 return parse_audio_feature_unit(state, unitid, p1); 1866 - case UAC_PROCESSING_UNIT_V1: 1867 /* UAC2_EFFECT_UNIT has the same value */ 1868 if (state->mixer->protocol == UAC_VERSION_1) 1869 return parse_audio_processing_unit(state, unitid, p1); 1870 else 1871 return 0; /* FIXME - effect units not implemented yet */ 1872 - case UAC_EXTENSION_UNIT_V1: 1873 /* UAC2_PROCESSING_UNIT_V2 has the same value */ 1874 if (state->mixer->protocol == UAC_VERSION_1) 1875 return parse_audio_extension_unit(state, unitid, p1); ··· 1913 struct usb_host_interface *hostif; 1914 void *p; 1915 1916 - hostif = &usb_ifnum_to_if(mixer->chip->dev, mixer->ctrlif)->altsetting[0]; 1917 memset(&state, 0, sizeof(state)); 1918 state.chip = mixer->chip; 1919 state.mixer = mixer; ··· 1933 p = NULL; 1934 while ((p = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, p, UAC_OUTPUT_TERMINAL)) != NULL) { 1935 if (mixer->protocol == UAC_VERSION_1) { 1936 - struct uac_output_terminal_descriptor_v1 *desc = p; 1937 1938 if (desc->bLength < sizeof(*desc)) 1939 continue; /* invalid descriptor? */ ··· 2005 list_for_each_entry(mixer, &chip->mixer_list, list) { 2006 snd_iprintf(buffer, 2007 "USB Mixer: usb_id=0x%08x, ctrlif=%i, ctlerr=%i\n", 2008 - chip->usb_id, mixer->ctrlif, 2009 mixer->ignore_ctl_error); 2010 snd_iprintf(buffer, "Card: %s\n", chip->card->longname); 2011 for (unitid = 0; unitid < MAX_ID_ELEMS; unitid++) { ··· 2123 int buffer_length; 2124 unsigned int epnum; 2125 2126 - hostif = &usb_ifnum_to_if(mixer->chip->dev, mixer->ctrlif)->altsetting[0]; 2127 /* we need one interrupt input endpoint */ 2128 if (get_iface_desc(hostif)->bNumEndpoints < 1) 2129 return 0; ··· 2166 if (!mixer) 2167 return -ENOMEM; 2168 mixer->chip = chip; 2169 - mixer->ctrlif = ctrlif; 2170 mixer->ignore_ctl_error = ignore_error; 2171 mixer->id_elems = kcalloc(MAX_ID_ELEMS, sizeof(*mixer->id_elems), 2172 GFP_KERNEL);
··· 26 * 27 */ 28 29 + /* 30 + * TODOs, for both the mixer and the streaming interfaces: 31 + * 32 + * - support for UAC2 effect units 33 + * - support for graphical equalizers 34 + * - RANGE and MEM set commands (UAC2) 35 + * - RANGE and MEM interrupt dispatchers (UAC2) 36 + * - audio channel clustering (UAC2) 37 + * - audio sample rate converter units (UAC2) 38 + * - proper handling of clock multipliers (UAC2) 39 + * - dispatch clock change notifications (UAC2) 40 + * - stop PCM streams which use a clock that became invalid 41 + * - stop PCM streams which use a clock selector that has changed 42 + * - parse available sample rates again when clock sources changed 43 + */ 44 + 45 #include <linux/bitops.h> 46 #include <linux/init.h> 47 #include <linux/list.h> ··· 275 276 static int get_ctl_value_v1(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret) 277 { 278 + struct snd_usb_audio *chip = cval->mixer->chip; 279 unsigned char buf[2]; 280 int val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1; 281 int timeout = 10; 282 283 while (timeout-- > 0) { 284 + if (snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), request, 285 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, 286 + validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), 287 buf, val_len, 100) >= val_len) { 288 *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len)); 289 return 0; 290 } 291 } 292 snd_printdd(KERN_ERR "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", 293 + request, validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), cval->val_type); 294 return -EINVAL; 295 } 296 297 static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret) 298 { 299 + struct snd_usb_audio *chip = cval->mixer->chip; 300 unsigned char buf[2 + 3*sizeof(__u16)]; /* enough space for one range */ 301 unsigned char *val; 302 int ret, size; ··· 312 313 memset(buf, 0, sizeof(buf)); 314 315 + ret = snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), bRequest, 316 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, 317 + validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), 318 buf, size, 1000); 319 320 if (ret < 0) { 321 snd_printk(KERN_ERR "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n", 322 + request, validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), cval->val_type); 323 return ret; 324 } 325 ··· 397 int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval, 398 int request, int validx, int value_set) 399 { 400 + struct snd_usb_audio *chip = cval->mixer->chip; 401 unsigned char buf[2]; 402 int val_len, timeout = 10; 403 ··· 419 buf[0] = value_set & 0xff; 420 buf[1] = (value_set >> 8) & 0xff; 421 while (timeout-- > 0) 422 + if (snd_usb_ctl_msg(chip->dev, 423 + usb_sndctrlpipe(chip->dev, 0), request, 424 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT, 425 + validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), 426 buf, val_len, 100) >= 0) 427 return 0; 428 snd_printdd(KERN_ERR "cannot set ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d, data = %#x/%#x\n", 429 + request, validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), cval->val_type, buf[0], buf[1]); 430 return -EINVAL; 431 } 432 ··· 582 switch (iterm->type >> 16) { 583 case UAC_SELECTOR_UNIT: 584 strcpy(name, "Selector"); return 8; 585 + case UAC1_PROCESSING_UNIT: 586 strcpy(name, "Process Unit"); return 12; 587 + case UAC1_EXTENSION_UNIT: 588 strcpy(name, "Ext Unit"); return 8; 589 case UAC_MIXER_UNIT: 590 strcpy(name, "Mixer"); return 5; ··· 672 term->name = uac_selector_unit_iSelector(d); 673 return 0; 674 } 675 + case UAC1_PROCESSING_UNIT: 676 + case UAC1_EXTENSION_UNIT: { 677 struct uac_processing_unit_descriptor *d = p1; 678 if (d->bNrInPins) { 679 id = d->baSourceID[0]; ··· 745 */ 746 static int get_min_max(struct usb_mixer_elem_info *cval, int default_min) 747 { 748 + struct snd_usb_audio *chip = cval->mixer->chip; 749 + 750 /* for failsafe */ 751 cval->min = default_min; 752 cval->max = cval->min + 1; ··· 767 if (get_ctl_value(cval, UAC_GET_MAX, (cval->control << 8) | minchn, &cval->max) < 0 || 768 get_ctl_value(cval, UAC_GET_MIN, (cval->control << 8) | minchn, &cval->min) < 0) { 769 snd_printd(KERN_ERR "%d:%d: cannot get min/max values for control %d (id %d)\n", 770 + cval->id, snd_usb_ctrl_intf(chip), cval->control, cval->id); 771 return -EINVAL; 772 } 773 if (get_ctl_value(cval, UAC_GET_RES, (cval->control << 8) | minchn, &cval->res) < 0) { ··· 1199 } 1200 } else { /* UAC_VERSION_2 */ 1201 for (i = 0; i < 30/2; i++) { 1202 unsigned int ch_bits = 0; 1203 unsigned int ch_read_only = 0; 1204 ··· 1855 return parse_audio_selector_unit(state, unitid, p1); 1856 case UAC_FEATURE_UNIT: 1857 return parse_audio_feature_unit(state, unitid, p1); 1858 + case UAC1_PROCESSING_UNIT: 1859 /* UAC2_EFFECT_UNIT has the same value */ 1860 if (state->mixer->protocol == UAC_VERSION_1) 1861 return parse_audio_processing_unit(state, unitid, p1); 1862 else 1863 return 0; /* FIXME - effect units not implemented yet */ 1864 + case UAC1_EXTENSION_UNIT: 1865 /* UAC2_PROCESSING_UNIT_V2 has the same value */ 1866 if (state->mixer->protocol == UAC_VERSION_1) 1867 return parse_audio_extension_unit(state, unitid, p1); ··· 1905 struct usb_host_interface *hostif; 1906 void *p; 1907 1908 + hostif = mixer->chip->ctrl_intf; 1909 memset(&state, 0, sizeof(state)); 1910 state.chip = mixer->chip; 1911 state.mixer = mixer; ··· 1925 p = NULL; 1926 while ((p = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, p, UAC_OUTPUT_TERMINAL)) != NULL) { 1927 if (mixer->protocol == UAC_VERSION_1) { 1928 + struct uac1_output_terminal_descriptor *desc = p; 1929 1930 if (desc->bLength < sizeof(*desc)) 1931 continue; /* invalid descriptor? */ ··· 1997 list_for_each_entry(mixer, &chip->mixer_list, list) { 1998 snd_iprintf(buffer, 1999 "USB Mixer: usb_id=0x%08x, ctrlif=%i, ctlerr=%i\n", 2000 + chip->usb_id, snd_usb_ctrl_intf(chip), 2001 mixer->ignore_ctl_error); 2002 snd_iprintf(buffer, "Card: %s\n", chip->card->longname); 2003 for (unitid = 0; unitid < MAX_ID_ELEMS; unitid++) { ··· 2115 int buffer_length; 2116 unsigned int epnum; 2117 2118 + hostif = mixer->chip->ctrl_intf; 2119 /* we need one interrupt input endpoint */ 2120 if (get_iface_desc(hostif)->bNumEndpoints < 1) 2121 return 0; ··· 2158 if (!mixer) 2159 return -ENOMEM; 2160 mixer->chip = chip; 2161 mixer->ignore_ctl_error = ignore_error; 2162 mixer->id_elems = kcalloc(MAX_ID_ELEMS, sizeof(*mixer->id_elems), 2163 GFP_KERNEL);
-1
sound/usb/mixer.h
··· 3 4 struct usb_mixer_interface { 5 struct snd_usb_audio *chip; 6 - unsigned int ctrlif; 7 struct list_head list; 8 unsigned int ignore_ctl_error; 9 struct urb *urb;
··· 3 4 struct usb_mixer_interface { 5 struct snd_usb_audio *chip; 6 struct list_head list; 7 unsigned int ignore_ctl_error; 8 struct urb *urb;
-3
sound/usb/pcm.h
··· 7 struct usb_host_interface *alts, 8 struct audioformat *fmt); 9 10 - int snd_usb_init_sample_rate(struct snd_usb_audio *chip, int iface, 11 - struct usb_host_interface *alts, 12 - struct audioformat *fmt, int rate); 13 14 #endif /* __USBAUDIO_PCM_H */
··· 7 struct usb_host_interface *alts, 8 struct audioformat *fmt); 9 10 11 #endif /* __USBAUDIO_PCM_H */
+99 -85
sound/usb/quirks-table.h
··· 2152 } 2153 }, 2154 { 2155 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7201), 2156 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2157 - USB_DEVICE_ID_MATCH_INT_CLASS | 2158 - USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2159 - .bInterfaceClass = USB_CLASS_AUDIO, 2160 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2161 - .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2162 - .vendor_name = "Hauppauge", 2163 - .product_name = "HVR-950Q", 2164 - .ifnum = QUIRK_ANY_INTERFACE, 2165 - .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2166 - } 2167 - }, 2168 - { 2169 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7202), 2170 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2171 - USB_DEVICE_ID_MATCH_INT_CLASS | 2172 - USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2173 - .bInterfaceClass = USB_CLASS_AUDIO, 2174 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2175 - .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2176 - .vendor_name = "Hauppauge", 2177 - .product_name = "HVR-950Q", 2178 - .ifnum = QUIRK_ANY_INTERFACE, 2179 - .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2180 - } 2181 - }, 2182 - { 2183 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7203), 2184 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2185 - USB_DEVICE_ID_MATCH_INT_CLASS | 2186 - USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2187 - .bInterfaceClass = USB_CLASS_AUDIO, 2188 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2189 - .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2190 - .vendor_name = "Hauppauge", 2191 - .product_name = "HVR-950Q", 2192 - .ifnum = QUIRK_ANY_INTERFACE, 2193 - .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2194 - } 2195 - }, 2196 - { 2197 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7204), 2198 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2199 - USB_DEVICE_ID_MATCH_INT_CLASS | 2200 - USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2201 - .bInterfaceClass = USB_CLASS_AUDIO, 2202 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2203 - .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2204 - .vendor_name = "Hauppauge", 2205 - .product_name = "HVR-950Q", 2206 - .ifnum = QUIRK_ANY_INTERFACE, 2207 - .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2208 - } 2209 - }, 2210 - { 2211 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7205), 2212 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2213 - USB_DEVICE_ID_MATCH_INT_CLASS | 2214 - USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2215 - .bInterfaceClass = USB_CLASS_AUDIO, 2216 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2217 - .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2218 - .vendor_name = "Hauppauge", 2219 - .product_name = "HVR-950Q", 2220 - .ifnum = QUIRK_ANY_INTERFACE, 2221 - .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2222 - } 2223 - }, 2224 - { 2225 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7250), 2226 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2227 - USB_DEVICE_ID_MATCH_INT_CLASS | 2228 - USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2229 - .bInterfaceClass = USB_CLASS_AUDIO, 2230 - .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2231 - .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2232 - .vendor_name = "Hauppauge", 2233 - .product_name = "HVR-950Q", 2234 - .ifnum = QUIRK_ANY_INTERFACE, 2235 - .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2236 - } 2237 - }, 2238 - { 2239 - USB_DEVICE_VENDOR_SPEC(0x2040, 0x7230), 2240 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2241 USB_DEVICE_ID_MATCH_INT_CLASS | 2242 USB_DEVICE_ID_MATCH_INT_SUBCLASS, ··· 2161 .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2162 .vendor_name = "Hauppauge", 2163 .product_name = "HVR-850", 2164 .ifnum = QUIRK_ANY_INTERFACE, 2165 .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2166 }
··· 2152 } 2153 }, 2154 { 2155 + USB_DEVICE_VENDOR_SPEC(0x2040, 0x7240), 2156 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2157 USB_DEVICE_ID_MATCH_INT_CLASS | 2158 USB_DEVICE_ID_MATCH_INT_SUBCLASS, ··· 2245 .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2246 .vendor_name = "Hauppauge", 2247 .product_name = "HVR-850", 2248 + .ifnum = QUIRK_ANY_INTERFACE, 2249 + .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2250 + } 2251 + }, 2252 + { 2253 + USB_DEVICE_VENDOR_SPEC(0x2040, 0x7210), 2254 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2255 + USB_DEVICE_ID_MATCH_INT_CLASS | 2256 + USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2257 + .bInterfaceClass = USB_CLASS_AUDIO, 2258 + .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2259 + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2260 + .vendor_name = "Hauppauge", 2261 + .product_name = "HVR-950Q", 2262 + .ifnum = QUIRK_ANY_INTERFACE, 2263 + .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2264 + } 2265 + }, 2266 + { 2267 + USB_DEVICE_VENDOR_SPEC(0x2040, 0x7217), 2268 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2269 + USB_DEVICE_ID_MATCH_INT_CLASS | 2270 + USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2271 + .bInterfaceClass = USB_CLASS_AUDIO, 2272 + .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2273 + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2274 + .vendor_name = "Hauppauge", 2275 + .product_name = "HVR-950Q", 2276 + .ifnum = QUIRK_ANY_INTERFACE, 2277 + .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2278 + } 2279 + }, 2280 + { 2281 + USB_DEVICE_VENDOR_SPEC(0x2040, 0x721b), 2282 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2283 + USB_DEVICE_ID_MATCH_INT_CLASS | 2284 + USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2285 + .bInterfaceClass = USB_CLASS_AUDIO, 2286 + .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2287 + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2288 + .vendor_name = "Hauppauge", 2289 + .product_name = "HVR-950Q", 2290 + .ifnum = QUIRK_ANY_INTERFACE, 2291 + .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2292 + } 2293 + }, 2294 + { 2295 + USB_DEVICE_VENDOR_SPEC(0x2040, 0x721e), 2296 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2297 + USB_DEVICE_ID_MATCH_INT_CLASS | 2298 + USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2299 + .bInterfaceClass = USB_CLASS_AUDIO, 2300 + .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2301 + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2302 + .vendor_name = "Hauppauge", 2303 + .product_name = "HVR-950Q", 2304 + .ifnum = QUIRK_ANY_INTERFACE, 2305 + .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2306 + } 2307 + }, 2308 + { 2309 + USB_DEVICE_VENDOR_SPEC(0x2040, 0x721f), 2310 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2311 + USB_DEVICE_ID_MATCH_INT_CLASS | 2312 + USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2313 + .bInterfaceClass = USB_CLASS_AUDIO, 2314 + .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2315 + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2316 + .vendor_name = "Hauppauge", 2317 + .product_name = "HVR-950Q", 2318 + .ifnum = QUIRK_ANY_INTERFACE, 2319 + .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2320 + } 2321 + }, 2322 + { 2323 + USB_DEVICE_VENDOR_SPEC(0x2040, 0x7280), 2324 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2325 + USB_DEVICE_ID_MATCH_INT_CLASS | 2326 + USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2327 + .bInterfaceClass = USB_CLASS_AUDIO, 2328 + .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2329 + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2330 + .vendor_name = "Hauppauge", 2331 + .product_name = "HVR-950Q", 2332 + .ifnum = QUIRK_ANY_INTERFACE, 2333 + .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2334 + } 2335 + }, 2336 + { 2337 + USB_DEVICE_VENDOR_SPEC(0x0fd9, 0x0008), 2338 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2339 + USB_DEVICE_ID_MATCH_INT_CLASS | 2340 + USB_DEVICE_ID_MATCH_INT_SUBCLASS, 2341 + .bInterfaceClass = USB_CLASS_AUDIO, 2342 + .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, 2343 + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { 2344 + .vendor_name = "Hauppauge", 2345 + .product_name = "HVR-950Q", 2346 .ifnum = QUIRK_ANY_INTERFACE, 2347 .type = QUIRK_AUDIO_ALIGN_TRANSFER, 2348 }
+1
sound/usb/quirks.c
··· 32 #include "helper.h" 33 #include "endpoint.h" 34 #include "pcm.h" 35 36 /* 37 * handle the quirks for the contained interfaces
··· 32 #include "helper.h" 33 #include "endpoint.h" 34 #include "pcm.h" 35 + #include "clock.h" 36 37 /* 38 * handle the quirks for the contained interfaces