···280280 no: ACPI OperationRegions are not marked as reserved,281281 no further checks are performed.282282283283- ad1848= [HW,OSS]284284- Format: <io>,<irq>,<dma>,<dma2>,<type>285285-286283 add_efi_memmap [EFI; X86] Include EFI memory map in287284 kernel's map of available physical RAM.288285289286 advansys= [HW,SCSI]290287 See header of drivers/scsi/advansys.c.291291-292292- aedsp16= [HW,OSS] Audio Excel DSP 16293293- Format: <io>,<irq>,<dma>,<mss_io>,<mpu_io>,<mpu_irq>294294- See also header of sound/oss/aedsp16.c.295288296289 agp= [AGP]297290 { off | try_unsupported }···303310304311 aic79xx= [HW,SCSI]305312 See Documentation/scsi/aic79xx.txt.313313+314314+ ALSA [HW,ALSA]315315+ See Documentation/sound/alsa/alsa-parameters.txt306316307317 alignment= [KNL,ARM]308318 Allow the default userspace alignment fault handler···650654 disable_timer_pin_1 [X86]651655 Disable PIN 1 of APIC timer652656 Can be useful to work around chipset bugs.653653-654654- dmasound= [HW,OSS] Sound subsystem buffers655657656658 dma_debug=off If the kernel is compiled with DMA_API_DEBUG support,657659 this option disables the debugging code at boot.···15171523 that the amount of memory usable for all allocations15181524 is not too small.1519152515201520- mpu401= [HW,OSS]15211521- Format: <io>,<irq>15221522-15231526 MTD_Partition= [MTD]15241527 Format: <name>,<region-number>,<size>,<offset>15251528···18401849 For example, to override I2C bus2:18411850 omap_mux=i2c2_scl.i2c2_scl=0x100,i2c2_sda.i2c2_sda=0x1001842185118431843- opl3= [HW,OSS]18441844- Format: <io>18451845-18461852 oprofile.timer= [HW]18471853 Use timer interrupt instead of performance counters18481854···18501862 arch_perfmon: [X86] Force use of architectural18511863 perfmon on Intel CPUs instead of the18521864 CPU specific event set.18651865+18661866+ OSS [HW,OSS]18671867+ See Documentation/sound/oss/oss-parameters.txt1853186818541869 osst= [HW,SCSI] SCSI Tape Driver18551870 Format: <buffer_size>,<write_threshold>···18891898 up parallel port mode and sets it to spp.18901899 Currently this function knows 686a and 8231 chips.18911900 Format: [spp|ps2|epp|ecp|ecpepp]18921892-18931893- pas2= [HW,OSS] Format:18941894- <io>,<irq>,<dma>,<dma16>,<sb_io>,<sb_irq>,<sb_dma>,<sb_dma16>1895190118961902 pas16= [HW,SCSI]18971903 See header of drivers/scsi/pas16.c.···21592171 [HW,MOUSE] Controls Logitech smartscroll autorepeat.21602172 0 = disabled, 1 = enabled (default).2161217321622162- pss= [HW,OSS] Personal Sound System (ECHO ESC614)21632163- Format:21642164- <io>,<mss_io>,<mss_irq>,<mss_dma>,<mpu_io>,<mpu_irq>21652165-21662174 pt. [PARIDE]21672175 See Documentation/blockdev/paride.txt.21682176···23672383 1: Fast pin select (default)23682384 2: ATC IRMode2369238523702370- snd-ad1816a= [HW,ALSA]23712371-23722372- snd-ad1848= [HW,ALSA]23732373-23742374- snd-ali5451= [HW,ALSA]23752375-23762376- snd-als100= [HW,ALSA]23772377-23782378- snd-als4000= [HW,ALSA]23792379-23802380- snd-azt2320= [HW,ALSA]23812381-23822382- snd-cmi8330= [HW,ALSA]23832383-23842384- snd-cmipci= [HW,ALSA]23852385-23862386- snd-cs4231= [HW,ALSA]23872387-23882388- snd-cs4232= [HW,ALSA]23892389-23902390- snd-cs4236= [HW,ALSA]23912391-23922392- snd-cs4281= [HW,ALSA]23932393-23942394- snd-cs46xx= [HW,ALSA]23952395-23962396- snd-dt019x= [HW,ALSA]23972397-23982398- snd-dummy= [HW,ALSA]23992399-24002400- snd-emu10k1= [HW,ALSA]24012401-24022402- snd-ens1370= [HW,ALSA]24032403-24042404- snd-ens1371= [HW,ALSA]24052405-24062406- snd-es968= [HW,ALSA]24072407-24082408- snd-es1688= [HW,ALSA]24092409-24102410- snd-es18xx= [HW,ALSA]24112411-24122412- snd-es1938= [HW,ALSA]24132413-24142414- snd-es1968= [HW,ALSA]24152415-24162416- snd-fm801= [HW,ALSA]24172417-24182418- snd-gusclassic= [HW,ALSA]24192419-24202420- snd-gusextreme= [HW,ALSA]24212421-24222422- snd-gusmax= [HW,ALSA]24232423-24242424- snd-hdsp= [HW,ALSA]24252425-24262426- snd-ice1712= [HW,ALSA]24272427-24282428- snd-intel8x0= [HW,ALSA]24292429-24302430- snd-interwave= [HW,ALSA]24312431-24322432- snd-interwave-stb=24332433- [HW,ALSA]24342434-24352435- snd-korg1212= [HW,ALSA]24362436-24372437- snd-maestro3= [HW,ALSA]24382438-24392439- snd-mpu401= [HW,ALSA]24402440-24412441- snd-mtpav= [HW,ALSA]24422442-24432443- snd-nm256= [HW,ALSA]24442444-24452445- snd-opl3sa2= [HW,ALSA]24462446-24472447- snd-opti92x-ad1848=24482448- [HW,ALSA]24492449-24502450- snd-opti92x-cs4231=24512451- [HW,ALSA]24522452-24532453- snd-opti93x= [HW,ALSA]24542454-24552455- snd-pmac= [HW,ALSA]24562456-24572457- snd-rme32= [HW,ALSA]24582458-24592459- snd-rme96= [HW,ALSA]24602460-24612461- snd-rme9652= [HW,ALSA]24622462-24632463- snd-sb8= [HW,ALSA]24642464-24652465- snd-sb16= [HW,ALSA]24662466-24672467- snd-sbawe= [HW,ALSA]24682468-24692469- snd-serial= [HW,ALSA]24702470-24712471- snd-sgalaxy= [HW,ALSA]24722472-24732473- snd-sonicvibes= [HW,ALSA]24742474-24752475- snd-sun-amd7930=24762476- [HW,ALSA]24772477-24782478- snd-sun-cs4231= [HW,ALSA]24792479-24802480- snd-trident= [HW,ALSA]24812481-24822482- snd-usb-audio= [HW,ALSA,USB]24832483-24842484- snd-via82xx= [HW,ALSA]24852485-24862486- snd-virmidi= [HW,ALSA]24872487-24882488- snd-wavefront= [HW,ALSA]24892489-24902490- snd-ymfpci= [HW,ALSA]24912491-24922386 softlockup_panic=24932387 [KNL] Should the soft-lockup detector generate panics.24942388···23802518 spia_fio_base=23812519 spia_pedr=23822520 spia_peddr=23832383-23842384- sscape= [HW,OSS]23852385- Format: <io>,<irq>,<dma>,<mpu_io>,<mpu_irq>2386252123872522 st= [HW,SCSI] SCSI tape parameters (buffers, etc.)23882523 See Documentation/scsi/st.txt.···25202661 to facilitate early boot debugging.25212662 See also Documentation/trace/events.txt2522266325232523- trix= [HW,OSS] MediaTrix AudioTrix Pro25242524- Format:25252525- <io>,<irq>,<dma>,<dma2>,<sb_io>,<sb_irq>,<sb_dma>,<mpu_io>,<mpu_irq>25262526-25272664 tsc= Disable clocksource-must-verify flag for TSC.25282665 Format: <string>25292666 [x86] reliable: mark tsc clocksource as reliable, this···2535268025362681 u14-34f= [HW,SCSI] UltraStor 14F/34F SCSI host adapter25372682 See header of drivers/scsi/u14-34f.c.25382538-25392539- uart401= [HW,OSS]25402540- Format: <io>,<irq>25412541-25422542- uart6850= [HW,OSS]25432543- Format: <io>,<irq>2544268325452684 uhash_entries= [KNL,NET]25462685 Set number of hash buckets for UDP/UDP-Lite connections···27012852 overridden by individual drivers. 0 will hide27022853 cursors, 1 will display them.2703285427042704- waveartist= [HW,OSS]27052705- Format: <io>,<irq>,<dma>,<dma2>27062706-27072855 wd33c93= [HW,SCSI]27082856 See header of drivers/scsi/wd33c93.c.27092857···2733288727342888TODO:2735288927362736- Add documentation for ALSA options.27372890 Add more DRM drivers.
+8
Documentation/sound/alsa/Procfile.txt
···103103 bit 2 = Enable additional jiffies check104104 bit 3 = Log hwptr update at each period interrupt105105 bit 4 = Log hwptr update at each snd_pcm_update_hw_ptr()106106+ bit 5 = Show last 10 positions on error107107+ bit 6 = Do above only once106108107109 When the bit 0 is set, the driver will show the messages to108110 kernel log when an xrun is detected. The debug message is···123121124122 Bits 3 and 4 are for logging the hwptr records. Note that125123 these will give flood of kernel messages.124124+125125+ When bit 5 is set, the driver logs the last 10 xrun errors and126126+ the proc file shows each jiffies, position, period_size,127127+ buffer_size, old_hw_ptr, and hw_ptr_base values.128128+129129+ When bit 6 is set, the full xrun log is shown only once.126130127131card*/pcm*/sub*/info128132 The general information of this PCM sub-stream.
+135
Documentation/sound/alsa/alsa-parameters.txt
···11+ ALSA Kernel Parameters22+ ~~~~~~~~~~~~~~~~~~~~~~33+44+See Documentation/kernel-parameters.txt for general information on55+specifying module parameters.66+77+This document may not be entirely up to date and comprehensive. The command88+"modinfo -p ${modulename}" shows a current list of all parameters of a loadable99+module. Loadable modules, after being loaded into the running kernel, also1010+reveal their parameters in /sys/module/${modulename}/parameters/. Some of these1111+parameters may be changed at runtime by the command1212+"echo -n ${value} > /sys/module/${modulename}/parameters/${parm}".1313+1414+1515+ snd-ad1816a= [HW,ALSA]1616+1717+ snd-ad1848= [HW,ALSA]1818+1919+ snd-ali5451= [HW,ALSA]2020+2121+ snd-als100= [HW,ALSA]2222+2323+ snd-als4000= [HW,ALSA]2424+2525+ snd-azt2320= [HW,ALSA]2626+2727+ snd-cmi8330= [HW,ALSA]2828+2929+ snd-cmipci= [HW,ALSA]3030+3131+ snd-cs4231= [HW,ALSA]3232+3333+ snd-cs4232= [HW,ALSA]3434+3535+ snd-cs4236= [HW,ALSA]3636+3737+ snd-cs4281= [HW,ALSA]3838+3939+ snd-cs46xx= [HW,ALSA]4040+4141+ snd-dt019x= [HW,ALSA]4242+4343+ snd-dummy= [HW,ALSA]4444+4545+ snd-emu10k1= [HW,ALSA]4646+4747+ snd-ens1370= [HW,ALSA]4848+4949+ snd-ens1371= [HW,ALSA]5050+5151+ snd-es968= [HW,ALSA]5252+5353+ snd-es1688= [HW,ALSA]5454+5555+ snd-es18xx= [HW,ALSA]5656+5757+ snd-es1938= [HW,ALSA]5858+5959+ snd-es1968= [HW,ALSA]6060+6161+ snd-fm801= [HW,ALSA]6262+6363+ snd-gusclassic= [HW,ALSA]6464+6565+ snd-gusextreme= [HW,ALSA]6666+6767+ snd-gusmax= [HW,ALSA]6868+6969+ snd-hdsp= [HW,ALSA]7070+7171+ snd-ice1712= [HW,ALSA]7272+7373+ snd-intel8x0= [HW,ALSA]7474+7575+ snd-interwave= [HW,ALSA]7676+7777+ snd-interwave-stb=7878+ [HW,ALSA]7979+8080+ snd-korg1212= [HW,ALSA]8181+8282+ snd-maestro3= [HW,ALSA]8383+8484+ snd-mpu401= [HW,ALSA]8585+8686+ snd-mtpav= [HW,ALSA]8787+8888+ snd-nm256= [HW,ALSA]8989+9090+ snd-opl3sa2= [HW,ALSA]9191+9292+ snd-opti92x-ad1848=9393+ [HW,ALSA]9494+9595+ snd-opti92x-cs4231=9696+ [HW,ALSA]9797+9898+ snd-opti93x= [HW,ALSA]9999+100100+ snd-pmac= [HW,ALSA]101101+102102+ snd-rme32= [HW,ALSA]103103+104104+ snd-rme96= [HW,ALSA]105105+106106+ snd-rme9652= [HW,ALSA]107107+108108+ snd-sb8= [HW,ALSA]109109+110110+ snd-sb16= [HW,ALSA]111111+112112+ snd-sbawe= [HW,ALSA]113113+114114+ snd-serial= [HW,ALSA]115115+116116+ snd-sgalaxy= [HW,ALSA]117117+118118+ snd-sonicvibes= [HW,ALSA]119119+120120+ snd-sun-amd7930=121121+ [HW,ALSA]122122+123123+ snd-sun-cs4231= [HW,ALSA]124124+125125+ snd-trident= [HW,ALSA]126126+127127+ snd-usb-audio= [HW,ALSA,USB]128128+129129+ snd-via82xx= [HW,ALSA]130130+131131+ snd-virmidi= [HW,ALSA]132132+133133+ snd-wavefront= [HW,ALSA]134134+135135+ snd-ymfpci= [HW,ALSA]
+51
Documentation/sound/oss/oss-parameters.txt
···11+ OSS Kernel Parameters22+ ~~~~~~~~~~~~~~~~~~~~~33+44+See Documentation/kernel-parameters.txt for general information on55+specifying module parameters.66+77+This document may not be entirely up to date and comprehensive. The command88+"modinfo -p ${modulename}" shows a current list of all parameters of a loadable99+module. Loadable modules, after being loaded into the running kernel, also1010+reveal their parameters in /sys/module/${modulename}/parameters/. Some of these1111+parameters may be changed at runtime by the command1212+"echo -n ${value} > /sys/module/${modulename}/parameters/${parm}".1313+1414+1515+ ad1848= [HW,OSS]1616+ Format: <io>,<irq>,<dma>,<dma2>,<type>1717+1818+ aedsp16= [HW,OSS] Audio Excel DSP 161919+ Format: <io>,<irq>,<dma>,<mss_io>,<mpu_io>,<mpu_irq>2020+ See also header of sound/oss/aedsp16.c.2121+2222+ dmasound= [HW,OSS] Sound subsystem buffers2323+2424+ mpu401= [HW,OSS]2525+ Format: <io>,<irq>2626+2727+ opl3= [HW,OSS]2828+ Format: <io>2929+3030+ pas2= [HW,OSS] Format:3131+ <io>,<irq>,<dma>,<dma16>,<sb_io>,<sb_irq>,<sb_dma>,<sb_dma16>3232+3333+ pss= [HW,OSS] Personal Sound System (ECHO ESC614)3434+ Format:3535+ <io>,<mss_io>,<mss_irq>,<mss_dma>,<mpu_io>,<mpu_irq>3636+3737+ sscape= [HW,OSS]3838+ Format: <io>,<irq>,<dma>,<mpu_io>,<mpu_irq>3939+4040+ trix= [HW,OSS] MediaTrix AudioTrix Pro4141+ Format:4242+ <io>,<irq>,<dma>,<dma2>,<sb_io>,<sb_irq>,<sb_dma>,<mpu_io>,<mpu_irq>4343+4444+ uart401= [HW,OSS]4545+ Format: <io>,<irq>4646+4747+ uart6850= [HW,OSS]4848+ Format: <io>,<irq>4949+5050+ waveartist= [HW,OSS]5151+ Format: <io>,<irq>,<dma>,<dma2>
+6
arch/um/drivers/hostaudio_kern.c
···88#include "linux/slab.h"99#include "linux/sound.h"1010#include "linux/soundcard.h"1111+#include "linux/smp_lock.h"1112#include "asm/uaccess.h"1213#include "init.h"1314#include "os.h"···199198 if (file->f_mode & FMODE_WRITE)200199 w = 1;201200201201+ lock_kernel();202202 ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);203203+ unlock_kernel();204204+203205 if (ret < 0) {204206 kfree(state);205207 return ret;···258254 if (file->f_mode & FMODE_WRITE)259255 w = 1;260256257257+ lock_kernel();261258 ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);259259+ unlock_kernel();262260263261 if (ret < 0) {264262 printk(KERN_ERR "hostaudio_open_mixdev failed to open '%s', "
···1818/* v1.0 and v2.0 of this standard have many things in common. For the rest1919 * of the definitions, please refer to audio.h */20202121+/*2222+ * bmControl field decoders2323+ *2424+ * From the USB Audio spec v2.0:2525+ *2626+ * bmaControls() is a (ch+1)-element array of 4-byte bitmaps,2727+ * each containing a set of bit pairs. If a Control is present,2828+ * it must be Host readable. If a certain Control is not2929+ * present then the bit pair must be set to 0b00.3030+ * If a Control is present but read-only, the bit pair must be3131+ * set to 0b01. If a Control is also Host programmable, the bit3232+ * pair must be set to 0b11. The value 0b10 is not allowed.3333+ *3434+ */3535+2136static inline bool uac2_control_is_readable(u32 bmControls, u8 control)2237{2338 return (bmControls >> (control * 2)) & 0x1;···136121137122/* 4.9.2 Class-Specific AS Interface Descriptor */138123139139-struct uac_as_header_descriptor_v2 {124124+struct uac2_as_header_descriptor {140125 __u8 bLength;141126 __u8 bDescriptorType;142127 __u8 bDescriptorSubtype;
···170170 AC97 codecs. In this mode, the power-mode is dynamically171171 controlled at each open/close.172172173173- The mode is activated by passing power_save=1 option to174174- snd-ac97-codec driver. You can toggle it dynamically over175175- sysfs, too.173173+ The mode is activated by passing 'power_save=X' to the174174+ snd-ac97-codec driver module, where 'X' is the time-out175175+ value, a nonnegative integer that specifies how many176176+ seconds of idle time the driver must count before it may177177+ put the AC97 into power-save mode; a value of 0 (zero)178178+ disables the use of this power-save mode.179179+180180+ After the snd-ac97-codec driver module has been loaded,181181+ the 'power_save' parameter can be set via sysfs as follows:182182+183183+ echo 10 > /sys/module/snd_ac97_codec/parameters/power_save184184+185185+ In this case, the time-out is set to 10 seconds; setting186186+ the time-out to 1 second (the minimum activation value)187187+ isn't recommended because many applications try to reopen188188+ the device frequently. A value of 10 seconds would be a189189+ good choice for normal operations.190190+191191+ See Documentation/sound/alsa/powersave.txt for more details.176192177193config SND_AC97_POWER_SAVE_DEFAULT178194 int "Default time-out for AC97 power-save mode"···197181 help198182 The default time-out value in seconds for AC97 automatic199183 power-save mode. 0 means to disable the power-save mode.184184+185185+ See SND_AC97_POWER_SAVE for more details.200186201187endif # SND_DRIVERS
···24292429 return mask;24302430}2431243124322432-static int vwsnd_audio_do_ioctl(struct inode *inode,24332433- struct file *file,24322432+static int vwsnd_audio_do_ioctl(struct file *file,24342433 unsigned int cmd,24352434 unsigned long arg)24362435{···24452446 int ival;244624472447244824482448- DBGEV("(inode=0x%p, file=0x%p, cmd=0x%x, arg=0x%lx)\n",24492449- inode, file, cmd, arg);24492449+ DBGEV("(file=0x%p, cmd=0x%x, arg=0x%lx)\n",24502450+ file, cmd, arg);24502451 switch (cmd) {24512452 case OSS_GETVERSION: /* _SIOR ('M', 118, int) */24522453 DBGX("OSS_GETVERSION\n");···28842885 return -EINVAL;28852886}2886288728872887-static int vwsnd_audio_ioctl(struct inode *inode,28882888- struct file *file,28882888+static long vwsnd_audio_ioctl(struct file *file,28892889 unsigned int cmd,28902890 unsigned long arg)28912891{28922892 vwsnd_dev_t *devc = (vwsnd_dev_t *) file->private_data;28932893 int ret;2894289428952895+ lock_kernel();28952896 mutex_lock(&devc->io_mutex);28962896- ret = vwsnd_audio_do_ioctl(inode, file, cmd, arg);28972897+ ret = vwsnd_audio_do_ioctl(file, cmd, arg);28972898 mutex_unlock(&devc->io_mutex);28992899+ unlock_kernel();29002900+28982901 return ret;28992902}29002903···2922292129232922 DBGE("(inode=0x%p, file=0x%p)\n", inode, file);2924292329242924+ lock_kernel();29252925 INC_USE_COUNT;29262926 for (devc = vwsnd_dev_list; devc; devc = devc->next_dev)29272927 if ((devc->audio_minor & ~0x0F) == (minor & ~0x0F))···2930292829312929 if (devc == NULL) {29322930 DEC_USE_COUNT;29312931+ unlock_kernel();29332932 return -ENODEV;29342933 }29352934···29392936 mutex_unlock(&devc->open_mutex);29402937 if (file->f_flags & O_NONBLOCK) {29412938 DEC_USE_COUNT;29392939+ unlock_kernel();29422940 return -EBUSY;29432941 }29442942 interruptible_sleep_on(&devc->open_wait);29452943 if (signal_pending(current)) {29462944 DEC_USE_COUNT;29452945+ unlock_kernel();29472946 return -ERESTARTSYS;29482947 }29492948 mutex_lock(&devc->open_mutex);···2998299329992994 file->private_data = devc;30002995 DBGRV();29962996+ unlock_kernel();30012997 return 0;30022998}30032999···30503044 .read = vwsnd_audio_read,30513045 .write = vwsnd_audio_write,30523046 .poll = vwsnd_audio_poll,30533053- .ioctl = vwsnd_audio_ioctl,30473047+ .unlocked_ioctl = vwsnd_audio_ioctl,30543048 .mmap = vwsnd_audio_mmap,30553049 .open = vwsnd_audio_open,30563050 .release = vwsnd_audio_release,···30683062 DBGEV("(inode=0x%p, file=0x%p)\n", inode, file);3069306330703064 INC_USE_COUNT;30653065+ lock_kernel();30713066 for (devc = vwsnd_dev_list; devc; devc = devc->next_dev)30723067 if (devc->mixer_minor == iminor(inode))30733068 break;3074306930753070 if (devc == NULL) {30763071 DEC_USE_COUNT;30723072+ unlock_kernel();30773073 return -ENODEV;30783074 }30793075 file->private_data = devc;30763076+ unlock_kernel();30803077 return 0;30813078}30823079···3212320332133204/* This is the ioctl entry to the mixer driver. */3214320532153215-static int vwsnd_mixer_ioctl(struct inode *ioctl,32163216- struct file *file,32063206+static long vwsnd_mixer_ioctl(struct file *file,32173207 unsigned int cmd,32183208 unsigned long arg)32193209{···3223321532243216 DBGEV("(devc=0x%p, cmd=0x%x, arg=0x%lx)\n", devc, cmd, arg);3225321732183218+ lock_kernel();32263219 mutex_lock(&devc->mix_mutex);32273220 {32283221 if ((cmd & ~nrmask) == MIXER_READ(0))···32343225 retval = -EINVAL;32353226 }32363227 mutex_unlock(&devc->mix_mutex);32283228+ unlock_kernel();32373229 return retval;32383230}3239323132403232static const struct file_operations vwsnd_mixer_fops = {32413233 .owner = THIS_MODULE,32423234 .llseek = no_llseek,32433243- .ioctl = vwsnd_mixer_ioctl,32353235+ .unlocked_ioctl = vwsnd_mixer_ioctl,32443236 .open = vwsnd_mixer_open,32453237 .release = vwsnd_mixer_release,32463238};
+2-8
sound/oss/waveartist.c
···184184static inline int185185waveartist_sleep(int timeout_ms)186186{187187- unsigned int timeout = timeout_ms * 10 * HZ / 100;188188-189189- do {190190- set_current_state(TASK_INTERRUPTIBLE);191191- timeout = schedule_timeout(timeout);192192- } while (timeout);193193-194194- return 0;187187+ unsigned int timeout = msecs_to_jiffies(timeout_ms*100);188188+ return schedule_timeout_interruptible(timeout);195189}196190197191static int
+2-2
sound/pci/als4000.c
···763763 /* SPECS_PAGE: 39 */764764 for (i = ALS4K_GCR91_DMA0_ADDR; i <= ALS4K_GCR96_DMA3_MODE_COUNT; ++i)765765 snd_als4k_gcr_write(chip, i, 0);766766-766766+ /* enable burst mode to prevent dropouts during high PCI bus usage */767767 snd_als4k_gcr_write(chip, ALS4K_GCR99_DMA_EMULATION_CTRL,768768- snd_als4k_gcr_read(chip, ALS4K_GCR99_DMA_EMULATION_CTRL));768768+ (snd_als4k_gcr_read(chip, ALS4K_GCR99_DMA_EMULATION_CTRL) & ~0x07) | 0x04);769769 spin_unlock_irq(&chip->reg_lock);770770}771771
+9-7
sound/pci/asihpi/asihpi.c
···460460 struct snd_card_asihpi *card = snd_pcm_substream_chip(substream);461461 int err;462462 u16 format;463463+ int width;463464 unsigned int bytes_per_sec;464465465466 print_hwparams(params);···513512 dpcm->hpi_buffer_attached);514513 }515514 bytes_per_sec = params_rate(params) * params_channels(params);516516- bytes_per_sec *= snd_pcm_format_width(params_format(params));515515+ width = snd_pcm_format_width(params_format(params));516516+ bytes_per_sec *= width;517517 bytes_per_sec /= 8;518518- if (bytes_per_sec <= 0)518518+ if (width < 0 || bytes_per_sec == 0)519519 return -EINVAL;520520521521 dpcm->bytes_per_sec = bytes_per_sec;···1385138313861384compile_time_assert(13871385 (ARRAY_SIZE(asihpi_src_names) ==13881388- (HPI_SOURCENODE_LAST_INDEX-HPI_SOURCENODE_BASE+1)),13861386+ (HPI_SOURCENODE_LAST_INDEX-HPI_SOURCENODE_NONE+1)),13891387 assert_src_names_size);1390138813911389#if ASI_STYLE_NAMES···1416141414171415compile_time_assert(14181416 (ARRAY_SIZE(asihpi_dst_names) ==14191419- (HPI_DESTNODE_LAST_INDEX-HPI_DESTNODE_BASE+1)),14171417+ (HPI_DESTNODE_LAST_INDEX-HPI_DESTNODE_NONE+1)),14201418 assert_dst_names_size);1421141914221420static inline int ctl_add(struct snd_card *card, struct snd_kcontrol_new *ctl,···21732171 &src_node_type, &src_node_index);2174217221752173 sprintf(uinfo->value.enumerated.name, "%s %d",21762176- asihpi_src_names[src_node_type - HPI_SOURCENODE_BASE],21742174+ asihpi_src_names[src_node_type - HPI_SOURCENODE_NONE],21772175 src_node_index);21782176 return 0;21792177}···2605260326062604 }2607260526082608- hpi_ctl.src_node_type -= HPI_SOURCENODE_BASE;26092609- hpi_ctl.dst_node_type -= HPI_DESTNODE_BASE;26062606+ hpi_ctl.src_node_type -= HPI_SOURCENODE_NONE;26072607+ hpi_ctl.dst_node_type -= HPI_DESTNODE_NONE;2610260826112609 /* ASI50xx in SSX mode has multiple meters on the same node.26122610 Use subindex to create distinct ALSA controls
+48-20
sound/pci/asihpi/hpi.h
···5050#define HPI_VER_RELEASE(v) ((int)(v & 0xFF))51515252/* Use single digits for versions less that 10 to avoid octal. */5353-#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 3, 25)5353+#define HPI_VER HPI_VERSION_CONSTRUCTOR(4L, 4, 1)5454+#define HPI_VER_STRING "4.04.01"54555556/* Library version as documented in hpi-api-versions.txt */5657#define HPI_LIB_VER HPI_VERSION_CONSTRUCTOR(9, 0, 0)···204203 exists on a destination node can be searched for using a source205204 node value of either 0, or HPI_SOURCENODE_NONE */206205 HPI_SOURCENODE_NONE = 100,207207- /** \deprecated Use HPI_SOURCENODE_NONE instead. */208208- HPI_SOURCENODE_BASE = 100,209206 /** Out Stream (Play) node. */210207 HPI_SOURCENODE_OSTREAM = 101,211208 /** Line in node - could be analog, AES/EBU or network. */···234235 exists on a source node can be searched for using a destination235236 node value of either 0, or HPI_DESTNODE_NONE */236237 HPI_DESTNODE_NONE = 200,237237- /** \deprecated Use HPI_DESTNODE_NONE instead. */238238- HPI_DESTNODE_BASE = 200,239238 /** In Stream (Record) node. */240239 HPI_DESTNODE_ISTREAM = 201,241240 HPI_DESTNODE_LINEOUT = 202, /**< line out node. */···429432Property 1 - adapter can do samplerate conversion (MRX)430433Property 2 - adapter can do timestretch (TSX)431434*/432432- HPI_ADAPTER_PROPERTY_CAPS2 = 269435435+ HPI_ADAPTER_PROPERTY_CAPS2 = 269,436436+437437+/** Readonly adapter sync header connection count.438438+*/439439+ HPI_ADAPTER_PROPERTY_SYNC_HEADER_CONNECTIONS = 270,440440+/** Readonly supports SSX2 property.441441+Indicates the adapter supports SSX2 in some mode setting. The442442+return value is true (1) or false (0). If the current adapter443443+mode is MONO SSX2 is disabled, even though this property will444444+return true.445445+*/446446+ HPI_ADAPTER_PROPERTY_SUPPORTS_SSX2 = 271433447};434448435449/** Adapter mode commands···821813/** The sampleclock output is derived from its local samplerate generator.822814 The local samplerate may be set using HPI_SampleClock_SetLocalRate(). */823815 HPI_SAMPLECLOCK_SOURCE_LOCAL = 1,824824-/** \deprecated Use HPI_SAMPLECLOCK_SOURCE_LOCAL instead */825825- HPI_SAMPLECLOCK_SOURCE_ADAPTER = 1,826816/** The adapter is clocked from a dedicated AES/EBU SampleClock input.*/827817 HPI_SAMPLECLOCK_SOURCE_AESEBU_SYNC = 2,828818/** From external wordclock connector */···831825 HPI_SAMPLECLOCK_SOURCE_SMPTE = 5,832826/** One of the aesebu inputs */833827 HPI_SAMPLECLOCK_SOURCE_AESEBU_INPUT = 6,834834-/** \deprecated The first aesebu input with a valid signal835835-Superseded by separate Auto enable flag836836-*/837837- HPI_SAMPLECLOCK_SOURCE_AESEBU_AUTO = 7,838828/** From a network interface e.g. Cobranet or Livewire at either 48 or 96kHz */839829 HPI_SAMPLECLOCK_SOURCE_NETWORK = 8,840830/** From previous adjacent module (ASI2416 only)*/···10171015 HPI_ERROR_CONTROL_DISABLED = 404,10181016 /** I2C transaction failed due to a missing ACK. */10191017 HPI_ERROR_CONTROL_I2C_MISSING_ACK = 405,10201020- /** Control attribute is valid, but not supported by this hardware. */10211021- HPI_ERROR_UNSUPPORTED_CONTROL_ATTRIBUTE = 406,10221018 /** Control is busy, or coming out of10231019 reset and cannot be accessed at this time. */10241020 HPI_ERROR_CONTROL_NOT_READY = 407,···18271827 Compressor Expander control18281828*******************************/1829182918301830-u16 hpi_compander_set(const struct hpi_hsubsys *ph_subsys, u32 h_control,18311831- u16 attack, u16 decay, short ratio100, short threshold0_01dB,18321832- short makeup_gain0_01dB);18301830+u16 hpi_compander_set_enable(const struct hpi_hsubsys *ph_subsys,18311831+ u32 h_control, u32 on);1833183218341834-u16 hpi_compander_get(const struct hpi_hsubsys *ph_subsys, u32 h_control,18351835- u16 *pw_attack, u16 *pw_decay, short *pw_ratio100,18361836- short *pn_threshold0_01dB, short *pn_makeup_gain0_01dB);18331833+u16 hpi_compander_get_enable(const struct hpi_hsubsys *ph_subsys,18341834+ u32 h_control, u32 *pon);18351835+18361836+u16 hpi_compander_set_makeup_gain(const struct hpi_hsubsys *ph_subsys,18371837+ u32 h_control, short makeup_gain0_01dB);18381838+18391839+u16 hpi_compander_get_makeup_gain(const struct hpi_hsubsys *ph_subsys,18401840+ u32 h_control, short *pn_makeup_gain0_01dB);18411841+18421842+u16 hpi_compander_set_attack_time_constant(const struct hpi_hsubsys18431843+ *ph_subsys, u32 h_control, u32 index, u32 attack);18441844+18451845+u16 hpi_compander_get_attack_time_constant(const struct hpi_hsubsys18461846+ *ph_subsys, u32 h_control, u32 index, u32 *pw_attack);18471847+18481848+u16 hpi_compander_set_decay_time_constant(const struct hpi_hsubsys *ph_subsys,18491849+ u32 h_control, u32 index, u32 decay);18501850+18511851+u16 hpi_compander_get_decay_time_constant(const struct hpi_hsubsys *ph_subsys,18521852+ u32 h_control, u32 index, u32 *pw_decay);18531853+18541854+u16 hpi_compander_set_threshold(const struct hpi_hsubsys *ph_subsys,18551855+ u32 h_control, u32 index, short threshold0_01dB);18561856+18571857+u16 hpi_compander_get_threshold(const struct hpi_hsubsys *ph_subsys,18581858+ u32 h_control, u32 index, short *pn_threshold0_01dB);18591859+18601860+u16 hpi_compander_set_ratio(const struct hpi_hsubsys *ph_subsys,18611861+ u32 h_control, u32 index, u32 ratio100);18621862+18631863+u16 hpi_compander_get_ratio(const struct hpi_hsubsys *ph_subsys,18641864+ u32 h_control, u32 index, u32 *pw_ratio100);1837186518381866/*******************************18391867 Cobranet HMI control
+7
sound/pci/asihpi/hpi6000.c
···687687 switch (pao->pci.subsys_device_id) {688688 case 0x5100:689689 case 0x5110: /* ASI5100 revB or higher with C6711D */690690+ case 0x5200: /* ASI5200 PC_ie version of ASI5100 */690691 case 0x6100:691692 case 0x6200:692693 boot_load_family = HPI_ADAPTER_FAMILY_ASI(0x6200);···11331132 if (HPI_ADAPTER_FAMILY_ASI(pao->pci.11341133 subsys_device_id) ==11351134 HPI_ADAPTER_FAMILY_ASI(0x5100))11351135+ mask = 0x00000000L;11361136+ /* ASI5200 uses AX6 code, */11371137+ /* but has no PLD r/w register to test */11381138+ if (HPI_ADAPTER_FAMILY_ASI(pao->pci.11391139+ subsys_device_id) ==11401140+ HPI_ADAPTER_FAMILY_ASI(0x5200))11361141 mask = 0x00000000L;11371142 break;11381143 case HPI_ADAPTER_FAMILY_ASI(0x8800):
+22-18
sound/pci/asihpi/hpi_internal.h
···104104#define STR_ROLE_FIELD_MAX 255U105105106106struct hpi_entity_str {107107- uint16_t size;108108- uint8_t type;109109- uint8_t role;107107+ u16 size;108108+ u8 type;109109+ u8 role;110110};111111112112#if defined(_MSC_VER)···119119#if ! defined(HPI_OS_DSP_C6000) || (defined(HPI_OS_DSP_C6000) && (__TI_COMPILER_VERSION__ > 6000008))120120 /* DSP C6000 compiler v6.0.8 and lower121121 do not support flexible array member */122122- uint8_t value[];122122+ u8 value[];123123#else124124 /* NOTE! Using sizeof(struct hpi_entity) will give erroneous results */125125#define HPI_INTERNAL_WARN_ABOUT_ENTITY_VALUE126126- uint8_t value[1];126126+ u8 value[1];127127#endif128128};129129···142142/******************************************* CONTROL ATTRIBUTES ****/143143/* (in order of control type ID */144144145145- /* This allows for 255 control types, 256 unique attributes each */145145+/* This allows for 255 control types, 256 unique attributes each */146146#define HPI_CTL_ATTR(ctl, ai) (HPI_CONTROL_##ctl * 0x100 + ai)147147148148/* Get the sub-index of the attribute for a control type */149149#define HPI_CTL_ATTR_INDEX(i) (i&0xff)150150+151151+/* Extract the control from the control attribute */152152+#define HPI_CTL_ATTR_CONTROL(i) (i>>8)150153151154/* Generic control attributes. */152155···314311/* Microphone control attributes */315312#define HPI_MICROPHONE_PHANTOM_POWER HPI_CTL_ATTR(MICROPHONE, 1)316313317317-/** Equalizer control attributes318318-*/314314+/** Equalizer control attributes */319315/** Used to get number of filters in an EQ. (Can't set) */320316#define HPI_EQUALIZER_NUM_FILTERS HPI_CTL_ATTR(EQUALIZER, 1)321317/** Set/get the filter by type, freq, Q, gain */···322320/** Get the biquad coefficients */323321#define HPI_EQUALIZER_COEFFICIENTS HPI_CTL_ATTR(EQUALIZER, 3)324322325325-#define HPI_COMPANDER_PARAMS HPI_CTL_ATTR(COMPANDER, 1)323323+/* Note compander also uses HPI_GENERIC_ENABLE */324324+#define HPI_COMPANDER_PARAMS HPI_CTL_ATTR(COMPANDER, 1)325325+#define HPI_COMPANDER_MAKEUPGAIN HPI_CTL_ATTR(COMPANDER, 2)326326+#define HPI_COMPANDER_THRESHOLD HPI_CTL_ATTR(COMPANDER, 3)327327+#define HPI_COMPANDER_RATIO HPI_CTL_ATTR(COMPANDER, 4)328328+#define HPI_COMPANDER_ATTACK HPI_CTL_ATTR(COMPANDER, 5)329329+#define HPI_COMPANDER_DECAY HPI_CTL_ATTR(COMPANDER, 6)326330327327-/* Cobranet control attributes.328328- MUST be distinct from all other control attributes.329329- This is so that host side processing can easily identify a Cobranet control330330- and apply additional host side operations (like copying data) as required.331331-*/331331+/* Cobranet control attributes. */332332#define HPI_COBRANET_SET HPI_CTL_ATTR(COBRANET, 1)333333#define HPI_COBRANET_GET HPI_CTL_ATTR(COBRANET, 2)334334#define HPI_COBRANET_SET_DATA HPI_CTL_ATTR(COBRANET, 3)···15161512 struct hpi_control_cache_info i;15171513 union {15181514 struct { /* volume */15191519- u16 an_log[2];15151515+ short an_log[2];15201516 } v;15211517 struct { /* peak meter */15221522- u16 an_log_peak[2];15231523- u16 an_logRMS[2];15181518+ short an_log_peak[2];15191519+ short an_logRMS[2];15241520 } p;15251521 struct { /* channel mode */15261522 u16 mode;···15301526 u16 source_node_index;15311527 } x;15321528 struct { /* level/trim */15331533- u16 an_log[2];15291529+ short an_log[2];15341530 } l;15351531 struct { /* tuner - partial caching.15361532 some attributes go to the DSP. */
···9797#include <linux/gameport.h>9898#include <linux/device.h>9999#include <linux/firmware.h>100100+#include <linux/kernel.h>100101#include <asm/io.h>101102#include <sound/core.h>102103#include <sound/info.h>···668667 unsigned char c;669668670669 while (len) {670670+ int value;671671+671672 c = in[len - 1];672672- if ((c >= '0') && (c <= '9'))673673- sum += mult * (c - '0');674674- else if ((c >= 'A') && (c <= 'F'))675675- sum += mult * (c - ('A' - 10));676676- else if ((c >= 'a') && (c <= 'f'))677677- sum += mult * (c - ('a' - 10));673673+ value = hex_to_bin(c);674674+ if (value >= 0)675675+ sum += mult * value;678676 mult *= 16;679677 --len;680678 }···1615161516161616 chip->playback_substream[sub_num] = substream;16171617 runtime->hw = snd_riptide_playback;16181618+16181619 data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL);16201620+ if (data == NULL)16211621+ return -ENOMEM;16191622 data->paths = lbus_play_paths[sub_num];16201623 data->id = play_ids[sub_num];16211624 data->source = play_sources[sub_num];···1638163516391636 chip->capture_substream = substream;16401637 runtime->hw = snd_riptide_capture;16381638+16411639 data = kzalloc(sizeof(struct pcmhw), GFP_KERNEL);16401640+ if (data == NULL)16411641+ return -ENOMEM;16421642 data->paths = lbus_rec_path;16431643 data->id = PADC;16441644 data->source = ACLNK2PADC;
+9-7
sound/pci/sis7019.c
···264264 * if using small periods.265265 *266266 * If we're less than 9 samples behind, we're on target.267267+ * Otherwise, shorten the next vperiod by the amount we've268268+ * been delayed.267269 */268270 if (sync > -9)269271 voice->vperiod = voice->sync_period_size + 1;270272 else271271- voice->vperiod = voice->sync_period_size - 4;273273+ voice->vperiod = voice->sync_period_size + sync + 10;272274273275 if (voice->vperiod < voice->buffer_size) {274276 sis_update_sso(voice, voice->vperiod);···738736 period_size = buffer_size;739737740738 /* Initially, we want to interrupt just a bit behind the end of741741- * the period we're clocking out. 10 samples seems to give a good739739+ * the period we're clocking out. 12 samples seems to give a good742740 * delay.743741 *744742 * We want to spread our interrupts throughout the virtual period,···749747 *750748 * This is all moot if we don't need to use virtual periods.751749 */752752- vperiod = runtime->period_size + 10;750750+ vperiod = runtime->period_size + 12;753751 if (vperiod > period_size) {754752 u16 tail = vperiod % period_size;755753 u16 quarter_period = period_size / 4;···778776 */779777 timing->flags |= VOICE_SYNC_TIMING;780778 timing->sync_base = voice->ctrl_base;781781- timing->sync_cso = runtime->period_size - 1;779779+ timing->sync_cso = runtime->period_size;782780 timing->sync_period_size = runtime->period_size;783781 timing->sync_buffer_size = runtime->buffer_size;784782 timing->period_size = period_size;···10491047 /* Reset the chip, and disable all interrputs.10501048 */10511049 outl(SIS_GCR_SOFTWARE_RESET, sis->ioport + SIS_GCR);10521052- udelay(10);10501050+ udelay(25);10531051 outl(0, sis->ioport + SIS_GCR);10541052 outl(0, sis->ioport + SIS_GIER);10551053···10851083 /* Reset the audio controller10861084 */10871085 outl(SIS_GCR_SOFTWARE_RESET, io + SIS_GCR);10881088- udelay(10);10861086+ udelay(25);10891087 outl(0, io + SIS_GCR);1090108810911089 /* Get the AC-link semaphore, and reset the codecs···10981096 return -EIO;1099109711001098 outl(SIS_AC97_CMD_CODEC_COLD_RESET, io + SIS_AC97_CMD);11011101- udelay(10);10991099+ udelay(250);1102110011031101 count = 0xffff;11041102 while ((inw(io + SIS_AC97_STATUS) & SIS_AC97_STATUS_BUSY) && --count)
···19192020#include <linux/bitops.h>2121#include <linux/init.h>2222-#include <linux/list.h>2323-#include <linux/slab.h>2422#include <linux/string.h>2523#include <linux/usb.h>2626-#include <linux/moduleparam.h>2727-#include <linux/mutex.h>2824#include <linux/usb/audio.h>2925#include <linux/usb/audio-v2.h>30263127#include <sound/core.h>3228#include <sound/info.h>3329#include <sound/pcm.h>3434-#include <sound/pcm_params.h>3535-#include <sound/initval.h>36303731#include "usbaudio.h"3832#include "card.h"3939-#include "midi.h"4040-#include "mixer.h"4141-#include "proc.h"4242-#include "quirks.h"4343-#include "endpoint.h"4433#include "helper.h"4545-#include "debug.h"4646-#include "pcm.h"4747-#include "urb.h"4848-#include "format.h"3434+#include "clock.h"49355036static struct uac_clock_source_descriptor *5137 snd_usb_find_clock_source(struct usb_host_interface *ctrl_iface,···120134 return !!data;121135}122136123123-/* Try to find the clock source ID of a given clock entity */124124-125137static int __uac_clock_find_source(struct snd_usb_audio *chip,126126- struct usb_host_interface *host_iface,127138 int entity_id, unsigned long *visited)128139{129140 struct uac_clock_source_descriptor *source;···137154 }138155139156 /* first, see if the ID we're looking for is a clock source already */140140- source = snd_usb_find_clock_source(host_iface, entity_id);157157+ source = snd_usb_find_clock_source(chip->ctrl_intf, entity_id);141158 if (source)142159 return source->bClockID;143160144144- selector = snd_usb_find_clock_selector(host_iface, entity_id);161161+ selector = snd_usb_find_clock_selector(chip->ctrl_intf, entity_id);145162 if (selector) {146163 int ret;147164···151168 if (ret < 0)152169 return ret;153170171171+ /* Selector values are one-based */172172+154173 if (ret > selector->bNrInPins || ret < 1) {155174 printk(KERN_ERR156175 "%s(): selector reported illegal value, id %d, ret %d\n",···161176 return -EINVAL;162177 }163178164164- return __uac_clock_find_source(chip, host_iface,165165- selector->baCSourceID[ret-1],179179+ return __uac_clock_find_source(chip, selector->baCSourceID[ret-1],166180 visited);167181 }168182169183 /* FIXME: multipliers only act as pass-thru element for now */170170- multiplier = snd_usb_find_clock_multiplier(host_iface, entity_id);184184+ multiplier = snd_usb_find_clock_multiplier(chip->ctrl_intf, entity_id);171185 if (multiplier)172172- return __uac_clock_find_source(chip, host_iface,173173- multiplier->bCSourceID, visited);186186+ return __uac_clock_find_source(chip, multiplier->bCSourceID,187187+ visited);174188175189 return -EINVAL;176190}177191178178-int snd_usb_clock_find_source(struct snd_usb_audio *chip,179179- struct usb_host_interface *host_iface,180180- int entity_id)192192+/*193193+ * For all kinds of sample rate settings and other device queries,194194+ * the clock source (end-leaf) must be used. However, clock selectors,195195+ * clock multipliers and sample rate converters may be specified as196196+ * clock source input to terminal. This functions walks the clock path197197+ * to its end and tries to find the source.198198+ *199199+ * The 'visited' bitfield is used internally to detect recursive loops.200200+ *201201+ * Returns the clock source UnitID (>=0) on success, or an error.202202+ */203203+int snd_usb_clock_find_source(struct snd_usb_audio *chip, int entity_id)181204{182205 DECLARE_BITMAP(visited, 256);183206 memset(visited, 0, sizeof(visited));184184- return __uac_clock_find_source(chip, host_iface, entity_id, visited);207207+ return __uac_clock_find_source(chip, entity_id, visited);185208}186209187210static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface,···204211 ep = get_endpoint(alts, 0)->bEndpointAddress;205212206213 /* if endpoint doesn't have sampling rate control, bail out */207207- if (!(fmt->attributes & UAC_EP_CS_ATTR_SAMPLE_RATE)) {208208- snd_printk(KERN_WARNING "%d:%d:%d: endpoint lacks sample rate attribute bit, cannot set.\n",209209- dev->devnum, iface, fmt->altsetting);214214+ if (!(fmt->attributes & UAC_EP_CS_ATTR_SAMPLE_RATE))210215 return 0;211211- }212216213217 data[0] = rate;214218 data[1] = rate >> 8;···244254 struct usb_device *dev = chip->dev;245255 unsigned char data[4];246256 int err, crate;247247- int clock = snd_usb_clock_find_source(chip, chip->ctrl_intf, fmt->clock);257257+ int clock = snd_usb_clock_find_source(chip, fmt->clock);248258249259 if (clock < 0)250260 return clock;251261252262 if (!uac_clock_source_is_valid(chip, clock)) {263263+ /* TODO: should we try to find valid clock setups by ourself? */253264 snd_printk(KERN_ERR "%d:%d:%d: clock source %d is not valid, cannot use\n",254265 dev->devnum, iface, fmt->altsetting, clock);255266 return -ENXIO;
+1-3
sound/usb/clock.h
···55 struct usb_host_interface *alts,66 struct audioformat *fmt, int rate);7788-int snd_usb_clock_find_source(struct snd_usb_audio *chip,99- struct usb_host_interface *host_iface,1010- int entity_id);88+int snd_usb_clock_find_source(struct snd_usb_audio *chip, int entity_id);1191210#endif /* __USBAUDIO_CLOCK_H */
+3-2
sound/usb/endpoint.c
···3333#include "pcm.h"3434#include "helper.h"3535#include "format.h"3636+#include "clock.h"36373738/*3839 * free a substream···276275 /* get audio formats */277276 switch (protocol) {278277 case UAC_VERSION_1: {279279- struct uac_as_header_descriptor_v1 *as =278278+ struct uac1_as_header_descriptor *as =280279 snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL);281280282281 if (!as) {···298297 case UAC_VERSION_2: {299298 struct uac2_input_terminal_descriptor *input_term;300299 struct uac2_output_terminal_descriptor *output_term;301301- struct uac_as_header_descriptor_v2 *as =300300+ struct uac2_as_header_descriptor *as =302301 snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL);303302304303 if (!as) {
+4-5
sound/usb/format.c
···264264 * on the audioformat table (audio class v2).265265 */266266static int parse_audio_format_rates_v2(struct snd_usb_audio *chip,267267- struct audioformat *fp,268268- struct usb_host_interface *iface)267267+ struct audioformat *fp)269268{270269 struct usb_device *dev = chip->dev;271270 unsigned char tmp[2], *data;272271 int nr_triplets, data_size, ret = 0;273273- int clock = snd_usb_clock_find_source(chip, chip->ctrl_intf, fp->clock);272272+ int clock = snd_usb_clock_find_source(chip, fp->clock);274273275274 if (clock < 0) {276275 snd_printk(KERN_ERR "%s(): unable to find clock source (clock %d)\n",···390391 break;391392 case UAC_VERSION_2:392393 /* fp->channels is already set in this case */393393- ret = parse_audio_format_rates_v2(chip, fp, iface);394394+ ret = parse_audio_format_rates_v2(chip, fp);394395 break;395396 }396397···449450 framesize = le16_to_cpu(fmt->wSamplesPerFrame);450451 snd_printd(KERN_INFO "found format II with max.bitrate = %d, frame size=%d\n", brate, framesize);451452 fp->frame_size = framesize;452452- ret = parse_audio_format_rates_v2(chip, fp, iface);453453+ ret = parse_audio_format_rates_v2(chip, fp);453454 break;454455 }455456 }
+7-7
sound/usb/midi.c
···434434 u8 cin = buffer[i] & 0x0f;435435 struct usbmidi_in_port *port = &ep->ports[cable];436436 int length;437437-437437+438438 length = snd_usbmidi_cin_length[cin];439439 if (cin == 0xf && buffer[i + 1] >= 0xf8)440440 ; /* realtime msg: no running status change */···628628629629static struct usb_protocol_ops snd_usbmidi_midiman_ops = {630630 .input = snd_usbmidi_midiman_input,631631- .output = snd_usbmidi_standard_output, 631631+ .output = snd_usbmidi_standard_output,632632 .output_packet = snd_usbmidi_output_midiman_packet,633633};634634635635static struct usb_protocol_ops snd_usbmidi_maudio_broken_running_status_ops = {636636 .input = snd_usbmidi_maudio_broken_running_status_input,637637- .output = snd_usbmidi_standard_output, 637637+ .output = snd_usbmidi_standard_output,638638 .output_packet = snd_usbmidi_output_standard_packet,639639};640640···12481248 */12491249static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi,12501250 struct snd_usb_midi_endpoint_info* ep_info,12511251- struct snd_usb_midi_endpoint* rep)12511251+ struct snd_usb_midi_endpoint* rep)12521252{12531253 struct snd_usb_midi_out_endpoint* ep;12541254 unsigned int i;···13981398}1399139914001400static struct snd_rawmidi_substream *snd_usbmidi_find_substream(struct snd_usb_midi* umidi,14011401- int stream, int number)14011401+ int stream, int number)14021402{14031403 struct list_head* list;14041404···18111811 snd_usbmidi_switch_roland_altsetting(umidi);1812181218131813 if (endpoint[0].out_ep || endpoint[0].in_ep)18141814- return 0; 18141814+ return 0;1815181518161816 intf = umidi->iface;18171817 if (!intf || intf->num_altsetting < 1)···18491849 struct snd_usb_midi_endpoint_info* endpoints)18501850{18511851 int err, i;18521852-18521852+18531853 err = snd_usbmidi_detect_endpoints(umidi, endpoints, MIDI_MAX_ENDPOINTS);18541854 for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {18551855 if (endpoints[i].out_ep)
+42-35
sound/usb/mixer.c
···2626 *2727 */28282929+/*3030+ * TODOs, for both the mixer and the streaming interfaces:3131+ *3232+ * - support for UAC2 effect units3333+ * - support for graphical equalizers3434+ * - RANGE and MEM set commands (UAC2)3535+ * - RANGE and MEM interrupt dispatchers (UAC2)3636+ * - audio channel clustering (UAC2)3737+ * - audio sample rate converter units (UAC2)3838+ * - proper handling of clock multipliers (UAC2)3939+ * - dispatch clock change notifications (UAC2)4040+ * - stop PCM streams which use a clock that became invalid4141+ * - stop PCM streams which use a clock selector that has changed4242+ * - parse available sample rates again when clock sources changed4343+ */4444+2945#include <linux/bitops.h>3046#include <linux/init.h>3147#include <linux/list.h>···291275292276static int get_ctl_value_v1(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret)293277{278278+ struct snd_usb_audio *chip = cval->mixer->chip;294279 unsigned char buf[2];295280 int val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1;296281 int timeout = 10;297282298283 while (timeout-- > 0) {299299- if (snd_usb_ctl_msg(cval->mixer->chip->dev,300300- usb_rcvctrlpipe(cval->mixer->chip->dev, 0),301301- request,284284+ if (snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), request,302285 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,303303- validx, cval->mixer->ctrlif | (cval->id << 8),286286+ validx, snd_usb_ctrl_intf(chip) | (cval->id << 8),304287 buf, val_len, 100) >= val_len) {305288 *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len));306289 return 0;307290 }308291 }309292 snd_printdd(KERN_ERR "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n",310310- request, validx, cval->mixer->ctrlif | (cval->id << 8), cval->val_type);293293+ request, validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), cval->val_type);311294 return -EINVAL;312295}313296314297static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret)315298{299299+ struct snd_usb_audio *chip = cval->mixer->chip;316300 unsigned char buf[2 + 3*sizeof(__u16)]; /* enough space for one range */317301 unsigned char *val;318302 int ret, size;···328312329313 memset(buf, 0, sizeof(buf));330314331331- ret = snd_usb_ctl_msg(cval->mixer->chip->dev,332332- usb_rcvctrlpipe(cval->mixer->chip->dev, 0),333333- bRequest,315315+ ret = snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), bRequest,334316 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,335335- validx, cval->mixer->ctrlif | (cval->id << 8),317317+ validx, snd_usb_ctrl_intf(chip) | (cval->id << 8),336318 buf, size, 1000);337319338320 if (ret < 0) {339321 snd_printk(KERN_ERR "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n",340340- request, validx, cval->mixer->ctrlif | (cval->id << 8), cval->val_type);322322+ request, validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), cval->val_type);341323 return ret;342324 }343325···411397int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,412398 int request, int validx, int value_set)413399{400400+ struct snd_usb_audio *chip = cval->mixer->chip;414401 unsigned char buf[2];415402 int val_len, timeout = 10;416403···434419 buf[0] = value_set & 0xff;435420 buf[1] = (value_set >> 8) & 0xff;436421 while (timeout-- > 0)437437- if (snd_usb_ctl_msg(cval->mixer->chip->dev,438438- usb_sndctrlpipe(cval->mixer->chip->dev, 0),439439- request,422422+ if (snd_usb_ctl_msg(chip->dev,423423+ usb_sndctrlpipe(chip->dev, 0), request,440424 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,441441- validx, cval->mixer->ctrlif | (cval->id << 8),425425+ validx, snd_usb_ctrl_intf(chip) | (cval->id << 8),442426 buf, val_len, 100) >= 0)443427 return 0;444428 snd_printdd(KERN_ERR "cannot set ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d, data = %#x/%#x\n",445445- request, validx, cval->mixer->ctrlif | (cval->id << 8), cval->val_type, buf[0], buf[1]);429429+ request, validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), cval->val_type, buf[0], buf[1]);446430 return -EINVAL;447431}448432···596582 switch (iterm->type >> 16) {597583 case UAC_SELECTOR_UNIT:598584 strcpy(name, "Selector"); return 8;599599- case UAC_PROCESSING_UNIT_V1:585585+ case UAC1_PROCESSING_UNIT:600586 strcpy(name, "Process Unit"); return 12;601601- case UAC_EXTENSION_UNIT_V1:587587+ case UAC1_EXTENSION_UNIT:602588 strcpy(name, "Ext Unit"); return 8;603589 case UAC_MIXER_UNIT:604590 strcpy(name, "Mixer"); return 5;···686672 term->name = uac_selector_unit_iSelector(d);687673 return 0;688674 }689689- case UAC_PROCESSING_UNIT_V1:690690- case UAC_EXTENSION_UNIT_V1: {675675+ case UAC1_PROCESSING_UNIT:676676+ case UAC1_EXTENSION_UNIT: {691677 struct uac_processing_unit_descriptor *d = p1;692678 if (d->bNrInPins) {693679 id = d->baSourceID[0];···759745 */760746static int get_min_max(struct usb_mixer_elem_info *cval, int default_min)761747{748748+ struct snd_usb_audio *chip = cval->mixer->chip;749749+762750 /* for failsafe */763751 cval->min = default_min;764752 cval->max = cval->min + 1;···783767 if (get_ctl_value(cval, UAC_GET_MAX, (cval->control << 8) | minchn, &cval->max) < 0 ||784768 get_ctl_value(cval, UAC_GET_MIN, (cval->control << 8) | minchn, &cval->min) < 0) {785769 snd_printd(KERN_ERR "%d:%d: cannot get min/max values for control %d (id %d)\n",786786- cval->id, cval->mixer->ctrlif, cval->control, cval->id);770770+ cval->id, snd_usb_ctrl_intf(chip), cval->control, cval->id);787771 return -EINVAL;788772 }789773 if (get_ctl_value(cval, UAC_GET_RES, (cval->control << 8) | minchn, &cval->res) < 0) {···12151199 }12161200 } else { /* UAC_VERSION_2 */12171201 for (i = 0; i < 30/2; i++) {12181218- /* From the USB Audio spec v2.0:12191219- bmaControls() is a (ch+1)-element array of 4-byte bitmaps,12201220- each containing a set of bit pairs. If a Control is present,12211221- it must be Host readable. If a certain Control is not12221222- present then the bit pair must be set to 0b00.12231223- If a Control is present but read-only, the bit pair must be12241224- set to 0b01. If a Control is also Host programmable, the bit12251225- pair must be set to 0b11. The value 0b10 is not allowed. */12261202 unsigned int ch_bits = 0;12271203 unsigned int ch_read_only = 0;12281204···18631855 return parse_audio_selector_unit(state, unitid, p1);18641856 case UAC_FEATURE_UNIT:18651857 return parse_audio_feature_unit(state, unitid, p1);18661866- case UAC_PROCESSING_UNIT_V1:18581858+ case UAC1_PROCESSING_UNIT:18671859 /* UAC2_EFFECT_UNIT has the same value */18681860 if (state->mixer->protocol == UAC_VERSION_1)18691861 return parse_audio_processing_unit(state, unitid, p1);18701862 else18711863 return 0; /* FIXME - effect units not implemented yet */18721872- case UAC_EXTENSION_UNIT_V1:18641864+ case UAC1_EXTENSION_UNIT:18731865 /* UAC2_PROCESSING_UNIT_V2 has the same value */18741866 if (state->mixer->protocol == UAC_VERSION_1)18751867 return parse_audio_extension_unit(state, unitid, p1);···19131905 struct usb_host_interface *hostif;19141906 void *p;1915190719161916- hostif = &usb_ifnum_to_if(mixer->chip->dev, mixer->ctrlif)->altsetting[0];19081908+ hostif = mixer->chip->ctrl_intf;19171909 memset(&state, 0, sizeof(state));19181910 state.chip = mixer->chip;19191911 state.mixer = mixer;···19331925 p = NULL;19341926 while ((p = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, p, UAC_OUTPUT_TERMINAL)) != NULL) {19351927 if (mixer->protocol == UAC_VERSION_1) {19361936- struct uac_output_terminal_descriptor_v1 *desc = p;19281928+ struct uac1_output_terminal_descriptor *desc = p;1937192919381930 if (desc->bLength < sizeof(*desc))19391931 continue; /* invalid descriptor? */···20051997 list_for_each_entry(mixer, &chip->mixer_list, list) {20061998 snd_iprintf(buffer,20071999 "USB Mixer: usb_id=0x%08x, ctrlif=%i, ctlerr=%i\n",20082008- chip->usb_id, mixer->ctrlif,20002000+ chip->usb_id, snd_usb_ctrl_intf(chip),20092001 mixer->ignore_ctl_error);20102002 snd_iprintf(buffer, "Card: %s\n", chip->card->longname);20112003 for (unitid = 0; unitid < MAX_ID_ELEMS; unitid++) {···21232115 int buffer_length;21242116 unsigned int epnum;2125211721262126- hostif = &usb_ifnum_to_if(mixer->chip->dev, mixer->ctrlif)->altsetting[0];21182118+ hostif = mixer->chip->ctrl_intf;21272119 /* we need one interrupt input endpoint */21282120 if (get_iface_desc(hostif)->bNumEndpoints < 1)21292121 return 0;···21662158 if (!mixer)21672159 return -ENOMEM;21682160 mixer->chip = chip;21692169- mixer->ctrlif = ctrlif;21702161 mixer->ignore_ctl_error = ignore_error;21712162 mixer->id_elems = kcalloc(MAX_ID_ELEMS, sizeof(*mixer->id_elems),21722163 GFP_KERNEL);
-1
sound/usb/mixer.h
···3344struct usb_mixer_interface {55 struct snd_usb_audio *chip;66- unsigned int ctrlif;76 struct list_head list;87 unsigned int ignore_ctl_error;98 struct urb *urb;
···3232#include "helper.h"3333#include "endpoint.h"3434#include "pcm.h"3535+#include "clock.h"35363637/*3738 * handle the quirks for the contained interfaces