Skip to contentSkip to conversation

Update Lpass digital codec macro drivers

PATCH In review Srinivasa Rao Mandadapu 3 participants 8 messages Oct 26, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v4 cover Update Lpass digital codec macro drivers

This patch set is to add support for lpass sc7280 based targets. Upadate compatible name and change of bulk clock voting to optional clock voting in digital codecs va, rx, tx macro drivers.

Changes Since V3:
-- Removed fixes tag.
-- Change signedoff by sequence.
Changes Since V2:
-- Add Tx macro deafults for lpass sc7280
Changes Since V1:
-- Removed individual clock voting and used bulk clock optional. -- Removed volatile changes and fixed default values. -- Typo errors.
Srinivasa Rao Mandadapu (5):
ASoC: qcom: Add compatible names in va,wsa,rx,tx codec drivers for

    sc7280

ASoC: qcom: dt-bindings: Add compatible names for lpass sc7280 digital
codecs
ASoC: codecs: tx-macro: Enable tx top soundwire mic clock
ASoC: codecs: tx-macro: Update tx default values
ASoC: codecs: Change bulk clock voting to optional voting in digital
codecs

 .../bindings/sound/qcom,lpass-rx-macro.yaml        |  4 +++-
 .../bindings/sound/qcom,lpass-tx-macro.yaml        |  4 +++-
 .../bindings/sound/qcom,lpass-va-macro.yaml        |  4 +++-
 .../bindings/sound/qcom,lpass-wsa-macro.yaml       |  4 +++-
 sound/soc/codecs/lpass-rx-macro.c                  |  3 ++-
 sound/soc/codecs/lpass-tx-macro.c                  | 25 +++++++++++++++++++---
 sound/soc/codecs/lpass-va-macro.c                  |  3 ++-
 sound/soc/codecs/lpass-wsa-macro.c                 |  1 +
 8 files changed, 39 insertions(+), 9 deletions(-)
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
#1 lore raw

PATCH v4 1/5 ASoC: qcom: Add compatible names in va,wsa,rx,tx codec drivers for sc7280

Add compatible names for sc7280 based targets in digital codec drivers va,wsa,rx and tx.

---
 sound/soc/codecs/lpass-rx-macro.c  | 1 +
 sound/soc/codecs/lpass-tx-macro.c  | 1 +
 sound/soc/codecs/lpass-va-macro.c  | 1 +
 sound/soc/codecs/lpass-wsa-macro.c | 1 +
 4 files changed, 4 insertions(+)
sound/soc/codecs/lpass-rx-macro.c +1 -0
index 196b068..c2b9333 100644
@@ -3577,6 +3577,7 @@ static int 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" },
 	{ }
 };
sound/soc/codecs/lpass-tx-macro.c +1 -0
index 27a0d5d..5dcae73 100644
@@ -1843,6 +1843,7 @@ static int tx_macro_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id tx_macro_dt_match[] = {
+	{ .compatible = "qcom,sc7280-lpass-tx-macro" },
 	{ .compatible = "qcom,sm8250-lpass-tx-macro" },
 	{ }
 };
sound/soc/codecs/lpass-va-macro.c +1 -0
index 56c93f4..70f09b4 100644
@@ -1472,6 +1472,7 @@ static int va_macro_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id va_macro_dt_match[] = {
+	{ .compatible = "qcom,sc7280-lpass-va-macro" },
 	{ .compatible = "qcom,sm8250-lpass-va-macro" },
 	{}
 };
sound/soc/codecs/lpass-wsa-macro.c +1 -0
index d3ac318..75baf8e 100644
@@ -2445,6 +2445,7 @@ static int wsa_macro_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id wsa_macro_dt_match[] = {
+	{.compatible = "qcom,sc7280-lpass-wsa-macro"},
 	{.compatible = "qcom,sm8250-lpass-wsa-macro"},
 	{}
 };
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
#2 lore raw

PATCH v4 2/5 ASoC: qcom: dt-bindings: Add compatible names for lpass sc7280 digital codecs

In reply to Srinivasa Rao Mandadapu

Update compatible names in va, wsa, rx and tx macro codes for lpass sc7280

---
 Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml  | 4 +++-
 Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml  | 4 +++-
 Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml  | 4 +++-
 Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml | 4 +++-
 4 files changed, 12 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml +3 -1
index 443d556..bc762b3 100644
@@ -11,7 +11,9 @@ maintainers:
 
 properties:
   compatible:
-    const: qcom,sm8250-lpass-rx-macro
+    enum:
+      - qcom,sc7280-lpass-rx-macro
+      - qcom,sm8250-lpass-rx-macro
 
   reg:
     maxItems: 1
Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml +3 -1
index 6b5ca02..74f5386 100644
@@ -11,7 +11,9 @@ maintainers:
 
 properties:
   compatible:
-    const: qcom,sm8250-lpass-tx-macro
+    enum:
+      - qcom,sc7280-lpass-tx-macro
+      - qcom,sm8250-lpass-tx-macro
 
   reg:
     maxItems: 1
Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml +3 -1
index 679b49c..99f2c36 100644
@@ -11,7 +11,9 @@ maintainers:
 
 properties:
   compatible:
-    const: qcom,sm8250-lpass-va-macro
+    enum:
+      - qcom,sc7280-lpass-va-macro
+      - qcom,sm8250-lpass-va-macro
 
   reg:
     maxItems: 1
Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml +3 -1
index 435b019..13cdb8a 100644
@@ -11,7 +11,9 @@ maintainers:
 
 properties:
   compatible:
-    const: qcom,sm8250-lpass-wsa-macro
+    enum:
+      - qcom,sc7280-lpass-wsa-macro
+      - qcom,sm8250-lpass-wsa-macro
 
   reg:
     maxItems: 1
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
#3 lore raw

PATCH v4 3/5 ASoC: codecs: tx-macro: Enable tx top soundwire mic clock

In reply to Srinivasa Rao Mandadapu

Enable tx path soundwire mic0 and mic1 clock.

---
 sound/soc/codecs/lpass-tx-macro.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/codecs/lpass-tx-macro.c +3 -0
index 5dcae73..d472af1 100644
@@ -1674,6 +1674,9 @@ static int tx_macro_component_probe(struct snd_soc_component *comp)
 
 	snd_soc_component_update_bits(comp, CDC_TX0_TX_PATH_SEC7, 0x3F,
 				      0x0A);
+	/* Enable swr mic0 and mic1 clock */
+	snd_soc_component_update_bits(comp, CDC_TX_TOP_CSR_SWR_AMIC0_CTL, 0xFF, 0x00);
+	snd_soc_component_update_bits(comp, CDC_TX_TOP_CSR_SWR_AMIC1_CTL, 0xFF, 0x00);
 
 	return 0;
 }
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
#4 lore raw

PATCH v4 4/5 ASoC: codecs: tx-macro: Update tx default values

In reply to Srinivasa Rao Mandadapu

Update mic control register default values to hardware reset values lpass sc7280.

---
 sound/soc/codecs/lpass-tx-macro.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
sound/soc/codecs/lpass-tx-macro.c +17 -2
index d472af1..6742405 100644
@@ -272,7 +272,7 @@ struct tx_macro {
 
 static const DECLARE_TLV_DB_SCALE(digital_gain, -8400, 100, -8400);
 
-static const struct reg_default tx_defaults[] = {
+static struct reg_default tx_defaults[] = {
 	/* TX Macro */
 	{ CDC_TX_CLK_RST_CTRL_MCLK_CONTROL, 0x00 },
 	{ CDC_TX_CLK_RST_CTRL_FS_CNT_CONTROL, 0x00 },
@@ -1781,9 +1781,10 @@ static const struct snd_soc_component_driver tx_macro_component_drv = {
 static int tx_macro_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
+	struct device_node *np = dev->of_node;
 	struct tx_macro *tx;
 	void __iomem *base;
-	int ret;
+	int ret, reg;
 
 	tx = devm_kzalloc(dev, sizeof(*tx), GFP_KERNEL);
 	if (!tx)
@@ -1805,6 +1806,20 @@ static int tx_macro_probe(struct platform_device *pdev)
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
+	/* Update defaults for lpass sc7280 */
+	if (of_device_is_compatible(np, "qcom,sc7280-lpass-tx-macro")) {
+		for (reg = 0; reg < ARRAY_SIZE(tx_defaults); reg++) {
+			switch (tx_defaults[reg].reg) {
+			case CDC_TX_TOP_CSR_SWR_AMIC0_CTL:
+			case CDC_TX_TOP_CSR_SWR_AMIC1_CTL:
+				tx_defaults[reg].def = 0x0E;
+				break;
+			default:
+				break;
+			}
+		}
+	}
+
 	tx->regmap = devm_regmap_init_mmio(dev, base, &tx_regmap_config);
 
 	dev_set_drvdata(dev, tx);
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
#5 lore raw

PATCH v4 5/5 ASoC: codecs: Change bulk clock voting to optional voting in digital codecs

In reply to Srinivasa Rao Mandadapu

Change bulk clock frequency voting to optional bulk voting in va, rx and tx macros to accommodate both ADSP and ADSP bypass based lpass architectures.

---
 sound/soc/codecs/lpass-rx-macro.c | 2 +-
 sound/soc/codecs/lpass-tx-macro.c | 2 +-
 sound/soc/codecs/lpass-va-macro.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/lpass-rx-macro.c +1 -1
index c2b9333..2bed5cf 100644
@@ -3531,7 +3531,7 @@ static int rx_macro_probe(struct platform_device *pdev)
 	rx->clks[3].id = "npl";
 	rx->clks[4].id = "fsgen";
 
-	ret = devm_clk_bulk_get(dev, RX_NUM_CLKS_MAX, rx->clks);
+	ret = devm_clk_bulk_get_optional(dev, RX_NUM_CLKS_MAX, rx->clks);
 	if (ret) {
 		dev_err(dev, "Error getting RX Clocks (%d)\n", ret);
 		return ret;
sound/soc/codecs/lpass-tx-macro.c +1 -1
index 6742405..a4c0a15 100644
@@ -1796,7 +1796,7 @@ static int tx_macro_probe(struct platform_device *pdev)
 	tx->clks[3].id = "npl";
 	tx->clks[4].id = "fsgen";
 
-	ret = devm_clk_bulk_get(dev, TX_NUM_CLKS_MAX, tx->clks);
+	ret = devm_clk_bulk_get_optional(dev, TX_NUM_CLKS_MAX, tx->clks);
 	if (ret) {
 		dev_err(dev, "Error getting RX Clocks (%d)\n", ret);
 		return ret;
sound/soc/codecs/lpass-va-macro.c +1 -1
index 70f09b4..11147e3 100644
@@ -1408,7 +1408,7 @@ static int va_macro_probe(struct platform_device *pdev)
 	va->clks[1].id = "dcodec";
 	va->clks[2].id = "mclk";
 
-	ret = devm_clk_bulk_get(dev, VA_NUM_CLKS_MAX, va->clks);
+	ret = devm_clk_bulk_get_optional(dev, VA_NUM_CLKS_MAX, va->clks);
 	if (ret) {
 		dev_err(dev, "Error getting VA Clocks (%d)\n", ret);
 		return ret;
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Tested-by Reviewed-by on the v4 series
#6 lore raw
In reply to Srinivasa Rao Mandadapu
Quoted 15 lines · Srinivasa Rao Mandadapu

This patch set is to add support for lpass sc7280 based targets. Upadate compatible name and change of bulk clock voting to optional clock voting in digital codecs va, rx, tx macro drivers.

Changes Since V3:
-- Removed fixes tag.
-- Change signedoff by sequence.
Changes Since V2:
-- Add Tx macro deafults for lpass sc7280
Changes Since V1:
-- Removed individual clock voting and used bulk clock optional. -- Removed volatile changes and fixed default values. -- Typo errors.
Srinivasa Rao Mandadapu (5):
ASoC: qcom: Add compatible names in va,wsa,rx,tx codec drivers for

Quoted 7 lines
     sc7280

ASoC: qcom: dt-bindings: Add compatible names for lpass sc7280 digital
codecs
ASoC: codecs: tx-macro: Enable tx top soundwire mic clock
ASoC: codecs: tx-macro: Update tx default values
ASoC: codecs: Change bulk clock voting to optional voting in digital
codecs

Tested on SM8250 MTP,

--srini

Quoted 11 lines
  .../bindings/sound/qcom,lpass-rx-macro.yaml        |  4 +++-
  .../bindings/sound/qcom,lpass-tx-macro.yaml        |  4 +++-
  .../bindings/sound/qcom,lpass-va-macro.yaml        |  4 +++-
  .../bindings/sound/qcom,lpass-wsa-macro.yaml       |  4 +++-
  sound/soc/codecs/lpass-rx-macro.c                  |  3 ++-
  sound/soc/codecs/lpass-tx-macro.c                  | 25 +++++++++++++++++++---
  sound/soc/codecs/lpass-va-macro.c                  |  3 ++-
  sound/soc/codecs/lpass-wsa-macro.c                 |  1 +
  8 files changed, 39 insertions(+), 9 deletions(-)
maintainer
#7 lore raw
In reply to Srinivasa Rao Mandadapu
Quoted 16 lines · Srinivasa Rao Mandadapu

This patch set is to add support for lpass sc7280 based targets. Upadate compatible name and change of bulk clock voting to optional clock voting in digital codecs va, rx, tx macro drivers.

Changes Since V3:
-- Removed fixes tag.
-- Change signedoff by sequence.
Changes Since V2:
-- Add Tx macro deafults for lpass sc7280
Changes Since V1:
-- Removed individual clock voting and used bulk clock optional. -- Removed volatile changes and fixed default values. -- Typo errors.
Srinivasa Rao Mandadapu (5):
ASoC: qcom: Add compatible names in va,wsa,rx,tx codec drivers for

    sc7280
Quoted 8 lines

ASoC: qcom: dt-bindings: Add compatible names for lpass sc7280 digital
codecs
ASoC: codecs: tx-macro: Enable tx top soundwire mic clock
ASoC: codecs: tx-macro: Update tx default values
ASoC: codecs: Change bulk clock voting to optional voting in digital
codecs

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/5] ASoC: qcom: Add compatible names in va,wsa,rx,tx codec drivers for sc7280

      commit: 9d8c69814d7d8abf299998dd1d3f4a0b595cddca
[2/5] ASoC: qcom: dt-bindings: Add compatible names for lpass sc7280 digital codecs
      commit: 6e3b196e5ad2e4cd23498935ba32cecedae53642
[3/5] ASoC: codecs: tx-macro: Enable tx top soundwire mic clock
      commit: 864b9b5856ae74a350933782399934bdde5df989
[4/5] ASoC: codecs: tx-macro: Update tx default values
      commit: 7b285c74e422d35b02349650a62d32f8ec78f51d
[5/5] ASoC: codecs: Change bulk clock voting to optional voting in digital codecs
      commit: 9f589cf0f91485c8591775acad056c80378a2d34

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