[RFC PATCH v3 0/4] regmap: reg_default_cb for flat cache defaults

Sheetal . posted 4 patches 2 weeks ago
drivers/base/regmap/internal.h      |  3 +
drivers/base/regmap/regcache-flat.c | 19 ++++++
drivers/base/regmap/regcache.c      |  3 +-
drivers/base/regmap/regmap-kunit.c  | 91 +++++++++++++++++++++++++++++
drivers/base/regmap/regmap.c        |  2 +
include/linux/regmap.h              | 14 +++++
sound/soc/tegra/tegra186_asrc.c     |  1 +
sound/soc/tegra/tegra186_dspk.c     |  1 +
sound/soc/tegra/tegra210_admaif.c   |  3 +
sound/soc/tegra/tegra210_adx.c      |  2 +
sound/soc/tegra/tegra210_ahub.c     | 60 +++++++++++++++++++
sound/soc/tegra/tegra210_ahub.h     | 30 ++++++++++
sound/soc/tegra/tegra210_amx.c      |  3 +
sound/soc/tegra/tegra210_dmic.c     |  1 +
sound/soc/tegra/tegra210_i2s.c      |  2 +
sound/soc/tegra/tegra210_mbdrc.c    |  1 +
sound/soc/tegra/tegra210_mixer.c    |  1 +
sound/soc/tegra/tegra210_mvc.c      |  1 +
sound/soc/tegra/tegra210_ope.c      |  1 +
sound/soc/tegra/tegra210_peq.c      |  1 +
sound/soc/tegra/tegra210_sfc.c      |  1 +
21 files changed, 240 insertions(+), 1 deletion(-)
[RFC PATCH v3 0/4] regmap: reg_default_cb for flat cache defaults
Posted by Sheetal . 2 weeks ago
From: sheetal <sheetal@nvidia.com>

This series adds a reg_default_cb callback for REGCACHE_FLAT to provide
defaults for registers not listed in reg_defaults. Defaults are loaded
eagerly during regcache init and the callback can use writeable_reg to
filter valid addresses and avoid holes.

Tegra ASoC drivers set reg_default_cb and add writeable_reg filtering for
AHUB RX holes to prevent invalid addresses from being marked valid.

Changes in v3:
- Add AHUB writeable_reg filtering for RX holes.
- Replace flat_cache_default_is_zero flag with reg_default_cb callback
- Load defaults at regcache init using reg_default_cb
- Set reg_default_cb in Tegra ASoC drivers
- Add KUnit coverage for reg_default_cb callback

Note:
 "ASoC: tegra: set reg_default_cb callback" patch depends on
 "ASoC: tegra: Add AHUB writeable_reg for RX holes" patch,
 hence included in this series.

Sheetal (4):
  ASoC: tegra: Add AHUB writeable_reg for RX holes
  regmap: Add reg_default_cb callback for flat cache defaults
  ASoC: tegra: set reg_default_cb callback
  regmap: add KUnit coverage for reg_default_cb callback

 drivers/base/regmap/internal.h      |  3 +
 drivers/base/regmap/regcache-flat.c | 19 ++++++
 drivers/base/regmap/regcache.c      |  3 +-
 drivers/base/regmap/regmap-kunit.c  | 91 +++++++++++++++++++++++++++++
 drivers/base/regmap/regmap.c        |  2 +
 include/linux/regmap.h              | 14 +++++
 sound/soc/tegra/tegra186_asrc.c     |  1 +
 sound/soc/tegra/tegra186_dspk.c     |  1 +
 sound/soc/tegra/tegra210_admaif.c   |  3 +
 sound/soc/tegra/tegra210_adx.c      |  2 +
 sound/soc/tegra/tegra210_ahub.c     | 60 +++++++++++++++++++
 sound/soc/tegra/tegra210_ahub.h     | 30 ++++++++++
 sound/soc/tegra/tegra210_amx.c      |  3 +
 sound/soc/tegra/tegra210_dmic.c     |  1 +
 sound/soc/tegra/tegra210_i2s.c      |  2 +
 sound/soc/tegra/tegra210_mbdrc.c    |  1 +
 sound/soc/tegra/tegra210_mixer.c    |  1 +
 sound/soc/tegra/tegra210_mvc.c      |  1 +
 sound/soc/tegra/tegra210_ope.c      |  1 +
 sound/soc/tegra/tegra210_peq.c      |  1 +
 sound/soc/tegra/tegra210_sfc.c      |  1 +
 21 files changed, 240 insertions(+), 1 deletion(-)

-- 
2.34.1
Re: (subset) [RFC PATCH v3 0/4] regmap: reg_default_cb for flat cache defaults
Posted by Mark Brown 1 week, 1 day ago
On Fri, 23 Jan 2026 15:23:42 +0530, Sheetal . wrote:
> This series adds a reg_default_cb callback for REGCACHE_FLAT to provide
> defaults for registers not listed in reg_defaults. Defaults are loaded
> eagerly during regcache init and the callback can use writeable_reg to
> filter valid addresses and avoid holes.
> 
> Tegra ASoC drivers set reg_default_cb and add writeable_reg filtering for
> AHUB RX holes to prevent invalid addresses from being marked valid.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/4] ASoC: tegra: Add AHUB writeable_reg for RX holes
      commit: 0ba6286a71581aaf8413a55b9bd90ea3463fd23b
[3/4] ASoC: tegra: set reg_default_cb callback
      commit: 9409d18bf7d58ab716337749e28e2caba0d64cb0

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
Re: (subset) [RFC PATCH v3 0/4] regmap: reg_default_cb for flat cache defaults
Posted by Mark Brown 1 week, 3 days ago
On Fri, 23 Jan 2026 15:23:42 +0530, Sheetal . wrote:
> This series adds a reg_default_cb callback for REGCACHE_FLAT to provide
> defaults for registers not listed in reg_defaults. Defaults are loaded
> eagerly during regcache init and the callback can use writeable_reg to
> filter valid addresses and avoid holes.
> 
> Tegra ASoC drivers set reg_default_cb and add writeable_reg filtering for
> AHUB RX holes to prevent invalid addresses from being marked valid.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[2/4] regmap: Add reg_default_cb callback for flat cache defaults
      commit: dc65b1ed4bb34ab6235ff2cc6a917b9295c04c2c
[4/4] regmap: add KUnit coverage for reg_default_cb callback
      commit: 70a65c53d228562cf0c8ae0f38c847d2a5dd59e6

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