Commit 34facb04 authored by Stephan Gerhold's avatar Stephan Gerhold Committed by Mark Brown

ASoC: dt-bindings: q6asm: Add Q6ASM_DAI_{TX_RX, TX, RX} defines

Right now the direction of a DAI has to be specified as a literal
number in the device tree, e.g.:

	dai@0 {
		reg = <0>;
		direction = <2>;
	};

but this does not make it immediately clear that this is a
playback/RX-only DAI.

Actually, q6asm-dai.c has useful defines for this. Move them to the
dt-bindings header to allow using them in the dts(i) files.
The example above then becomes:

	dai@0 {
		reg = <0>;
		direction = <Q6ASM_DAI_RX>;
	};

which is immediately recognizable as playback/RX-only DAI.
Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
Reviewed-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200727082502.2341-1-stephan@gerhold.netSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1255296c
......@@ -39,9 +39,9 @@ configuration of each dai. Must contain the following properties.
Usage: Required for Compress offload dais
Value type: <u32>
Definition: Specifies the direction of the dai stream
0 for both tx and rx
1 for only tx (Capture/Encode)
2 for only rx (Playback/Decode)
Q6ASM_DAI_TX_RX (0) for both tx and rx
Q6ASM_DAI_TX (1) for only tx (Capture/Encode)
Q6ASM_DAI_RX (2) for only rx (Playback/Decode)
- is-compress-dai:
Usage: Required for Compress offload dais
......@@ -50,6 +50,7 @@ configuration of each dai. Must contain the following properties.
= EXAMPLE
#include <dt-bindings/sound/qcom,q6asm.h>
apr-service@7 {
compatible = "qcom,q6asm";
......@@ -62,7 +63,7 @@ apr-service@7 {
dai@0 {
reg = <0>;
direction = <2>;
direction = <Q6ASM_DAI_RX>;
is-compress-dai;
};
};
......
......@@ -19,4 +19,8 @@
#define MSM_FRONTEND_DAI_MULTIMEDIA15 14
#define MSM_FRONTEND_DAI_MULTIMEDIA16 15
#define Q6ASM_DAI_TX_RX 0
#define Q6ASM_DAI_TX 1
#define Q6ASM_DAI_RX 2
#endif /* __DT_BINDINGS_Q6_ASM_H__ */
......@@ -37,9 +37,6 @@
#define COMPR_PLAYBACK_MAX_FRAGMENT_SIZE (128 * 1024)
#define COMPR_PLAYBACK_MIN_NUM_FRAGMENTS (4)
#define COMPR_PLAYBACK_MAX_NUM_FRAGMENTS (16 * 4)
#define Q6ASM_DAI_TX_RX 0
#define Q6ASM_DAI_TX 1
#define Q6ASM_DAI_RX 2
#define ALAC_CH_LAYOUT_MONO ((101 << 16) | 1)
#define ALAC_CH_LAYOUT_STEREO ((101 << 16) | 2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment