From e5f636a2003fd651c0c46d800ed7220ffe276eda Mon Sep 17 00:00:00 2001 From: SENEMOS patch gate Date: Tue, 15 Sep 2026 21:52:27 +0300 Subject: [PATCH] ASoC: qcom: describe unidirectional DAI links Allow Qualcomm sound-card device trees to describe front ends that support only playback or only capture. Validate the mutually exclusive properties in the binding and reject contradictory firmware data in the common parser. Signed-off-by: SENEMOS patch gate --- .../devicetree/bindings/sound/qcom,sm8250.yaml | 14 ++++++++++++++ sound/soc/qcom/common.c | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml index cfcd952f8..923747567 100644 --- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml @@ -83,6 +83,14 @@ patternProperties: $ref: /schemas/types.yaml#/definitions/string maxItems: 1 + playback-only: + description: Restrict this DAI link to playback streams. + type: boolean + + capture-only: + description: Restrict this DAI link to capture streams. + type: boolean + cpu: description: Holds subnode which indicates cpu dai. type: object @@ -115,6 +123,12 @@ patternProperties: - link-name - cpu + allOf: + - not: + required: + - playback-only + - capture-only + additionalProperties: false required: diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index edc461169..65f248ae0 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -95,6 +95,14 @@ int qcom_snd_parse_of(struct snd_soc_card *card) return ret; } + link->playback_only = of_property_read_bool(np, "playback-only"); + link->capture_only = of_property_read_bool(np, "capture-only"); + if (link->playback_only && link->capture_only) { + dev_err(dev, "%s: dai link cannot be both playback-only and capture-only\n", + link->name); + return -EINVAL; + } + struct device_node *cpu __free(device_node) = of_get_child_by_name(np, "cpu"); struct device_node *platform __free(device_node) = -- 2.55.0