devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x
@ 2025-05-26 10:49 Krzysztof Kozlowski
  2025-05-26 10:49 ` [PATCH 1/6] ASoC: codecs: wcd937x: Simplify with devm_regulator_bulk_get_enable() Krzysztof Kozlowski
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26 10:49 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-sound, linux-kernel, linux-arm-msm, devicetree,
	Krzysztof Kozlowski

Make the WCD93xx codec drivers simpler using
devm_regulator_bulk_get_enable() and obtain missing VDD_PX supply on
wcd939x.

Context depends on fixes:
https://lore.kernel.org/r/20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-v1-0-0b8a2993b7d3@linaro.org

---
Krzysztof Kozlowski (6):
      ASoC: codecs: wcd937x: Simplify with devm_regulator_bulk_get_enable()
      ASoC: codecs: wcd938x: Simplify with devm_regulator_bulk_get_enable()
      ASoC: codecs: wcd939x: Simplify with devm_regulator_bulk_get_enable()
      ASoC: codecs: wcd939x: Simplify return from devm_gpiod_get() error
      ASoC: dt-bindings: qcom,wcd939x: Document missing VDD_PX supply
      ASoC: codecs: wcd939x: Add VDD_PX supply

 .../devicetree/bindings/sound/qcom,wcd939x.yaml    |  3 ++
 sound/soc/codecs/wcd937x.c                         | 31 +++++----------
 sound/soc/codecs/wcd937x.h                         |  1 -
 sound/soc/codecs/wcd938x.c                         | 35 +++++------------
 sound/soc/codecs/wcd939x.c                         | 45 +++++++---------------
 5 files changed, 34 insertions(+), 81 deletions(-)
---
base-commit: 3717d2adda1ad07b4ecf3bef144ee489cc1563a1
change-id: 20250526-b4-asoc-wcd9395-vdd-px-ec173383bd02
prerequisite-change-id: 20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-0ce64398f9cc:v1
prerequisite-patch-id: 104000f7254b9cc81be49af9ca584544718e52f1
prerequisite-patch-id: 230fcd1b712c5a3199e7c9d8250e98e5d55c0a40
prerequisite-patch-id: ecdbe74955eb7b710f72af1e3cf32ccac52890d5

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/6] ASoC: codecs: wcd937x: Simplify with devm_regulator_bulk_get_enable()
  2025-05-26 10:49 [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Krzysztof Kozlowski
@ 2025-05-26 10:49 ` Krzysztof Kozlowski
  2025-05-26 10:49 ` [PATCH 2/6] ASoC: codecs: wcd938x: " Krzysztof Kozlowski
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26 10:49 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-sound, linux-kernel, linux-arm-msm, devicetree,
	Krzysztof Kozlowski

Drop separate regulator get and enable in probe() path with
devm_regulator_bulk_get_enable(), which simplifies cleanup paths and
device remove().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wcd937x.c | 31 +++++++++----------------------
 sound/soc/codecs/wcd937x.h |  1 -
 2 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/sound/soc/codecs/wcd937x.c b/sound/soc/codecs/wcd937x.c
index b9df58b86ce953427e01ffb8c7eb7e52f9c2392a..92765a8693fbf87e2ba53fef75657ffb1b5fdb8f 100644
--- a/sound/soc/codecs/wcd937x.c
+++ b/sound/soc/codecs/wcd937x.c
@@ -90,7 +90,6 @@ struct wcd937x_priv {
 	struct irq_domain *virq;
 	struct regmap_irq_chip *wcd_regmap_irq_chip;
 	struct regmap_irq_chip_data *irq_chip;
-	struct regulator_bulk_data supplies[WCD937X_MAX_BULK_SUPPLY];
 	struct snd_soc_jack *jack;
 	unsigned long status_mask;
 	s32 micb_ref[WCD937X_MAX_MICBIAS];
@@ -113,6 +112,10 @@ struct wcd937x_priv {
 	atomic_t ana_clk_count;
 };
 
+static const char * const wcd937x_supplies[] = {
+	"vdd-rxtx", "vdd-px", "vdd-mic-bias", "vdd-buck",
+};
+
 static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(ear_pa_gain, 600, -1800);
 static const DECLARE_TLV_DB_SCALE(line_gain, 0, 7, 1);
 static const DECLARE_TLV_DB_SCALE(analog_gain, 0, 25, 1);
@@ -2934,18 +2937,10 @@ static int wcd937x_probe(struct platform_device *pdev)
 	cfg = &wcd937x->mbhc_cfg;
 	cfg->swap_gnd_mic = wcd937x_swap_gnd_mic;
 
-	wcd937x->supplies[0].supply = "vdd-rxtx";
-	wcd937x->supplies[1].supply = "vdd-px";
-	wcd937x->supplies[2].supply = "vdd-mic-bias";
-	wcd937x->supplies[3].supply = "vdd-buck";
-
-	ret = devm_regulator_bulk_get(dev, WCD937X_MAX_BULK_SUPPLY, wcd937x->supplies);
+	ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(wcd937x_supplies),
+					     wcd937x_supplies);
 	if (ret)
-		return dev_err_probe(dev, ret, "Failed to get supplies\n");
-
-	ret = regulator_bulk_enable(WCD937X_MAX_BULK_SUPPLY, wcd937x->supplies);
-	if (ret)
-		return dev_err_probe(dev, ret, "Failed to enable supplies\n");
+		return dev_err_probe(dev, ret, "Failed to get and enable supplies\n");
 
 	wcd937x_dt_parse_micbias_info(dev, wcd937x);
 
@@ -2962,13 +2957,13 @@ static int wcd937x_probe(struct platform_device *pdev)
 
 	ret = wcd937x_add_slave_components(wcd937x, dev, &match);
 	if (ret)
-		goto err_disable_regulators;
+		return ret;
 
 	wcd937x_reset(wcd937x);
 
 	ret = component_master_add_with_match(dev, &wcd937x_comp_ops, match);
 	if (ret)
-		goto err_disable_regulators;
+		return ret;
 
 	pm_runtime_set_autosuspend_delay(dev, 1000);
 	pm_runtime_use_autosuspend(dev);
@@ -2978,25 +2973,17 @@ static int wcd937x_probe(struct platform_device *pdev)
 	pm_runtime_idle(dev);
 
 	return 0;
-
-err_disable_regulators:
-	regulator_bulk_disable(WCD937X_MAX_BULK_SUPPLY, wcd937x->supplies);
-
-	return ret;
 }
 
 static void wcd937x_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct wcd937x_priv *wcd937x = dev_get_drvdata(dev);
 
 	component_master_del(&pdev->dev, &wcd937x_comp_ops);
 
 	pm_runtime_disable(dev);
 	pm_runtime_set_suspended(dev);
 	pm_runtime_dont_use_autosuspend(dev);
-
-	regulator_bulk_disable(WCD937X_MAX_BULK_SUPPLY, wcd937x->supplies);
 }
 
 #if defined(CONFIG_OF)
diff --git a/sound/soc/codecs/wcd937x.h b/sound/soc/codecs/wcd937x.h
index 4ef57c496c37c555c8684d65249c53f6a8b645a1..3ab21bb5846e2c85520d67e7dc248d4e7715dba5 100644
--- a/sound/soc/codecs/wcd937x.h
+++ b/sound/soc/codecs/wcd937x.h
@@ -487,7 +487,6 @@
 #define WCD937X_MAX_REGISTER			(WCD937X_DIGITAL_EFUSE_REG_31)
 
 #define WCD937X_MAX_MICBIAS			3
-#define WCD937X_MAX_BULK_SUPPLY			4
 #define WCD937X_MAX_SWR_CH_IDS			15
 #define WCD937X_SWRM_CH_MASK(ch_idx)		BIT(ch_idx - 1)
 

-- 
2.45.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/6] ASoC: codecs: wcd938x: Simplify with devm_regulator_bulk_get_enable()
  2025-05-26 10:49 [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Krzysztof Kozlowski
  2025-05-26 10:49 ` [PATCH 1/6] ASoC: codecs: wcd937x: Simplify with devm_regulator_bulk_get_enable() Krzysztof Kozlowski
@ 2025-05-26 10:49 ` Krzysztof Kozlowski
  2025-05-26 10:49 ` [PATCH 3/6] ASoC: codecs: wcd939x: " Krzysztof Kozlowski
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26 10:49 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-sound, linux-kernel, linux-arm-msm, devicetree,
	Krzysztof Kozlowski

Drop separate regulator get and enable in probe() path with
devm_regulator_bulk_get_enable(), which simplifies cleanup paths and
device remove().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wcd938x.c | 35 +++++++++--------------------------
 1 file changed, 9 insertions(+), 26 deletions(-)

diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index b72dcd9d01720f44550d6e438498a2e7eab6dc1a..72c36c6138e1f0e33d5acb3972aa26f7d2dd9b22 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -26,7 +26,6 @@
 #include "wcd938x.h"
 
 #define WCD938X_MAX_MICBIAS		(4)
-#define WCD938X_MAX_SUPPLY		(4)
 #define WCD938X_MBHC_MAX_BUTTONS	(8)
 #define TX_ADC_MAX			(4)
 
@@ -161,7 +160,6 @@ struct wcd938x_priv {
 	struct irq_domain *virq;
 	struct regmap_irq_chip *wcd_regmap_irq_chip;
 	struct regmap_irq_chip_data *irq_chip;
-	struct regulator_bulk_data supplies[WCD938X_MAX_SUPPLY];
 	struct snd_soc_jack *jack;
 	unsigned long status_mask;
 	s32 micb_ref[WCD938X_MAX_MICBIAS];
@@ -188,6 +186,10 @@ struct wcd938x_priv {
 	bool mux_setup_done;
 };
 
+static const char * const wcd938x_supplies[] = {
+	"vdd-rxtx", "vdd-io", "vdd-buck", "vdd-mic-bias",
+};
+
 static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(ear_pa_gain, 600, -1800);
 static const DECLARE_TLV_DB_SCALE(line_gain, -3000, 150, 0);
 static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(analog_gain, 0, 3000);
@@ -3293,20 +3295,10 @@ static int wcd938x_populate_dt_data(struct wcd938x_priv *wcd938x, struct device
 
 	cfg->swap_gnd_mic = wcd938x_swap_gnd_mic;
 
-	wcd938x->supplies[0].supply = "vdd-rxtx";
-	wcd938x->supplies[1].supply = "vdd-io";
-	wcd938x->supplies[2].supply = "vdd-buck";
-	wcd938x->supplies[3].supply = "vdd-mic-bias";
-
-	ret = regulator_bulk_get(dev, WCD938X_MAX_SUPPLY, wcd938x->supplies);
+	ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(wcd938x_supplies),
+					     wcd938x_supplies);
 	if (ret)
-		return dev_err_probe(dev, ret, "Failed to get supplies\n");
-
-	ret = regulator_bulk_enable(WCD938X_MAX_SUPPLY, wcd938x->supplies);
-	if (ret) {
-		regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies);
-		return dev_err_probe(dev, ret, "Failed to enable supplies\n");
-	}
+		return dev_err_probe(dev, ret, "Failed to get and enable supplies\n");
 
 	wcd938x_dt_parse_micbias_info(dev, wcd938x);
 
@@ -3570,13 +3562,13 @@ static int wcd938x_probe(struct platform_device *pdev)
 
 	ret = wcd938x_add_slave_components(wcd938x, dev, &match);
 	if (ret)
-		goto err_disable_regulators;
+		return ret;
 
 	wcd938x_reset(wcd938x);
 
 	ret = component_master_add_with_match(dev, &wcd938x_comp_ops, match);
 	if (ret)
-		goto err_disable_regulators;
+		return ret;
 
 	pm_runtime_set_autosuspend_delay(dev, 1000);
 	pm_runtime_use_autosuspend(dev);
@@ -3586,12 +3578,6 @@ static int wcd938x_probe(struct platform_device *pdev)
 	pm_runtime_idle(dev);
 
 	return 0;
-
-err_disable_regulators:
-	regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies);
-	regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies);
-
-	return ret;
 }
 
 static void wcd938x_remove(struct platform_device *pdev)
@@ -3607,9 +3593,6 @@ static void wcd938x_remove(struct platform_device *pdev)
 
 	if (wcd938x->us_euro_mux && wcd938x->mux_setup_done)
 		mux_control_deselect(wcd938x->us_euro_mux);
-
-	regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies);
-	regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies);
 }
 
 #if defined(CONFIG_OF)

-- 
2.45.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/6] ASoC: codecs: wcd939x: Simplify with devm_regulator_bulk_get_enable()
  2025-05-26 10:49 [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Krzysztof Kozlowski
  2025-05-26 10:49 ` [PATCH 1/6] ASoC: codecs: wcd937x: Simplify with devm_regulator_bulk_get_enable() Krzysztof Kozlowski
  2025-05-26 10:49 ` [PATCH 2/6] ASoC: codecs: wcd938x: " Krzysztof Kozlowski
@ 2025-05-26 10:49 ` Krzysztof Kozlowski
  2025-05-26 10:49 ` [PATCH 4/6] ASoC: codecs: wcd939x: Simplify return from devm_gpiod_get() error Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26 10:49 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-sound, linux-kernel, linux-arm-msm, devicetree,
	Krzysztof Kozlowski

Drop separate regulator get and enable in probe() path with
devm_regulator_bulk_get_enable(), which simplifies cleanup paths and
device remove().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wcd939x.c | 38 ++++++++++----------------------------
 1 file changed, 10 insertions(+), 28 deletions(-)

diff --git a/sound/soc/codecs/wcd939x.c b/sound/soc/codecs/wcd939x.c
index 067d23c7ecf90ae06da1ad6cc89d273fb7f7f875..95cd88a37acb5ef455d4a40948284ae45e2dfb28 100644
--- a/sound/soc/codecs/wcd939x.c
+++ b/sound/soc/codecs/wcd939x.c
@@ -32,7 +32,6 @@
 #include "wcd939x.h"
 
 #define WCD939X_MAX_MICBIAS		(4)
-#define WCD939X_MAX_SUPPLY		(4)
 #define WCD939X_MBHC_MAX_BUTTONS	(8)
 #define TX_ADC_MAX			(4)
 #define WCD_MBHC_HS_V_MAX		1600
@@ -192,7 +191,6 @@ struct wcd939x_priv {
 	struct irq_domain *virq;
 	struct regmap_irq_chip *wcd_regmap_irq_chip;
 	struct regmap_irq_chip_data *irq_chip;
-	struct regulator_bulk_data supplies[WCD939X_MAX_SUPPLY];
 	struct snd_soc_jack *jack;
 	unsigned long status_mask;
 	s32 micb_ref[WCD939X_MAX_MICBIAS];
@@ -213,6 +211,10 @@ struct wcd939x_priv {
 	bool ldoh;
 };
 
+static const char * const wcd939x_supplies[] = {
+	"vdd-rxtx", "vdd-io", "vdd-buck", "vdd-mic-bias",
+};
+
 static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(ear_pa_gain, 600, -1800);
 static const DECLARE_TLV_DB_SCALE(line_gain, 0, 7, 1);
 static const DECLARE_TLV_DB_SCALE(analog_gain, 0, 25, 1);
@@ -3244,20 +3246,10 @@ static int wcd939x_populate_dt_data(struct wcd939x_priv *wcd939x, struct device
 		return dev_err_probe(dev, ret, "Failed to get reset gpio\n");
 	}
 
-	wcd939x->supplies[0].supply = "vdd-rxtx";
-	wcd939x->supplies[1].supply = "vdd-io";
-	wcd939x->supplies[2].supply = "vdd-buck";
-	wcd939x->supplies[3].supply = "vdd-mic-bias";
-
-	ret = regulator_bulk_get(dev, WCD939X_MAX_SUPPLY, wcd939x->supplies);
+	ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(wcd939x_supplies),
+					     wcd939x_supplies);
 	if (ret)
-		return dev_err_probe(dev, ret, "Failed to get supplies\n");
-
-	ret = regulator_bulk_enable(WCD939X_MAX_SUPPLY, wcd939x->supplies);
-	if (ret) {
-		regulator_bulk_free(WCD939X_MAX_SUPPLY, wcd939x->supplies);
-		return dev_err_probe(dev, ret, "Failed to enable supplies\n");
-	}
+		return dev_err_probe(dev, ret, "Failed to get and enable supplies\n");
 
 	wcd939x_dt_parse_micbias_info(dev, wcd939x);
 
@@ -3629,17 +3621,17 @@ static int wcd939x_probe(struct platform_device *pdev)
 
 	ret = wcd939x_add_typec(wcd939x, dev);
 	if (ret)
-		goto err_disable_regulators;
+		return ret;
 
 	ret = wcd939x_add_slave_components(wcd939x, dev, &match);
 	if (ret)
-		goto err_disable_regulators;
+		return ret;
 
 	wcd939x_reset(wcd939x);
 
 	ret = component_master_add_with_match(dev, &wcd939x_comp_ops, match);
 	if (ret)
-		goto err_disable_regulators;
+		return ret;
 
 	pm_runtime_set_autosuspend_delay(dev, 1000);
 	pm_runtime_use_autosuspend(dev);
@@ -3649,27 +3641,17 @@ static int wcd939x_probe(struct platform_device *pdev)
 	pm_runtime_idle(dev);
 
 	return 0;
-
-err_disable_regulators:
-	regulator_bulk_disable(WCD939X_MAX_SUPPLY, wcd939x->supplies);
-	regulator_bulk_free(WCD939X_MAX_SUPPLY, wcd939x->supplies);
-
-	return ret;
 }
 
 static void wcd939x_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct wcd939x_priv *wcd939x = dev_get_drvdata(dev);
 
 	component_master_del(dev, &wcd939x_comp_ops);
 
 	pm_runtime_disable(dev);
 	pm_runtime_set_suspended(dev);
 	pm_runtime_dont_use_autosuspend(dev);
-
-	regulator_bulk_disable(WCD939X_MAX_SUPPLY, wcd939x->supplies);
-	regulator_bulk_free(WCD939X_MAX_SUPPLY, wcd939x->supplies);
 }
 
 #if defined(CONFIG_OF)

-- 
2.45.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/6] ASoC: codecs: wcd939x: Simplify return from devm_gpiod_get() error
  2025-05-26 10:49 [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2025-05-26 10:49 ` [PATCH 3/6] ASoC: codecs: wcd939x: " Krzysztof Kozlowski
@ 2025-05-26 10:49 ` Krzysztof Kozlowski
  2025-05-26 10:49 ` [PATCH 5/6] ASoC: dt-bindings: qcom,wcd939x: Document missing VDD_PX supply Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26 10:49 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-sound, linux-kernel, linux-arm-msm, devicetree,
	Krzysztof Kozlowski

No need to store devm_gpiod_get() error code in temporary variable.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wcd939x.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/wcd939x.c b/sound/soc/codecs/wcd939x.c
index 95cd88a37acb5ef455d4a40948284ae45e2dfb28..9592462f2d6e3067a2ed3339ddd5f676eaf3b5ed 100644
--- a/sound/soc/codecs/wcd939x.c
+++ b/sound/soc/codecs/wcd939x.c
@@ -3241,10 +3241,9 @@ static int wcd939x_populate_dt_data(struct wcd939x_priv *wcd939x, struct device
 	int ret;
 
 	wcd939x->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
-	if (IS_ERR(wcd939x->reset_gpio)) {
-		ret = PTR_ERR(wcd939x->reset_gpio);
-		return dev_err_probe(dev, ret, "Failed to get reset gpio\n");
-	}
+	if (IS_ERR(wcd939x->reset_gpio))
+		return dev_err_probe(dev, PTR_ERR(wcd939x->reset_gpio),
+				     "Failed to get reset gpio\n");
 
 	ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(wcd939x_supplies),
 					     wcd939x_supplies);

-- 
2.45.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/6] ASoC: dt-bindings: qcom,wcd939x: Document missing VDD_PX supply
  2025-05-26 10:49 [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2025-05-26 10:49 ` [PATCH 4/6] ASoC: codecs: wcd939x: Simplify return from devm_gpiod_get() error Krzysztof Kozlowski
@ 2025-05-26 10:49 ` Krzysztof Kozlowski
  2025-05-27 19:09   ` Rob Herring (Arm)
  2025-05-26 10:49 ` [PATCH 6/6] ASoC: codecs: wcd939x: Add " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26 10:49 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-sound, linux-kernel, linux-arm-msm, devicetree,
	Krzysztof Kozlowski

Document VDD_PX supply on WCD9390 and WCD9395 audio codecs, which was
missed in original posting.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/sound/qcom,wcd939x.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/qcom,wcd939x.yaml b/Documentation/devicetree/bindings/sound/qcom,wcd939x.yaml
index c69291f4d575ca5b4fc037ac4d59c91f0df74cd1..85283f94465d4f1ae6ec7a250e0c7f65d2fca172 100644
--- a/Documentation/devicetree/bindings/sound/qcom,wcd939x.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,wcd939x.yaml
@@ -45,6 +45,9 @@ properties:
       purpose of handling altmode muxing and orientation switching to detect and
       enable Audio Accessory Mode.
 
+  vdd-px-supply:
+    description: A reference to the 1.2V PX supply
+
 required:
   - compatible
 

-- 
2.45.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/6] ASoC: codecs: wcd939x: Add VDD_PX supply
  2025-05-26 10:49 [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2025-05-26 10:49 ` [PATCH 5/6] ASoC: dt-bindings: qcom,wcd939x: Document missing VDD_PX supply Krzysztof Kozlowski
@ 2025-05-26 10:49 ` Krzysztof Kozlowski
  2025-05-29  9:20 ` [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Srinivas Kandagatla
  2025-06-09 21:00 ` Mark Brown
  7 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-26 10:49 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-sound, linux-kernel, linux-arm-msm, devicetree,
	Krzysztof Kozlowski

Device has also VDD_PX supply, which should be acquired by the driver.
Regulator framework will provide a dummy supply, thus the change is
compatible with older DTS.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wcd939x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wcd939x.c b/sound/soc/codecs/wcd939x.c
index 9592462f2d6e3067a2ed3339ddd5f676eaf3b5ed..690832037b5dcee0722e118536a45cb70e5c61c2 100644
--- a/sound/soc/codecs/wcd939x.c
+++ b/sound/soc/codecs/wcd939x.c
@@ -212,7 +212,7 @@ struct wcd939x_priv {
 };
 
 static const char * const wcd939x_supplies[] = {
-	"vdd-rxtx", "vdd-io", "vdd-buck", "vdd-mic-bias",
+	"vdd-rxtx", "vdd-io", "vdd-buck", "vdd-mic-bias", "vdd-px",
 };
 
 static const SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(ear_pa_gain, 600, -1800);

-- 
2.45.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 5/6] ASoC: dt-bindings: qcom,wcd939x: Document missing VDD_PX supply
  2025-05-26 10:49 ` [PATCH 5/6] ASoC: dt-bindings: qcom,wcd939x: Document missing VDD_PX supply Krzysztof Kozlowski
@ 2025-05-27 19:09   ` Rob Herring (Arm)
  0 siblings, 0 replies; 10+ messages in thread
From: Rob Herring (Arm) @ 2025-05-27 19:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-kernel, Takashi Iwai, Liam Girdwood, Krzysztof Kozlowski,
	devicetree, Mark Brown, Jaroslav Kysela, Srinivas Kandagatla,
	Conor Dooley, linux-arm-msm, linux-sound


On Mon, 26 May 2025 12:49:54 +0200, Krzysztof Kozlowski wrote:
> Document VDD_PX supply on WCD9390 and WCD9395 audio codecs, which was
> missed in original posting.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/sound/qcom,wcd939x.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring (Arm) <robh@kernel.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x
  2025-05-26 10:49 [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Krzysztof Kozlowski
                   ` (5 preceding siblings ...)
  2025-05-26 10:49 ` [PATCH 6/6] ASoC: codecs: wcd939x: Add " Krzysztof Kozlowski
@ 2025-05-29  9:20 ` Srinivas Kandagatla
  2025-06-09 21:00 ` Mark Brown
  7 siblings, 0 replies; 10+ messages in thread
From: Srinivas Kandagatla @ 2025-05-29  9:20 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Srinivas Kandagatla, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-sound, linux-kernel, linux-arm-msm, devicetree



On 5/26/25 11:49 AM, Krzysztof Kozlowski wrote:
> Make the WCD93xx codec drivers simpler using
> devm_regulator_bulk_get_enable() and obtain missing VDD_PX supply on
> wcd939x.
> 
> Context depends on fixes:
> https://lore.kernel.org/r/20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-v1-0-0b8a2993b7d3@linaro.org
> 

LGTM, thanks for the cleanup.


Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>


-Srini
> ---
> Krzysztof Kozlowski (6):
>       ASoC: codecs: wcd937x: Simplify with devm_regulator_bulk_get_enable()
>       ASoC: codecs: wcd938x: Simplify with devm_regulator_bulk_get_enable()
>       ASoC: codecs: wcd939x: Simplify with devm_regulator_bulk_get_enable()
>       ASoC: codecs: wcd939x: Simplify return from devm_gpiod_get() error
>       ASoC: dt-bindings: qcom,wcd939x: Document missing VDD_PX supply
>       ASoC: codecs: wcd939x: Add VDD_PX supply
> 
>  .../devicetree/bindings/sound/qcom,wcd939x.yaml    |  3 ++
>  sound/soc/codecs/wcd937x.c                         | 31 +++++----------
>  sound/soc/codecs/wcd937x.h                         |  1 -
>  sound/soc/codecs/wcd938x.c                         | 35 +++++------------
>  sound/soc/codecs/wcd939x.c                         | 45 +++++++---------------
>  5 files changed, 34 insertions(+), 81 deletions(-)
> ---
> base-commit: 3717d2adda1ad07b4ecf3bef144ee489cc1563a1
> change-id: 20250526-b4-asoc-wcd9395-vdd-px-ec173383bd02
> prerequisite-change-id: 20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-0ce64398f9cc:v1
> prerequisite-patch-id: 104000f7254b9cc81be49af9ca584544718e52f1
> prerequisite-patch-id: 230fcd1b712c5a3199e7c9d8250e98e5d55c0a40
> prerequisite-patch-id: ecdbe74955eb7b710f72af1e3cf32ccac52890d5
> 
> Best regards,


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x
  2025-05-26 10:49 [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Krzysztof Kozlowski
                   ` (6 preceding siblings ...)
  2025-05-29  9:20 ` [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Srinivas Kandagatla
@ 2025-06-09 21:00 ` Mark Brown
  7 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2025-06-09 21:00 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Krzysztof Kozlowski
  Cc: linux-sound, linux-kernel, linux-arm-msm, devicetree

On Mon, 26 May 2025 12:49:49 +0200, Krzysztof Kozlowski wrote:
> Make the WCD93xx codec drivers simpler using
> devm_regulator_bulk_get_enable() and obtain missing VDD_PX supply on
> wcd939x.
> 
> Context depends on fixes:
> https://lore.kernel.org/r/20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-v1-0-0b8a2993b7d3@linaro.org
> 
> [...]

Applied to

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

Thanks!

[1/6] ASoC: codecs: wcd937x: Simplify with devm_regulator_bulk_get_enable()
      commit: 10cf8f6be63f2acfd3d366d917f1af6625cd9124
[2/6] ASoC: codecs: wcd938x: Simplify with devm_regulator_bulk_get_enable()
      commit: a7ee107c2dc382d28794d7b254d0b4de2a75dff2
[3/6] ASoC: codecs: wcd939x: Simplify with devm_regulator_bulk_get_enable()
      commit: cc50d176d0d8b38df2ae119310970f793cb5e756
[4/6] ASoC: codecs: wcd939x: Simplify return from devm_gpiod_get() error
      commit: 1a134881a8f861bfc996d77d3eee9017a95eb5d7
[5/6] ASoC: dt-bindings: qcom,wcd939x: Document missing VDD_PX supply
      commit: 7d648206bae8e7fd3d67481751a76dcb0a299eb8
[6/6] ASoC: codecs: wcd939x: Add VDD_PX supply
      commit: b9ecde0bcf6a99a3ff08496d4ba90a385ebbfd68

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-06-09 21:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-26 10:49 [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Krzysztof Kozlowski
2025-05-26 10:49 ` [PATCH 1/6] ASoC: codecs: wcd937x: Simplify with devm_regulator_bulk_get_enable() Krzysztof Kozlowski
2025-05-26 10:49 ` [PATCH 2/6] ASoC: codecs: wcd938x: " Krzysztof Kozlowski
2025-05-26 10:49 ` [PATCH 3/6] ASoC: codecs: wcd939x: " Krzysztof Kozlowski
2025-05-26 10:49 ` [PATCH 4/6] ASoC: codecs: wcd939x: Simplify return from devm_gpiod_get() error Krzysztof Kozlowski
2025-05-26 10:49 ` [PATCH 5/6] ASoC: dt-bindings: qcom,wcd939x: Document missing VDD_PX supply Krzysztof Kozlowski
2025-05-27 19:09   ` Rob Herring (Arm)
2025-05-26 10:49 ` [PATCH 6/6] ASoC: codecs: wcd939x: Add " Krzysztof Kozlowski
2025-05-29  9:20 ` [PATCH 0/6] ASoC: codecs: wcd93xx: Few simplifications of code and extend wcd939x Srinivas Kandagatla
2025-06-09 21:00 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).