Skip to content

ES8389: sync codec driver with upstream & enable for Waveshare ES8389 Audio HAT - #14

Open
EngineerWill wants to merge 15 commits into
waveshareteam:ES8389-Audio-HATfrom
EngineerWill:ES8389-Audio-HAT
Open

EngineerWill wants to merge 15 commits into
waveshareteam:ES8389-Audio-HATfrom
EngineerWill:ES8389-Audio-HAT

Conversation

@EngineerWill

Copy link
Copy Markdown

This PR brings the ES8389 codec driver in the Raspberry Pi kernel tree up to date
with upstream (torvalds/master) and enables it for the Waveshare ES8389 Audio HAT.

  • Sync sound/soc/codecs/es8389.c / es8389.h to upstream — 14 commits
    cherry-picked from torvalds/master with original authorship and commit messages
    preserved. The two files are now byte-identical to upstream master.
  • Enable CONFIG_SND_SOC_ES8389=m in 5 Raspberry Pi board defconfigs for the
    Waveshare ES8389 Audio HAT.

morimoto and others added 15 commits October 20, 2026 21:21
This patch converts below functions.

dapm->dev					-> snd_soc_dapm_to_dev()
dapm->card					-> snd_soc_dapm_to_card()
dapm->component					-> snd_soc_dapm_to_component()

dapm_kcontrol_get_value()			-> snd_soc_dapm_kcontrol_get_value()

snd_soc_component_enable_pin()			-> snd_soc_dapm_enable_pin()
snd_soc_component_enable_pin_unlocked()		-> snd_soc_dapm_enable_pin_unlocked()
snd_soc_component_disable_pin()			-> snd_soc_dapm_disable_pin()
snd_soc_component_disable_pin_unlocked()	-> snd_soc_dapm_disable_pin_unlocked()
snd_soc_component_nc_pin()			-> snd_soc_dapm_nc_pin()
snd_soc_component_nc_pin_unlocked()		-> snd_soc_dapm_nc_pin_unlocked()
snd_soc_component_get_pin_status()		-> snd_soc_dapm_get_pin_status()
snd_soc_component_force_enable_pin()		-> snd_soc_dapm_force_enable_pin()
snd_soc_component_force_enable_pin_unlocked()	-> snd_soc_dapm_force_enable_pin_unlocked()
snd_soc_component_force_bias_level()		-> snd_soc_dapm_force_bias_level()
snd_soc_component_get_bias_level()		-> snd_soc_dapm_get_bias_level()
snd_soc_component_init_bias_level()		-> snd_soc_dapm_init_bias_level()
snd_soc_component_get_dapm()			-> snd_soc_component_to_dapm()

snd_soc_dapm_kcontrol_component()		-> snd_soc_dapm_kcontrol_to_component()
snd_soc_dapm_kcontrol_widget()			-> snd_soc_dapm_kcontrol_to_widget()
snd_soc_dapm_kcontrol_dapm()			-> snd_soc_dapm_kcontrol_to_dapm()
snd_soc_dapm_np_pin()				-> snd_soc_dapm_disable_pin()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/87pl9p5sfx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Added the members `avdd-supply` and `dvdd-supply` to
enable the driver to get the power supply status.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260105091548.4196-3-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Update wake-up configuration to ensure the codec works properly.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260105091548.4196-4-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Execute different configurations based on version number
in order to support different versions of es8389.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260105091548.4196-5-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
To ensure better performance of the codec, different configurations
will be employed based on power supply conditions.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260105091548.4196-6-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
While being less compact, using named initializers allows to more easily
see which members of the structs are assigned which value without having
to lookup the declaration of the struct. And it's also more robust
against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct
i2c_device_id that replaces .driver_data by an anonymous union.

While touching all these arrays, unify indention and usage of commas.

This patch doesn't modify the compiled arrays, only their representation
in source form benefits. The former was confirmed with x86 and arm64
builds.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/ae2ff4898eb340bd8bcafb7b75443eb4a0ce3e76.1778692164.git.u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark some registers that are not volatile as false
And modified the logic for `cache_bypass` during `8389_resume`.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-2-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Fix the issue with incorrect modifications to mclk_src
When the system needs to be configured to use the MCLK from the SCLK pin,
the code still sets the relevant registers to use the MCLK from the MCLK pin

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-3-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Updated the configuration for certain frequencies

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-4-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Modify the initial configuration

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-5-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add private members related to HPF.
Add Kcontrol for HPF

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-6-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add INPUTL MUX and INPUTR MUX in route

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260630072311.8427-7-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The comparison (target_hz < 0) will always be false because the variable
'target_hz' is of the u32 type.

Remove redundant comparison and simply code around it.

Fixes: 87592da ("ASoC: codecs: ES8389: Add private members about HPF")
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260719221502.536804-1-ethantidmore06@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
To prevent enable_count underflow in clk_core_disable,
I replaced the direct call to `es8389_set_bias_level(component, SND_SOC_BIAS_STANDBY);`
in the code with a helper function.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20260904104141.3885-1-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Enable CONFIG_SND_SOC_ES8389=m for the Waveshare ES8389 Audio HAT.

Signed-off-by: Yu Dukai <646689853@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants