Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200727082502.2341-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Stephan Gerhold and committed by
Mark Brown
34facb04 1255296c

+9 -7
+5 -4
Documentation/devicetree/bindings/sound/qcom,q6asm.txt
··· 39 39 Usage: Required for Compress offload dais 40 40 Value type: <u32> 41 41 Definition: Specifies the direction of the dai stream 42 - 0 for both tx and rx 43 - 1 for only tx (Capture/Encode) 44 - 2 for only rx (Playback/Decode) 42 + Q6ASM_DAI_TX_RX (0) for both tx and rx 43 + Q6ASM_DAI_TX (1) for only tx (Capture/Encode) 44 + Q6ASM_DAI_RX (2) for only rx (Playback/Decode) 45 45 46 46 - is-compress-dai: 47 47 Usage: Required for Compress offload dais ··· 50 50 51 51 52 52 = EXAMPLE 53 + #include <dt-bindings/sound/qcom,q6asm.h> 53 54 54 55 apr-service@7 { 55 56 compatible = "qcom,q6asm"; ··· 63 62 64 63 dai@0 { 65 64 reg = <0>; 66 - direction = <2>; 65 + direction = <Q6ASM_DAI_RX>; 67 66 is-compress-dai; 68 67 }; 69 68 };
+4
include/dt-bindings/sound/qcom,q6asm.h
··· 19 19 #define MSM_FRONTEND_DAI_MULTIMEDIA15 14 20 20 #define MSM_FRONTEND_DAI_MULTIMEDIA16 15 21 21 22 + #define Q6ASM_DAI_TX_RX 0 23 + #define Q6ASM_DAI_TX 1 24 + #define Q6ASM_DAI_RX 2 25 + 22 26 #endif /* __DT_BINDINGS_Q6_ASM_H__ */
-3
sound/soc/qcom/qdsp6/q6asm-dai.c
··· 37 37 #define COMPR_PLAYBACK_MAX_FRAGMENT_SIZE (128 * 1024) 38 38 #define COMPR_PLAYBACK_MIN_NUM_FRAGMENTS (4) 39 39 #define COMPR_PLAYBACK_MAX_NUM_FRAGMENTS (16 * 4) 40 - #define Q6ASM_DAI_TX_RX 0 41 - #define Q6ASM_DAI_TX 1 42 - #define Q6ASM_DAI_RX 2 43 40 44 41 #define ALAC_CH_LAYOUT_MONO ((101 << 16) | 1) 45 42 #define ALAC_CH_LAYOUT_STEREO ((101 << 16) | 2)