diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-04-25 09:44:55 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-05-26 08:22:14 -0400 |
commit | c68a1c6584d066d0f2b7aa2117d2eddce2d01def (patch) | |
tree | 2493f740847f17778ccf1a41430bb5d6291d84ec | |
parent | a7fa0d047f879bf3c744e9005769183abdf2ec4b (diff) |
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>
-rw-r--r-- | sound/firewire/cmp.c | 1 | ||||
-rw-r--r-- | sound/firewire/cmp.h | 7 | ||||
-rw-r--r-- | sound/firewire/speakers.c | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/sound/firewire/cmp.c b/sound/firewire/cmp.c index deb494d6e785..c7f7a3164390 100644 --- a/sound/firewire/cmp.c +++ b/sound/firewire/cmp.c | |||
@@ -94,6 +94,7 @@ static int pcr_modify(struct cmp_connection *c, | |||
94 | */ | 94 | */ |
95 | int cmp_connection_init(struct cmp_connection *c, | 95 | int cmp_connection_init(struct cmp_connection *c, |
96 | struct fw_unit *unit, | 96 | struct fw_unit *unit, |
97 | enum cmp_direction direction, | ||
97 | unsigned int pcr_index) | 98 | unsigned int pcr_index) |
98 | { | 99 | { |
99 | __be32 mpr_be; | 100 | __be32 mpr_be; |
diff --git a/sound/firewire/cmp.h b/sound/firewire/cmp.h index 2320cd44d499..9b58448d5791 100644 --- a/sound/firewire/cmp.h +++ b/sound/firewire/cmp.h | |||
@@ -7,6 +7,11 @@ | |||
7 | 7 | ||
8 | struct fw_unit; | 8 | struct fw_unit; |
9 | 9 | ||
10 | enum cmp_direction { | ||
11 | CMP_INPUT = 0, | ||
12 | CMP_OUTPUT, | ||
13 | }; | ||
14 | |||
10 | /** | 15 | /** |
11 | * struct cmp_connection - manages an isochronous connection to a device | 16 | * struct cmp_connection - manages an isochronous connection to a device |
12 | * @speed: the connection's actual speed | 17 | * @speed: the connection's actual speed |
@@ -26,10 +31,12 @@ struct cmp_connection { | |||
26 | __be32 last_pcr_value; | 31 | __be32 last_pcr_value; |
27 | unsigned int pcr_index; | 32 | unsigned int pcr_index; |
28 | unsigned int max_speed; | 33 | unsigned int max_speed; |
34 | enum cmp_direction direction; | ||
29 | }; | 35 | }; |
30 | 36 | ||
31 | int cmp_connection_init(struct cmp_connection *connection, | 37 | int cmp_connection_init(struct cmp_connection *connection, |
32 | struct fw_unit *unit, | 38 | struct fw_unit *unit, |
39 | enum cmp_direction direction, | ||
33 | unsigned int pcr_index); | 40 | unsigned int pcr_index); |
34 | void cmp_connection_destroy(struct cmp_connection *connection); | 41 | void cmp_connection_destroy(struct cmp_connection *connection); |
35 | 42 | ||
diff --git a/sound/firewire/speakers.c b/sound/firewire/speakers.c index 58e7ab010c60..dd9983b98607 100644 --- a/sound/firewire/speakers.c +++ b/sound/firewire/speakers.c | |||
@@ -673,7 +673,7 @@ static int fwspk_probe(struct fw_unit *unit, | |||
673 | fwspk->unit = fw_unit_get(unit); | 673 | fwspk->unit = fw_unit_get(unit); |
674 | fwspk->device_info = (const struct device_info *)id->driver_data; | 674 | fwspk->device_info = (const struct device_info *)id->driver_data; |
675 | 675 | ||
676 | err = cmp_connection_init(&fwspk->connection, unit, 0); | 676 | err = cmp_connection_init(&fwspk->connection, unit, CMP_INPUT, 0); |
677 | if (err < 0) | 677 | if (err < 0) |
678 | goto err_unit; | 678 | goto err_unit; |
679 | 679 | ||