linux/sound/firewire/fireface
Takashi Sakamoto f0f9f497d4 ALSA: fireface: support rx MIDI functionality for Fireface UCX
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>
2019-01-22 17:20:56 +01:00
..
amdtp-ff.c locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE() 2017-10-25 11:01:08 +02:00
ff-hwdep.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
ff-midi.c ALSA: fireface: support rx MIDI functionality for Fireface UCX 2019-01-22 17:20:56 +01:00
ff-pcm.c ALSA: fireface: add protocol-dependent operation to get clock status 2019-01-21 15:12:20 +01:00
ff-proc.c ALSA: fireface: code refactoring to parse of clock configuration 2019-01-21 15:12:23 +01:00
ff-protocol-former.c ALSA: fireface: add protocol-specific operation to fill transaction buffer with MIDI messages 2019-01-22 17:20:54 +01:00
ff-protocol-latter.c ALSA: fireface: support rx MIDI functionality for Fireface UCX 2019-01-22 17:20:56 +01:00
ff-stream.c ALSA: fireface: add protocol-dependent operation to get clock status 2019-01-21 15:12:20 +01:00
ff-transaction.c ALSA: fireface: add protocol-specific operation to fill transaction buffer with MIDI messages 2019-01-22 17:20:54 +01:00
ff.c ALSA: fireface: support rx MIDI functionality for Fireface UCX 2019-01-22 17:20:56 +01:00
ff.h ALSA: fireface: support rx MIDI functionality for Fireface UCX 2019-01-22 17:20:56 +01:00
Makefile ALSA: fireface: add support for Fireface UCX 2019-01-21 15:12:25 +01:00