linux/sound
Takashi Sakamoto 73f5537fb2 ALSA: fireface: support tx MIDI functionality of Fireface UCX
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>
2019-01-22 17:20:51 +01:00
..
ac97
aoa ALSA: aoa: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:51 +01:00
arm ALSA: arm: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:58 +01:00
atmel
core ALSA: pcm: Make snd_pcm_suspend() local static 2019-01-15 17:48:23 +01:00
drivers ALSA: drivers: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:06 +01:00
firewire ALSA: fireface: support tx MIDI functionality of Fireface UCX 2019-01-22 17:20:51 +01:00
hda ALSA: hda: program stripe bits for controller 2019-01-14 19:52:28 +01:00
i2c ALSA: i2c/cs8427: Fix int to char conversion 2018-10-18 15:44:08 +02:00
isa Merge branch 'topic/pcm-device-suspend' into for-next 2019-01-18 17:37:21 +01:00
mips ALSA: mips: Cleanup indirect PCM helper usages 2018-09-04 12:13:46 +02:00
oss
parisc
pci ALSA: hda/tegra: add driver flag for runtime PM 2019-01-22 09:21:56 +01:00
pcmcia ALSA: pcmcia: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:48:04 +01:00
ppc ALSA: ppc: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:45 +01:00
sh
soc ALSA: pcm: Suspend streams globally via device type PM ops 2019-01-15 17:46:36 +01:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next 2018-12-26 10:32:18 -08:00
spi
synth ALSA: emux: Fix potential Spectre v1 vulnerabilities 2018-12-13 09:13:04 +01:00
usb Merge branch 'topic/pcm-device-suspend' into for-next 2019-01-18 17:37:21 +01:00
x86 ALSA: x86: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:39 +01:00
xen ALSA: xen-front: Use Xen common shared buffer implementation 2018-12-18 12:19:37 -05:00
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c