summaryrefslogtreecommitdiff
path: root/sound/firewire/amdtp-am824.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2015-09-19 05:21:57 +0300
committerTakashi Iwai <tiwai@suse.de>2015-09-29 13:48:19 +0300
commitbc8500da3e62cd6a896407a1b330a2eb21817c22 (patch)
tree74259f781b6999135349f5670c0bbd907f28936f /sound/firewire/amdtp-am824.c
parent51c29fd21389d9995a8a18a91eeb8dd1220a2119 (diff)
downloadlinux-bc8500da3e62cd6a896407a1b330a2eb21817c22.tar.xz
ALSA: firewire-lib: move PCM substream constraint to AM824 layer
In IEC 61883-6, PCM frames are transferred in Multi Bit Linear Audio data channel. The data channel transfers 16/20/24 bit PCM samples. Thus, PCM substream has a constrain about it. This commit moves codes related to the constraint from packet streaming layer to AM824 data block processing layer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp-am824.c')
-rw-r--r--sound/firewire/amdtp-am824.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sound/firewire/amdtp-am824.c b/sound/firewire/amdtp-am824.c
index f5edcbfa3157..7adaba356579 100644
--- a/sound/firewire/amdtp-am824.c
+++ b/sound/firewire/amdtp-am824.c
@@ -53,6 +53,26 @@ int amdtp_am824_set_parameters(struct amdtp_stream *s, unsigned int rate,
EXPORT_SYMBOL_GPL(amdtp_am824_set_parameters);
/**
+ * amdtp_am824_add_pcm_hw_constraints - add hw constraints for PCM substream
+ * @s: the AMDTP stream for AM824 data block, must be initialized.
+ * @runtime: the PCM substream runtime
+ *
+ */
+int amdtp_am824_add_pcm_hw_constraints(struct amdtp_stream *s,
+ struct snd_pcm_runtime *runtime)
+{
+ int err;
+
+ err = amdtp_stream_add_pcm_hw_constraints(s, runtime);
+ if (err < 0)
+ return err;
+
+ /* AM824 in IEC 61883-6 can deliver 24bit data. */
+ return snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+}
+EXPORT_SYMBOL_GPL(amdtp_am824_add_pcm_hw_constraints);
+
+/**
* amdtp_am824_init - initialize an AMDTP stream structure to handle AM824
* data block
* @s: the AMDTP stream to initialize