ALSA: firewire-lib: Add 'direction' member to 'amdtp_stream' structure
This patch adds 'direction' member to amdtp_stream structure to indicate its direction. This patch also adds 'direction' argument to amdtp_stream_init() function to determine its direction. The amdtp_stream_init() function is exported and used by firewire-speakers and dice so this patch also affects them. This patch just add them. Actual implementation will be done by followed patches. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
b445db440c
commit
3ff7e8f0d4
|
@ -53,12 +53,14 @@ static void pcm_period_tasklet(unsigned long data);
|
||||||
* amdtp_stream_init - initialize an AMDTP stream structure
|
* amdtp_stream_init - initialize an AMDTP stream structure
|
||||||
* @s: the AMDTP stream to initialize
|
* @s: the AMDTP stream to initialize
|
||||||
* @unit: the target of the stream
|
* @unit: the target of the stream
|
||||||
|
* @dir: the direction of stream
|
||||||
* @flags: the packet transmission method to use
|
* @flags: the packet transmission method to use
|
||||||
*/
|
*/
|
||||||
int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
|
int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
|
||||||
enum cip_flags flags)
|
enum amdtp_stream_direction dir, enum cip_flags flags)
|
||||||
{
|
{
|
||||||
s->unit = fw_unit_get(unit);
|
s->unit = fw_unit_get(unit);
|
||||||
|
s->direction = dir;
|
||||||
s->flags = flags;
|
s->flags = flags;
|
||||||
s->context = ERR_PTR(-1);
|
s->context = ERR_PTR(-1);
|
||||||
mutex_init(&s->mutex);
|
mutex_init(&s->mutex);
|
||||||
|
|
|
@ -48,9 +48,15 @@ struct fw_unit;
|
||||||
struct fw_iso_context;
|
struct fw_iso_context;
|
||||||
struct snd_pcm_substream;
|
struct snd_pcm_substream;
|
||||||
|
|
||||||
|
enum amdtp_stream_direction {
|
||||||
|
AMDTP_OUT_STREAM = 0,
|
||||||
|
AMDTP_IN_STREAM
|
||||||
|
};
|
||||||
|
|
||||||
struct amdtp_stream {
|
struct amdtp_stream {
|
||||||
struct fw_unit *unit;
|
struct fw_unit *unit;
|
||||||
enum cip_flags flags;
|
enum cip_flags flags;
|
||||||
|
enum amdtp_stream_direction direction;
|
||||||
struct fw_iso_context *context;
|
struct fw_iso_context *context;
|
||||||
struct mutex mutex;
|
struct mutex mutex;
|
||||||
|
|
||||||
|
@ -85,6 +91,7 @@ struct amdtp_stream {
|
||||||
};
|
};
|
||||||
|
|
||||||
int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
|
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);
|
||||||
void amdtp_stream_destroy(struct amdtp_stream *s);
|
void amdtp_stream_destroy(struct amdtp_stream *s);
|
||||||
|
|
||||||
|
|
|
@ -1360,7 +1360,7 @@ static int dice_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)
|
||||||
goto err_owner;
|
goto err_owner;
|
||||||
dice->resources.channels_mask = 0x00000000ffffffffuLL;
|
dice->resources.channels_mask = 0x00000000ffffffffuLL;
|
||||||
|
|
||||||
err = amdtp_stream_init(&dice->stream, unit,
|
err = amdtp_stream_init(&dice->stream, unit, AMDTP_OUT_STREAM,
|
||||||
CIP_BLOCKING | CIP_HI_DUALWIRE);
|
CIP_BLOCKING | CIP_HI_DUALWIRE);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto err_resources;
|
goto err_resources;
|
||||||
|
|
|
@ -683,7 +683,8 @@ static int fwspk_probe(struct fw_unit *unit,
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto err_unit;
|
goto err_unit;
|
||||||
|
|
||||||
err = amdtp_stream_init(&fwspk->stream, unit, CIP_NONBLOCKING);
|
err = amdtp_stream_init(&fwspk->stream, unit, AMDTP_OUT_STREAM,
|
||||||
|
CIP_NONBLOCKING);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto err_connection;
|
goto err_connection;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue