[PATCH v3 00/10] ASoC: add audio digital codecs for Qualcomm SM8550
Hi,
This patchset can be merged as is - no dependencies.
Changes since v2 ================ 1. Rebase. 2. New patch: ASoC: dt-bindings: qcom,lpass-va-macro: Add missing NPL clock. 3. Add Rb tags.
Changes since v1 ================ 1. Move the flag define to common header.
NOT a dependency ================ The patchset can be applied independently of my previous fix: https://lore.kernel.org/linux-arm-msm/20230310100937.32485-1-krzysztof.kozlo...
Logically, better if they were together, but code will work fine other way.
Best regards, Krzysztof
Krzysztof Kozlowski (10): ASoC: dt-bindings: qcom,lpass-rx-macro: narrow clocks per variants ASoC: dt-bindings: qcom,lpass-rx-macro: Add SM8550 RX macro ASoC: codecs: lpass-rx-macro: add support for SM8550 ASoC: dt-bindings: qcom,lpass-tx-macro: narrow clocks per variants ASoC: dt-bindings: qcom,lpass-tx-macro: Add SM8550 TX macro ASoC: codecs: lpass-tx-macro: add support for SM8550 ASoC: dt-bindings: qcom,lpass-va-macro: Add missing NPL clock ASoC: dt-bindings: qcom,lpass-va-macro: Add SM8550 VA macro ASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8550 WSA macro ASoC: codecs: lpass-wsa-macro: add support for SM8550
.../bindings/sound/qcom,lpass-rx-macro.yaml | 76 +++++++++++++--- .../bindings/sound/qcom,lpass-tx-macro.yaml | 81 +++++++++++++---- .../bindings/sound/qcom,lpass-va-macro.yaml | 86 ++++++++++++++++--- .../bindings/sound/qcom,lpass-wsa-macro.yaml | 23 ++++- sound/soc/codecs/lpass-macro-common.h | 3 + sound/soc/codecs/lpass-rx-macro.c | 36 ++++++-- sound/soc/codecs/lpass-tx-macro.c | 35 ++++++-- sound/soc/codecs/lpass-wsa-macro.c | 37 ++++++-- 8 files changed, 309 insertions(+), 68 deletions(-)
Currently the Qualcomm RX macro codec binding allows two different clock setups - with (for ADSP) and without macro/dcodec entries (for ADSP bypassed). With more devices coming soon, this will keep growing, thus rework the clocks/clock-names to be specific for each binding.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Rob Herring robh@kernel.org --- .../bindings/sound/qcom,lpass-rx-macro.yaml | 58 ++++++++++++++----- 1 file changed, 44 insertions(+), 14 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml index 009105275368..babf2ac20afb 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml @@ -9,9 +9,6 @@ title: LPASS(Low Power Audio Subsystem) RX Macro audio codec maintainers: - Srinivas Kandagatla srinivas.kandagatla@linaro.org
-allOf: - - $ref: dai-common.yaml# - properties: compatible: enum: @@ -34,17 +31,8 @@ properties: maxItems: 5
clock-names: - oneOf: - - items: # for ADSP based platforms - - const: mclk - - const: npl - - const: macro - - const: dcodec - - const: fsgen - - items: # for ADSP bypass based platforms - - const: mclk - - const: npl - - const: fsgen + minItems: 3 + maxItems: 5
clock-output-names: maxItems: 1 @@ -62,6 +50,48 @@ required: - reg - "#sound-dai-cells"
+allOf: + - $ref: dai-common.yaml# + - if: + properties: + compatible: + enum: + - qcom,sc7280-lpass-rx-macro + then: + properties: + clock-names: + oneOf: + - items: # for ADSP based platforms + - const: mclk + - const: npl + - const: macro + - const: dcodec + - const: fsgen + - items: # for ADSP bypass based platforms + - const: mclk + - const: npl + - const: fsgen + + - if: + properties: + compatible: + enum: + - qcom,sc8280xp-lpass-rx-macro + - qcom,sm8250-lpass-rx-macro + - qcom,sm8450-lpass-rx-macro + then: + properties: + clocks: + minItems: 5 + maxItems: 5 + clock-names: + items: + - const: mclk + - const: npl + - const: macro + - const: dcodec + - const: fsgen + unevaluatedProperties: false
examples:
Add the RX macro codec on Qualcomm SM8550, which comes without NPL clock exposed.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Rob Herring robh@kernel.org --- .../bindings/sound/qcom,lpass-rx-macro.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml index babf2ac20afb..ec4b0ac8ad68 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml @@ -15,6 +15,7 @@ properties: - qcom,sc7280-lpass-rx-macro - qcom,sm8250-lpass-rx-macro - qcom,sm8450-lpass-rx-macro + - qcom,sm8550-lpass-rx-macro - qcom,sc8280xp-lpass-rx-macro
reg: @@ -92,6 +93,23 @@ allOf: - const: dcodec - const: fsgen
+ - if: + properties: + compatible: + enum: + - qcom,sm8550-lpass-rx-macro + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + - const: fsgen + unevaluatedProperties: false
examples:
Add support for the RX macro codec on Qualcomm SM8550. SM8550 does not use NPL clock, thus add flags allowing to skip it.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org
---
Changes since v1: 1. Move the flag define to common header --- sound/soc/codecs/lpass-macro-common.h | 3 +++ sound/soc/codecs/lpass-rx-macro.c | 36 +++++++++++++++++++++------ 2 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/sound/soc/codecs/lpass-macro-common.h b/sound/soc/codecs/lpass-macro-common.h index f2cbf9fe2c6e..4eb886565ea3 100644 --- a/sound/soc/codecs/lpass-macro-common.h +++ b/sound/soc/codecs/lpass-macro-common.h @@ -6,6 +6,9 @@ #ifndef __LPASS_MACRO_COMMON_H__ #define __LPASS_MACRO_COMMON_H__
+/* NPL clock is expected */ +#define LPASS_MACRO_FLAG_HAS_NPL_CLOCK BIT(0) + struct lpass_macro { struct device *macro_pd; struct device *dcodec_pd; diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c index 372bea8b3525..685ca95ef4a9 100644 --- a/sound/soc/codecs/lpass-rx-macro.c +++ b/sound/soc/codecs/lpass-rx-macro.c @@ -3491,7 +3491,10 @@ static int rx_macro_register_mclk_output(struct rx_macro *rx) struct clk_init_data init; int ret;
- parent_clk_name = __clk_get_name(rx->npl); + if (rx->npl) + parent_clk_name = __clk_get_name(rx->npl); + else + parent_clk_name = __clk_get_name(rx->mclk);
init.name = clk_name; init.ops = &swclk_gate_ops; @@ -3521,10 +3524,13 @@ static const struct snd_soc_component_driver rx_macro_component_drv = { static int rx_macro_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + kernel_ulong_t flags; struct rx_macro *rx; void __iomem *base; int ret;
+ flags = (kernel_ulong_t)device_get_match_data(dev); + rx = devm_kzalloc(dev, sizeof(*rx), GFP_KERNEL); if (!rx) return -ENOMEM; @@ -3541,9 +3547,11 @@ static int rx_macro_probe(struct platform_device *pdev) if (IS_ERR(rx->mclk)) return PTR_ERR(rx->mclk);
- rx->npl = devm_clk_get(dev, "npl"); - if (IS_ERR(rx->npl)) - return PTR_ERR(rx->npl); + if (flags & LPASS_MACRO_FLAG_HAS_NPL_CLOCK) { + rx->npl = devm_clk_get(dev, "npl"); + if (IS_ERR(rx->npl)) + return PTR_ERR(rx->npl); + }
rx->fsgen = devm_clk_get(dev, "fsgen"); if (IS_ERR(rx->fsgen)) @@ -3653,10 +3661,22 @@ static void rx_macro_remove(struct platform_device *pdev) }
static const struct of_device_id rx_macro_dt_match[] = { - { .compatible = "qcom,sc7280-lpass-rx-macro" }, - { .compatible = "qcom,sm8250-lpass-rx-macro" }, - { .compatible = "qcom,sm8450-lpass-rx-macro" }, - { .compatible = "qcom,sc8280xp-lpass-rx-macro" }, + { + .compatible = "qcom,sc7280-lpass-rx-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + + }, { + .compatible = "qcom,sm8250-lpass-rx-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8450-lpass-rx-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8550-lpass-rx-macro", + }, { + .compatible = "qcom,sc8280xp-lpass-rx-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, { } }; MODULE_DEVICE_TABLE(of, rx_macro_dt_match);
Currently the Qualcomm TX macro codec binding allows two different clock setups - with (for ADSP) and without macro/dcodec entries (for ADSP bypassed). With more devices coming soon, this will keep growing, thus rework the clocks/clock-names to be specific for each binding.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Rob Herring robh@kernel.org --- .../bindings/sound/qcom,lpass-tx-macro.yaml | 63 ++++++++++++++----- 1 file changed, 46 insertions(+), 17 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml index 6c8751497d36..768757cd077d 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml @@ -9,9 +9,6 @@ title: LPASS(Low Power Audio Subsystem) TX Macro audio codec maintainers: - Srinivas Kandagatla srinivas.kandagatla@linaro.org
-allOf: - - $ref: dai-common.yaml# - properties: compatible: enum: @@ -30,22 +27,12 @@ properties: const: 0
clocks: - oneOf: - - maxItems: 3 - - maxItems: 5 + minItems: 3 + maxItems: 5
clock-names: - oneOf: - - items: # for ADSP based platforms - - const: mclk - - const: npl - - const: macro - - const: dcodec - - const: fsgen - - items: # for ADSP bypass based platforms - - const: mclk - - const: npl - - const: fsgen + minItems: 3 + maxItems: 5
clock-output-names: maxItems: 1 @@ -67,6 +54,48 @@ required: - reg - "#sound-dai-cells"
+allOf: + - $ref: dai-common.yaml# + - if: + properties: + compatible: + enum: + - qcom,sc7280-lpass-tx-macro + then: + properties: + clock-names: + oneOf: + - items: # for ADSP based platforms + - const: mclk + - const: npl + - const: macro + - const: dcodec + - const: fsgen + - items: # for ADSP bypass based platforms + - const: mclk + - const: npl + - const: fsgen + + - if: + properties: + compatible: + enum: + - qcom,sc8280xp-lpass-tx-macro + - qcom,sm8250-lpass-tx-macro + - qcom,sm8450-lpass-tx-macro + then: + properties: + clocks: + minItems: 5 + maxItems: 5 + clock-names: + items: + - const: mclk + - const: npl + - const: macro + - const: dcodec + - const: fsgen + unevaluatedProperties: false
examples:
Add the TX macro codec on Qualcomm SM8550, which comes without NPL clock exposed.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Rob Herring robh@kernel.org --- .../bindings/sound/qcom,lpass-tx-macro.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml index 768757cd077d..4156981fe02b 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml @@ -15,6 +15,7 @@ properties: - qcom,sc7280-lpass-tx-macro - qcom,sm8250-lpass-tx-macro - qcom,sm8450-lpass-tx-macro + - qcom,sm8550-lpass-tx-macro - qcom,sc8280xp-lpass-tx-macro
reg: @@ -96,6 +97,23 @@ allOf: - const: dcodec - const: fsgen
+ - if: + properties: + compatible: + enum: + - qcom,sm8550-lpass-tx-macro + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + - const: fsgen + unevaluatedProperties: false
examples:
Add support for the TX macro codec on Qualcomm SM8550. SM8550 does not use NPL clock, thus add flags allowing to skip it.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org
---
Changes since v1: 1. Move the flag define to common header --- sound/soc/codecs/lpass-tx-macro.c | 35 ++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-)
diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c index d9318799f6b7..da6fcf7f0991 100644 --- a/sound/soc/codecs/lpass-tx-macro.c +++ b/sound/soc/codecs/lpass-tx-macro.c @@ -1915,7 +1915,10 @@ static int tx_macro_register_mclk_output(struct tx_macro *tx) struct clk_init_data init; int ret;
- parent_clk_name = __clk_get_name(tx->npl); + if (tx->npl) + parent_clk_name = __clk_get_name(tx->npl); + else + parent_clk_name = __clk_get_name(tx->mclk);
init.name = clk_name; init.ops = &swclk_gate_ops; @@ -1946,10 +1949,13 @@ static int tx_macro_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; + kernel_ulong_t flags; struct tx_macro *tx; void __iomem *base; int ret, reg;
+ flags = (kernel_ulong_t)device_get_match_data(dev); + tx = devm_kzalloc(dev, sizeof(*tx), GFP_KERNEL); if (!tx) return -ENOMEM; @@ -1966,9 +1972,11 @@ static int tx_macro_probe(struct platform_device *pdev) if (IS_ERR(tx->mclk)) return PTR_ERR(tx->mclk);
- tx->npl = devm_clk_get(dev, "npl"); - if (IS_ERR(tx->npl)) - return PTR_ERR(tx->npl); + if (flags & LPASS_MACRO_FLAG_HAS_NPL_CLOCK) { + tx->npl = devm_clk_get(dev, "npl"); + if (IS_ERR(tx->npl)) + return PTR_ERR(tx->npl); + }
tx->fsgen = devm_clk_get(dev, "fsgen"); if (IS_ERR(tx->fsgen)) @@ -2143,10 +2151,21 @@ static const struct dev_pm_ops tx_macro_pm_ops = { };
static const struct of_device_id tx_macro_dt_match[] = { - { .compatible = "qcom,sc7280-lpass-tx-macro" }, - { .compatible = "qcom,sm8250-lpass-tx-macro" }, - { .compatible = "qcom,sm8450-lpass-tx-macro" }, - { .compatible = "qcom,sc8280xp-lpass-tx-macro" }, + { + .compatible = "qcom,sc7280-lpass-tx-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8250-lpass-tx-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8450-lpass-tx-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8550-lpass-tx-macro", + }, { + .compatible = "qcom,sc8280xp-lpass-tx-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, { } }; MODULE_DEVICE_TABLE(of, tx_macro_dt_match);
Several devices (e.g. SC8280XP and SM8450) expect a NPL (Near Pad Logic) clock. Add the clock and customize allowed clocks per each variant. The clocks are also required by ADSP in all variants.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
---
Changes since v1: 1. New patch. --- .../bindings/sound/qcom,lpass-va-macro.yaml | 68 ++++++++++++++++--- 1 file changed, 57 insertions(+), 11 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml index 61cdfc265b0f..528b677a439c 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml @@ -9,9 +9,6 @@ title: LPASS(Low Power Audio Subsystem) VA Macro audio codec maintainers: - Srinivas Kandagatla srinivas.kandagatla@linaro.org
-allOf: - - $ref: dai-common.yaml# - properties: compatible: enum: @@ -30,16 +27,12 @@ properties: const: 0
clocks: - maxItems: 3 + minItems: 1 + maxItems: 4
clock-names: - oneOf: - - items: # for ADSP based platforms - - const: mclk - - const: macro - - const: dcodec - - items: # for ADSP bypass based platforms - - const: mclk + minItems: 1 + maxItems: 4
clock-output-names: maxItems: 1 @@ -63,6 +56,59 @@ required: - compatible - reg - "#sound-dai-cells" + - clock-names + - clocks + +allOf: + - $ref: dai-common.yaml# + + - if: + properties: + compatible: + contains: + const: qcom,sc7280-lpass-va-macro + then: + properties: + clocks: + maxItems: 1 + clock-names: + items: + - const: mclk + + - if: + properties: + compatible: + contains: + const: qcom,sm8250-lpass-va-macro + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + + - if: + properties: + compatible: + contains: + enum: + - qcom,sc8280xp-lpass-va-macro + - qcom,sm8450-lpass-va-macro + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + - const: npl
unevaluatedProperties: false
On 27/03/2023 15:22, Krzysztof Kozlowski wrote:
Several devices (e.g. SC8280XP and SM8450) expect a NPL (Near Pad Logic) clock. Add the clock and customize allowed clocks per each variant. The clocks are also required by ADSP in all variants.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
Changes since v1:
- New patch.
.../bindings/sound/qcom,lpass-va-macro.yaml | 68 ++++++++++++++++---
Mark,
It seems you applied v2, not v3, so this patch is missing and the binding needs fixes.
I will send a new version of this.
Best regards, Krzysztof
On Thu, Mar 30, 2023 at 08:59:12AM +0200, Krzysztof Kozlowski wrote:
It seems you applied v2, not v3, so this patch is missing and the binding needs fixes.
I'd queued v2 already when you sent v3, and you're sending a lot of serieses right now.
Add the VA macro codec on Qualcomm SM8550, which comes without NPL clock exposed.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Rob Herring robh@kernel.org --- .../bindings/sound/qcom,lpass-va-macro.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml index 528b677a439c..4a56108c444b 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml @@ -15,6 +15,7 @@ properties: - qcom,sc7280-lpass-va-macro - qcom,sm8250-lpass-va-macro - qcom,sm8450-lpass-va-macro + - qcom,sm8550-lpass-va-macro - qcom,sc8280xp-lpass-va-macro
reg: @@ -110,6 +111,23 @@ allOf: - const: dcodec - const: npl
+ - if: + properties: + compatible: + contains: + enum: + - qcom,sm8550-lpass-va-macro + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + unevaluatedProperties: false
examples:
Add the WSA macro codec on Qualcomm SM8550, which comes without NPL clock exposed.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Rob Herring robh@kernel.org --- .../bindings/sound/qcom,lpass-wsa-macro.yaml | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml index 66cbb1f5e31a..eea7609d1b33 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml @@ -15,6 +15,7 @@ properties: - qcom,sc7280-lpass-wsa-macro - qcom,sm8250-lpass-wsa-macro - qcom,sm8450-lpass-wsa-macro + - qcom,sm8550-lpass-wsa-macro - qcom,sc8280xp-lpass-wsa-macro
reg: @@ -27,11 +28,11 @@ properties: const: 0
clocks: - minItems: 5 + minItems: 4 maxItems: 6
clock-names: - minItems: 5 + minItems: 4 maxItems: 6
clock-output-names: @@ -62,6 +63,7 @@ allOf: then: properties: clocks: + minItems: 5 maxItems: 5 clock-names: items: @@ -89,6 +91,23 @@ allOf: - const: va - const: fsgen
+ - if: + properties: + compatible: + enum: + - qcom,sm8550-lpass-wsa-macro + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + - const: fsgen + unevaluatedProperties: false
examples:
Add support for the WSA macro codec on Qualcomm SM8550. SM8550 does not use NPL clock, thus add flags allowing to skip it.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Reviewed-by: Srinivas Kandagatla srinivas.kandagatla@linaro.org
---
Changes since v1: 1. Move the flag define to common header --- sound/soc/codecs/lpass-wsa-macro.c | 37 +++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c index 6484c335bd5d..8ba7dc89daaa 100644 --- a/sound/soc/codecs/lpass-wsa-macro.c +++ b/sound/soc/codecs/lpass-wsa-macro.c @@ -14,6 +14,8 @@ #include <linux/pm_runtime.h> #include <linux/of_platform.h> #include <sound/tlv.h> + +#include "lpass-macro-common.h" #include "lpass-wsa-macro.h"
#define CDC_WSA_CLK_RST_CTRL_MCLK_CONTROL (0x0000) @@ -2346,7 +2348,10 @@ static int wsa_macro_register_mclk_output(struct wsa_macro *wsa) struct clk_init_data init; int ret;
- parent_clk_name = __clk_get_name(wsa->npl); + if (wsa->npl) + parent_clk_name = __clk_get_name(wsa->npl); + else + parent_clk_name = __clk_get_name(wsa->mclk);
init.name = "mclk"; of_property_read_string(dev_of_node(dev), "clock-output-names", @@ -2379,9 +2384,12 @@ static int wsa_macro_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct wsa_macro *wsa; + kernel_ulong_t flags; void __iomem *base; int ret;
+ flags = (kernel_ulong_t)device_get_match_data(dev); + wsa = devm_kzalloc(dev, sizeof(*wsa), GFP_KERNEL); if (!wsa) return -ENOMEM; @@ -2398,9 +2406,11 @@ static int wsa_macro_probe(struct platform_device *pdev) if (IS_ERR(wsa->mclk)) return PTR_ERR(wsa->mclk);
- wsa->npl = devm_clk_get(dev, "npl"); - if (IS_ERR(wsa->npl)) - return PTR_ERR(wsa->npl); + if (flags & LPASS_MACRO_FLAG_HAS_NPL_CLOCK) { + wsa->npl = devm_clk_get(dev, "npl"); + if (IS_ERR(wsa->npl)) + return PTR_ERR(wsa->npl); + }
wsa->fsgen = devm_clk_get(dev, "fsgen"); if (IS_ERR(wsa->fsgen)) @@ -2551,10 +2561,21 @@ static const struct dev_pm_ops wsa_macro_pm_ops = { };
static const struct of_device_id wsa_macro_dt_match[] = { - {.compatible = "qcom,sc7280-lpass-wsa-macro"}, - {.compatible = "qcom,sm8250-lpass-wsa-macro"}, - {.compatible = "qcom,sm8450-lpass-wsa-macro"}, - {.compatible = "qcom,sc8280xp-lpass-wsa-macro" }, + { + .compatible = "qcom,sc7280-lpass-wsa-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8250-lpass-wsa-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8450-lpass-wsa-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8550-lpass-wsa-macro", + }, { + .compatible = "qcom,sc8280xp-lpass-wsa-macro", + .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + }, {} }; MODULE_DEVICE_TABLE(of, wsa_macro_dt_match);
On Mon, 27 Mar 2023 15:22:44 +0200, Krzysztof Kozlowski wrote:
This patchset can be merged as is - no dependencies.
Changes since v2
- Rebase.
- New patch: ASoC: dt-bindings: qcom,lpass-va-macro: Add missing NPL clock.
- Add Rb tags.
[...]
Applied to
broonie/sound.git for-6.4
Thanks!
[01/10] ASoC: dt-bindings: qcom,lpass-rx-macro: narrow clocks per variants commit: e4cf7805f084772cccf2094b634a16bccf2f444f [02/10] ASoC: dt-bindings: qcom,lpass-rx-macro: Add SM8550 RX macro commit: 0fc109f875721f9cef29bb68095f50d67343b4b7 [03/10] ASoC: codecs: lpass-rx-macro: add support for SM8550 commit: 492fe974fed0754f7076580e069e1e182e7b3603 [04/10] ASoC: dt-bindings: qcom,lpass-tx-macro: narrow clocks per variants commit: bf4afbf950938d42cf0df1ecd915affeb26f4d76 [05/10] ASoC: dt-bindings: qcom,lpass-tx-macro: Add SM8550 TX macro commit: 050578c6f18c28e95f9659493a52a67b68b4b667 [06/10] ASoC: codecs: lpass-tx-macro: add support for SM8550 commit: 5faf6a1c5256559af98c998b7416e4db8fb09b75 [07/10] ASoC: dt-bindings: qcom,lpass-va-macro: Add missing NPL clock (no commit info) [08/10] ASoC: dt-bindings: qcom,lpass-va-macro: Add SM8550 VA macro commit: f769fcefa683e150456555e2a280668509d834df [09/10] ASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8550 WSA macro commit: c1bda22bd2f382f9c3b27fb7a899f8804d92f897 [10/10] ASoC: codecs: lpass-wsa-macro: add support for SM8550 commit: 6b004b836ced4d9ce655b5f1c810833c1a880369
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
On Mon, 27 Mar 2023 15:22:44 +0200, Krzysztof Kozlowski wrote:
This patchset can be merged as is - no dependencies.
Changes since v2
- Rebase.
- New patch: ASoC: dt-bindings: qcom,lpass-va-macro: Add missing NPL clock.
- Add Rb tags.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[07/10] ASoC: dt-bindings: qcom,lpass-va-macro: Add missing NPL clock commit: cfad817095e111b640c7d538b9f182d2535ee065
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (2)
-
Krzysztof Kozlowski
-
Mark Brown