firewire-lib: Add quirks for Fireworks chipset

This commit adds three modifications for Fireworks quirks.

1. This module handle transmitted packets with both TAG0 and TAG1

In IEC 61883-1, each common isochronous packet (CIP) has 'tag' field in its
packet header. The value is generally 0x01 (CIP header is included = TAG1).
But Fireworks in IEC 61883-1/6 compliant mode transmits 'no data' packet with
0x00 (No CIP header is included = TAG0) but the packet includes CIP structure.
For duplex streams synchronization, this packets must be handled.

Current firewire-lib supports packet with TAG1. This commit makes firewire-lib
to support both TAG0 and TAG1 for this quirk.

When handling CIP packet with invalid header, this module already output
'Invalid CIP header for AMDTP' log and continue to process.

(I note this 'no data' packet is out of specification because it includes no
dummy data. In IEC 61883-6, 'no data' packet is generated by two ways. One is
empty CIP packet defined in IEC 61883-1. Another is 'special non-empty packet'
defined in IEC 61883-6. Fireworks uses strange combination of them.)

2. This module calculate data block size by itself don't check counter.
One of Fireworks device, AudioFirePre8, always reports 8 data block size in
transmitted packets and the data block counter is incremented by 8. But this is
wrong. This commit force this module to calculate data block size and not to
check counter continuity.

3. The driver can indicate the number of first data blocks in which this module
put MIDI messages for out stream.
This commit add 'blocks_for_midi' member to 'amdtp_stream' structure for this
purpose. Fireworks can pick up MIDI messages in first 8 data blocks and ignore
in other data blocks.

I confirm these quirks in firmware version 4.8 to 5.8. I have no investigation
for the other versions.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
bebob: Add skelton for BridgeCo BeBoB based devices

This commit add a new driver with no functionality.
This driver just reacts to Firewire bus events and create/remove card instance.

Current supported devices:
 - Edirol FA-66/FA-101
 - Mackie OnyxFirewire
 - Tascam  IF-FW/DM
 - Behringer X32
 - Apogee Rosetta200
 - ESI Quotafire610
 - AcousticReality eARMasterOne
 - CME MatrixKFW
 - Phonic HB24U
 - BridgeCo RDAudio1/Audio5
bebob: Add command and stream management

This commit adds BridgeCo's AV/C extension commands and connection/stream
management. The driver can get channel combination with the commands.
bebob: Add proc interface for debug

This commit adds proc interface to get chipset information and stream
formation for debug.
bebob: Add functionality to change sampling rate and control interface

This commit adds the functionality to change sampling rate. To debug this,
this commit also adds control interface. I plan to extend this control
interface for the other functionality.
bebob: Add MIDI interface

This commit adds the functionality to capture/playback MIDI message. MIDI
message is multiplexed/demultiplexed into AMDTP stream.
bebob: Add PCM interface

This commit adds the functionality to capture/playback PCM samples.

PCM samples are multiplexed/demultiplexed into AMDTP stream safely with stream
helper functions.
bebob: Add hwdep interface to lock/unlock streaming

This is for mixer/control application in user land. The application can
lock/unlock kernel streaming or get notification at starting/stopping kernel
streaming to use hwdep interface.
bebob: Prepare for device specific operations

This commit is for some devices designed for semi-professional use. They have
some model specific functionality and quirks.

Many functionality should be implemented in user land. Then this commit adds
functionality related to stream such as sampling frequency or clock source. And
some device need cue to load firmware. This commit adds this mechanism. For
debugging, this commit adds the functionality to get metering information if
it's available.

To help these functionalities, this commit adds some AV/C commands in 'AV/C
Audio Subunit Specification (1394TA)' and 'Connection and Compatibility
Management(1394TA)'.
bebob: add support for M-Audio Firewire series

This commit allows this driver to support all of models which M-Audio produces
with BeBoB chipset. They are:
 - Firewire Solo
 - Firewire AudioPhile
 - Firewire 410
 - Firewire 1814
 - Ozonic
 - NRV10
 - ProjectMix I/O
 - FirewireLightBridge

This commit adds M-Audio specific operations, quirks and functionalities. They
are categorized to three parts.

1. send cue to load firmware
This is for 'Firewire Audiophile', 'Firewire410', 'Firewire1814' and
'ProjectMix I/O'. With firmware version 5058 or later, they wait to receive a
cue to load firmware just after powering on. With less firmware version, they
wait to upload firmware binary blob so this driver can't handle this versions.
This functionality can be implemented in user land but currently in kernel land
for my convinience.

2. switching source of clock
This if for 'Firewire Solo', 'Firewire Audiophile', 'Firewire410',
'Firewire1814' and'ProjectMix I/O'. They can switch source of clock with signal
source command but the value of parameters is a bit different.

3. handling metering information
This is all of models, mainly for my debugging. This information includes
information for clock synchronization.

Firewire1814 and ProjectMix I/O has heavily customized BeBoB chipset. The usual
operation to handle BeBoB chipset cannot be applied for them. For this reason,
this commit add some model specific members in 'struct snd_bebob' and model
specific functions.
bebob: Add support for Focusrite Saffire/SaffirePro series

This commit allows this driver to support all of models which Focusrite
produces with BeBoB chipset. They are:
 - Saffire
 - Saffire LE
 - SaffirePro 10 I/O
 - SaffirePro 26 I/O

This commit adds Focusrite specific operations, quirks for its four
functionalities.

1. Switching source of clock
2. Change sampling frequency
3. Check clock synchronization
4. Get metering information

The driver uses these functionalities to read/write specific address by async
transaction.
bebob: Add support for Terratec PHASE series

This commit allows this driver to support all of models which Terratec produced
with BeBoB chipset. They are:
 - PHASE 24 FW
 - PHASE X24 FW
 - PHASE 88 Rack FW

This commit adds Terratec specific operations, quirks for three functionalities.

1. Switching source of clock
2. Change sampling frequency
3. Check clock synchronization

The driver uses these functionalities with AV/C vendor specific commands and
AV/C Audio Subunit commands.
bebob: Add support for Yamaha GO series

This commit allows this driver to support all of models which Yamaha produced
with BeBoB chipset. They are:
 - GO44
 - GO46

This commit adds Yamaha specific operations, quirks for three functionalities.

1. Switching source of clock
2. Detecting signal in digital input
3. Check clock synchronization

The driver uses these functionalities with AV/C vendor specific commands and
AV/C Audio Subunit commands.
bebob: Add support for Presonus FIREBOX/FIREPOD

This commit allows this driver to support FIREBOX/FIREPOD which PreSonus
produced with BeBoB chipset.

This commit adds FIREBOX specific operations for switching source of clock
with AV/C Signal Cource command. FIREPOD is not tested so use normal spec.
fireworks: Add skelton for Echo Audio Fireworks based devices

This commit add a new driver with no functionality. This driver just reacts to
Firewire bus events and create/remove card instance.

Current supported devices:
 - Mackie Onyx 400F/1200F
 - Echo AudioFire8(until 2009 July)/AudioFire12
 - Echo AudioFire2/4/8(since 2009 July)/Pre8
 - Echo Fireworks 8/HDMI
 - Gibson RIP/GoldTop
fireworks: add Echo Fireworks Command and Response

Fireworks uses its own system to command/response. Previously this is over
AV/C vendor dependent command but recent firmware don't use this type. Then
command to and response from specific addresses.

The address to receive response give us an issue. When this driver allocate its
own callback function into the address, then user-land implement cannot allocate
its own callback function via Juju interface. Currently this commit don't solve
this issue. This issue must be resolved in future.
fireworks: Add stream and connection management

Fireworks transmit/receive AMDTP stream with a few quirks and manage the
connection by CMP.
fireworks: Add proc interface for debugging

This commit add proc interface to output infomation for debugging.
 - hardware capabilities
 - clock
 - meters
fireworks: Add control interface

Currently supported controls are:
 - switching source of clock
 - change sampling rate
 - change S/PDIF format
 - change Digital interface mode

They are mainly for my debugging.
fireworks: Add MIDI interface

This commit adds the functionality to capture/playback MIDI message. MIDI
message is multiplexed/demultiplexed into AMDTP stream.