From f65be911c0e13fab28919e17c9fa00c38dc4ff2f Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Sat, 19 Sep 2015 11:21:58 +0900 Subject: ALSA: firewire-lib: add helper functions to set positions of data channels In IEC 61883-6, several types of data are available in AM824 format. The data is transferred in each data channel. The position of data channel in data block differs depending on model. Current implementation has an array to map the index of data channel in an data block to the position of actual data channel. The implementation allows each driver to access the mapping directly. In later commit, the mapping is in specific structure pushed into an opaque pointer. Helper functions are required. This commit adds the helper functions for this purpose. In IEC 61883-6, AM824 format supports many data types, while this specification easily causes over-engineering. Current AM824 implementation is allowed to handle two types of data, Multi Bit Linear Audio data (=PCM samples) and MIDI conformant data (=MIDI messages). Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/dice/dice-stream.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sound/firewire/dice') diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c index 89483818785e..2108f7f1a764 100644 --- a/sound/firewire/dice/dice-stream.c +++ b/sound/firewire/dice/dice-stream.c @@ -141,8 +141,9 @@ static int start_stream(struct snd_dice *dice, struct amdtp_stream *stream, pcm_chs /= 2; for (i = 0; i < pcm_chs; i++) { - stream->pcm_positions[i] = i * 2; - stream->pcm_positions[i + pcm_chs] = i * 2 + 1; + amdtp_am824_set_pcm_position(stream, i, i * 2); + amdtp_am824_set_pcm_position(stream, i + pcm_chs, + i * 2 + 1); } } -- cgit v1.2.3