Skip to content

Commit 34facb0

Browse files
stephan-ghbroonie
authored andcommitted
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 <[email protected]> Reviewed-by: Srinivas Kandagatla <[email protected]> Cc: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 1255296 commit 34facb0

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Documentation/devicetree/bindings/sound/qcom,q6asm.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ configuration of each dai. Must contain the following properties.
3939
Usage: Required for Compress offload dais
4040
Value type: <u32>
4141
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)
4545

4646
- is-compress-dai:
4747
Usage: Required for Compress offload dais
@@ -50,6 +50,7 @@ configuration of each dai. Must contain the following properties.
5050

5151

5252
= EXAMPLE
53+
#include <dt-bindings/sound/qcom,q6asm.h>
5354

5455
apr-service@7 {
5556
compatible = "qcom,q6asm";
@@ -62,7 +63,7 @@ apr-service@7 {
6263

6364
dai@0 {
6465
reg = <0>;
65-
direction = <2>;
66+
direction = <Q6ASM_DAI_RX>;
6667
is-compress-dai;
6768
};
6869
};

include/dt-bindings/sound/qcom,q6asm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@
1919
#define MSM_FRONTEND_DAI_MULTIMEDIA15 14
2020
#define MSM_FRONTEND_DAI_MULTIMEDIA16 15
2121

22+
#define Q6ASM_DAI_TX_RX 0
23+
#define Q6ASM_DAI_TX 1
24+
#define Q6ASM_DAI_RX 2
25+
2226
#endif /* __DT_BINDINGS_Q6_ASM_H__ */

sound/soc/qcom/qdsp6/q6asm-dai.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
#define COMPR_PLAYBACK_MAX_FRAGMENT_SIZE (128 * 1024)
3838
#define COMPR_PLAYBACK_MIN_NUM_FRAGMENTS (4)
3939
#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
4340

4441
#define ALAC_CH_LAYOUT_MONO ((101 << 16) | 1)
4542
#define ALAC_CH_LAYOUT_STEREO ((101 << 16) | 2)

0 commit comments

Comments
 (0)