Like most Qualcomm SoCs, SM6115 has a TX Macro.
Only some minor changes were required.
Signed-off-by: Konrad Dybcio konrad.dybcio@linaro.org --- Konrad Dybcio (2): ASoC: dt-bindings: qcom,lpass-tx-macro: Add SM6115 ASoC: codecs: lpass-tx-macro: Add SM6115 support
.../bindings/sound/qcom,lpass-tx-macro.yaml | 18 ++++++++++++++++++ sound/soc/codecs/lpass-macro-common.h | 2 ++ sound/soc/codecs/lpass-tx-macro.c | 22 +++++++++++++++------- 3 files changed, 35 insertions(+), 7 deletions(-) --- base-commit: 6269320850097903b30be8f07a5c61d9f7592393 change-id: 20230825-topic-6115tx-b523a0209639
Best regards,
SM6115 has a TX Macro, requiring an NPL clock, but not DCODEC. Document it.
Signed-off-by: Konrad Dybcio konrad.dybcio@linaro.org --- .../devicetree/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 4156981fe02b..962701e9eb42 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml @@ -13,6 +13,7 @@ properties: compatible: enum: - qcom,sc7280-lpass-tx-macro + - qcom,sm6115-lpass-tx-macro - qcom,sm8250-lpass-tx-macro - qcom,sm8450-lpass-tx-macro - qcom,sm8550-lpass-tx-macro @@ -97,6 +98,23 @@ allOf: - const: dcodec - const: fsgen
+ - if: + properties: + compatible: + enum: + - qcom,sm6115-lpass-tx-macro + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: mclk + - const: npl + - const: dcodec + - const: fsgen + - if: properties: compatible:
On 25/08/2023 19:23, Konrad Dybcio wrote:
SM6115 has a TX Macro, requiring an NPL clock, but not DCODEC. Document it.
...
- if:
properties:
compatible:
enum:
- qcom,sm6115-lpass-tx-macro
- then:
properties:
clocks:
minItems: 4
maxItems: 4
clock-names:
items:
- const: mclk
- const: npl
- const: dcodec
- const: fsgen
Are you sure there is no macro? This means there will be no LPASS_HW_MACRO_VOTE vote. Do you have downstream sources somewhere?
Best regards, Krzysztof
On 26.08.2023 11:32, Krzysztof Kozlowski wrote:
On 25/08/2023 19:23, Konrad Dybcio wrote:
SM6115 has a TX Macro, requiring an NPL clock, but not DCODEC. Document it.
...
- if:
properties:
compatible:
enum:
- qcom,sm6115-lpass-tx-macro
- then:
properties:
clocks:
minItems: 4
maxItems: 4
clock-names:
items:
- const: mclk
- const: npl
- const: dcodec
- const: fsgen
Are you sure there is no macro? This means there will be no LPASS_HW_MACRO_VOTE vote.
Yes.
Do you have downstream sources somewhere? Also yes, but they're not public..
Konrad
On 26/08/2023 11:37, Konrad Dybcio wrote:
On 26.08.2023 11:32, Krzysztof Kozlowski wrote:
On 25/08/2023 19:23, Konrad Dybcio wrote:
SM6115 has a TX Macro, requiring an NPL clock, but not DCODEC. Document it.
...
- if:
properties:
compatible:
enum:
- qcom,sm6115-lpass-tx-macro
- then:
properties:
clocks:
minItems: 4
maxItems: 4
clock-names:
items:
- const: mclk
- const: npl
- const: dcodec
- const: fsgen
Are you sure there is no macro? This means there will be no LPASS_HW_MACRO_VOTE vote.
Yes.
Do you have downstream sources somewhere? Also yes, but they're not public..
Indeed. Looks correct:
Reviewed-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
Best regards, Krzysztof
SM6115 has a TX macro, which surprisingly doesn't host a SWR master. Conditionally skip the SWR reset sequence on this platform.
Signed-off-by: Konrad Dybcio konrad.dybcio@linaro.org --- sound/soc/codecs/lpass-macro-common.h | 2 ++ sound/soc/codecs/lpass-tx-macro.c | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/lpass-macro-common.h b/sound/soc/codecs/lpass-macro-common.h index 4eb886565ea3..d3684c7ab930 100644 --- a/sound/soc/codecs/lpass-macro-common.h +++ b/sound/soc/codecs/lpass-macro-common.h @@ -8,6 +8,8 @@
/* NPL clock is expected */ #define LPASS_MACRO_FLAG_HAS_NPL_CLOCK BIT(0) +/* The soundwire block should be internally reset at probe */ +#define LPASS_MACRO_FLAG_RESET_SWR BIT(1)
struct lpass_macro { struct device *macro_pd; diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c index 3e33418898e8..82f9873ffada 100644 --- a/sound/soc/codecs/lpass-tx-macro.c +++ b/sound/soc/codecs/lpass-tx-macro.c @@ -2045,15 +2045,19 @@ static int tx_macro_probe(struct platform_device *pdev) if (ret) goto err_fsgen;
+ /* reset soundwire block */ - regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, - CDC_TX_SWR_RESET_MASK, CDC_TX_SWR_RESET_ENABLE); + if (flags & LPASS_MACRO_FLAG_RESET_SWR) + regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, + CDC_TX_SWR_RESET_MASK, CDC_TX_SWR_RESET_ENABLE);
regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, CDC_TX_SWR_CLK_EN_MASK, CDC_TX_SWR_CLK_ENABLE); - regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, - CDC_TX_SWR_RESET_MASK, 0x0); + + if (flags & LPASS_MACRO_FLAG_RESET_SWR) + regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, + CDC_TX_SWR_RESET_MASK, 0x0);
ret = devm_snd_soc_register_component(dev, &tx_macro_component_drv, tx_macro_dai, @@ -2158,18 +2162,22 @@ 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", + .data = (void *)(LPASS_MACRO_FLAG_HAS_NPL_CLOCK | LPASS_MACRO_FLAG_RESET_SWR), + }, { + .compatible = "qcom,sm6115-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, + .data = (void *)(LPASS_MACRO_FLAG_HAS_NPL_CLOCK | LPASS_MACRO_FLAG_RESET_SWR), }, { .compatible = "qcom,sm8450-lpass-tx-macro", - .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + .data = (void *)(LPASS_MACRO_FLAG_HAS_NPL_CLOCK | LPASS_MACRO_FLAG_RESET_SWR), }, { .compatible = "qcom,sm8550-lpass-tx-macro", + .data = (void *)LPASS_MACRO_FLAG_RESET_SWR, }, { .compatible = "qcom,sc8280xp-lpass-tx-macro", - .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + .data = (void *)(LPASS_MACRO_FLAG_HAS_NPL_CLOCK | LPASS_MACRO_FLAG_RESET_SWR), }, { } };
On 25/08/2023 19:23, Konrad Dybcio wrote:
SM6115 has a TX macro, which surprisingly doesn't host a SWR master. Conditionally skip the SWR reset sequence on this platform.
Signed-off-by: Konrad Dybcio konrad.dybcio@linaro.org
sound/soc/codecs/lpass-macro-common.h | 2 ++ sound/soc/codecs/lpass-tx-macro.c | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/lpass-macro-common.h b/sound/soc/codecs/lpass-macro-common.h index 4eb886565ea3..d3684c7ab930 100644 --- a/sound/soc/codecs/lpass-macro-common.h +++ b/sound/soc/codecs/lpass-macro-common.h @@ -8,6 +8,8 @@
/* NPL clock is expected */ #define LPASS_MACRO_FLAG_HAS_NPL_CLOCK BIT(0) +/* The soundwire block should be internally reset at probe */ +#define LPASS_MACRO_FLAG_RESET_SWR BIT(1)
struct lpass_macro { struct device *macro_pd; diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c index 3e33418898e8..82f9873ffada 100644 --- a/sound/soc/codecs/lpass-tx-macro.c +++ b/sound/soc/codecs/lpass-tx-macro.c @@ -2045,15 +2045,19 @@ static int tx_macro_probe(struct platform_device *pdev) if (ret) goto err_fsgen;
Stray link line.
Rest looks good:
Reviewed-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
Best regards, Krzysztof
On Fri, 25 Aug 2023 19:23:11 +0200, Konrad Dybcio wrote:
Like most Qualcomm SoCs, SM6115 has a TX Macro.
Only some minor changes were required.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: dt-bindings: qcom,lpass-tx-macro: Add SM6115 commit: 9ff143aaabba989f275612de0d83cf9d39274828 [2/2] ASoC: codecs: lpass-tx-macro: Add SM6115 support commit: 510c46884299cf8da8e9d7db27572eafa9a0c567
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 (3)
-
Konrad Dybcio
-
Krzysztof Kozlowski
-
Mark Brown