Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5955815e authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai
Browse files

ALSA: firewire-lib: add data block processing layer for AM824 format



This commit adds data block processing layer for AM824 format. The new
layer initializes streaming layer with its value for fmt field.

Currently, most implementation of data block processing still remains
streaming layer. In later commits, these codes will be moved to the layer.

Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d67c46b9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
snd-firewire-lib-objs := lib.o iso-resources.o packets-buffer.o \
			 fcp.o cmp.o amdtp-stream.o
			 fcp.o cmp.o amdtp-stream.o amdtp-am824.o
snd-oxfw-objs := oxfw.o
snd-isight-objs := isight.o
snd-scs1x-objs := scs1x.o
+26 −0
Original line number Diff line number Diff line
/*
 * AM824 format in Audio and Music Data Transmission Protocol (IEC 61883-6)
 *
 * Copyright (c) 2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>
 *
 * Licensed under the terms of the GNU General Public License, version 2.
 */

#include "amdtp-am824.h"

#define CIP_FMT_AM		0x10

/**
 * amdtp_am824_init - initialize an AMDTP stream structure to handle AM824
 *		      data block
 * @s: the AMDTP stream to initialize
 * @unit: the target of the stream
 * @dir: the direction of stream
 * @flags: the packet transmission method to use
 */
int amdtp_am824_init(struct amdtp_stream *s, struct fw_unit *unit,
		     enum amdtp_stream_direction dir, enum cip_flags flags)
{
	return amdtp_stream_init(s, unit, dir, flags, CIP_FMT_AM);
}
EXPORT_SYMBOL_GPL(amdtp_am824_init);
+8 −0
Original line number Diff line number Diff line
#ifndef SOUND_FIREWIRE_AMDTP_AM824_H_INCLUDED
#define SOUND_FIREWIRE_AMDTP_AM824_H_INCLUDED

#include "amdtp-stream.h"

int amdtp_am824_init(struct amdtp_stream *s, struct fw_unit *unit,
		     enum amdtp_stream_direction dir, enum cip_flags flags);
#endif
+4 −3
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
#include <linux/firewire.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/rawmidi.h>
@@ -78,9 +77,11 @@ static void pcm_period_tasklet(unsigned long data);
 * @unit: the target of the stream
 * @dir: the direction of stream
 * @flags: the packet transmission method to use
 * @fmt: the value of fmt field in CIP header
 */
int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
		      enum amdtp_stream_direction dir, enum cip_flags flags)
		      enum amdtp_stream_direction dir, enum cip_flags flags,
		      unsigned int fmt)
{
	s->unit = unit;
	s->direction = dir;
@@ -94,7 +95,7 @@ int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
	s->callbacked = false;
	s->sync_slave = NULL;

	s->fmt = CIP_FMT_AM;
	s->fmt = fmt;

	return 0;
}
+2 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/sched.h>
#include <sound/asound.h>
#include "packets-buffer.h"

@@ -174,7 +175,7 @@ struct amdtp_stream {

int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
		      enum amdtp_stream_direction dir,
		      enum cip_flags flags);
		      enum cip_flags flags, unsigned int fmt);
void amdtp_stream_destroy(struct amdtp_stream *s);

int amdtp_stream_set_parameters(struct amdtp_stream *s,
Loading