summaryrefslogtreecommitdiffstats
path: root/sound/firewire/fireface
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'asoc-v5.3' of ↵Takashi Iwai2019-07-0810-18/+10Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus 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>
| * treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345Thomas Gleixner2019-06-059-18/+9Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Merge tag 'sound-5.2-rc3' of ↵Linus Torvalds2019-05-311-5/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "No big surprises here, just a few device-specific fixes. HD-audio received several fixes for Acer, Dell, Huawei and other laptops as well as the workaround for the new Intel chipset. One significant one-liner fix is the disablement of the node-power saving on Realtek codecs, which may potentially cover annoying bugs like the background noises or click noises on many devices. Other than that, a fix for FireWire bit definitions, and another fix for LINE6 USB audio bug that was discovered by syzkaller" * tag 'sound-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: fireface: Use ULL suffixes for 64-bit constants ALSA: hda/realtek - Improve the headset mic for Acer Aspire laptops ALSA: line6: Assure canceling delayed work at disconnection ALSA: hda - Force polling mode on CNL for fixing codec communication ALSA: hda/realtek - Enable micmute LED for Huawei laptops ALSA: hda/realtek - Set default power save node to 0 ALSA: hda/realtek - Check headset type by unplug and resume
| * | treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2019-05-211-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>
* | | Merge branch 'for-linus' into for-nextTakashi Iwai2019-07-011-5/+5
|\ \ \ | | |/ | |/| | | | | | | | | | | | | This back-merge is necessary for adjusting the latest FireWire fix with the recent refactoring in 5.3 development branch. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: fireface: Use ULL suffixes for 64-bit constantsGeert Uytterhoeven2019-05-291-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With gcc 4.1: sound/firewire/fireface/ff-protocol-latter.c: In function ‘latter_switch_fetching_mode’: sound/firewire/fireface/ff-protocol-latter.c:97: warning: integer constant is too large for ‘long’ type sound/firewire/fireface/ff-protocol-latter.c: In function ‘latter_begin_session’: sound/firewire/fireface/ff-protocol-latter.c:170: warning: integer constant is too large for ‘long’ type sound/firewire/fireface/ff-protocol-latter.c:197: warning: integer constant is too large for ‘long’ type sound/firewire/fireface/ff-protocol-latter.c:205: warning: integer constant is too large for ‘long’ type sound/firewire/fireface/ff-protocol-latter.c: In function ‘latter_finish_session’: sound/firewire/fireface/ff-protocol-latter.c:214: warning: integer constant is too large for ‘long’ type Fix this by adding the missing "ULL" suffixes. Add the same suffix to the last constant, to maintain consistency. Fixes: fd1cc9de64c2ca6c ("ALSA: fireface: add support for Fireface UCX") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: unify stop and release method for duplex streamsTakashi Sakamoto2019-06-213-11/+5Star
| | | | | | | | | | | | | | | | | | >From callbacks for pcm and rawmidi interfaces, the functions to stop and release duplex streams are called at the same time. This commit merges the two functions. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: code refactoring for pcm.hw_params/hw_free callbacksTakashi Sakamoto2019-06-111-48/+7Star
| | | | | | | | | | | | | | | | | | | | The pairs of pcm.hw_params callbacks and .hw_free callbacks for both direction have no differences. This commit unifies the pairs. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: minor code refactoring to finish streaming sessionTakashi Sakamoto2019-06-111-17/+6Star
| | | | | | | | | | | | | | | | | | | | | | The operation to finish packet streaming corresponds to stopping isochronous contexts. This commit applies code refactoring to move codes to stop into a helper function to finish the session. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: update isochronous resources when starting packet streaming ↵Takashi Sakamoto2019-06-113-14/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after bus-reset After bus reset, isochronous resource manager releases all of allocated isochronous resources. The nodes to restart packet streaming should request reallocation of the resources. However, between the bus-reset and invocation of 'struct fw_driver.update' handler, ALSA PCM application can detect this situation by XRUN because the target device cancelled to transmit packets once bus-reset occurs. Due to the above mechanism, ALSA fireface driver just stops packet streaming in the update handler, thus pcm.prepare handler should request the reallocation. This commit requests the reallocation in pcm.prepare callback when bus generation is changed. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: reserve/release isochronous resources in ↵Takashi Sakamoto2019-06-113-30/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pcm.hw_params/hw_free callbacks Once allocated, isochronous resources are available for packet streaming, even if the streaming is cancelled. For this reason, current implementation handles allocation of the resources and starting packet streaming at the same time. However, this brings complicated procedure to start packet streaming. This commit separates the allocation and starting. The allocation is done in pcm.hw_params callback and available till pcm.hw_free callback. Even if any XRUN occurs, pcm.prepare callback is done to restart packet streaming for allocated the resources. There are two points to stop packet streaming; in pcm.hw_params and pcm.prepare callbacks. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: support allocate_resources operation in latter protocolTakashi Sakamoto2019-06-111-57/+56Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. This commit implements allocate_resources callback for the protocol specific to latter models. The encoded values of constant table is split into several condition statements to separate the operation to configure sampling transfer frequency from the operation to configure the number of data channels in rx packet. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: support allocate_resources operation in ff400 protocolTakashi Sakamoto2019-06-111-20/+16Star
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. This commit implements allocate_resources callback for ff400 protocol. In this callback, sampling transfer frequency is configured to the device as well. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: support allocate_resources operation in ff800 protocolTakashi Sakamoto2019-06-111-24/+22Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. This commit implements allocate_resources callback for ff800 protocol. As I noted in commit fc716397a5c7 ("ALSA: fireface: add support for packet streaming on Fireface 800"), this unit allocates isochronous resources for tx stream voluntarily. Therefore, this commit is to maintain isochronous rsources for rx stream. In the callback, sampling transfer frequency is configured to the device as well. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: add protocol-specific operation to allocate isochronous ↵Takashi Sakamoto2019-06-112-0/+5
|/ | | | | | | | | | | | | | | resources This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. In ALSA fireface driver, the allocation of isochronous resources is programmed in each implementation of protocol. This commit adds protocol-specific operation for the allocation separated from the operation to begin session. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: firewire: Remove superfluous snd_info_register() callsTakashi Iwai2019-02-061-10/+2Star
| | | | | | | | | | | 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>
* ALSA: fireface: Off by one in latter_handle_midi_msg()Dan Carpenter2019-01-251-1/+1
| | | | | | | | | | The > should be >= or otherwise we potentially read one element beyond the end of the ff->tx_midi_substreams[] array. Fixes: 73f5537fb209 ("ALSA: fireface: support tx MIDI functionality of Fireface UCX") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: comment cleanup about destination address of async ↵Takashi Sakamoto2019-01-243-29/+48
| | | | | | | | | | | | | | | | | | | | | | | | | transactions for MIDI messages In Fireface series, registration of higher 4 bytes of destination address for asynchronous transaction of MIDI messages is done by a write transaction to model-specific register. On the other hand, registration of lower 4 bytes of the address is selectable from 4 options. A register for this registration includes the other purpose options such as input attenuation. Thus this driver expects userspace applications to configure the register. Actual behaviour for the asynchronous transaction is different depending on protocols. In former protocol, destination offset of each transaction is the same as the registered address even if it is block request. In latter models, destination offset of each transaction is the offset of previous transaction plus 4 byte and the transaction is quadlet request. This commit cleanups comments about the above mechanism. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: support rx MIDI functionality for Fireface UCXTakashi Sakamoto2019-01-224-2/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In latter model of Fireface series, asynchronous transaction includes a prefix byte to indicate the way to decode included MIDI bytes. Upper 4 bits of the prefix byte indicates port number, and the rest 4 bits indicate the way to decode rest of bytes for MIDI messages. Basically the rest bits indicates the number of bytes for MIDI message. However, if the last byte of each MIDi message is included, the rest bits are 0xf. For example: message: f0 00 00 66 14 20 00 00 f7 offset: content (big endian, port 0) '0030: 0x02f00000 '0030: 0x03006614 '0030: 0x03200000 '0030: 0x0ff70000 This commit supports encoding scheme for the above and allows applications to transfer MIDI messages via ALSA rawmidi interface. An unused member (running_status) is reused to keep state of transmission of system exclusive messages. For your information, this is a dump of config rom. $ sudo ./hinawa-config-rom-printer /dev/fw1 { 'bus-info': { 'bmc': False, 'chip_ID': 13225063715, 'cmc': False, 'cyc_clk_acc': 0, 'imc': False, 'isc': True, 'max_rec': 512, 'name': '1394', 'node_vendor_ID': 2613}, 'root-directory': [ [ 'NODE_CAPABILITIES', { 'addressing': {'64': True, 'fix': True, 'prv': False}, 'misc': {'int': False, 'ms': False, 'spt': True}, 'state': { 'atn': False, 'ded': False, 'drq': True, 'elo': False, 'init': False, 'lst': True, 'off': False}, 'testing': {'bas': False, 'ext': False}}], ['VENDOR', 2613], ['DESCRIPTOR', 'RME!'], ['EUI_64', 2873037108442403], [ 'UNIT', [ ['SPECIFIER_ID', 2613], ['VERSION', 4], ['MODEL', 1054720], ['DESCRIPTOR', 'Fireface UCX']]]]} Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add protocol-specific operation to fill transaction buffer ↵Takashi Sakamoto2019-01-223-19/+38
| | | | | | | | | | | | | with MIDI messages Between former and latter models, content of asynchronous transaction for MIDI messages from driver to device is different. This commit is a preparation to support latter models. A protocol-specific operation is added to encode MIDI messages to the transaction. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add model-dependent parameter for address to receive async ↵Takashi Sakamoto2019-01-223-5/+6
| | | | | | | | | | | | transaction for MIDI messages Between former and latter models, destination address to receive asynchronous transactions for MIDI messages is different. This commit adds model-dependent parameter for the addresses. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: support tx MIDI functionality of Fireface UCXTakashi Sakamoto2019-01-222-14/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fireface UCX transfers asynchronous transactions for MIDI messages. One transaction includes quadlet data therefore it can transfer 3 message bytes as maximum. Base address of the destination is configured by two settings; a register for higher 8 byte of the address, and a bitflag to option register indicates lower 8byte. The register for higher address is 0x'ffff'0000'0034. Unfortunately, firmware v24 includes a bug to ignore registered value for the destination address and transfers to 0x0001xxxxxxxx always. This driver doesn't work well if the bug exists, therefore users should install the latest firmware (v27). The bitflag is a part of value to be written to option register (0x'ffff'0000'0014). lower addr: bitflag (little endian) '0000'0000: 0x00002000 '0000'0080: 0x00004000 '0000'0100: 0x00008000 '0000'0180: 0x00010000 This register includes more options but they are not relevant to packet streaming or MIDI functionality. This driver don't touch it. Furthermore, the transaction is sent to address offset incremented by 4 byte to the offset in previous time. When it reaches base address plus 0x7c, next offset is the base address. Content of the transaction includes a prefix byte. Upper 4 bits of the byte indicates port number, and the rest 4 bits indicate the way to decode rest of bytes for MIDI message. Except for system exclusive messages, the rest bits are the same as status bits of the message without channel bits. For system exclusive messages, the rest bits are encoded according to included message bytes. For example: message: f0 7e 7f 09 01 f7 offset: content (little endian, port 0) '0000: 0x04f07e7f '0004: 0x070901f7 message: f0 00 00 66 14 20 00 00 00 f7 offset: content (little endian, port 1) '0014: 0x14f00000 '0018: 0x14661420 '001c: 0x14000000 '0020: 0x15f70000 message: f0 00 00 66 14 20 00 00 f7 offset: content (little endian, port 0) '0078: 0x04f00000 '007c: 0x04661420 '0000: 0x070000f7 This commit supports decoding scheme for the above and allows applications to receive MIDI messages via ALSA rawmidi interface. The lower 8 bytes of destination address is fixed to 0x'0000'0000, thus this driver expects userspace applications to configure option register with bitflag 0x00002000 in advance. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add model-dependent parameter for address range to receive ↵Takashi Sakamoto2019-01-223-1/+4
| | | | | | | | | | | | | | | | | async transaction In Fireface series, drivers can register destination address for asynchronous transaction which transfers MIDI messages from device. In former models, all of the transactions arrive at the registered address without any offset. In latter models, each of the transaction arrives at the registered address with sequential offset within 0x00 to 0x7f. This seems to be for discontinuity detection. This commit adds model-dependent member for the address range. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: change prototype of handler for async transaction with MIDI ↵Takashi Sakamoto2019-01-223-4/+9
| | | | | | | | | | | | | | | | | | | messages In a series of Fireface, devices transfer asynchronous transaction with MIDI messages. In the transaction, content is different depending on models. ALSA fireface driver has protocol-dependent handler to pick up MIDI messages from the content. In latter models of the series, the transaction is transferred to range of address sequentially. This seems to check continuity of transferred messages. This commit changes prototype of the handler to receive offset of address for received transactions. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add support for Fireface UCXTakashi Sakamoto2019-01-214-9/+309
| | | | | | | | | | | | | | Fireface UFX was shipped by RME GmbH in 2012. This model supports later protocol for management of isochronous communication and synchronization of sampling transmission frequency. This commit adds support for the model. At present, it's not clear how to encode MIDI messages and decide destination address for asynchronous transaction, thus this commit adds support for isochronous communication for PCM frames only. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: code refactoring to parse of clock configurationTakashi Sakamoto2019-01-213-101/+89Star
| | | | | | | | | | A procedure to retrieve clock configuration is used by two callers. Each of caller has duplicated code to parse bits. This commit adds refactoring to remove the duplicated code. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: code refactoring for dump of sync statusTakashi Sakamoto2019-01-211-101/+75Star
| | | | | | | | This commit adds refactoring for dump of sync status by adding tables for check bits. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add protocol-dependent operation to get clock statusTakashi Sakamoto2019-01-215-70/+71
| | | | | | | | This commit adds a member for a callback function to get clock status to former protocol. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add protocol-dependent operation to switch mode to fetch PCM ↵Takashi Sakamoto2019-01-213-38/+41
| | | | | | | | | | frame This commit adds a member for a callback function to switch frame fetching mode to former protocol. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add protocol-dependent operation to dump statusTakashi Sakamoto2019-01-213-204/+214
| | | | | | | | This commit adds a member for a callback function to dump status and move existing code to former protocol. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: obsolete proc node to leave one nodeTakashi Sakamoto2019-01-211-8/+12
| | | | | | | | | | | | In a series of Fireface, latter protocol has no way for drivers to retrieve current clock configuration. On the other hand, this driver has proc node for it. This commit removes a proc node to dump both clock configuration and synchronization status in one proc node. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: unify protocol layer for FF400/FF800Takashi Sakamoto2019-01-213-163/+148Star
| | | | | | | This commit moves codes for Fireface 400 to a file of former protocol. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: rename protocol layer for former modelsTakashi Sakamoto2019-01-212-8/+7Star
| | | | | | | | | | In a series of Fireface, later model supports different protocol from former models. This commit is a preparation to support both of protocols. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: code refactoring to handle model-specific registersTakashi Sakamoto2018-12-163-15/+6Star
| | | | | | | | | | | As a result of investigation for Fireface 800, 'struct snd_ff_spec.regs' is just for higher address to receive tx asynchronous packets of MIDI messages, thus it can be simplified. This commit simplifies it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add support for packet streaming on Fireface 800Takashi Sakamoto2018-12-162-16/+129
| | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a functionality to multiplex PCM frames into isochronous packets and demultiplex PCM frames from isochronous packets for ALSA PCM applications. Fireface 800 voluntarily maintains resources for tx isochronous communication. It performs reservation of isochronous channel and allocation/update of bandwidth in some cases below: - at a first request to allocation after bus resets - at requests to allocation when further bandwidth is required When request is grant and the unit is prepared, read data from 0x0000801c0008 represents isochronous channel for tx stream, then the unit can handle requests to start communication. If driver send the request without checking the register, the unit takes panic to continue bus resets. The unit starts transmission of tx packets after receiving several rx packets from driver. I note that the unit can process tx/rx packets and generate/record sound regardless of HOST LED. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: allocate isochronous resources in mode-specific implementationTakashi Sakamoto2018-12-162-55/+68
| | | | | | | | | | | The way to maintain isochronous resources on bus is different between Fireface 400/800. This commit is a preparation. This commit moves a function to allocate resource to model-dependent implementation. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: code refactoring to handle multiplier modeTakashi Sakamoto2018-12-163-28/+58
| | | | | | | | | | | | Fireface 400/800 use three modes against the number of data channels in data block for both tx/rx packets. This commit adds refactoring for it. Some enumerators are added to represent each of mode and a function is added to calculate the mode from sampling frequency code (sfc). Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: share helper function to switch fetching modeTakashi Sakamoto2018-12-163-33/+36
| | | | | | | | | | | Both of Fireface 400/800 have the same register to switch frame fetching mode regardless of difference of available number of PCM frames in rx isochronous packet. This commit moves a helper function from model-dependent implementation. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: fix for state to fetch PCM framesTakashi Sakamoto2018-12-161-1/+1
| | | | | | | | | | | | | | According to my memo at hand and saved records, writing 0x00000001 to SND_FF_REG_FETCH_PCM_FRAMES disables fetching PCM frames in corresponding channel, however current implement uses reversed logic. This results in muted volume in device side during playback. This commit corrects the bug. Cc: <stable@vger.kernel.org> # v4.12+ Fixes: 76fdb3a9e13a ('ALSA: fireface: add support for Fireface 400') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add support for Fireface 800 with MIDI functionality onlyTakashi Sakamoto2018-12-114-13/+69
| | | | | | | | | | | | | | | | | | | | Fireface 800 is a flagship model of RME GmbH for audio and music units on IEEE 1394 bus, shipped 2004. This model consists of four chips: - TI TSB81BA3D for physical layer on cable environment of EEE 1394 bus - TI TSB82AA2 for link layer for 1394 OHCI bus bridge to PCI bus - Xilinx Spartan-3 FPGA XC3S400 - Xilinx High-Performance CPLD XC9572XL This commit adds support Fireface 800. In this time, the support is restricted to its MIDI functionality, thus this commit adds some condition statements to avoid touching streaming functionality. Unlike Fireface 400, Fireface 800 has no functionality to suppress asynchronous transactions for MIDI messages except for unregister of listen address in controller side, thus the feature is available as is. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: localize a handler for MIDI messages on tx transactionTakashi Sakamoto2018-12-113-33/+40
| | | | | | | | | | | Content of asynchronous transaction for MIDI messages differs between Fireface 400 and 800. This commit adds a model-specific handler for the transaction and adds arrangement. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add driver data for register for MIDI high addressTakashi Sakamoto2018-12-114-34/+34
| | | | | | | | | | | | | | Fireface 400 and 800 have the same mechanism to decide address to which asynchronous transactions are sent for MIDI messages, however they use different registers for controllers to notify higher 4 byte of the address. This commit adds a model-specific parameter to represent the address. Additionally, it corrects some comments. I note that these two models have a difference to enable/disable the transaction. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: share register for async transaction of MIDI messagesTakashi Sakamoto2018-12-113-8/+5Star
| | | | | | | | | | | | As long as investigating packet dumps from Fireface 400/800, a register to receive asynchronous transactions for MIDI messages is the same. For Fireface 800, minor register is used. This commit declares macros for the transactions and obsoletes model-specific parameters. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: add support for second optical interface for ADAT streamTakashi Sakamoto2018-12-113-10/+30
| | | | | | | | | | | | Unlike Fireface 400, Fireface 800 have two pair of optical interface for ADAT signal and S/PDIF signal. ADAT signals for the interface are handled for sampling clock source separately. This commit modifies a parser for clock configuration to distinguish these two ADAT signals. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: share helper function to get current sampling rate and clock ↵Takashi Sakamoto2018-12-115-64/+63Star
| | | | | | | | | | | | | source As long as investigating packet dumps from Fireface 400/800, bits on status registers for clock synchronization are the same. This commit moves a parser for a register of clock configuration to obsolete model-specific operations. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: share status and configuration dumpTakashi Sakamoto2018-12-113-198/+176Star
| | | | | | | | | | | As long as investigating packet dumps from Fireface 400/800, bits on status registers for clock synchronization are the same. This commit moves a parser for the registers to obsolete model-specific operations. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: share some registers for status of clock synchronizationTakashi Sakamoto2018-12-112-7/+9
| | | | | | | | | | As long as investigating packet dumps from Fireface 400/800, status registers for clock synchronization is common. This commit moves some macros for them to header file. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: fireface: fix reference to wrong register for clock configurationTakashi Sakamoto2018-12-091-1/+1
| | | | | | | | | | | | | | | In an initial commit, 'SYNC_STATUS' register is referred to get clock configuration, however this is wrong, according to my local note at hand for reverse-engineering about packet dump. It should be 'CLOCK_CONFIG' register. Actually, ff400_dump_clock_config() is correctly programmed. This commit fixes the bug. Cc: <stable@vger.kernel.org> # v4.12+ Fixes: 76fdb3a9e13a ('ALSA: fireface: add support for Fireface 400') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: firewire: simplify cleanup process when failing to register sound cardTakashi Sakamoto2018-10-101-10/+5Star
| | | | | | | | | | | | 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>
* ALSA: firewire: release reference count of firewire unit in .remove callback ↵Takashi Sakamoto2018-10-101-6/+3Star
| | | | | | | | | | | | | of bus driver 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>