ASoC: es9356: propagate HID button read errors
PATCH 1/1 ASoC: es9356: propagate HID button read errors
es9356_sdca_button_detect() returns zero when a regmap read fails, so the interrupt handler cannot distinguish the error from a valid no-button result.
Return the original error and keep the button result signed so the existing negative-result check also handles decoding errors. Leave the ownership handoff unchanged.
--- sound/soc/codecs/es9356.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
sound/soc/codecs/es9356.c +8 -3
@@ -293,13 +293,15 @@ static int es9356_sdca_button(unsigned int *buffer)static int es9356_sdca_button_detect (struct es9356_sdw_priv *es9356) { -unsigned int btn_type =0 , offset, idx, val, owner; +unsigned int offset, idx, val, owner;unsigned int button[3 ]; -int ret; +int btn_type =0 , ret; ret =regmap_read (es9356->regmap,SDW_SDCA_CTL (FUNC_NUM_HID ,ES9356_SDCA_ENT_HID01 ,ES9356_SDCA_CTL_HIDTX_CURRENT_OWNER ,0 ), &owner); -if (ret <0 || owner ==0x01 ) +if (ret <0 ) +return ret; +if (owner ==0x01 )return 0 ; ret =regmap_read (es9356->regmap,ES9356_BUF_ADDR_HID , &offset);
@@ -320,6 +322,9 @@ static int es9356_sdca_button_detect(struct es9356_sdw_priv *es9356)regmap_write (es9356->regmap,SDW_SDCA_CTL (FUNC_NUM_HID ,ES9356_SDCA_ENT_HID01 ,ES9356_SDCA_CTL_HIDTX_CURRENT_OWNER ,0 ),0x01 ); +if (ret <0 ) +return ret; +return btn_type; }
Mark Brown
maintainerQuoted 1 line · Avi Weiss
ASoC: es9356: propagate HID button read errors
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5
Thanks!
[1/1] ASoC: es9356: propagate HID button read errors
https://git.kernel.org/broonie/sound/c/b491075b3f9a
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