* amdtp_stream_init - initialize an AMDTP stream structure
* @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_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->direction = dir;
s->flags = flags;
s->context = ERR_PTR(-1);
mutex_init(&s->mutex);
struct fw_iso_context;
struct snd_pcm_substream;
+enum amdtp_stream_direction {
+ AMDTP_OUT_STREAM = 0,
+ AMDTP_IN_STREAM
+};
+
struct amdtp_stream {
struct fw_unit *unit;
enum cip_flags flags;
+ enum amdtp_stream_direction direction;
struct fw_iso_context *context;
struct mutex mutex;
};
int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
+ enum amdtp_stream_direction dir,
enum cip_flags flags);
void amdtp_stream_destroy(struct amdtp_stream *s);
goto err_owner;
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);
if (err < 0)
goto err_resources;
if (err < 0)
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)
goto err_connection;