ASoC: tas2781: Add register decoded info to I/O error logs
Subsystems (3)
Shenghao Ding
maintainerPATCH 1/1 ASoC: tas2781: Add register decoded info to I/O error logs
TAS2563/TAS2781 use a paged register space, but I/O failures only log the error code. Decode and print book/page/register in error messages to speed up I2C debugging across all read/write/update paths.
---
v1:
- Add register decoded info to I/O error logs.
- Update the copyright year range to include 2026 in both files.
--- sound/soc/codecs/tas2781-comlib-i2c.c | 7 +++++-- sound/soc/codecs/tas2781-comlib.c | 22 +++++++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-)
sound/soc/codecs/tas2781-comlib-i2c.c +5 -2
@@ -2,7 +2,7 @@// // TAS2563/TAS2781 Common functions for HDA and ASoC Audio drivers based on I2C // -// Copyright 2025 Texas Instruments, Inc. +// Copyright 2025 - 2026 Texas Instruments, Inc. // // Author: Shenghao Ding <[email protected]>
@@ -131,7 +131,10 @@ int tasdevice_dev_update_bits( ret =regmap_update_bits (map,TASDEVICE_PGRG (reg), mask, value);if (ret <0 ) -dev_err (tas_priv->dev,"%s, E=%d\n" , __func__, ret); +dev_err (tas_priv->dev,"%s, Bx%02xPx%02xRx%02x E=%d\n" , + __func__,TASDEVICE_BOOK_ID (reg), +TASDEVICE_PAGE_ID (reg), +TASDEVICE_PAGE_REG (reg), ret); }else {dev_err (tas_priv->dev,"%s, no such channel(%d)\n" , __func__, chn);
sound/soc/codecs/tas2781-comlib.c +17 -5
@@ -2,7 +2,7 @@// // TAS2563/TAS2781 Common functions for HDA and ASoC Audio drivers // -// Copyright 2023 - 2025 Texas Instruments, Inc. +// Copyright 2023 - 2026 Texas Instruments, Inc. // // Author: Shenghao Ding <[email protected]>
@@ -34,7 +34,10 @@ int tasdevice_dev_read(struct tasdevice_priv *tas_priv, ret =regmap_read (map,TASDEVICE_PGRG (reg), val);if (ret <0 ) -dev_err (tas_priv->dev,"%s, E=%d\n" , __func__, ret); +dev_err (tas_priv->dev,"%s, Bx%02xPx%02xRx%02x E=%d\n" , + __func__,TASDEVICE_BOOK_ID (reg), +TASDEVICE_PAGE_ID (reg), +TASDEVICE_PAGE_REG (reg), ret); }else { ret = -EINVAL ; dev_err(tas_priv->dev, "%s, no such channel(%d)\n", __func__,
@@ -62,7 +65,10 @@ int tasdevice_dev_bulk_read(struct tasdevice_priv *tas_priv, ret =regmap_bulk_read (map,TASDEVICE_PGRG (reg), data, len);if (ret <0 ) -dev_err (tas_priv->dev,"%s, E=%d\n" , __func__, ret); +dev_err (tas_priv->dev,"%s, Bx%02xPx%02xRx%02x E=%d\n" , + __func__,TASDEVICE_BOOK_ID (reg), +TASDEVICE_PAGE_ID (reg), +TASDEVICE_PAGE_REG (reg), ret); }else dev_err (tas_priv->dev,"%s, no such channel(%d)\n" , __func__, chn);
@@ -88,7 +94,10 @@ int tasdevice_dev_write(struct tasdevice_priv *tas_priv, ret =regmap_write (map,TASDEVICE_PGRG (reg), value);if (ret <0 ) -dev_err (tas_priv->dev,"%s, E=%d\n" , __func__, ret); +dev_err (tas_priv->dev,"%s, Bx%02xPx%02xRx%02x E=%d\n" , + __func__,TASDEVICE_BOOK_ID (reg), +TASDEVICE_PAGE_ID (reg), +TASDEVICE_PAGE_REG (reg), ret); }else { ret = -EINVAL ; dev_err(tas_priv->dev, "%s, no such channel(%d)\n", __func__,
@@ -118,7 +127,10 @@ int tasdevice_dev_bulk_write( ret =regmap_bulk_write (map,TASDEVICE_PGRG (reg), data, len);if (ret <0 ) -dev_err (tas_priv->dev,"%s, E=%d\n" , __func__, ret); +dev_err (tas_priv->dev,"%s, Bx%02xPx%02xRx%02x E=%d\n" , + __func__,TASDEVICE_BOOK_ID (reg), +TASDEVICE_PAGE_ID (reg), +TASDEVICE_PAGE_REG (reg), ret); }else { ret = -EINVAL ; dev_err(tas_priv->dev, "%s, no such channel(%d)\n", __func__,
Signature · 1 line
2.43.0
Mark Brown
maintainerQuoted 1 line · Shenghao Ding
ASoC: tas2781: Add register decoded info to I/O error logs
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/1] ASoC: tas2781: Add register decoded info to I/O error logs
https://git.kernel.org/broonie/sound/c/6f83e540f945
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