* [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src
2026-06-09 2:55 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
@ 2026-06-09 2:56 ` Zhang Yi
2026-06-09 3:11 ` sashiko-bot
0 siblings, 1 reply; 15+ messages in thread
From: Zhang Yi @ 2026-06-09 2:56 UTC (permalink / raw)
To: alsa-devel, broonie, devicetree; +Cc: tiwai, robh, krzk+dt, conor+dt, Zhang Yi
Fix the issue with incorrect modifications to mclk_src
Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
---
sound/soc/codecs/es8389.c | 12 ++++--------
sound/soc/codecs/es8389.h | 5 ++---
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
index 9c8164916..7a9d5d42a 100644
--- a/sound/soc/codecs/es8389.c
+++ b/sound/soc/codecs/es8389.c
@@ -36,8 +36,8 @@ struct es8389_private {
unsigned int sysclk;
int mastermode;
- u8 mclk_src;
u8 vddd;
+ bool mclk_src;
int version;
enum snd_soc_bias_level bias_level;
};
@@ -607,9 +607,9 @@ static int es8389_pcm_hw_params(struct snd_pcm_substream *substream,
regmap_update_bits(es8389->regmap, ES8389_ADC_FORMAT_MUTE, ES8389_DATA_LEN_MASK, state);
regmap_update_bits(es8389->regmap, ES8389_DAC_FORMAT_MUTE, ES8389_DATA_LEN_MASK, state);
- if (es8389->mclk_src == ES8389_SCLK_PIN) {
+ if (es8389->mclk_src) {
regmap_update_bits(es8389->regmap, ES8389_MASTER_CLK,
- ES8389_MCLK_SOURCE, es8389->mclk_src);
+ ES8389_MCLK_MASK, ES8389_MCLK_FROM_SCLK);
es8389->sysclk = params_channels(params) * params_width(params) * params_rate(params);
}
@@ -897,11 +897,7 @@ static int es8389_probe(struct snd_soc_component *component)
int ret, i;
struct es8389_private *es8389 = snd_soc_component_get_drvdata(component);
- ret = device_property_read_u8(component->dev, "everest,mclk-src", &es8389->mclk_src);
- if (ret != 0) {
- dev_dbg(component->dev, "mclk-src return %d", ret);
- es8389->mclk_src = ES8389_MCLK_SOURCE;
- }
+ es8389->mclk_src = device_property_read_bool(component->dev, "everest,mclk-from-sclk");
for (i = 0; i < ARRAY_SIZE(es8389_core_supplies); i++)
es8389->core_supply[i].supply = es8389_core_supplies[i];
diff --git a/sound/soc/codecs/es8389.h b/sound/soc/codecs/es8389.h
index d21e72f87..7f1212219 100644
--- a/sound/soc/codecs/es8389.h
+++ b/sound/soc/codecs/es8389.h
@@ -116,9 +116,8 @@
#define ES8389_TDM_SLOT (0x70 << 0)
#define ES8389_TDM_SHIFT 4
-#define ES8389_MCLK_SOURCE (1 << 6)
-#define ES8389_MCLK_PIN (1 << 6)
-#define ES8389_SCLK_PIN (0 << 6)
+#define ES8389_MCLK_MASK (3 << 6)
+#define ES8389_MCLK_FROM_SCLK (1 << 6)
/* ES8389_FMT */
#define ES8389_S24_LE (0 << 5)
--
2.17.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver
@ 2026-06-09 3:06 Zhang Yi
2026-06-09 3:06 ` [PATCH 1/7] ASoC: codecs: ES8389: Modify volatile_register Zhang Yi
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: Zhang Yi @ 2026-06-09 3:06 UTC (permalink / raw)
To: alsa-devel, broonie, devicetree; +Cc: tiwai, robh, krzk+dt, conor+dt, Zhang Yi
v0:
- Modify volatile_register
- Add MCLK_MASK to resolve the issue related to mclk_src
- Modify configuration about clock
- Add private members about HPF at driver and devicetree
- Add INPUT MUX at route
Zhang Yi (7):
ASoC: codecs: ES8389: Modify volatile_register
ASoC: codecs: ES8389: Fix the issue about mclk_src
ASoC: codecs: ES8389: Modify the clock table
ASoC: codecs: ES8389: Modify the initial configuration
ASoC: codecs: ES8389: Add private members related to HPF
ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX
ASoC: dt-bindings: ES8389: Add members about HPF and clock
.../bindings/sound/everest,es8389.yaml | 23 +++
sound/soc/codecs/es8389.c | 136 +++++++++++++-----
sound/soc/codecs/es8389.h | 6 +-
3 files changed, 125 insertions(+), 40 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/7] ASoC: codecs: ES8389: Modify volatile_register
2026-06-09 3:06 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
@ 2026-06-09 3:06 ` Zhang Yi
2026-06-09 3:17 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src Zhang Yi
` (5 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Zhang Yi @ 2026-06-09 3:06 UTC (permalink / raw)
To: alsa-devel, broonie, devicetree; +Cc: tiwai, robh, krzk+dt, conor+dt, Zhang Yi
Mark some registers that are not volatile as false
Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
---
sound/soc/codecs/es8389.c | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
index 449d9574b..9c8164916 100644
--- a/sound/soc/codecs/es8389.c
+++ b/sound/soc/codecs/es8389.c
@@ -50,10 +50,29 @@ static const char * const es8389_core_supplies[] = {
static bool es8389_volatile_register(struct device *dev,
unsigned int reg)
{
- if ((reg <= 0xff))
- return true;
- else
+ switch (reg) {
+ case ES8389_ADC_HPF1:
+ case ES8389_ADC_HPF2:
+ case ES8389_ADCL_VOL:
+ case ES8389_ADCR_VOL:
+ case ES8389_MIC1_GAIN:
+ case ES8389_MIC2_GAIN:
+ case ES8389_DACL_VOL:
+ case ES8389_DACR_VOL:
+ case ES8389_ALC_ON:
+ case ES8389_ALC_CTL:
+ case ES8389_ALC_TARGET:
+ case ES8389_ALC_GAIN:
+ case ES8389_ADC_MUTE:
+ case ES8389_OSR_VOL:
+ case ES8389_DAC_INV:
+ case ES8389_MIX_VOL:
+ case ES8389_DAC_MIX:
+ case ES8389_ADC_RESET:
return false;
+ default:
+ return true;
+ }
}
static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -9550, 50, 0);
--
2.17.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src
2026-06-09 3:06 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
2026-06-09 3:06 ` [PATCH 1/7] ASoC: codecs: ES8389: Modify volatile_register Zhang Yi
@ 2026-06-09 3:06 ` Zhang Yi
2026-06-09 3:20 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 3/7] ASoC: codecs: ES8389: Modify the clock table Zhang Yi
` (4 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Zhang Yi @ 2026-06-09 3:06 UTC (permalink / raw)
To: alsa-devel, broonie, devicetree; +Cc: tiwai, robh, krzk+dt, conor+dt, Zhang Yi
Fix the issue with incorrect modifications to mclk_src
Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
---
sound/soc/codecs/es8389.c | 12 ++++--------
sound/soc/codecs/es8389.h | 5 ++---
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
index 9c8164916..7a9d5d42a 100644
--- a/sound/soc/codecs/es8389.c
+++ b/sound/soc/codecs/es8389.c
@@ -36,8 +36,8 @@ struct es8389_private {
unsigned int sysclk;
int mastermode;
- u8 mclk_src;
u8 vddd;
+ bool mclk_src;
int version;
enum snd_soc_bias_level bias_level;
};
@@ -607,9 +607,9 @@ static int es8389_pcm_hw_params(struct snd_pcm_substream *substream,
regmap_update_bits(es8389->regmap, ES8389_ADC_FORMAT_MUTE, ES8389_DATA_LEN_MASK, state);
regmap_update_bits(es8389->regmap, ES8389_DAC_FORMAT_MUTE, ES8389_DATA_LEN_MASK, state);
- if (es8389->mclk_src == ES8389_SCLK_PIN) {
+ if (es8389->mclk_src) {
regmap_update_bits(es8389->regmap, ES8389_MASTER_CLK,
- ES8389_MCLK_SOURCE, es8389->mclk_src);
+ ES8389_MCLK_MASK, ES8389_MCLK_FROM_SCLK);
es8389->sysclk = params_channels(params) * params_width(params) * params_rate(params);
}
@@ -897,11 +897,7 @@ static int es8389_probe(struct snd_soc_component *component)
int ret, i;
struct es8389_private *es8389 = snd_soc_component_get_drvdata(component);
- ret = device_property_read_u8(component->dev, "everest,mclk-src", &es8389->mclk_src);
- if (ret != 0) {
- dev_dbg(component->dev, "mclk-src return %d", ret);
- es8389->mclk_src = ES8389_MCLK_SOURCE;
- }
+ es8389->mclk_src = device_property_read_bool(component->dev, "everest,mclk-from-sclk");
for (i = 0; i < ARRAY_SIZE(es8389_core_supplies); i++)
es8389->core_supply[i].supply = es8389_core_supplies[i];
diff --git a/sound/soc/codecs/es8389.h b/sound/soc/codecs/es8389.h
index d21e72f87..7f1212219 100644
--- a/sound/soc/codecs/es8389.h
+++ b/sound/soc/codecs/es8389.h
@@ -116,9 +116,8 @@
#define ES8389_TDM_SLOT (0x70 << 0)
#define ES8389_TDM_SHIFT 4
-#define ES8389_MCLK_SOURCE (1 << 6)
-#define ES8389_MCLK_PIN (1 << 6)
-#define ES8389_SCLK_PIN (0 << 6)
+#define ES8389_MCLK_MASK (3 << 6)
+#define ES8389_MCLK_FROM_SCLK (1 << 6)
/* ES8389_FMT */
#define ES8389_S24_LE (0 << 5)
--
2.17.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/7] ASoC: codecs: ES8389: Modify the clock table
2026-06-09 3:06 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
2026-06-09 3:06 ` [PATCH 1/7] ASoC: codecs: ES8389: Modify volatile_register Zhang Yi
2026-06-09 3:06 ` [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src Zhang Yi
@ 2026-06-09 3:06 ` Zhang Yi
2026-06-09 3:19 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 4/7] ASoC: codecs: ES8389: Modify the initial configuration Zhang Yi
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Zhang Yi @ 2026-06-09 3:06 UTC (permalink / raw)
To: alsa-devel, broonie, devicetree; +Cc: tiwai, robh, krzk+dt, conor+dt, Zhang Yi
Updated the configuration for certain frequencies
Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
---
sound/soc/codecs/es8389.c | 46 ++++++++++++++++++++-------------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
index 7a9d5d42a..6ad0b5800 100644
--- a/sound/soc/codecs/es8389.c
+++ b/sound/soc/codecs/es8389.c
@@ -434,52 +434,54 @@ static const struct _coeff_div coeff_div[] = {
{36, 576000, 16000, 0x00, 0x55, 0x84, 0xD0, 0x01, 0xC1, 0x90, 0x00, 0x00, 0x23, 0x8F, 0xBF, 0xC0, 0x1F, 0x8F, 0x01, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{48, 768000, 16000, 0x02, 0x57, 0x04, 0xC0, 0x01, 0xC1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{50, 800000, 16000, 0x00, 0x7E, 0x01, 0xD9, 0x00, 0xC2, 0x80, 0x00, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0xC7, 0x95, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
- {64, 1024000, 16000, 0x00, 0x45, 0x24, 0xC0, 0x01, 0xD1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
- {72, 1152000, 16000, 0x00, 0x45, 0x24, 0xC0, 0x01, 0xD1, 0x90, 0x00, 0x00, 0x23, 0x8F, 0xBF, 0xC0, 0x1F, 0x8F, 0x01, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
+ {64, 1024000, 16000, 0x00, 0x45, 0x24, 0xC0, 0x01, 0xC1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
+ {72, 1152000, 16000, 0x00, 0x45, 0x24, 0xC0, 0x01, 0xC1, 0x90, 0x00, 0x00, 0x23, 0x8F, 0xBF, 0xC0, 0x1F, 0x8F, 0x01, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{96, 1536000, 16000, 0x02, 0x55, 0x84, 0xD0, 0x01, 0xC1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{128, 2048000, 16000, 0x00, 0x51, 0x04, 0xD0, 0x01, 0xC1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{144, 2304000, 16000, 0x00, 0x51, 0x00, 0xC0, 0x01, 0xC1, 0x90, 0x00, 0x00, 0x23, 0x8F, 0xBF, 0xC0, 0x1F, 0x8F, 0x01, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
+ {150, 2400000, 16000, 0x02, 0x7E, 0x01, 0xC9, 0x00, 0xC2, 0x80, 0x40, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0xC7, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
{192, 3072000, 16000, 0x02, 0x65, 0x25, 0xE0, 0x00, 0xE1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
- {256, 4096000, 16000, 0x00, 0x41, 0x04, 0xC0, 0x01, 0xD1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
+ {256, 4096000, 16000, 0x00, 0x41, 0x04, 0xC0, 0x01, 0xC1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{300, 4800000, 16000, 0x02, 0x66, 0x01, 0xD9, 0x00, 0xC2, 0x80, 0x00, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0xC7, 0x95, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{384, 6144000, 16000, 0x02, 0x51, 0x04, 0xD0, 0x01, 0xC1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
- {512, 8192000, 16000, 0x01, 0x41, 0x04, 0xC0, 0x01, 0xD1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
+ {512, 8192000, 16000, 0x01, 0x41, 0x04, 0xC0, 0x01, 0xC1, 0x90, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{750, 12000000, 16000, 0x0E, 0x7E, 0x01, 0xC9, 0x00, 0xC2, 0x80, 0x40, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0xC7, 0x95, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
- {768, 12288000, 16000, 0x02, 0x41, 0x04, 0xC0, 0x01, 0xD1, 0x90, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
- {1024, 16384000, 16000, 0x03, 0x41, 0x04, 0xC0, 0x01, 0xD1, 0x90, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
+ {768, 12288000, 16000, 0x02, 0x41, 0x04, 0xC0, 0x01, 0xC1, 0x90, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
+ {1024, 16384000, 16000, 0x03, 0x41, 0x04, 0xC0, 0x01, 0xC1, 0x90, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{1152, 18432000, 16000, 0x08, 0x51, 0x04, 0xD0, 0x01, 0xC1, 0x90, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{1200, 19200000, 16000, 0x0B, 0x66, 0x01, 0xD9, 0x00, 0xC2, 0x80, 0x40, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0xC7, 0x95, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{1500, 24000000, 16000, 0x0E, 0x26, 0x01, 0xD9, 0x00, 0xC2, 0x80, 0xC0, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0xC7, 0x95, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
- {1536, 24576000, 16000, 0x05, 0x41, 0x04, 0xC0, 0x01, 0xD1, 0x90, 0xC0, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
+ {1536, 24576000, 16000, 0x05, 0x41, 0x04, 0xC0, 0x01, 0xC1, 0x90, 0xC0, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0xFF, 0x7F, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{1625, 26000000, 16000, 0x40, 0x6E, 0x05, 0xC8, 0x01, 0xC2, 0x90, 0xC0, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x12, 0x31, 0x0E, 2, 2},
{800, 19200000, 24000, 0x07, 0x66, 0x01, 0xD9, 0x00, 0xC2, 0x80, 0x40, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0xC7, 0x95, 0x00, 0x12, 0x00, 0x1A, 0x49, 0x14, 2, 2},
{375, 12000000, 32000, 0x0E, 0x2E, 0x05, 0xC8, 0x00, 0xC2, 0x80, 0x40, 0x01, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x23, 0x61, 0x1B, 2, 0},
- {600, 19200000, 32000, 0x05, 0x46, 0x01, 0xD8, 0x10, 0xD2, 0x80, 0x40, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x23, 0x61, 0x1B, 2, 2},
- {32, 1411200, 44100, 0x00, 0x45, 0xA4, 0xD0, 0x10, 0xD1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {600, 19200000, 32000, 0x05, 0x46, 0x01, 0xD8, 0x10, 0xC2, 0x80, 0x40, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x23, 0x61, 0x1B, 2, 2},
+ {32, 1411200, 44100, 0x00, 0x45, 0xA4, 0xD0, 0x10, 0xC1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
{64, 2822400, 44100, 0x00, 0x51, 0x00, 0xC0, 0x10, 0xC1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {128, 5644800, 44100, 0x00, 0x41, 0x04, 0xD0, 0x10, 0xD1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {256, 11289600, 44100, 0x01, 0x41, 0x04, 0xD0, 0x10, 0xD1, 0x80, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {512, 22579200, 44100, 0x03, 0x41, 0x04, 0xD0, 0x10, 0xD1, 0x80, 0xC0, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {32, 1536000, 48000, 0x00, 0x45, 0xA4, 0xD0, 0x10, 0xD1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {128, 5644800, 44100, 0x00, 0x41, 0x04, 0xD0, 0x10, 0xC1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {256, 11289600, 44100, 0x01, 0x41, 0x04, 0xD0, 0x10, 0xC1, 0x80, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {512, 22579200, 44100, 0x03, 0x41, 0x04, 0xD0, 0x10, 0xC1, 0x80, 0xC0, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {32, 1536000, 48000, 0x00, 0x45, 0xA4, 0xD0, 0x10, 0xC1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
{48, 2304000, 48000, 0x02, 0x55, 0x04, 0xC0, 0x10, 0xC1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
{50, 2400000, 48000, 0x00, 0x76, 0x01, 0xC8, 0x10, 0xC2, 0x80, 0x00, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
{64, 3072000, 48000, 0x00, 0x51, 0x04, 0xC0, 0x10, 0xC1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {100, 4800000, 48000, 0x00, 0x46, 0x01, 0xD8, 0x10, 0xD2, 0x80, 0x00, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {100, 4800000, 48000, 0x00, 0x46, 0x01, 0xD8, 0x10, 0xC2, 0x80, 0x00, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
{125, 6000000, 48000, 0x04, 0x6E, 0x05, 0xC8, 0x10, 0xC2, 0x80, 0x00, 0x01, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {128, 6144000, 48000, 0x00, 0x41, 0x04, 0xD0, 0x10, 0xD1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {200, 9600000, 48000, 0x01, 0x46, 0x01, 0xD8, 0x10, 0xD2, 0x80, 0x00, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {128, 6144000, 48000, 0x00, 0x41, 0x04, 0xD0, 0x10, 0xC1, 0x80, 0x00, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {200, 9600000, 48000, 0x01, 0x46, 0x01, 0xD8, 0x10, 0xC2, 0x80, 0x00, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
{250, 12000000, 48000, 0x04, 0x76, 0x01, 0xC8, 0x10, 0xC2, 0x80, 0x40, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {256, 12288000, 48000, 0x01, 0x41, 0x04, 0xD0, 0x10, 0xD1, 0x80, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {384, 18432000, 48000, 0x02, 0x41, 0x04, 0xD0, 0x10, 0xD1, 0x80, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {400, 19200000, 48000, 0x03, 0x46, 0x01, 0xD8, 0x10, 0xD2, 0x80, 0x40, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {500, 24000000, 48000, 0x04, 0x46, 0x01, 0xD8, 0x10, 0xD2, 0x80, 0xC0, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
- {512, 24576000, 48000, 0x03, 0x41, 0x04, 0xD0, 0x10, 0xD1, 0x80, 0xC0, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {256, 12288000, 48000, 0x01, 0x41, 0x04, 0xD0, 0x10, 0xC1, 0x80, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {384, 18432000, 48000, 0x02, 0x41, 0x04, 0xD0, 0x10, 0xC1, 0x80, 0x40, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {400, 19200000, 48000, 0x03, 0x46, 0x01, 0xD8, 0x10, 0xC2, 0x80, 0x40, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {500, 24000000, 48000, 0x04, 0x46, 0x01, 0xD8, 0x10, 0xC2, 0x80, 0xC0, 0x00, 0x18, 0x95, 0xD0, 0xC0, 0x63, 0x95, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
+ {512, 24576000, 48000, 0x03, 0x41, 0x04, 0xD0, 0x10, 0xC1, 0x80, 0xC0, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
{800, 38400000, 48000, 0x18, 0x45, 0x04, 0xC0, 0x10, 0xC1, 0x80, 0xC0, 0x00, 0x1F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x00, 0x12, 0x00, 0x35, 0x91, 0x28, 2, 2},
{128, 11289600, 88200, 0x00, 0x50, 0x00, 0xC0, 0x10, 0xC1, 0x80, 0x40, 0x00, 0x9F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x80, 0x12, 0xC0, 0x32, 0x89, 0x25, 2, 2},
- {64, 6144000, 96000, 0x00, 0x41, 0x00, 0xD0, 0x10, 0xD1, 0x80, 0x00, 0x00, 0x9F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x80, 0x12, 0xC0, 0x35, 0x91, 0x28, 2, 2},
+ {64, 6144000, 96000, 0x00, 0x41, 0x00, 0xD0, 0x10, 0xC1, 0x80, 0x00, 0x00, 0x9F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x80, 0x12, 0xC0, 0x35, 0x91, 0x28, 2, 2},
{96, 9216000, 96000, 0x02, 0x43, 0x00, 0xC0, 0x10, 0xC0, 0x80, 0x00, 0x00, 0x9F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x80, 0x12, 0xC0, 0x35, 0x91, 0x28, 2, 2},
{256, 24576000, 96000, 0x00, 0x40, 0x00, 0xC0, 0x10, 0xC1, 0x80, 0xC0, 0x00, 0x9F, 0x7F, 0xBF, 0xC0, 0x7F, 0x7F, 0x80, 0x12, 0xC0, 0x35, 0x91, 0x28, 2, 2},
{128, 24576000, 192000, 0x00, 0x50, 0x00, 0xC0, 0x18, 0xC1, 0x81, 0xC0, 0x00, 0x8F, 0x7F, 0xBF, 0xC0, 0x3F, 0x7F, 0x80, 0x12, 0xC0, 0x3F, 0xF9, 0x3F, 2, 2},
+ {64, 12288000, 192000, 0x00, 0x41, 0x00, 0xC0, 0x18, 0xC1, 0x80, 0x00, 0x00, 0x8F, 0x7F, 0xEF, 0xC0, 0x7F, 0x7F, 0x80, 0x12, 0xC0, 0x3F, 0xF9, 0x3F, 1, 0},
};
static inline int get_coeff(u8 vddd, u8 dmic, int mclk, int rate)
--
2.17.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/7] ASoC: codecs: ES8389: Modify the initial configuration
2026-06-09 3:06 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
` (2 preceding siblings ...)
2026-06-09 3:06 ` [PATCH 3/7] ASoC: codecs: ES8389: Modify the clock table Zhang Yi
@ 2026-06-09 3:06 ` Zhang Yi
2026-06-09 3:13 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 5/7] ASoC: codecs: ES8389: Add private members related to HPF Zhang Yi
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Zhang Yi @ 2026-06-09 3:06 UTC (permalink / raw)
To: alsa-devel, broonie, devicetree; +Cc: tiwai, robh, krzk+dt, conor+dt, Zhang Yi
Modify the initial configuration
Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
---
sound/soc/codecs/es8389.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
index 6ad0b5800..8e47b4e32 100644
--- a/sound/soc/codecs/es8389.c
+++ b/sound/soc/codecs/es8389.c
@@ -792,7 +792,7 @@ static void es8389_init(struct snd_soc_component *component)
regmap_read(es8389->regmap, ES8389_MAX_REGISTER, ®);
es8389->version = reg;
- regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x00);
+ regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x56);
regmap_write(es8389->regmap, ES8389_RESET, 0x7E);
regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x38);
regmap_write(es8389->regmap, ES8389_ADC_HPF1, 0x64);
@@ -844,7 +844,7 @@ static void es8389_init(struct snd_soc_component *component)
regmap_write(es8389->regmap, ES8389_SCLK_DIV, 0x04);
regmap_write(es8389->regmap, ES8389_LRCK_DIV1, 0x01);
regmap_write(es8389->regmap, ES8389_LRCK_DIV2, 0x00);
- regmap_write(es8389->regmap, ES8389_OSC_CLK, 0x00);
+ regmap_write(es8389->regmap, ES8389_OSC_CLK, 0x10);
regmap_write(es8389->regmap, ES8389_ADC_OSR, 0x1F);
regmap_write(es8389->regmap, ES8389_ADC_DSP, 0x7F);
regmap_write(es8389->regmap, ES8389_ADC_MUTE, 0xC0);
--
2.17.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/7] ASoC: codecs: ES8389: Add private members related to HPF
2026-06-09 3:06 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
` (3 preceding siblings ...)
2026-06-09 3:06 ` [PATCH 4/7] ASoC: codecs: ES8389: Modify the initial configuration Zhang Yi
@ 2026-06-09 3:06 ` Zhang Yi
2026-06-09 3:06 ` [PATCH 6/7] ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX Zhang Yi
2026-06-09 3:06 ` [PATCH 7/7] ASoC: dt-bindings: ES8389: Add members about HPF and clock Zhang Yi
6 siblings, 0 replies; 15+ messages in thread
From: Zhang Yi @ 2026-06-09 3:06 UTC (permalink / raw)
To: alsa-devel, broonie, devicetree; +Cc: tiwai, robh, krzk+dt, conor+dt, Zhang Yi
Add private members related to HPF.
And defines ES8389_HPF_DEFAULT
Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
---
sound/soc/codecs/es8389.c | 18 ++++++++++++++++--
sound/soc/codecs/es8389.h | 1 +
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
index 8e47b4e32..d1bcbbfcd 100644
--- a/sound/soc/codecs/es8389.c
+++ b/sound/soc/codecs/es8389.c
@@ -36,6 +36,8 @@ struct es8389_private {
unsigned int sysclk;
int mastermode;
+ u8 hpfl;
+ u8 hpfr;
u8 vddd;
bool mclk_src;
int version;
@@ -742,8 +744,8 @@ static int es8389_mute(struct snd_soc_dai *dai, int mute, int direction)
regmap_update_bits(es8389->regmap, ES8389_DAC_FORMAT_MUTE,
0x03, 0x00);
} else {
- regmap_update_bits(es8389->regmap, ES8389_ADC_HPF1, 0x0f, 0x0a);
- regmap_update_bits(es8389->regmap, ES8389_ADC_HPF2, 0x0f, 0x0a);
+ regmap_update_bits(es8389->regmap, ES8389_ADC_HPF1, 0x0f, es8389->hpfl);
+ regmap_update_bits(es8389->regmap, ES8389_ADC_HPF2, 0x0f, es8389->hpfr);
regmap_update_bits(es8389->regmap, ES8389_ADC_FORMAT_MUTE,
0x03, 0x00);
}
@@ -901,6 +903,18 @@ static int es8389_probe(struct snd_soc_component *component)
es8389->mclk_src = device_property_read_bool(component->dev, "everest,mclk-from-sclk");
+ ret = device_property_read_u8(component->dev, "everest,hpfl", &es8389->hpfl);
+ if (ret != 0) {
+ dev_dbg(component->dev, "hpfl return %d\n", ret);
+ es8389->hpfl = ES8389_HPF_DEFAULT;
+ }
+
+ ret = device_property_read_u8(component->dev, "everest,hpfr", &es8389->hpfr);
+ if (ret != 0) {
+ dev_dbg(component->dev, "hpfr return %d\n", ret);
+ es8389->hpfr = ES8389_HPF_DEFAULT;
+ }
+
for (i = 0; i < ARRAY_SIZE(es8389_core_supplies); i++)
es8389->core_supply[i].supply = es8389_core_supplies[i];
ret = devm_regulator_bulk_get(component->dev, ARRAY_SIZE(es8389_core_supplies), es8389->core_supply);
diff --git a/sound/soc/codecs/es8389.h b/sound/soc/codecs/es8389.h
index 7f1212219..81353dcec 100644
--- a/sound/soc/codecs/es8389.h
+++ b/sound/soc/codecs/es8389.h
@@ -105,6 +105,7 @@
#define ES8389_MIC_SEL_MASK (7 << 4)
#define ES8389_MIC_DEFAULT (1 << 4)
+#define ES8389_HPF_DEFAULT (0x0A << 0)
#define ES8389_MASTER_MODE_EN (1 << 0)
--
2.17.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 6/7] ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX
2026-06-09 3:06 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
` (4 preceding siblings ...)
2026-06-09 3:06 ` [PATCH 5/7] ASoC: codecs: ES8389: Add private members related to HPF Zhang Yi
@ 2026-06-09 3:06 ` Zhang Yi
2026-06-09 3:21 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 7/7] ASoC: dt-bindings: ES8389: Add members about HPF and clock Zhang Yi
6 siblings, 1 reply; 15+ messages in thread
From: Zhang Yi @ 2026-06-09 3:06 UTC (permalink / raw)
To: alsa-devel, broonie, devicetree; +Cc: tiwai, robh, krzk+dt, conor+dt, Zhang Yi
Add INPUTL MUX and INPUTR MUX in route
Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
---
sound/soc/codecs/es8389.c | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
index d1bcbbfcd..5e4afafd9 100644
--- a/sound/soc/codecs/es8389.c
+++ b/sound/soc/codecs/es8389.c
@@ -164,6 +164,16 @@ static const struct soc_enum alc_ramprate =
static const struct soc_enum alc_winsize =
SOC_ENUM_SINGLE(ES8389_ALC_CTL, 0, 16, winsize);
+static const char *const es8389_adcl_mux_txt[] = {
+ "Normal",
+ "ADC2 channel to ADC1 channel",
+};
+
+static const char *const es8389_adcr_mux_txt[] = {
+ "Normal",
+ "ADC1 channel to ADC2 channel",
+};
+
static const char *const es8389_outl_mux_txt[] = {
"Normal",
"DAC2 channel to DAC1 channel",
@@ -191,6 +201,20 @@ static const unsigned int es8389_pga_values[] = {
1, 5, 6
};
+static const struct soc_enum es8389_adcl_mux_enum =
+ SOC_ENUM_SINGLE(ES8389_ADC_MODE, 5,
+ ARRAY_SIZE(es8389_adcl_mux_txt), es8389_adcl_mux_txt);
+
+static const struct snd_kcontrol_new es8389_adcl_mux_controls =
+ SOC_DAPM_ENUM("INPUTL MUX", es8389_adcl_mux_enum);
+
+static const struct soc_enum es8389_adcr_mux_enum =
+ SOC_ENUM_SINGLE(ES8389_ADC_MODE, 4,
+ ARRAY_SIZE(es8389_adcr_mux_txt), es8389_adcr_mux_txt);
+
+static const struct snd_kcontrol_new es8389_adcr_mux_controls =
+ SOC_DAPM_ENUM("INPUTR MUX", es8389_adcr_mux_enum);
+
static const struct soc_enum es8389_outl_mux_enum =
SOC_ENUM_SINGLE(ES8389_DAC_MIX, 5,
ARRAY_SIZE(es8389_outl_mux_txt), es8389_outl_mux_txt);
@@ -319,6 +343,8 @@ static const struct snd_soc_dapm_widget es8389_dapm_widgets[] = {
&es8389_adc_mixer_controls[0],
ARRAY_SIZE(es8389_adc_mixer_controls)),
SND_SOC_DAPM_MUX("ADC MUX", SND_SOC_NOPM, 0, 0, &es8389_dmic_mux_controls),
+ SND_SOC_DAPM_MUX("INPUTL MUX", SND_SOC_NOPM, 0, 0, &es8389_adcl_mux_controls),
+ SND_SOC_DAPM_MUX("INPUTR MUX", SND_SOC_NOPM, 0, 0, &es8389_adcr_mux_controls),
SND_SOC_DAPM_MUX("OUTL MUX", SND_SOC_NOPM, 0, 0, &es8389_outl_mux_controls),
SND_SOC_DAPM_MUX("OUTR MUX", SND_SOC_NOPM, 0, 0, &es8389_outr_mux_controls),
@@ -332,10 +358,15 @@ static const struct snd_soc_dapm_route es8389_dapm_routes[] = {
{"ADCL", NULL, "PGAL"},
{"ADCR", NULL, "PGAR"},
+ {"INPUTL MUX", "Normal", "ADCL"},
+ {"INPUTL MUX", "ADC2 channel to ADC1 channel", "ADCR"},
+ {"INPUTR MUX", "Normal", "ADCR"},
+ {"INPUTR MUX", "ADC1 channel to ADC2 channel", "ADCL"},
+
{"ADC Mixer", "DACL ADCL Mixer", "DACL"},
{"ADC Mixer", "DACR ADCR Mixer", "DACR"},
- {"ADC Mixer", NULL, "ADCL"},
- {"ADC Mixer", NULL, "ADCR"},
+ {"ADC Mixer", NULL, "INPUTL MUX"},
+ {"ADC Mixer", NULL, "INPUTR MUX"},
{"ADC MUX", "AMIC", "ADC Mixer"},
{"ADC MUX", "DMIC", "DMIC"},
--
2.17.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 7/7] ASoC: dt-bindings: ES8389: Add members about HPF and clock
2026-06-09 3:06 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
` (5 preceding siblings ...)
2026-06-09 3:06 ` [PATCH 6/7] ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX Zhang Yi
@ 2026-06-09 3:06 ` Zhang Yi
6 siblings, 0 replies; 15+ messages in thread
From: Zhang Yi @ 2026-06-09 3:06 UTC (permalink / raw)
To: alsa-devel, broonie, devicetree; +Cc: tiwai, robh, krzk+dt, conor+dt, Zhang Yi
Add members related to HPF and mclk_source
Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
---
.../bindings/sound/everest,es8389.yaml | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/everest,es8389.yaml b/Documentation/devicetree/bindings/sound/everest,es8389.yaml
index 75ce0bc48..be92014c0 100644
--- a/Documentation/devicetree/bindings/sound/everest,es8389.yaml
+++ b/Documentation/devicetree/bindings/sound/everest,es8389.yaml
@@ -38,6 +38,27 @@ properties:
description:
Interface power supply.
+ everest,mclk-from-sclk:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description:
+ Indicates that SCLK is used as the internal clock.
+
+ everest,hpfl:
+ $ref: /schemas/types.yaml#/definitions/uint8
+ description:
+ the HPF value of ADCL.
+ minimum: 0x00
+ maximum: 0x0f
+ default: 0x0a
+
+ everest,hpfr:
+ $ref: /schemas/types.yaml#/definitions/uint8
+ description:
+ the HPF value of ADCR.
+ minimum: 0x00
+ maximum: 0x0f
+ default: 0x0a
+
required:
- compatible
- reg
@@ -58,5 +79,7 @@ examples:
#sound-dai-cells = <0>;
vddd-supply = <&vdd3v3>;
vdda-supply = <&vdd3v3>;
+ everest,hpfl = [0a];
+ everest,hpfr = [0a];
};
};
--
2.17.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src
2026-06-09 2:56 ` [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src Zhang Yi
@ 2026-06-09 3:11 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-06-09 3:11 UTC (permalink / raw)
To: Zhang Yi; +Cc: conor+dt, devicetree, robh
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
Pre-existing issues:
- [High] Incorrect sysclk calculation for SCLK mode due to using params_width() instead of params_physical_width() or snd_soc_params_to_bclk().
- [High] Component probe function ties devm_ allocations to the I2C device, causing memory and resource leaks on ASoC card unbind/rebind.
- [High] Regulators are enabled in component probe but never disabled in component remove, leading to regulator enable count leaks.
- [High] Silent failure when valid clock coefficients are not found.
--
commit 96650b0d78cc8e7757fca690cc1cc18f2d5796b3
Author: Zhang Yi <zhangyi@everest-semi.com>
ASoC: codecs: ES8389: Fix the issue about mclk_src
Fix the issue with incorrect modifications to mclk_src
> diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
> index 9c816491648c7..7a9d5d42a05d0 100644
> --- a/sound/soc/codecs/es8389.c
> +++ b/sound/soc/codecs/es8389.c
[ ... ]
> @@ -607,9 +607,9 @@ static int es8389_pcm_hw_params(struct snd_pcm_substream *substream,
> regmap_update_bits(es8389->regmap, ES8389_ADC_FORMAT_MUTE, ES8389_DATA_LEN_MASK, state);
> regmap_update_bits(es8389->regmap, ES8389_DAC_FORMAT_MUTE, ES8389_DATA_LEN_MASK, state);
>
> - if (es8389->mclk_src == ES8389_SCLK_PIN) {
> + if (es8389->mclk_src) {
> regmap_update_bits(es8389->regmap, ES8389_MASTER_CLK,
> - ES8389_MCLK_SOURCE, es8389->mclk_src);
> + ES8389_MCLK_MASK, ES8389_MCLK_FROM_SCLK);
> es8389->sysclk = params_channels(params) * params_width(params) * params_rate(params);
[Severity: High]
This isn't a bug introduced by this patch, but does this calculate the
sysclk correctly for SCLK mode?
It looks like params_width() returns the semantic sample width (e.g., 24
for S24_LE), rather than the physical slot width on the I2S bus
(typically 32 bits for 24-bit samples).
Could this result in an incorrectly calculated sysclk, causing get_coeff()
to fail or configure incorrect clock dividers? Should this use
params_physical_width() or snd_soc_params_to_bclk() instead?
Later in this same function:
sound/soc/codecs/es8389.c:es8389_pcm_hw_params() {
...
coeff = get_coeff(es8389->vddd, dmic_enable, es8389->sysclk, params_rate(params));
if (coeff >= 0) {
...
} else {
dev_warn(component->dev, "Clock coefficients do not match");
}
return 0;
}
[Severity: High]
This is a pre-existing issue, but does this safely handle errors?
If get_coeff() fails to find valid clock coefficients and returns -EINVAL,
the driver logs a warning but unconditionally returns 0 (success) to the
ALSA core.
Will this cause the audio framework to proceed with an unconfigured codec,
resulting in silent failures or garbled audio? Should it propagate the error
code instead?
[ ... ]
> @@ -897,11 +897,7 @@ static int es8389_probe(struct snd_soc_component *component)
> int ret, i;
> struct es8389_private *es8389 = snd_soc_component_get_drvdata(component);
>
> - ret = device_property_read_u8(component->dev, "everest,mclk-src", &es8389->mclk_src);
> - if (ret != 0) {
> - dev_dbg(component->dev, "mclk-src return %d", ret);
> - es8389->mclk_src = ES8389_MCLK_SOURCE;
> - }
> + es8389->mclk_src = device_property_read_bool(component->dev, "everest,mclk-from-sclk");
>
> for (i = 0; i < ARRAY_SIZE(es8389_core_supplies); i++)
> es8389->core_supply[i].supply = es8389_core_supplies[i];
[Severity: High]
This isn't a bug introduced by this patch, but does es8389_probe() leak
resources during ASoC card unbind/rebind?
This is an ASoC component probe callback (executed when the sound card
binds), not an I2C driver probe callback. However, later in this
function, it allocates devm resources tied to the I2C device:
sound/soc/codecs/es8389.c:es8389_probe() {
...
ret = devm_regulator_bulk_get(component->dev, ARRAY_SIZE(es8389_core_supplies), es8389->core_supply);
...
es8389->mclk = devm_clk_get_optional(component->dev, "mclk");
...
}
Since the I2C device's lifecycle spans beyond the sound card's lifecycle,
every time the sound card is unbound and rebound, won't es8389_probe()
execute again, allocating new regulators and clock handles on the I2C
device's devres list without freeing the previous ones?
Furthermore, this probe function enables the regulators:
sound/soc/codecs/es8389.c:es8389_probe() {
...
ret = regulator_bulk_enable(ARRAY_SIZE(es8389_core_supplies), es8389->core_supply);
...
}
[Severity: High]
This is a pre-existing issue, but does this leak the regulator enable count?
The corresponding es8389_remove() function does not call
regulator_bulk_disable():
sound/soc/codecs/es8389.c:es8389_remove() {
struct es8389_private *es8389 = snd_soc_component_get_drvdata(component);
regmap_write(es8389->regmap, ES8389_MASTER_MODE, 0x28);
regmap_write(es8389->regmap, ES8389_HPSW, 0x00);
...
}
Every time the ASoC component is bound and then unbound, won't the
regulator's internal enable count be incremented but never decremented?
Could this prevent the regulator from ever being powered off by the system,
leading to increased power consumption?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609025605.16945-1-zhangyi@everest-semi.com?part=2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 4/7] ASoC: codecs: ES8389: Modify the initial configuration
2026-06-09 3:06 ` [PATCH 4/7] ASoC: codecs: ES8389: Modify the initial configuration Zhang Yi
@ 2026-06-09 3:13 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-06-09 3:13 UTC (permalink / raw)
To: Zhang Yi; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing return value checks on regmap_read() in multiple functions leads to use of uninitialized memory.
--
commit 13fc2779b6e0163ece67df605c65dd1048a313c5
Author: Zhang Yi <zhangyi@everest-semi.com>
ASoC: codecs: ES8389: Modify the initial configuration
This commit updates the initial configuration values for the ES8389 codec.
It modifies the register writes for ISO_CTL and OSC_CLK during device
initialization.
> diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
> index 6ad0b580068cf..8e47b4e3214e0 100644
> --- a/sound/soc/codecs/es8389.c
> +++ b/sound/soc/codecs/es8389.c
> @@ -792,7 +792,7 @@ static void es8389_init(struct snd_soc_component *component)
>
> regmap_read(es8389->regmap, ES8389_MAX_REGISTER, ®);
> es8389->version = reg;
[Severity: High]
This is a pre-existing issue, but is it safe to consume the value of reg
without checking the return value of regmap_read()?
If the underlying bus read fails, regmap_read() returns an error code and
leaves reg unmodified. This means uninitialized stack memory would be
assigned to es8389->version here.
This same pattern appears to exist in several other functions in this
driver where the regmap_read() return value is not checked before
evaluating the output variable. For example, in es8389_resume():
regmap_read(es8389->regmap, ES8389_RESET, ®v);
...
if (regv == 0xff)
And similarly in es8389_mute():
regmap_read(es8389->regmap, ES8389_CSM_STATE1, ®v);
if (regv != ES8389_STATE_ON) {
Could these unchecked reads lead to unpredictable hardware configuration
and incorrect control flow if a bus timeout or error occurs?
> - regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x00);
> + regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x56);
> regmap_write(es8389->regmap, ES8389_RESET, 0x7E);
> regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x38);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609030623.17404-1-zhangyi@everest-semi.com?part=4
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/7] ASoC: codecs: ES8389: Modify volatile_register
2026-06-09 3:06 ` [PATCH 1/7] ASoC: codecs: ES8389: Modify volatile_register Zhang Yi
@ 2026-06-09 3:17 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-06-09 3:17 UTC (permalink / raw)
To: Zhang Yi; +Cc: devicetree, conor+dt, robh
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
New issues:
- [High] The regmap cache for non-volatile registers is overwritten with hardcoded default values during resume if the device lost power, neutralizing the patch's fix.
Pre-existing issues:
- [High] Critical configuration registers modified during stream setup are marked as volatile, causing them to be lost upon suspend/resume.
- [High] The variable `regv` is evaluated uninitialized if `regmap_read` fails during resume.
--
commit 146c46405cf59e3e0362628efb42fd4f52cff71a
Author: Zhang Yi <zhangyi@everest-semi.com>
ASoC: codecs: ES8389: Modify volatile_register
This patch modifies es8389_volatile_register() to mark a specific set of
registers as non-volatile, enabling regcache for them. All other registers
now default to being volatile.
> diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
> index 449d9574b03a8..9c816491648c7 100644
> --- a/sound/soc/codecs/es8389.c
> +++ b/sound/soc/codecs/es8389.c
> @@ -50,10 +50,29 @@ static const char * const es8389_core_supplies[] = {
> static bool es8389_volatile_register(struct device *dev,
> unsigned int reg)
> {
> - if ((reg <= 0xff))
> - return true;
> - else
> + switch (reg) {
> + case ES8389_ADC_HPF1:
> + case ES8389_ADC_HPF2:
[ ... ]
> + case ES8389_ADC_RESET:
> return false;
> + default:
> + return true;
[Severity: High]
This is a pre-existing issue, but does this fall-through prevent critical
configuration registers from being restored by regcache_sync()?
Critical configuration registers modified during stream setup like
ES8389_DMIC_EN, ES8389_ADC_MODE, ES8389_ADC_FORMAT_MUTE, and ES8389_ADC_OSR
remain uncached.
Since the ALSA framework does not re-invoke hw_params on resume, these
registers must be cached and restored by regcache_sync(). Because they are
volatile, active audio streams will fail or lose routing after a
suspend/resume cycle.
> + }
> }
[Severity: High]
By newly marking these registers as non-volatile, does this cause the
regcache to be overwritten with defaults during a power-loss resume?
In sound/soc/codecs/es8389.c:es8389_resume(), if the device lost power
(regv == 0xff), es8389_init() is called without regcache_cache_bypass being
enabled:
regmap_read(es8389->regmap, ES8389_RESET, ®v);
regcache_cache_bypass(es8389->regmap, false);
if (regv == 0xff)
es8389_init(component);
Inside es8389_init(), direct regmap_write() calls are made:
regmap_write(es8389->regmap, ES8389_ADC_HPF1, 0x64);
Because bypass is disabled, these writes clobber the newly added regmap cache
with hardcoded default values. The subsequent regcache_sync() then syncs these
defaults instead of the user's prior settings, breaking state restoration.
[Severity: High]
This is a pre-existing issue, but can regv be evaluated uninitialized if the
regmap_read fails during resume?
In sound/soc/codecs/es8389.c:es8389_resume():
regmap_read(es8389->regmap, ES8389_RESET, ®v);
regcache_cache_bypass(es8389->regmap, false);
if (regv == 0xff)
If regmap_read() fails (which can occur during resume due to bus readiness
issues), regv contains uninitialized stack memory. The subsequent evaluation
against 0xff produces undefined behavior, potentially skipping necessary
device initialization and leading to silent failure.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609030623.17404-1-zhangyi@everest-semi.com?part=1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/7] ASoC: codecs: ES8389: Modify the clock table
2026-06-09 3:06 ` [PATCH 3/7] ASoC: codecs: ES8389: Modify the clock table Zhang Yi
@ 2026-06-09 3:19 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-06-09 3:19 UTC (permalink / raw)
To: Zhang Yi; +Cc: conor+dt, devicetree, robh
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
Pre-existing issues:
- [High] The matching logic in `get_coeff()` incorrectly treats `dmic_sel == 0` and `dvdd_vol == 0` as wildcards, causing subsequent specific entries to be shadowed and become unreachable dead code.
- [High] Failure to find valid clock coefficients in the hardware parameters callback only logs a warning but incorrectly returns success, leading to invalid hardware states.
- [High] Changing the DAI format dynamically to Slave Mode (`SND_SOC_DAIFMT_CBC_CFC`) fails to clear the hardware Master Mode enable bit.
--
commit d0ffd7a30dca1537de1cecec2b6513b14d3c847f
Author: Zhang Yi <zhangyi@everest-semi.com>
ASoC: codecs: ES8389: Modify the clock table
This patch modifies the ES8389 clock configuration table to update several
frequency settings and adds a new entry for the 192000Hz rate.
> diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
> index 7a9d5d42a05d0..6ad0b580068cf 100644
> --- a/sound/soc/codecs/es8389.c
> +++ b/sound/soc/codecs/es8389.c
> @@ -434,52 +434,54 @@ static const struct _coeff_div coeff_div[] = {
[ ... ]
> {128, 24576000, 192000, 0x00, 0x50, 0x00, 0xC0, 0x18, 0xC1, 0x81, 0xC0, 0x00, 0x8F, 0x7F, 0xBF, 0xC0, 0x3F, 0x7F, 0x80, 0x12, 0xC0, 0x3F, 0xF9, 0x3F, 2, 2},
> + {64, 12288000, 192000, 0x00, 0x41, 0x00, 0xC0, 0x18, 0xC1, 0x80, 0x00, 0x00, 0x8F, 0x7F, 0xEF, 0xC0, 0x7F, 0x7F, 0x80, 0x12, 0xC0, 0x3F, 0xF9, 0x3F, 1, 0},
[Severity: High]
This is a pre-existing issue, but is it possible this newly added entry
unintentionally acts as a wildcard due to dmic_sel=0?
In get_coeff(), wildcard matching is implemented using ~(val % 2) & 0x01. Since
0 % 2 == 0, dmic_sel=0 will evaluate to 1, causing this entry to match both 0
and 1 at runtime.
Will this cause subsequent exact-match entries with the same parameters to be
shadowed and unreachable?
> };
>
> static inline int get_coeff(u8 vddd, u8 dmic, int mclk, int rate)
[Severity: High]
This is a pre-existing issue, but should es8389_pcm_hw_params() return an
error code when get_coeff() returns -EINVAL?
sound/soc/codecs/es8389.c:es8389_pcm_hw_params() {
...
coeff = get_coeff(es8389->vddd, dmic_enable, es8389->sysclk,
params_rate(params));
if (coeff >= 0) {
...
} else {
dev_warn(component->dev, "Clock coefficients do not match");
}
return 0;
}
Returning success to the ALSA framework despite failing to configure the
hardware clocks allows the stream to start in an unconfigured state. Can this
result in broken or silent audio?
[Severity: High]
This is a pre-existing issue, but could dynamically switching to Slave Mode in
es8389_set_dai_fmt() leave the hardware stuck in Master Mode?
sound/soc/codecs/es8389.c:es8389_set_dai_fmt() {
...
case SND_SOC_DAIFMT_CBC_CFC:
es8389->mastermode = 0;
break;
...
}
While the driver updates its internal state to mastermode = 0, it appears to
forget to call regmap_update_bits() to clear the ES8389_MASTER_MODE_EN flag.
If a dynamic switch occurs, will the hardware continue to drive the bus clocks
and cause the audio interface to fail?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609030623.17404-1-zhangyi@everest-semi.com?part=3
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src
2026-06-09 3:06 ` [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src Zhang Yi
@ 2026-06-09 3:20 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-06-09 3:20 UTC (permalink / raw)
To: Zhang Yi; +Cc: robh, devicetree, conor+dt
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
Pre-existing issues:
- [High] Incorrect BCLK (SCLK) frequency calculation when using SCLK as MCLK.
- [High] es8389_set_dai_fmt fails to clear the master mode bit when transitioning to slave mode.
- [High] es8389_pcm_hw_params ignores the error from get_coeff() and returns 0 (success).
--
commit d51ce6794a54f470a01270d750f648c145cd7dce
Author: Zhang Yi <zhangyi@everest-semi.com>
ASoC: codecs: ES8389: Fix the issue about mclk_src
This commit fixes an issue with incorrect modifications to the mclk_src
variable. It changes mclk_src to a boolean and reads it using
device_property_read_bool, simplifying the MCLK configuration logic.
> diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
> index 9c816491648c7..7a9d5d42a05d0 100644
> --- a/sound/soc/codecs/es8389.c
> +++ b/sound/soc/codecs/es8389.c
[ ... ]
> @@ -607,9 +607,9 @@ static int es8389_pcm_hw_params(struct snd_pcm_substream *substream,
> regmap_update_bits(es8389->regmap, ES8389_ADC_FORMAT_MUTE, ES8389_DATA_LEN_MASK, state);
> regmap_update_bits(es8389->regmap, ES8389_DAC_FORMAT_MUTE, ES8389_DATA_LEN_MASK, state);
>
> - if (es8389->mclk_src == ES8389_SCLK_PIN) {
> + if (es8389->mclk_src) {
> regmap_update_bits(es8389->regmap, ES8389_MASTER_CLK,
> - ES8389_MCLK_SOURCE, es8389->mclk_src);
> + ES8389_MCLK_MASK, ES8389_MCLK_FROM_SCLK);
> es8389->sysclk = params_channels(params) * params_width(params) * params_rate(params);
[Severity: High]
This is a pre-existing issue, but does this calculation yield the correct
physical BCLK rate?
Using params_width() returns the logical sample width (e.g., 24 for S24_LE)
instead of the physical wire width, and this ignores TDM slot configurations.
This could result in calculating a lower SCLK frequency than what is
physically driven on the bus, leading to an incorrect sysclk and the wrong
internal clock dividers.
Should this use snd_soc_params_to_bclk(params) instead?
Also in sound/soc/codecs/es8389.c:es8389_set_dai_fmt():
switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBC_CFP:
regmap_update_bits(es8389->regmap, ES8389_MASTER_MODE,
ES8389_MASTER_MODE_EN, ES8389_MASTER_MODE_EN);
es8389->mastermode = 1;
break;
case SND_SOC_DAIFMT_CBC_CFC:
es8389->mastermode = 0;
break;
[Severity: High]
This is a pre-existing issue, but does the transition to slave mode properly
clear the hardware state?
When SND_SOC_DAIFMT_CBC_CFC is requested, the internal mastermode variable is
updated, but it appears ES8389_MASTER_MODE_EN is not cleared in the
ES8389_MASTER_MODE register. If the codec was previously set to master mode,
could this leave it incorrectly operating as a clock provider and cause bus
contention?
Later in sound/soc/codecs/es8389.c:es8389_pcm_hw_params():
coeff = get_coeff(es8389->vddd, dmic_enable, es8389->sysclk, params_rate(params));
if (coeff >= 0) {
...
regmap_write(es8389->regmap, ES8389_SYSTEM19, coeff_div[coeff].Reg0x19);
} else {
dev_warn(component->dev, "Clock coefficients do not match");
}
return 0;
[Severity: High]
This is a pre-existing issue, but should this function return an error code
when get_coeff() fails?
Currently, if get_coeff() fails to find a matching configuration, it prints a
warning but unconditionally returns 0. Could this cause the ALSA core to
assume the hardware is correctly configured and proceed to start the stream,
potentially resulting in silent or distorted audio?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609030623.17404-1-zhangyi@everest-semi.com?part=2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 6/7] ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX
2026-06-09 3:06 ` [PATCH 6/7] ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX Zhang Yi
@ 2026-06-09 3:21 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-06-09 3:21 UTC (permalink / raw)
To: Zhang Yi; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] User configuration for the newly added ADC MUXes is permanently lost across a suspend/resume cycle if the device loses power.
--
commit 244b36be42543e8998257a345f41703019f1e7ea
Author: Zhang Yi <zhangyi@everest-semi.com>
ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX
This commit adds INPUTL MUX and INPUTR MUX to the routing table for the
ES8389 codec.
> diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
> index d1bcbbfcd4754..5e4afafd9be63 100644
> --- a/sound/soc/codecs/es8389.c
> +++ b/sound/soc/codecs/es8389.c
[ ... ]
> @@ -191,6 +201,20 @@ static const unsigned int es8389_pga_values[] = {
> 1, 5, 6
> };
>
> +static const struct soc_enum es8389_adcl_mux_enum =
> + SOC_ENUM_SINGLE(ES8389_ADC_MODE, 5,
> + ARRAY_SIZE(es8389_adcl_mux_txt), es8389_adcl_mux_txt);
[Severity: Medium]
Will the user configuration for these new MUXes be lost across a suspend
and resume cycle?
Because ES8389_ADC_MODE is omitted from the non-volatile list in
es8389_volatile_register(), it is treated as volatile and bypasses the
regmap cache.
When the device resumes from suspend and power is lost, es8389_resume()
calls es8389_init(), which overwrites this register with default values:
sound/soc/codecs/es8389.c:es8389_init() {
...
regmap_write(es8389->regmap, ES8389_ADC_MODE, (0x00 | ES8389_TDM_MODE));
...
}
Since ES8389_ADC_MODE is volatile, the subsequent regcache_sync() will skip
it, leaving the routing configuration permanently clobbered. Does
ES8389_ADC_MODE need to be added to the non-volatile register list so the
MUX state can be properly restored?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609030623.17404-1-zhangyi@everest-semi.com?part=6
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-06-09 3:21 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 3:06 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
2026-06-09 3:06 ` [PATCH 1/7] ASoC: codecs: ES8389: Modify volatile_register Zhang Yi
2026-06-09 3:17 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src Zhang Yi
2026-06-09 3:20 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 3/7] ASoC: codecs: ES8389: Modify the clock table Zhang Yi
2026-06-09 3:19 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 4/7] ASoC: codecs: ES8389: Modify the initial configuration Zhang Yi
2026-06-09 3:13 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 5/7] ASoC: codecs: ES8389: Add private members related to HPF Zhang Yi
2026-06-09 3:06 ` [PATCH 6/7] ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX Zhang Yi
2026-06-09 3:21 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 7/7] ASoC: dt-bindings: ES8389: Add members about HPF and clock Zhang Yi
-- strict thread matches above, loose matches on Subject: below --
2026-06-09 2:55 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
2026-06-09 2:56 ` [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src Zhang Yi
2026-06-09 3:11 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox