aboutsummaryrefslogtreecommitdiffstats
path: root/sound (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-01-28ALSA: Include linux/io.h instead of asm/io.hTakashi Iwai97-108/+97
Nowadays it's recommended. Replace all in a shot. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: sscape: add missing include of linux/io.hArnd Bergmann1-0/+1
The soundscape driver uses the ISA inb/outb functions declared in linux/io.h, so it needs to include this header to avoid a build error: sscape.c: In function 'sscape_write_unsafe': sscape.c:203:2: error: implicit declaration of function 'outb' [-Werror=implicit-function-declaration] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28Merge branch 'topic/line6' into for-nextTakashi Iwai15-1105/+705
2015-01-28ALSA: line6: Handle error from line6_pcm_acquire()Takashi Iwai2-6/+20
Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Make common PCM pointer callbackTakashi Iwai4-20/+12
Both playback and capture callbacks are identical, so let's merge them. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Reorganize PCM stream handlingTakashi Iwai7-425/+252
The current code deals with the stream start / stop solely via line6_pcm_acquire() and line6_pcm_release(). This was (supposedly) intended to avoid the races, but it doesn't work as expected. The concurrent acquire and release calls can be performed without proper protections, thus this might result in memory corruption. Furthermore, we can't take a mutex to protect the whole function because it can be called from the PCM trigger callback that is an atomic context. Also spinlock isn't appropriate because the function allocates with kmalloc with GFP_KERNEL. That is, these function just lead to singular problems. This is an attempt to reduce the existing races. First off, separate both the stream buffer management and the stream URB management. The former is protected via a newly introduced state_mutex while the latter is protected via each line6_pcm_stream lock. Secondly, the stream state are now managed in opened and running bit flags of each line6_pcm_stream. Not only this a bit clearer than previous combined bit flags, this also gives a better abstraction. These rewrites allows us to make common hw_params and hw_free callbacks for both playback and capture directions. For the monitor and impulse operations, still line6_pcm_acquire() and line6_pcm_release() are used. They call internally the corresponding functions for both playback and capture streams with proper lock or mutex. Unlike the previous versions, these function don't take the bit masks but the only single type value. Also they are supposed to be applied only as duplex operations. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Clear prev_fbuf and prev_fsize properlyTakashi Iwai2-7/+7
Clearing prev_fsize in line6_pcm_acquire() is pretty racy. This can be called at any time while the stream is being played. Rather better to clear prev_fbuf and prev_fsize at the proper place like the stream stop for capture, and just after copying the monitor / impulse data inside the spinlock. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Fix racy loopback handlingTakashi Iwai2-20/+24
The impulse and monitor handling in submit_audio_out_urb() isn't protected thus this can be racy with the capture stream handling. This patch extends the range to protect via each stream's spinlock (now the whole submit_audio_*_urb() are covered), and take the capture stream lock additionally for the impulse and monitor handling part. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Minor tidy up in line6_probe()Takashi Iwai1-11/+9
Move the check of multi configurations before snd_card_new() as a short path, and reduce superfluous pointer references. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Let snd_card_new() allocate private dataTakashi Iwai6-45/+20
Instead of allocating the private data individually in each driver's probe at first, let snd_card_new() allocate the data that is called in line6_probe(). This simplifies the primary probe functions. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Drop interface argument from private_init and disconnect callbacksTakashi Iwai6-30/+31
The interface argument is used just for retrieving the assigned device, which can be already found in line6->ifcdev. Drop them from the callbacks. Also, pass the usb id to private_init so that the driver can deal with it there. This is a preliminary work for the further cleanup to move the whole allocation into driver.c. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Skip volume manipulation during silence copyingTakashi Iwai1-2/+3
A minor optimization; while pausing, the driver just copies the zero that doesn't need any volume changes. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Do clipping in volume / monitor manipulationsTakashi Iwai1-3/+7
Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Consolidate PCM stream buffer allocation and freeTakashi Iwai5-38/+29
The PCM stream buffer allocation and free are identical for both playback and capture streams. Provide single helper functions. These are used only in pcm.c, thus they can be even static. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Use dev_err()Takashi Iwai1-1/+2
This is the last remaining snd_printk() usage in this driver. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Consolidate URB unlink and sync helpersTakashi Iwai5-133/+69
The codes to unlink and sync URBs are identical for both playback and capture streams. Consolidate to single helper functions. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Rearrange PCM structureTakashi Iwai4-208/+142
Introduce a new line6_pcm_stream structure and group individual fields of snd_line6_pcm struct to playback and capture groups. This patch itself just does rename and nothing else. More meaningful cleanups based on these fields shuffling will follow. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Drop voodoo workaroundsTakashi Iwai2-24/+0
If the problem still really remains, we should fix it instead of papering over it like this... Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Use incremental loopTakashi Iwai3-11/+11
Using a decremental loop without particular reasons worsens the readability a lot. Use incremental loops instead. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Drop superfluous spinlock for triggerTakashi Iwai2-22/+6
The trigger callback is already spinlocked, so we need no more lock here (even for the linked substreams). Let's drop it. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Fix the error recovery in line6_pcm_acquire()Takashi Iwai1-6/+6
line6_pcm_acquire() tries to restore the newly obtained resources at the error path. But some flags aren't recorded and released properly when the corresponding buffer is already present. These bits have to be cleared in the error recovery, too. Also, "flags_final" can be initialized to zero since we pass only the subset of "channels" bits. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Use logical ORTakashi Iwai1-2/+2
Fixed a few places using bits OR wrongly for condition checks. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Fix missing error handling in line6_pcm_acquire()Takashi Iwai1-1/+2
Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Reduce superfluous spinlock in midi.cTakashi Iwai2-18/+7
The midi_transmit_lock is used always inside the send_urb_lock, thus it doesn't play any role. Let's kill it. Also, rename "send_urb_lock" as a more simple name "lock" since this is the only lock for midi. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Remove unused line6_nop_read()Takashi Iwai2-12/+0
The function isn't used any longer after rewriting from sysfs to leds class in toneport.c. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Fix memory leak at probe error pathTakashi Iwai1-29/+30
Fix memory leak at probe error path by rearranging the call order in line6_destruct() so that the common destructor is always called. Also this simplifies the error path to a single goto label. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Minor refactoringTakashi Iwai1-45/+49
Split some codes in the lengthy line6_probe(). Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6/toneport: Implement LED controls via LED classTakashi Iwai2-74/+91
Instead of non-standard sysfs, reimplement the LED controls on TonePort as LED class devices. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6/toneport: Fix wrong argument for toneport_has_led()Takashi Iwai1-3/+1
Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Don't forget to call driver's destructor at error pathTakashi Iwai1-0/+2
Currently disconnect callback is used as a driver's destructor, and this has to be called not only at the disconnection time but also at the error paths during probe. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6/toneport: Move setup_timer() at the beginningTakashi Iwai1-4/+5
... so that timer_del_sync() in the destructor can be called safely at any time. Also move the mod_timer() call in toneport_setup(), which is a bit clearer place. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Remove superfluous NULL checks in each driverTakashi Iwai4-38/+8
The interface and driver objects are always set when callbacks are called. Drop such superfluous NULL checks in init and disconnect calls of each driver. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Abort if inconsistent usbdev is found at disconnectTakashi Iwai1-3/+3
It's utterly unsafe to proceed further the disconnect procedure if the assigned usbdev is inconsistent with the expected object. Better to put a WARN_ON() for more cautions and abort immediately. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-28ALSA: line6: Yet more cleanup of superfluous NULL checksTakashi Iwai1-11/+2
... in line6_disconnect() as well. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-26ALSA: seq: remove unused callback_all fieldClemens Ladisch3-7/+2
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-26ALSA: seq: fix off-by-one error in port limit checkClemens Ladisch1-1/+1
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-26ALSA: seq: correctly report maximum number of portsClemens Ladisch1-1/+1
Due to SNDRV_SEQ_ADDRESS_BROADCAST, not all 256 port number values can be used. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-26Merge branch 'for-linus' into for-nextTakashi Iwai22-90/+158
Sync with the latest 3.19-rc state for applying other ALSA sequencer core fixes.
2015-01-26ALSA: seq-dummy: remove deadlock-causing events on closeClemens Ladisch1-31/+0
When the last subscriber to a "Through" port has been removed, the subscribed destination ports might still be active, so it would be wrong to send "all sounds off" and "reset controller" events to them. The proper place for such a shutdown would be the closing of the actual MIDI port (and close_substream() in rawmidi.c already can do this). This also fixes a deadlock when dummy_unuse() tries to send events to its own port that is already locked because it is being freed. Reported-by: Peter Billam <peter@www.pjb.com.au> Cc: <stable@vger.kernel.org> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-26Merge remote-tracking branches 'asoc/fix/rt5677', 'asoc/fix/simple', 'asoc/fix/ts3a227e', 'asoc/fix/wm8904' and 'asoc/fix/wm8960' into asoc-linusMark Brown5-17/+39
2015-01-26Merge remote-tracking branches 'asoc/fix/adi', 'asoc/fix/compress', 'asoc/fix/fsl-ssi', 'asoc/fix/imx', 'asoc/fix/intel', 'asoc/fix/omap', 'asoc/fix/rockchip' and 'asoc/fix/rt286' into asoc-linusMark Brown9-16/+52
2015-01-26Merge remote-tracking branch 'asoc/fix/pcm512x' into asoc-linusMark Brown1-1/+1
2015-01-26Merge remote-tracking branch 'asoc/fix/fsl-esai' into asoc-linusMark Brown1-1/+1
2015-01-20ALSA: hda - Enable docking station for an HP machineTienFu Chen1-0/+13
On this machine we need to inform the driver where the docking station pins are, because it has not been set up by BIOS. Tested-by: TienFu Chen <tienfu.chen@canonical.com> BugLink: https://bugs.launchpad.net/bugs/1412800 Signed-off-by: TienFu Chen <tienfu.chen@canonical.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-20Merge branch 'topic/timer-cleanup' into for-nextTakashi Iwai20-114/+63
2015-01-20Merge branch 'topic/line6' into for-nextTakashi Iwai26-1428/+946
2015-01-20ALSA: line6: Remove driver version from header commentChris Rorvick16-16/+16
The driver version string was removed in an ealier commit for being useless. These are equally useless. Signed-off-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-20ALSA: line6: Refer to manufacturer as "Line 6"Chris Rorvick18-50/+50
The correct spelling includes the space. Fix this in strings and comments that refer to the manufacturer. Signed-off-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-20ALSA: line6: Remove superfluous NULL checksChris Rorvick1-11/+1
Signed-off-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-20ALSA: line6: Drop line6_send_program() and line6_transmit_parameter()Takashi Iwai2-62/+0
Both functions are used nowhere. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>