ASoC: tas2781: Refactor TAS2573 calibration status read
Subsystems (3)
Shenghao Ding
maintainerPATCH 1/1 ASoC: tas2781: Refactor TAS2573 calibration status read
The TAS2573 calibration status control currently builds the register list inline and hand-rolls the whole payload; it duplicates logic that is already available through tas2573_status_get_common(). No functional change.
---
v1:
- Move the FCT status register list into tas2573-reg.h as fct_status_regs[] and describe it with a struct tasdev_reg_map, then drop the duplicated read loop in tas2573_calib_status_get() in favour of a call to tas2573_status_get_common().
- Derive max from the map so the buffer size always matches the register list.
--- include/sound/tas2573-reg.h | 22 +++++++++++ sound/soc/codecs/tas2781-i2c.c | 67 +++------------------------------- 2 files changed, 27 insertions(+), 62 deletions(-)
include/sound/tas2573-reg.h +22 -0
@@ -59,6 +59,28 @@ struct tasdev_reg_map {/* YM955 */ #define TAS2573_SHORTCKT TASDEVICE_REG(0x00, 0x83, 0x6C) +/* Registers for the speaker calibration */ +static const __maybe_unused unsigned int fct_status_regs[] = { +TAS2573_FCT_INT_LATCH , +TAS2573_FCT_STATUS_CTRL , +TAS2573_FCT_STATUS_BINNING , +TAS2573_SILENCE_DETECTED , +TAS2573_OPEN_CIRCUIT , +TAS2573_SHORTCKT , +TAS2573_FCT_OUTPUT_R0 , +TAS2573_FCT_OUTPUT_R0_LOW , +TAS2573_FCT_OUTPUT_INV_R0 , +TAS2573_FCT_OUTPUT_POWERTOT , +TAS2573_FCT_OUTPUT_F0 , +TAS2573_RE_OUT , +}; + +static const __maybe_unused struct tasdev_reg_map calib_status_map = { + .regs = fct_status_regs, + .nregs =ARRAY_SIZE (fct_status_regs), + .tag ="fct_status_regs" , +}; +/* Registers for the realtime (RT) speaker protection data */ static const __maybe_unused unsigned int tas2573_rt_data_regs[] = {TAS2573_TDM_DET_REG ,
sound/soc/codecs/tas2781-i2c.c +5 -62
82 lines not on this page · raw message
Signature · 1 line
2.53.0
Mark Brown
maintainerQuoted 1 line · Shenghao Ding
ASoC: tas2781: Refactor TAS2573 calibration status read
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5
Thanks!
[1/1] ASoC: tas2781: Refactor TAS2573 calibration status read
https://git.kernel.org/broonie/sound/c/ac8059e45250
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