aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/fireworks (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-08-05ALSA: fireworks: support AMDTP domainTakashi Sakamoto2-43/+51
This commit adds AMDTP domain support for ALSA fireworks driver. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-08-05ALSA: fireworks: code refactoring for bus reset handlerTakashi Sakamoto1-8/+5
This commit is a preparation to support AMDTP domain. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-08-05ALSA: fireworks: code refactoring for initialization/destruction of AMDTP streamsTakashi Sakamoto1-41/+36
This commit is a preparation to support AMDTP domain. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-07-22ALSA: firewire-lib: obsolete ctx_data.tx.first_dbc with CIP_UNALIGHED_DBC flagTakashi Sakamoto1-1/+1
Recent firmware for Fireworks board module have a quirk to start transmission of CIP with non-zero value for its data block counter. In current implementation of ALSA firewire stack, the quirk is handled by 'struct amdtp_stream.ctx_data.tx.first_dbc' with value 0x02. However, the value comes from reverse engineering. It's better to handle this quirk without the explicit value. In a process to parse CIP header, the quirk of data block counter affects decision of sequence index in sequence-multiplexed data channel; i.e. MIDI conformant data channel. In Fireworks, the index is decided by the number of data blocks from top of the same CIP, thus the value of data block counter is useless. This commit adds CIP_UNALIGHED_DBC flag and obsoletes the explicit value for this quirk. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-07-08Merge tag 'asoc-v5.3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai10-18/+10
ASoC: Updates for v5.3 This is a very big update, mainly thanks to Morimoto-san's refactoring work and some fairly large new drivers. - Lots more work on moving towards a component based framework from Morimoto-san. - Support for force disconnecting muxes from Jerome Brunet. - New drivers for Cirrus Logic CS47L35, CS47L85 and CS47L90, Conexant CX2072X, Realtek RT1011 and RT1308. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-07-07ALSA: fireworks: fix wrong reference count for stream functionality at error path of rawmidi interfaceTakashi Sakamoto1-0/+2
In IEC 61883-6, several types of sampling data can be multiplexed into payload of common isochronous packet (CIP). For typical audio and music units, PCM samples and MIDI messages are multiplexed into one packet streaming. ALSA fireworks driver allows applications of rawmidi interface to start packet streaming for transmission of MIDI messages. However at error path, the reference count of stream functionality is not operated correctly. This can brings a bug that packet streaming is not stopped when all referrers release the count. This commit fixes the bug. Fixes: 3d7250667ea9 ("ALSA: fireworks: configure sampling transfer frequency in pcm.hw_params callback") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-21ALSA: fireworks: ensure to release isochronous resources in pcm.hw_params callbackTakashi Sakamoto1-0/+3
When stopping packet streaming in reserve function for duplex streams, isochronous resources should be released. Fixes: 7bc93821a70a ("ALSA: firewire-lib: split allocation of isochronous resources from establishment of connection") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-17ALSA: firewire-lib: split allocation of isochronous resources from establishment of connectionTakashi Sakamoto1-5/+17
In current implementation, establishment connection corresponds to allocation of isochronous resources. Although this is an ideal implementation of CMP described in IEC 61883-1, it's not enough efficient to recover PCM substream multiplexed in packet streaming. The packet streaming can always restart on the same allocated isochronous resources even if the previous packet streaming corrupted. This commit splits allocation of isochronous resources from establishment of connection so that CMP runs with allocated isochronous resources. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-17ALSA: fireworks: change the range of critical section for stream data in PCM.hw_free callbackTakashi Sakamoto1-4/+5
The operation of duplex streams should be in critical section. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-12ALSA: fireworks: don't set XRUN in stop streamingTakashi Sakamoto1-1/+0
When stopping packet streaming, no need to stop PCM substream with XRUN state. This commit suppresses it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-12ALSA: fireworks: configure stream parameters in pcm.hw_params callbackTakashi Sakamoto1-33/+49
This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. This commit splits out an operation to configure stream parameters into pcm.hw_params callback. In pcm.prepare callback, establishing connections and start isochronous contexts. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-12ALSA: fireworks: configure sampling transfer frequency in pcm.hw_params callbackTakashi Sakamoto4-32/+57
This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. At present, several operations are done in pcm.prepare callback. To reduce load of the callback, This commit splits out an operation to set sampling transfer frequency in pcm.hw_params callback. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-12ALSA: fireworks: code refactoring for pcm.hw_params/hw_freeTakashi Sakamoto1-39/+6
Two sets of callbacks for pcm.hw_params/hw_free but they have the same codes. This commit unifies each of the callbacks. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-12ALSA: fireworks: code refactoring for rawmidi.open/closeTakashi Sakamoto1-39/+6
Two sets of callbacks for rawmidi.open/close but they have the same codes. This commit unifies each of the callbacks. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-12ALSA: fireworks: unify substream counterTakashi Sakamoto4-27/+19
This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. It's inconvenient to handle two isochronous context separately each other. This commit unifies the counters to handle the two at the same time. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345Thomas Gleixner9-18/+9
Based on 1 normalized pattern(s): licensed under the terms of the gnu general public license version 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 88 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000437.521539229@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-22ALSA: firewire-lib: use union for directional parametersTakashi Sakamoto1-2/+2
Some parameters of struct amdtp_stream is dependent on direction. This commit uses union for such parameters to distinguish from common parameters. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner1-0/+1
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-06ALSA: firewire: Remove superfluous snd_info_register() callsTakashi Iwai1-10/+2
The calls of snd_info_register() are superfluous and should be avoided at the procfs creation time. They are called at the end of the whole initialization via snd_card_register(). This patch drops such superfluous calls. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10ALSA: firewire: simplify cleanup process when failing to register sound cardTakashi Sakamoto1-21/+7
In former commits, .private_free callback releases resources just for data transmission. This release function can be called without the resources are actually allocated in error paths. This commit applies a small refactoring to clean up codes in error paths. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10ALSA: bebob/fireworks: simplify handling of local device entry tableTakashi Sakamoto1-14/+7
In drivers of ALSA firewire stack, bebob and fireworks drivers have local device entry table. At present, critical section to operate the table is from the beginning/end of 'do_registration' call. This can be more narrow and simplify codes. This commit applies small refactoring for the above purpose. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10ALSA: firewire: release reference count of firewire unit in .remove callback of bus driverTakashi Sakamoto1-6/+3
In a previous commit, drivers in ALSA firewire stack blocks .remove callback of bus driver. This enables to release members of private data in the callback after releasing device of sound card. This commit simplifies codes to release the members. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-10ALSA: firewire: block .remove callback of bus driver till all of ALSA character devices are releasedTakashi Sakamoto1-2/+2
At present, in .remove callback of bus driver just decrease reference count of device for ALSA card instance. This delegates release of the device to a process in which the last of ALSA character device is released. On the other hand, the other drivers such as for devices on PCIe are programmed to block .remove callback of bus driver till all of ALSA character devices are released. For consistency of behaviour for whole drivers, this probably confuses users. This commit takes drivers in ALSA firewire stack to imitate the above behaviour. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04ALSA: fireworks: use managed-resource to maintain response bufferTakashi Sakamoto1-6/+3
ALSA fireworks driver allocates memory object to handle response from target unit. The object is used to initiate transaction unique to Fireworks board module. This can be released as managed-resource of 'struct snd_card.card_dev'. This commit uses managed-resource of the sound card device for this purpose. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-10-04ALSA: firewire: use managed-resource of fw unit device for private dataTakashi Sakamoto1-4/+2
At present, private data of each driver in ALSA firewire stack is allocated/freed by kernel slab allocator for corresponding unit on IEEE 1394 bus. In this case, resource-managed slab allocator is available to release memory object automatically just before releasing device structure for the unit. This idea can prevent runtime from memory leak due to programming mistakes. This commit uses the allocator for the private data. These drivers already use reference counter to maintain lifetime of device structure for the unit by a pair of fw_unit_get()/fw_unit_put(). The private data is safely released in a callback of 'struct snd_card.private_free(). Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-09-17ALSA: fireworks: fix memory leak of response buffer at error pathTakashi Sakamoto1-0/+2
After allocating memory object for response buffer, ALSA fireworks driver has leak of the memory object at error path. This commit releases the object at the error path. Fixes: 7d3c1d5901aa('ALSA: fireworks: delayed registration of sound card') Cc: <stable@vger.kernel.org> # v4.7+ Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-18ALSA: pcm: Nuke snd_pcm_lib_mmap_vmalloc()Takashi Iwai1-1/+0
snd_pcm_lib_mmap_vmalloc() was supposed to be implemented with somewhat special for vmalloc handling, but in the end, this turned to just the default handler, i.e. NULL. As the situation has never changed over decades, let's rip it off. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-28sound: Use octal not symbolic permissionsJoe Perches1-1/+1
Convert the S_<FOO> symbolic permissions to their octal equivalents as using octal and not symbolic permissions is preferred by many as more readable. see: https://lkml.org/lkml/2016/8/2/1945 Done with automated conversion via: $ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace <files...> Miscellanea: o Wrapped one multi-line call to a single line Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-11vfs: do bulk POLL* -> EPOLL* replacementLinus Torvalds1-2/+2
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-11-27sound: annotate ->poll() instancesAl Viro1-2/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-08-22ALSA: firewire: add const qualifier to identifiers for read-only symbolsTakashi Sakamoto1-1/+1
Drivers in ALSA firewire stack still includes some symbols which can be moved to a section for read-only symbols. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-08ALSA: firewire: arrange common PCM info/constraints for AMDTP engine applicationsTakashi Sakamoto1-21/+0
In ALSA firewire stack, 8 drivers uses IEC 61883-1/6 engine for data transmission. They have common PCM info/constraints and duplicated codes. This commit unifies the codes into fireiwre-lib. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-06-07ALSA: firewire: process packets in 'struct snd_pcm_ops.ack' callbackTakashi Sakamoto1-0/+16
In recent commit for ALSA PCM core, some arrangement is done for 'struct snd_pcm_ops.ack' callback. This is called when appl_ptr is explicitly moved in intermediate buffer for PCM frames, except for some cases described later. For drivers in ALSA firewire stack, usage of this callback has a merit to reduce latency between time of PCM frame queueing and handling actual packets in recent isochronous cycle, because no need to wait for software IRQ context from isochronous context of OHCI 1394. If this works well in a case that mapped page frame is used for the intermediate buffer, user process should execute some commands for ioctl(2) to tell the number of handled PCM frames in the intermediate buffer just after handling them. Therefore, at present, with a combination of below conditions, this doesn't work as expected and user process should wait for the software IRQ context as usual: - when ALSA PCM core judges page frame mapping is available for status data (struct snd_pcm_mmap_status) and control data (struct snd_pcm_mmap_control). - user process handles PCM frames by loop just with 'snd_pcm_mmap_begin()' and 'snd_pcm_mmap_commit()'. - user process uses PCM hw plugin in alsa-lib to operate I/O without 'sync_ptr_ioctl' option. Unfortunately, major use case include these three conditions. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-22ALSA: firewire: remove support for 16 bit PCM samples in playback substreamTakashi Sakamoto1-4/+0
In IEC 61883-6, AM824 is described as format of data block. In this format, one data block consists of several data channels, which is aligned to 32 bit. One data channel has 8 bit label field and 24 bit data field. PCM frames are transferred in Multi Bit Linear Audio (MBLA) data channel. This channel can include 16/20/24 bit PCM sample. As long as I know, models which support IEC 61883-1/6 doesn't allow to switch bit length of PCM sample in MBLA data channel. They always transmit/receive PCM frames of 24 bit length. This can be seen for the other models which support protocols similar to IEC 61883-1/6. On the other hand, current drivers for these protocols supports 16 bit length PCM sample in playback substream. In this case, PCM sample is put into the MBLA data channel with 8 bit padding in LSB side. Although 16 bit PCM sample is major because it's in CD format, this doesn't represent device capability as is. This commit removes support for 16 bit PCM samples in playback substream. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-02sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h>Ingo Molnar1-0/+1
Fix up affected files that include this signal functionality via sched.h. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-01-12ALSA: firewire: Constify snd_rawmidi_opsTakashi Iwai1-2/+2
Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi, we can constify the definitions. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-05ALSA: fireworks: enclose identifiers referred by single functionTakashi Sakamoto3-51/+46
Some identifiers are referred just by one functions. In this case, they can be put into the function definition. This brings two merits; readers can easily follow codes related to the identifiers, developers are free from name conflict. This commit moves such identifiers to each function definition. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-03ALSA: fireworks: fix asymmetric API call at unit removalTakashi Sakamoto1-1/+1
ALSA fireworks driver has a bug not to call an API to destroy 'cmp_connection' structure for input direction. Currently this causes no issues because it just destroys 'mutex' structure, while it's better to fix it for future work. Fix: d23c2cc4485d ("ALSA: fireworks/bebob/dice/oxfw: allow stream destructor after releasing runtime") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-31ALSA: fireworks: accessing to user space outside spinlockTakashi Sakamoto4-25/+56
In hwdep interface of fireworks driver, accessing to user space is in a critical section with disabled local interrupt. Depending on architecture, accessing to user space can cause page fault exception. Then local processor stores machine status and handles the synchronous event. A handler corresponding to the event can call task scheduler to wait for preparing pages. In a case of usage of single core processor, the state to disable local interrupt is worse because it don't handle usual interrupts from hardware. This commit fixes this bug, performing the accessing outside spinlock. This commit also gives up counting the number of queued response messages to simplify ring-buffer management. Reported-by: Vaishali Thakkar <vaishali.thakkar@oracle.com> Cc: stable@vger.kernel.org Fixes: 555e8a8f7f14('ALSA: fireworks: Add command/response functionality into hwdep interface') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-05-10ALSA: fireworks: drop reuse of incoming packet parameter for ougoing packet parameterTakashi Sakamoto2-68/+17
On Fireworks board module of Echo Audio, TSB43Cx43A (IceLynx Micro, iCEM) is used to process payload of isochronous packets. There's an public document of this chip[1]. This document is for firmware programmers to transfer/receive AMDTP with IEC60958 data format, however in clause 2.5, 2.6 and 2.7, we can see system design to utilize the sequence of value in SYT field of CIP header. In clause 2.3, we can see the specification of Audio Master Clock (MCLK) from iCEM. Well, this clock is actually not used for sampling clock. This can be confirmed when corresponding driver transfer random value as the sequence of SYT field. Even if in this case, the unit generates proper sound. Additionally, in unique command set for this board module, the format of CIP is changed; for IEC 61883-6 mode which we use, and for Windows Operating System. In the latter mode, the whole 32 bit field in second CIP header from Windows driver is used to represent counter of packets (NO-DATA code is still used for packets without data blocks). If the master clock was physically used by DSP on the board module, the Windows driver must have transferred correct sequence of SYT field. Furthermore, as long as seeing capacities of AudioFire2, AudioFire4, AudioFire8, AudioFirePre8 and AudioFire12, these models don't support SYT-Match clock source. Summary, we have no need to relate incoming/outgoing packets. This commit drops reusing SYT sequence of incoming packets for outgoing packets. [1] Using TSB43Cx43A: S/PDIF over 1394 (2003, Texus Instruments Incorporated) http://www.ti.com/analog/docs/litabsmultiplefilelist.tsp?literatureNumber=slla148&docCategoryId=1&familyId=361 Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-31ALSA: fireworks: delayed registration of sound cardTakashi Sakamoto2-47/+103
When some fireworks units are connected sequentially, userspace applications are involved at bus-reset state on IEEE 1394 bus. In the state, any communications can be canceled. Therefore, sound card registration should be delayed till the bus gets calm. This commit achieves it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-28ALSA: fireworks: move model quirk detection code to information parserTakashi Sakamoto1-10/+11
Currently, model-specific quirks are detected out of information parser, however it's natural to detect it in the parser. This commit applies the idea. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-20ALSA: fireworks: serialize transactions to update connections at bus resetTakashi Sakamoto2-4/+5
In IEC 61883-1, at bus-reset, applications can continue isochronous streaming by updating connections. In ALSA fireworks driver, the operation is executed in 'update' handler for bus driver. The connection resources are also changed in process contexts of PCM/MIDI applications. Therefore, bus-reset handling has race condition against connection. Current ALSA fireworks driver has a bug for the condition. This commit fixes the bug, by expand critical section with mutex. As a result, connection updating operation in bus-reset handler and connection changing operation in process context are serialized. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-11-14ALSA: fireworks: change type of substream counter from atomic_t to unsigned intTakashi Sakamoto4-23/+22
The counter is incremented/decremented in critical section protected with mutex. Therefore, no need to use atomic_t. This commit changes the type to unsigned int. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-11-14ALSA: fireworks: move mutex from function callees to callersTakashi Sakamoto3-11/+24
Currently, critical section is protected by mutex in functions of fireworks_stream.c. Callers increments/decrements substreams counter before calling the functions. Moving mutex to the callers code allows to change type of the substeram counter from atomic_t to unsigned int. This commit is a preparation for obsoleting usage of atomic_t for substream counter. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-10-19ALSA: fireworks: use u32 type for be32_to_cpup() macroTakashi Sakamoto1-1/+1
In former commit, snd_efw_command_get_phys_meters() was added to handle metering data. The given buffer is used to save transaction result and to convert between endianness. But this causes sparse warnings. fireworks_command.c:269:25: warning: incorrect type in argument 1 (different base types) fireworks_command.c:269:25: expected unsigned int [usertype] *p fireworks_command.c:269:25: got restricted __be32 [usertype] * This commit fixes this bug. Fixes: bde8a8f23bbe('ALSA: fireworks: Add transaction and some commands') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-10-18ALSA: fireworks/bebob/oxfw/dice: enable to make as built-inTakashi Sakamoto1-1/+1
When committed to upstream, these four modules had wrong entries for Makefile. This forces them to be loadable modules even if they're set as built-in. This commit fixes this bug. Fixes: b5b04336015e('ALSA: fireworks: Add skelton for Fireworks based devices') Fixes: fd6f4b0dc167('ALSA: bebob: Add skelton for BeBoB based devices') Fixes: 1a4e39c2e5ca('ALSA: oxfw: Move to its own directory') Fixes: 14ff6a094815('ALSA: dice: Move file to its own directory') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-29ALSA: firewire-lib: rename macros with AM824 prefixTakashi Sakamoto2-8/+8
This commit renames some macros just related to AM824 format. In later commit, they're moved to AM824 layer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-29ALSA: firewire-lib: rename PCM format helper functionTakashi Sakamoto1-2/+4
Setting the format of PCM substream to AMDTP stream structure is important to set a handler to copy actual PCM samples between buffers. The processing should be in data block processing layer because essentially it has no relationship to packet streaming. This commit renames PCM format setting function to prepare for integrating AM824 layer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-29ALSA: firewire-lib: move MIDI trigger helper function to AM824 layerTakashi Sakamoto1-6/+6
In IEC 61883-6, MIDI messages are transferred in MIDI conformant data channel. Essentially, packet streaming layer is not responsible for MIDI functionality. This commit moves MIDI trigger helper function from the layer to AM824 layer. The rest of codes related to MIDI functionality will be moved in later commits. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>