Skip to content

Commit c68a1c6

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-lib: Add 'direction' member to 'cmp_connection' structure
This patch adds 'direction' member to 'cmp_connection' structure to indicate the direction of connection. This patch also adds 'direction' argument to cmp_connection_init() function to determine the direction. The cmp_connection_init() function is exported and used in snd-firewire-speakers so this patch also affect it. 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>
1 parent a7fa0d0 commit c68a1c6

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎sound/firewire/cmp.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ static int pcr_modify(struct cmp_connection *c,
9494
*/
9595
int cmp_connection_init(struct cmp_connection *c,
9696
struct fw_unit *unit,
97+
enum cmp_direction direction,
9798
unsigned int pcr_index)
9899
{
99100
__be32 mpr_be;

‎sound/firewire/cmp.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
struct fw_unit;
99

10+
enum cmp_direction {
11+
CMP_INPUT = 0,
12+
CMP_OUTPUT,
13+
};
14+
1015
/**
1116
* struct cmp_connection - manages an isochronous connection to a device
1217
* @speed: the connection's actual speed
@@ -26,10 +31,12 @@ struct cmp_connection {
2631
__be32 last_pcr_value;
2732
unsigned int pcr_index;
2833
unsigned int max_speed;
34+
enum cmp_direction direction;
2935
};
3036

3137
int cmp_connection_init(struct cmp_connection *connection,
3238
struct fw_unit *unit,
39+
enum cmp_direction direction,
3340
unsigned int pcr_index);
3441
void cmp_connection_destroy(struct cmp_connection *connection);
3542

‎sound/firewire/speakers.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ static int fwspk_probe(struct fw_unit *unit,
673673
fwspk->unit = fw_unit_get(unit);
674674
fwspk->device_info = (const struct device_info *)id->driver_data;
675675

676-
err = cmp_connection_init(&fwspk->connection, unit, 0);
676+
err = cmp_connection_init(&fwspk->connection, unit, CMP_INPUT, 0);
677677
if (err < 0)
678678
goto err_unit;
679679

0 commit comments

Comments
 (0)