summaryrefslogtreecommitdiffstats
path: root/sound/firewire/oxfw/oxfw-stream.c
diff options
context:
space:
mode:
authorTakashi Sakamoto2014-12-08 16:10:43 +0100
committerTakashi Iwai2014-12-10 10:47:54 +0100
commit3c96101f190020e91d413c5835f7a722fc007923 (patch)
tree00aaf93b5806daa8c1f750e08c1ee50332a96747 /sound/firewire/oxfw/oxfw-stream.c
parentALSA: oxfw: Change the way to make PCM rules/constraints (diff)
downloadkernel-qcow2-linux-3c96101f190020e91d413c5835f7a722fc007923.tar.gz
kernel-qcow2-linux-3c96101f190020e91d413c5835f7a722fc007923.tar.xz
kernel-qcow2-linux-3c96101f190020e91d413c5835f7a722fc007923.zip
ALSA: oxfw: Add proc interface for debugging purpose
This commit adds proc interface to get information about stream formation. This commit also adds snd_oxfw_stream_get_current_formation() to get current stream formation. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/oxfw/oxfw-stream.c')
-rw-r--r--sound/firewire/oxfw/oxfw-stream.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c
index 17e3802e6ac2..210bf5a2f56e 100644
--- a/sound/firewire/oxfw/oxfw-stream.c
+++ b/sound/firewire/oxfw/oxfw-stream.c
@@ -108,6 +108,33 @@ void snd_oxfw_stream_update_simplex(struct snd_oxfw *oxfw)
amdtp_stream_update(&oxfw->rx_stream);
}
+int snd_oxfw_stream_get_current_formation(struct snd_oxfw *oxfw,
+ enum avc_general_plug_dir dir,
+ struct snd_oxfw_stream_formation *formation)
+{
+ u8 *format;
+ unsigned int len;
+ int err;
+
+ len = AVC_GENERIC_FRAME_MAXIMUM_BYTES;
+ format = kmalloc(len, GFP_KERNEL);
+ if (format == NULL)
+ return -ENOMEM;
+
+ err = avc_stream_get_format_single(oxfw->unit, dir, 0, format, &len);
+ if (err < 0)
+ goto end;
+ if (len < 3) {
+ err = -EIO;
+ goto end;
+ }
+
+ err = snd_oxfw_stream_parse_format(format, formation);
+end:
+ kfree(format);
+ return err;
+}
+
/*
* See Table 6.16 - AM824 Stream Format
* Figure 6.19 - format_information field for AM824 Compound