diff options
Diffstat (limited to 'sound/firewire')
-rw-r--r-- | sound/firewire/cmp.c | 18 | ||||
-rw-r--r-- | sound/firewire/cmp.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sound/firewire/cmp.c b/sound/firewire/cmp.c index 9da40d9e79da..d31a403ac539 100644 --- a/sound/firewire/cmp.c +++ b/sound/firewire/cmp.c | |||
@@ -152,6 +152,24 @@ int cmp_connection_init(struct cmp_connection *c, | |||
152 | EXPORT_SYMBOL(cmp_connection_init); | 152 | EXPORT_SYMBOL(cmp_connection_init); |
153 | 153 | ||
154 | /** | 154 | /** |
155 | * cmp_connection_check_used - check connection is already esablished or not | ||
156 | * @c: the connection manager to be checked | ||
157 | */ | ||
158 | int cmp_connection_check_used(struct cmp_connection *c, bool *used) | ||
159 | { | ||
160 | __be32 pcr; | ||
161 | int err; | ||
162 | |||
163 | err = snd_fw_transaction( | ||
164 | c->resources.unit, TCODE_READ_QUADLET_REQUEST, | ||
165 | pcr_address(c), &pcr, 4, 0); | ||
166 | if (err >= 0) | ||
167 | *used = (pcr & cpu_to_be32(PCR_BCAST_CONN | PCR_P2P_CONN_MASK)); | ||
168 | return err; | ||
169 | } | ||
170 | EXPORT_SYMBOL(cmp_connection_check_used); | ||
171 | |||
172 | /** | ||
155 | * cmp_connection_destroy - free connection manager resources | 173 | * cmp_connection_destroy - free connection manager resources |
156 | * @c: the connection manager | 174 | * @c: the connection manager |
157 | */ | 175 | */ |
diff --git a/sound/firewire/cmp.h b/sound/firewire/cmp.h index 9b58448d5791..ebcb48484fca 100644 --- a/sound/firewire/cmp.h +++ b/sound/firewire/cmp.h | |||
@@ -38,6 +38,7 @@ int cmp_connection_init(struct cmp_connection *connection, | |||
38 | struct fw_unit *unit, | 38 | struct fw_unit *unit, |
39 | enum cmp_direction direction, | 39 | enum cmp_direction direction, |
40 | unsigned int pcr_index); | 40 | unsigned int pcr_index); |
41 | int cmp_connection_check_used(struct cmp_connection *connection, bool *used); | ||
41 | void cmp_connection_destroy(struct cmp_connection *connection); | 42 | void cmp_connection_destroy(struct cmp_connection *connection); |
42 | 43 | ||
43 | int cmp_connection_establish(struct cmp_connection *connection, | 44 | int cmp_connection_establish(struct cmp_connection *connection, |