* [PATCH 0/2] ASoC: es8316: Add regulator support
@ 2026-07-23 7:54 Hongyang Zhao
2026-07-23 7:54 ` [PATCH 1/2] ASoC: dt-bindings: es8316: Add regulator supplies Hongyang Zhao
2026-07-23 7:54 ` [PATCH 2/2] ASoC: codecs: es8316: Add regulator support Hongyang Zhao
0 siblings, 2 replies; 5+ messages in thread
From: Hongyang Zhao @ 2026-07-23 7:54 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai
Cc: Konrad Dybcio, Roger Shimizu, linux-sound, devicetree,
linux-kernel, Hongyang Zhao
Add regulator support for the four ES8316 power domains so
board descriptions can model and control the codec supplies.
The binding patch documents AVDD, CPVDD, DVDD and PVDD as optional
supplies to preserve compatibility with existing device-tree descriptions.
The driver patch requests and enables them before clocking or accessing the
codec, and unwinds them on failure and removal.
The supplies remain enabled over system suspend because the existing
suspend and resume callbacks do not handle a complete power loss.
Powering the codec down would require separate reset and
reinitialization support.
The missing supply model was identified while reviewing the RubikPi 3
audio support:
https://lore.kernel.org/linux-arm-msm/c293d9c7-bdb7-4303-80c8-404228c434d7@oss.qualcomm.com/
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
---
Hongyang Zhao (2):
ASoC: dt-bindings: es8316: Add regulator supplies
ASoC: codecs: es8316: Add regulator support
.../devicetree/bindings/sound/everest,es8316.yaml | 16 ++++++++++
sound/soc/codecs/es8316.c | 35 ++++++++++++++++++++--
2 files changed, 49 insertions(+), 2 deletions(-)
---
base-commit: b4515cf4156356e8f4fe6e0fdc17f59adab9772f
change-id: 20260723-es8316-regulator-next-20260722-7d96badfd4da
Best regards,
--
Hongyang Zhao <hongyang.zhao@thundersoft.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] ASoC: dt-bindings: es8316: Add regulator supplies
2026-07-23 7:54 [PATCH 0/2] ASoC: es8316: Add regulator support Hongyang Zhao
@ 2026-07-23 7:54 ` Hongyang Zhao
2026-07-24 9:53 ` Krzysztof Kozlowski
2026-07-23 7:54 ` [PATCH 2/2] ASoC: codecs: es8316: Add regulator support Hongyang Zhao
1 sibling, 1 reply; 5+ messages in thread
From: Hongyang Zhao @ 2026-07-23 7:54 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai
Cc: Konrad Dybcio, Roger Shimizu, linux-sound, devicetree,
linux-kernel, Hongyang Zhao
The ES8316 has separate AVDD, CPVDD, DVDD and PVDD supply inputs
for its analog, charge pump, digital core and digital I/O domains.
Describe all four inputs so boards can model the codec power topology.
Keep the properties optional for compatibility with existing
descriptions.
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
---
.../devicetree/bindings/sound/everest,es8316.yaml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/everest,es8316.yaml b/Documentation/devicetree/bindings/sound/everest,es8316.yaml
index fe5d938ca310..f45f59b7b070 100644
--- a/Documentation/devicetree/bindings/sound/everest,es8316.yaml
+++ b/Documentation/devicetree/bindings/sound/everest,es8316.yaml
@@ -49,6 +49,18 @@ properties:
items:
- const: mclk
+ avdd-supply:
+ description: Regulator providing the analog supply, from 2.0 V to 3.6 V
+
+ cpvdd-supply:
+ description: Regulator providing the charge pump supply, from 1.6 V to 2.0 V
+
+ dvdd-supply:
+ description: Regulator providing the digital core supply, from 1.6 V to 3.6 V
+
+ pvdd-supply:
+ description: Regulator providing the digital I/O supply, from 1.6 V to 3.6 V
+
interrupts:
maxItems: 1
description: Headphone detect interrupt
@@ -77,6 +89,10 @@ examples:
reg = <0x11>;
clocks = <&clks 10>;
clock-names = "mclk";
+ avdd-supply = <®_3p3v>;
+ cpvdd-supply = <®_1p8v>;
+ dvdd-supply = <®_1p8v>;
+ pvdd-supply = <®_1p8v>;
#sound-dai-cells = <0>;
};
};
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] ASoC: codecs: es8316: Add regulator support
2026-07-23 7:54 [PATCH 0/2] ASoC: es8316: Add regulator support Hongyang Zhao
2026-07-23 7:54 ` [PATCH 1/2] ASoC: dt-bindings: es8316: Add regulator supplies Hongyang Zhao
@ 2026-07-23 7:54 ` Hongyang Zhao
1 sibling, 0 replies; 5+ messages in thread
From: Hongyang Zhao @ 2026-07-23 7:54 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai
Cc: Konrad Dybcio, Roger Shimizu, linux-sound, devicetree,
linux-kernel, Hongyang Zhao
ES8316 has separate AVDD, CPVDD, DVDD and PVDD supply inputs.
Request the supplies during I2C probe. Enable them before enabling MCLK
and accessing the device registers, and disable them on probe failure
and component removal.
Leave the supplies enabled during system suspend because the existing
suspend and resume callbacks do not handle a complete power loss.
Powering the codec down would require separate reset and
reinitialization support.
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
---
sound/soc/codecs/es8316.c | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
index 3abe77423f29..904056b2569a 100644
--- a/sound/soc/codecs/es8316.c
+++ b/sound/soc/codecs/es8316.c
@@ -14,6 +14,7 @@
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
@@ -30,10 +31,20 @@ static const unsigned int supported_mclk_lrck_ratios[] = {
256, 384, 400, 500, 512, 768, 1024
};
+static const char * const es8316_supply_names[] = {
+ "avdd",
+ "cpvdd",
+ "dvdd",
+ "pvdd",
+};
+
+#define ES8316_NUM_SUPPLIES ARRAY_SIZE(es8316_supply_names)
+
struct es8316_priv {
struct mutex lock;
struct clk *mclk;
struct regmap *regmap;
+ struct regulator_bulk_data supplies[ES8316_NUM_SUPPLIES];
struct snd_soc_component *component;
struct snd_soc_jack *jack;
int irq;
@@ -767,10 +778,16 @@ static int es8316_probe(struct snd_soc_component *component)
if (!es8316->mclk)
dev_warn(component->dev, "assuming static mclk\n");
+ ret = regulator_bulk_enable(ES8316_NUM_SUPPLIES, es8316->supplies);
+ if (ret) {
+ dev_err(component->dev, "unable to enable supplies\n");
+ return ret;
+ }
+
ret = clk_prepare_enable(es8316->mclk);
if (ret) {
dev_err(component->dev, "unable to enable mclk\n");
- return ret;
+ goto err_disable_supplies;
}
/* Reset codec and enable current state machine */
@@ -793,6 +810,11 @@ static int es8316_probe(struct snd_soc_component *component)
snd_soc_component_write(component, ES8316_CLKMGR_ADCOSR, 0x32);
return 0;
+
+err_disable_supplies:
+ regulator_bulk_disable(ES8316_NUM_SUPPLIES, es8316->supplies);
+
+ return ret;
}
static void es8316_remove(struct snd_soc_component *component)
@@ -800,6 +822,7 @@ static void es8316_remove(struct snd_soc_component *component)
struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component);
clk_disable_unprepare(es8316->mclk);
+ regulator_bulk_disable(ES8316_NUM_SUPPLIES, es8316->supplies);
}
static int es8316_resume(struct snd_soc_component *component)
@@ -862,7 +885,7 @@ static int es8316_i2c_probe(struct i2c_client *i2c_client)
{
struct device *dev = &i2c_client->dev;
struct es8316_priv *es8316;
- int ret;
+ int i, ret;
es8316 = devm_kzalloc(&i2c_client->dev, sizeof(struct es8316_priv),
GFP_KERNEL);
@@ -871,6 +894,14 @@ static int es8316_i2c_probe(struct i2c_client *i2c_client)
i2c_set_clientdata(i2c_client, es8316);
+ for (i = 0; i < ES8316_NUM_SUPPLIES; i++)
+ es8316->supplies[i].supply = es8316_supply_names[i];
+
+ ret = devm_regulator_bulk_get(dev, ES8316_NUM_SUPPLIES,
+ es8316->supplies);
+ if (ret)
+ return dev_err_probe(dev, ret, "unable to get supplies\n");
+
es8316->regmap = devm_regmap_init_i2c(i2c_client, &es8316_regmap);
if (IS_ERR(es8316->regmap))
return PTR_ERR(es8316->regmap);
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] ASoC: dt-bindings: es8316: Add regulator supplies
2026-07-23 7:54 ` [PATCH 1/2] ASoC: dt-bindings: es8316: Add regulator supplies Hongyang Zhao
@ 2026-07-24 9:53 ` Krzysztof Kozlowski
2026-07-30 2:26 ` Hongyang Zhao
0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-24 9:53 UTC (permalink / raw)
To: Hongyang Zhao
Cc: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai, Konrad Dybcio,
Roger Shimizu, linux-sound, devicetree, linux-kernel
On Thu, Jul 23, 2026 at 03:54:29PM +0800, Hongyang Zhao wrote:
> The ES8316 has separate AVDD, CPVDD, DVDD and PVDD supply inputs
But you also add them to ES8311 and ES8323, without any explanation
here.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] ASoC: dt-bindings: es8316: Add regulator supplies
2026-07-24 9:53 ` Krzysztof Kozlowski
@ 2026-07-30 2:26 ` Hongyang Zhao
0 siblings, 0 replies; 5+ messages in thread
From: Hongyang Zhao @ 2026-07-30 2:26 UTC (permalink / raw)
To: krzk
Cc: broonie, conor+dt, devicetree, drake, hongyang.zhao, katsuhiro,
konrad.dybcio, krzk+dt, lgirdwood, linux-kernel, linux-sound,
matteomartelli3, perex, robh, rosh, tiwai, zhoubinbin
Thanks for the review!
On Thu, Jul 23, 2026 at 03:54:29PM +0800, Hongyang Zhao wrote:
> > The ES8316 has separate AVDD, CPVDD, DVDD and PVDD supply inputs
>
> But you also add them to ES8311 and ES8323, without any explanation
> here.
I checked the datasheet. The ES8311 and ES8323 family have different
supply inputs, while this series only implements regulator support for
ES8316. I will restrict AVDD, CPVDD, DVDD and PVDD to the everest,es8316
compatible in v2.
Thanks,
Hongyang
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-30 2:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 7:54 [PATCH 0/2] ASoC: es8316: Add regulator support Hongyang Zhao
2026-07-23 7:54 ` [PATCH 1/2] ASoC: dt-bindings: es8316: Add regulator supplies Hongyang Zhao
2026-07-24 9:53 ` Krzysztof Kozlowski
2026-07-30 2:26 ` Hongyang Zhao
2026-07-23 7:54 ` [PATCH 2/2] ASoC: codecs: es8316: Add regulator support Hongyang Zhao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox