summaryrefslogtreecommitdiff
path: root/sound/firewire/cmp.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-04-25 22:44:57 +0900
committerTakashi Iwai <tiwai@suse.de>2014-05-26 14:22:46 +0200
commitb04479fb8540c906f0ad17f21e4c2715f6e8e7a3 (patch)
tree4fc9162da6a97bcc5db9e8aee49e19620cab081e /sound/firewire/cmp.c
parent44aff6980af107cccda4d6677995c88b9dad3482 (diff)
ALSA: firewire-lib: Add a new function to check others' connection
Plug Control Registers have two fields related to the number of established connections, one is 'Broadcast connection counter' and another is 'Point-to-point connection counter'. The driver can know there are established connections or not to check these fields. This commit is for considering about JACK/FFADO streaming. Currently, when JACK/FFADO starts its streaming to the device, cmp_connection_establish() is failed expectedly. This seems to be enough but there are some devices which needs to change sampling frequency before trying to establish connections. For such devices, this functionality is needed. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/cmp.c')
-rw-r--r--sound/firewire/cmp.c18
1 files changed, 18 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,
EXPORT_SYMBOL(cmp_connection_init);
/**
+ * cmp_connection_check_used - check connection is already esablished or not
+ * @c: the connection manager to be checked
+ */
+int cmp_connection_check_used(struct cmp_connection *c, bool *used)
+{
+ __be32 pcr;
+ int err;
+
+ err = snd_fw_transaction(
+ c->resources.unit, TCODE_READ_QUADLET_REQUEST,
+ pcr_address(c), &pcr, 4, 0);
+ if (err >= 0)
+ *used = (pcr & cpu_to_be32(PCR_BCAST_CONN | PCR_P2P_CONN_MASK));
+ return err;
+}
+EXPORT_SYMBOL(cmp_connection_check_used);
+
+/**
* cmp_connection_destroy - free connection manager resources
* @c: the connection manager
*/