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