All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies
@ 2023-08-03 21:55 Fabio Estevam
  2023-08-03 21:55 ` [PATCH 2/2] ASoC: wm8960: Add support for " Fabio Estevam
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Fabio Estevam @ 2023-08-03 21:55 UTC (permalink / raw)
  To: broonie
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, patches, alsa-devel,
	linux-kernel, shengjiu.wang, Fabio Estevam

From: Fabio Estevam <festevam@denx.de>

WM8960 has the following power supplies:

- AVDD
- DBVDD
- DCVDD
- SPKVDD1
- SPKVDD1

Add them to bindings to improve the hardware description.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 .../devicetree/bindings/sound/wlf,wm8960.yaml | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/wlf,wm8960.yaml b/Documentation/devicetree/bindings/sound/wlf,wm8960.yaml
index ee8eba7f0104..82519f6720ef 100644
--- a/Documentation/devicetree/bindings/sound/wlf,wm8960.yaml
+++ b/Documentation/devicetree/bindings/sound/wlf,wm8960.yaml
@@ -26,6 +26,21 @@ properties:
   '#sound-dai-cells':
     const: 0
 
+  AVDD-supply:
+    description: Analogue supply.
+
+  DBVDD-supply:
+    description: Digital Buffer Supply.
+
+  DCVDD-supply:
+    description: Digital Core Supply.
+
+  SPKVDD1-supply:
+    description: Supply for speaker drivers 1.
+
+  SPKVDD2-supply:
+    description: Supply for speaker drivers 2.
+
   wlf,capless:
     type: boolean
     description:
@@ -84,5 +99,10 @@ examples:
             wlf,hp-cfg = <3 2 3>;
             wlf,gpio-cfg = <1 3>;
             wlf,shared-lrclk;
+            DCVDD-supply = <&reg_audio>;
+            DBVDD-supply = <&reg_audio>;
+            AVDD-supply = <&reg_audio>;
+            SPKVDD1-supply = <&reg_audio>;
+            SPKVDD2-supply = <&reg_audio>;
         };
     };
-- 
2.34.1


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

* [PATCH 2/2] ASoC: wm8960: Add support for the power supplies
  2023-08-03 21:55 [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies Fabio Estevam
@ 2023-08-03 21:55 ` Fabio Estevam
  2023-08-04  8:38   ` Charles Keepax
  2023-08-04  8:39 ` [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe " Charles Keepax
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2023-08-03 21:55 UTC (permalink / raw)
  To: broonie
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, patches, alsa-devel,
	linux-kernel, shengjiu.wang, Fabio Estevam

From: Fabio Estevam <festevam@denx.de>

WM8960 has the following power supplies:

- AVDD
- DBVDD
- DCVDD
- SPKVDD1
- SPKVDD1

Add support for them.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Hi,

I haven't tested this. The motivation for this patch is due to a schema
warning on imx8m-evk.dts that says 'SPKVDD1-supply' is not a valid property.

 sound/soc/codecs/wm8960.c | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index d4bc97088354..0a50180750e8 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -120,6 +120,15 @@ static bool wm8960_volatile(struct device *dev, unsigned int reg)
 	}
 }
 
+#define WM8960_NUM_SUPPLIES 5
+static const char *wm8960_supply_names[WM8960_NUM_SUPPLIES] = {
+	"DCVDD",
+	"DBVDD",
+	"AVDD",
+	"SPKVDD1",
+	"SPKVDD2",
+};
+
 struct wm8960_priv {
 	struct clk *mclk;
 	struct regmap *regmap;
@@ -137,6 +146,7 @@ struct wm8960_priv {
 	bool is_stream_in_use[2];
 	struct wm8960_data pdata;
 	ktime_t dsch_start;
+	struct regulator_bulk_data supplies[WM8960_NUM_SUPPLIES];
 };
 
 #define wm8960_reset(c)	regmap_write(c, WM8960_RESET, 0)
@@ -1417,6 +1427,7 @@ static int wm8960_i2c_probe(struct i2c_client *i2c)
 {
 	struct wm8960_data *pdata = dev_get_platdata(&i2c->dev);
 	struct wm8960_priv *wm8960;
+	unsigned int i;
 	int ret;
 	u8 val;
 
@@ -1439,6 +1450,23 @@ static int wm8960_i2c_probe(struct i2c_client *i2c)
 		}
 	}
 
+	for (i = 0; i < ARRAY_SIZE(wm8960->supplies); i++)
+		wm8960->supplies[i].supply = wm8960_supply_names[i];
+
+	ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8960->supplies),
+				 wm8960->supplies);
+	if (ret <  0) {
+		dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret);
+		return ret;
+	}
+
+	ret = regulator_bulk_enable(ARRAY_SIZE(wm8960->supplies),
+				    wm8960->supplies);
+	if (ret < 0) {
+		dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret);
+		return ret;
+	}
+
 	wm8960->regmap = devm_regmap_init_i2c(i2c, &wm8960_regmap);
 	if (IS_ERR(wm8960->regmap))
 		return PTR_ERR(wm8960->regmap);
@@ -1505,7 +1533,11 @@ static int wm8960_i2c_probe(struct i2c_client *i2c)
 }
 
 static void wm8960_i2c_remove(struct i2c_client *client)
-{}
+{
+	struct wm8960_priv *wm8960 = i2c_get_clientdata(client);
+
+	regulator_bulk_disable(ARRAY_SIZE(wm8960->supplies), wm8960->supplies);
+}
 
 static const struct i2c_device_id wm8960_i2c_id[] = {
 	{ "wm8960", 0 },
-- 
2.34.1


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

* Re: [PATCH 2/2] ASoC: wm8960: Add support for the power supplies
  2023-08-03 21:55 ` [PATCH 2/2] ASoC: wm8960: Add support for " Fabio Estevam
@ 2023-08-04  8:38   ` Charles Keepax
  0 siblings, 0 replies; 7+ messages in thread
From: Charles Keepax @ 2023-08-04  8:38 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: broonie, robh+dt, krzysztof.kozlowski+dt, conor+dt, patches,
	alsa-devel, linux-kernel, shengjiu.wang, Fabio Estevam

On Thu, Aug 03, 2023 at 06:55:06PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> WM8960 has the following power supplies:
> 
> - AVDD
> - DBVDD
> - DCVDD
> - SPKVDD1
> - SPKVDD1
> 
> Add support for them.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies
  2023-08-03 21:55 [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies Fabio Estevam
  2023-08-03 21:55 ` [PATCH 2/2] ASoC: wm8960: Add support for " Fabio Estevam
@ 2023-08-04  8:39 ` Charles Keepax
  2023-08-04 15:39 ` Conor Dooley
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Charles Keepax @ 2023-08-04  8:39 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: broonie, robh+dt, krzysztof.kozlowski+dt, conor+dt, patches,
	alsa-devel, linux-kernel, shengjiu.wang, Fabio Estevam

On Thu, Aug 03, 2023 at 06:55:05PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> WM8960 has the following power supplies:
> 
> - AVDD
> - DBVDD
> - DCVDD
> - SPKVDD1
> - SPKVDD1
> 
> Add them to bindings to improve the hardware description.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies
  2023-08-03 21:55 [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies Fabio Estevam
  2023-08-03 21:55 ` [PATCH 2/2] ASoC: wm8960: Add support for " Fabio Estevam
  2023-08-04  8:39 ` [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe " Charles Keepax
@ 2023-08-04 15:39 ` Conor Dooley
  2023-08-04 16:57 ` Mark Brown
  2023-08-05 21:31 ` Krzysztof Kozlowski
  4 siblings, 0 replies; 7+ messages in thread
From: Conor Dooley @ 2023-08-04 15:39 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: broonie, robh+dt, krzysztof.kozlowski+dt, conor+dt, patches,
	alsa-devel, linux-kernel, shengjiu.wang, Fabio Estevam

[-- Attachment #1: Type: text/plain, Size: 410 bytes --]

On Thu, Aug 03, 2023 at 06:55:05PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> WM8960 has the following power supplies:
> 
> - AVDD
> - DBVDD
> - DCVDD
> - SPKVDD1
> - SPKVDD1
> 
> Add them to bindings to improve the hardware description.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies
  2023-08-03 21:55 [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies Fabio Estevam
                   ` (2 preceding siblings ...)
  2023-08-04 15:39 ` Conor Dooley
@ 2023-08-04 16:57 ` Mark Brown
  2023-08-05 21:31 ` Krzysztof Kozlowski
  4 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2023-08-04 16:57 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, patches, alsa-devel,
	linux-kernel, shengjiu.wang, Fabio Estevam

On Thu, 03 Aug 2023 18:55:05 -0300, Fabio Estevam wrote:
> WM8960 has the following power supplies:
> 
> - AVDD
> - DBVDD
> - DCVDD
> - SPKVDD1
> - SPKVDD1
> 
> [...]

Applied to

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

Thanks!

[1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies
      commit: 6a41c3a1606089bdf7f8da2b267d1d82fb32b378
[2/2] ASoC: wm8960: Add support for the power supplies
      commit: 422f10adc3eb5a7ff8567bf6e6590a4e4fa756c3

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] 7+ messages in thread

* Re: [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies
  2023-08-03 21:55 [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies Fabio Estevam
                   ` (3 preceding siblings ...)
  2023-08-04 16:57 ` Mark Brown
@ 2023-08-05 21:31 ` Krzysztof Kozlowski
  4 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-05 21:31 UTC (permalink / raw)
  To: Fabio Estevam, broonie
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, patches, alsa-devel,
	linux-kernel, shengjiu.wang, Fabio Estevam

On 03/08/2023 23:55, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> WM8960 has the following power supplies:
> 
> - AVDD
> - DBVDD
> - DCVDD
> - SPKVDD1
> - SPKVDD1
> 
> Add them to bindings to improve the hardware description.

Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.

You missed at least DT list (maybe more), so this won't be tested by
automated tooling. Performing review on untested code might be a waste
of time, thus I will skip this patch entirely till you follow the
process allowing the patch to be tested.

Please kindly resend and include all necessary To/Cc entries.

Best regards,
Krzysztof


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

end of thread, other threads:[~2023-08-05 21:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-03 21:55 [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe the power supplies Fabio Estevam
2023-08-03 21:55 ` [PATCH 2/2] ASoC: wm8960: Add support for " Fabio Estevam
2023-08-04  8:38   ` Charles Keepax
2023-08-04  8:39 ` [PATCH 1/2] ASoC: dt-bindings: wlf,wm8960: Describe " Charles Keepax
2023-08-04 15:39 ` Conor Dooley
2023-08-04 16:57 ` Mark Brown
2023-08-05 21:31 ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.