regmap: Add flat_cache_default_is_zero flag for flat cache
Subsystems (5)
v2 cover regmap: Add flat_cache_default_is_zero flag for flat cache
From: Sheetal <[email protected]>
This patch series adds a flat_cache_default_is_zero flag for REGCACHE_FLAT that marks cache entries as valid on first read.
For hardware with zero power-on-reset registers, this avoids the need to add all such registers to reg_defaults (maintenance burden, code bloat, no functional benefit) just to set the validity bits.
By setting valid bits on read rather than at init, only accessed registers are marked valid. This keeps regcache_sync scope minimal and avoids writes to unused registers or holes.
Changes in v2:
- Renamed flag from cache_default_is_zero to flat_cache_default_is_zero to make it explicit that this is specific to REGCACHE_FLAT
- Added KUnit test coverage (patch 2/3)
- Updated commit message to explain why valid bits are set on first read rather than at init time
Sheetal (3):
regmap: Add flat_cache_default_is_zero flag for flat cache
regmap: Add KUnit test for flat_cache_default_is_zero
ASoC: tegra: Enable flat_cache_default_is_zero for audio drivers
drivers/base/regmap/internal.h | 2 ++ drivers/base/regmap/regcache-flat.c | 12 ++++++++---- drivers/base/regmap/regcache.c | 1 + drivers/base/regmap/regmap-kunit.c | 93 ++++++++++++++++++++++++++++++ include/linux/regmap.h | 1 + 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 | 3 +++ 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 + 19 files changed, 127 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1
RFC PATCH v2 1/3 regmap: Add flat_cache_default_is_zero flag for flat cache
From: Sheetal <[email protected]>
Commit e062bdfdd6ad ("regmap: warn users about uninitialized flat cache") added a warning for drivers using REGCACHE_FLAT when reading registers not present in reg_defaults.
For hardware where registers have a power-on-reset value of zero or drivers that wish to treat zero as a valid cache default, adding all such registers to reg_defaults has drawbacks:
1. Maintenance burden: Drivers must list every readable register regardless of its reset value.
2. No functional benefit: Entries like { REG, 0x0 } only set the validity bit; the flat cache value is already zero.
3. Code bloat: Large reg_defaults arrays increase driver size.
Add a flat_cache_default_is_zero flag to struct regmap_config. When set, the flat cache marks registers as valid on first read instead of warning.
The valid bit is set on first read rather than marking all registers valid at init time for the following reasons:
- Avoids writes to register holes or unused addresses during sync.
- Safer for drivers that don't have writeable_reg callback defined.
--- drivers/base/regmap/internal.h | 2 ++ drivers/base/regmap/regcache-flat.c | 12 ++++++++---- drivers/base/regmap/regcache.c | 1 + include/linux/regmap.h | 1 + 4 files changed, 12 insertions(+), 4 deletions(-)
drivers/base/regmap/internal.h +2 -0
@@ -157,6 +157,8 @@ struct regmap {bool cache_dirty;/* if set, the HW registers are known to match map->reg_defaults */ bool no_sync_defaults; +/* if set, zero is a valid default for REGCACHE_FLAT cache type registers not in reg_defaults */ +bool flat_cache_default_is_zero;struct reg_sequence *patch;int patch_regs;
drivers/base/regmap/regcache-flat.c +8 -4
@@ -88,10 +88,14 @@ static int regcache_flat_read(struct regmap *map,struct regcache_flat_data *cache = map->cache;unsigned int index =regcache_flat_get_index (map, reg); -/* legacy behavior: ignore validity, but warn the user */ -if (unlikely (!test_bit (index, cache->valid))) -dev_warn_once (map->dev, -"using zero-initialized flat cache, this may cause unexpected behavior" ); +/* legacy behavior: ignore validity, but warn if zero is not a valid default */ +if (unlikely (!test_bit (index, cache->valid))) { +if (map->flat_cache_default_is_zero) +set_bit (index, cache->valid); +else +dev_warn_once (map->dev, +"using zero-initialized flat cache, this may cause unexpected behavior" ); + } *value = cache->data[index];
drivers/base/regmap/regcache.c +1 -0
@@ -177,6 +177,7 @@ int regcache_init(struct regmap *map, const struct regmap_config *config) map->reg_defaults_raw = config->reg_defaults_raw; map->cache_word_size =BITS_TO_BYTES (config->val_bits); map->cache_size_raw = map->cache_word_size * config->num_reg_defaults_raw; + map->flat_cache_default_is_zero = config->flat_cache_default_is_zero; map->cache =NULL ; map->cache_ops = cache_types[i];
include/linux/regmap.h +1 -0
@@ -452,6 +452,7 @@ struct regmap_config {enum regcache_type cache_type;const void *reg_defaults_raw;unsigned int num_reg_defaults_raw; +bool flat_cache_default_is_zero;unsigned long read_flag_mask;unsigned long write_flag_mask;
Signature · 1 line
2.34.1
Hi,
Quoted 6 lines · Sheetal .
From: Sheetal <[email protected]>
Commit
e062bdfdd6ad("regmap: warn users about uninitialized flat cache") added a warning for drivers usingREGCACHE_FLATwhen reading registers not present inreg_defaults.
Quoted 6 lines
For hardware where registers have a power-on-reset value of zero or drivers that wish to treat zero as a valid cache default, adding all such registers to
reg_defaultshas drawbacks:1. Maintenance burden: Drivers must list every readable register regardless of its reset value.
If you would extend regmap_config to accept a callback for defaults, this burden could be reduced to near-zero if it was a simple wrapper for the writeable_regs and/or readable_regs callbacks. I.e. "return 0x0 if readable or writable".
Quoted 2 lines
2. No functional benefit: Entries like { REG,
0x0} only set the validity bit; the flat cache value is already zero.
There is a functional benefit: it allows regmap_sync() to do what it is supposed to do: check if a cached register matches the reset value to omit writing the cached value to hardware after a reset.
Quoted 1 line
3. Code bloat: Large
reg_defaultsarrays increase driver size.
As I argued before, bloat would be limited if the user could provide tables or callbacks for defaults.
Quoted 9 lines
Add a
flat_cache_default_is_zeroflag to structregmap_config. When set, the flat cache marks registers as valid on first read instead of warning.The valid bit is set on first read rather than marking all registers valid at init time for the following reasons:
- Avoids writes to register holes or unused addresses during sync.
- Safer for drivers that don't havewriteable_regcallback defined.
These are benefits of using a sparse cache, but on closer inspection don't actually apply here. You can validate this in your kunit test if you also do the negative check: assert that registers outside of the written range are left untouched (written == 0).
Because regcache_read() will never return -ENOENT with this option enabled, regmap_sync() will see all registers as "written". Since there are no defaults to check against, this will cause regmap_sync() to write to *all* writable registers. With this patch, you are just reverting to the old behaviour where regmap_sync() silently overwrites registers you never accessed with 0.
Best,
Sander
Mark Brown
maintainerQuoted 8 lines · Sander Vanheule
Quoted 2 lines · Sheetal .
1. Maintenance burden: Drivers must list every readable register regardless of its reset value.
If you would extend
regmap_configto accept a callback for defaults, this burden could be reduced to near-zero if it was a simple wrapper for thewriteable_regsand/orreadable_regscallbacks. I.e. "return0x0if readable or writable".
That does seem like a good idea.
RFC PATCH v2 2/3 regmap: Add KUnit test for flat_cache_default_is_zero
In reply to Sheetal .From: Sheetal <[email protected]>
Add KUnit test coverage for the flat_cache_default_is_zero flag. The test verifies that when the flag is set:
- Writes in cache_only mode work before registers are marked valid
- Writes in cache_only mode work after registers are marked valid
- After regcache_mark_dirty() and regcache_sync(), cached values are correctly written to hardware
- Reads return the cached values
Test command:
./tools/testing/kunit/kunit.py run regmap
Test results:
============= flat_cache_default_is_zero_flag ============= [PASSED] flat-default @0x0
[PASSED] flat-default fast I/O @0x0
[PASSED] flat-default @0x2001
[PASSED] flat-default @0x2002
========= [PASSED] flat_cache_default_is_zero_flag =========
--- drivers/base/regmap/regmap-kunit.c | 87 +++++++++++++++++++++++++++ 1 file changed, 87 insertions(+)
drivers/base/regmap/regmap-kunit.c +87 -0
@@ -118,6 +118,15 @@ static const struct regmap_test_param real_cache_types_only_list[] = {KUNIT_ARRAY_PARAM (real_cache_types_only, real_cache_types_only_list, param_to_desc); +static const struct regmap_test_param flat_cache_types_list[] = { + { .cache =REGCACHE_FLAT , .from_reg =0 }, + { .cache =REGCACHE_FLAT , .from_reg =0 , .fast_io = true }, + { .cache =REGCACHE_FLAT , .from_reg =0x2001 }, + { .cache =REGCACHE_FLAT , .from_reg =0x2002 }, +}; + +KUNIT_ARRAY_PARAM (flat_cache_types, flat_cache_types_list, param_to_desc); +static const struct regmap_test_param real_cache_types_list[] = { { .cache =REGCACHE_FLAT , .from_reg =0 }, { .cache =REGCACHE_FLAT , .from_reg =0 , .fast_io = true },
@@ -1517,6 +1526,83 @@ static void cache_present(struct kunit *test)KUNIT_ASSERT_TRUE (test,regcache_reg_cached (map, param->from_reg + i)); } +/* +* Test flat_cache_default_is_zero flag behavior. +* +* When this flag is set on REGCACHE_FLAT, registers not in reg_defaults +* are treated as having a default value of zero. This allows drivers to +* avoid maintaining large reg_defaults arrays for hardware with zero +* power-on-reset values. +*/ +static void flat_cache_default_is_zero_flag (struct kunit *test) +{ +const struct regmap_test_param *param = test->param_value; +struct regmap *map; +struct regmap_config config; +struct regmap_ram_data *data; +unsigned int val; +int i; + + config = test_regmap_config; + config.flat_cache_default_is_zero = true; + + map =gen_regmap (test, &config, &data); +KUNIT_ASSERT_FALSE (test,IS_ERR (map)); +if (IS_ERR (map)) +return ; + +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) { + data->read[param->from_reg + i] = false; + data->written[param->from_reg + i] = false; + } + +/* Write in cache_only mode before registers are marked valid */ +regcache_cache_only (map, true); +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) +KUNIT_EXPECT_EQ (test,0 ,regmap_write (map, param->from_reg + i, i +0x100 )); + +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) +KUNIT_ASSERT_FALSE (test, data->written[param->from_reg + i]); + +regcache_cache_only (map, false); +regcache_mark_dirty (map); +KUNIT_EXPECT_EQ (test,0 ,regcache_sync (map)); + +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) +KUNIT_ASSERT_TRUE (test, data->written[param->from_reg + i]); + +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) +KUNIT_EXPECT_EQ (test, i +0x100 , data->vals[param->from_reg + i]); + +/* Verify reads return cached values */ +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) { +KUNIT_EXPECT_EQ (test,0 ,regmap_read (map, param->from_reg + i, &val)); +KUNIT_EXPECT_EQ (test, i +0x100 , val); + } + +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) + data->written[param->from_reg + i] = false; + +/* Write in cache_only mode after registers are already valid */ +regcache_cache_only (map, true); + +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) +KUNIT_EXPECT_EQ (test,0 ,regmap_write (map, param->from_reg + i, i +0x200 )); + +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) +KUNIT_ASSERT_FALSE (test, data->written[param->from_reg + i]); + +regcache_cache_only (map, false); +regcache_mark_dirty (map); +KUNIT_EXPECT_EQ (test,0 ,regcache_sync (map)); + +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) +KUNIT_ASSERT_TRUE (test, data->written[param->from_reg + i]); + +for (i =0 ; i <BLOCK_TEST_SIZE ; i++) +KUNIT_EXPECT_EQ (test, i +0x200 , data->vals[param->from_reg + i]); +} +static void cache_write_zero (struct kunit *test) {const struct regmap_test_param *param = test->param_value;
@@ -2078,6 +2164,7 @@ static struct kunit_case regmap_test_cases[] = {KUNIT_CASE_PARAM (cache_present, sparse_cache_types_gen_params),KUNIT_CASE_PARAM (cache_write_zero, sparse_cache_types_gen_params),KUNIT_CASE_PARAM (cache_range_window_reg, real_cache_types_only_gen_params), +KUNIT_CASE_PARAM (flat_cache_default_is_zero_flag, flat_cache_types_gen_params),KUNIT_CASE_PARAM (raw_read_defaults_single, raw_test_types_gen_params), KUNIT_CASE_PARAM(raw_read_defaults, raw_test_types_gen_params),
Signature · 1 line
2.17.1
RFC PATCH v2 3/3 ASoC: tegra: Enable flat_cache_default_is_zero for audio drivers
In reply to Sheetal .From: Sheetal <[email protected]>
Set flat_cache_default_is_zero flag in Tegra audio driver regmap configurations.
Tegra APE hardware has numerous registers with zero power-on-reset values. Use flat_cache_default_is_zero to mark cache entries as valid instead of adding all these registers to reg_defaults arrays.
This patch depends on:
https://patchwork.ozlabs.org/project/linux-tegra/patch/[email protected]/
--- sound/soc/tegra/tegra186_asrc.c | 21 ++++++----- sound/soc/tegra/tegra186_dspk.c | 21 ++++++----- sound/soc/tegra/tegra210_admaif.c | 63 ++++++++++++++++--------------- sound/soc/tegra/tegra210_adx.c | 42 +++++++++++---------- sound/soc/tegra/tegra210_ahub.c | 35 +++++++++-------- sound/soc/tegra/tegra210_amx.c | 63 ++++++++++++++++--------------- sound/soc/tegra/tegra210_dmic.c | 21 ++++++----- sound/soc/tegra/tegra210_i2s.c | 42 +++++++++++---------- sound/soc/tegra/tegra210_mbdrc.c | 25 ++++++------ sound/soc/tegra/tegra210_mixer.c | 23 +++++------ sound/soc/tegra/tegra210_mvc.c | 21 ++++++----- sound/soc/tegra/tegra210_ope.c | 21 ++++++----- sound/soc/tegra/tegra210_peq.c | 25 ++++++------ sound/soc/tegra/tegra210_sfc.c | 23 +++++------ 14 files changed, 234 insertions(+), 212 deletions(-)
sound/soc/tegra/tegra186_asrc.c +11 -10
@@ -941,16 +941,17 @@ static bool tegra186_asrc_volatile_reg(struct device *dev, unsigned int reg) }static const struct regmap_config tegra186_asrc_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =TEGRA186_ASRC_CYA , - .writeable_reg = tegra186_asrc_wr_reg, - .readable_reg = tegra186_asrc_rd_reg, - .volatile_reg = tegra186_asrc_volatile_reg, - .reg_defaults = tegra186_asrc_reg_defaults, - .num_reg_defaults =ARRAY_SIZE (tegra186_asrc_reg_defaults), - .cache_type =REGCACHE_FLAT , + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .max_register =TEGRA186_ASRC_CYA , + .writeable_reg = tegra186_asrc_wr_reg, + .readable_reg = tegra186_asrc_rd_reg, + .volatile_reg = tegra186_asrc_volatile_reg, + .reg_defaults = tegra186_asrc_reg_defaults, + .num_reg_defaults =ARRAY_SIZE (tegra186_asrc_reg_defaults), + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };static const struct tegra_asrc_soc_data soc_data_tegra186 = {
sound/soc/tegra/tegra186_dspk.c +11 -10
@@ -458,16 +458,17 @@ static bool tegra186_dspk_volatile_reg(struct device *dev, unsigned int reg) }static const struct regmap_config tegra186_dspk_regmap = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =TEGRA186_DSPK_CODEC_CTRL , - .writeable_reg = tegra186_dspk_wr_reg, - .readable_reg = tegra186_dspk_rd_reg, - .volatile_reg = tegra186_dspk_volatile_reg, - .reg_defaults = tegra186_dspk_reg_defaults, - .num_reg_defaults =ARRAY_SIZE (tegra186_dspk_reg_defaults), - .cache_type =REGCACHE_FLAT , + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .max_register =TEGRA186_DSPK_CODEC_CTRL , + .writeable_reg = tegra186_dspk_wr_reg, + .readable_reg = tegra186_dspk_rd_reg, + .volatile_reg = tegra186_dspk_volatile_reg, + .reg_defaults = tegra186_dspk_reg_defaults, + .num_reg_defaults =ARRAY_SIZE (tegra186_dspk_reg_defaults), + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };static const struct of_device_id tegra186_dspk_of_match[] = {
sound/soc/tegra/tegra210_admaif.c +33 -30
75 lines not on this page · raw message
sound/soc/tegra/tegra210_adx.c +22 -20
51 lines not on this page · raw message
sound/soc/tegra/tegra210_ahub.c +19 -16
@@ -2073,28 +2073,31 @@ static bool tegra264_ahub_wr_reg(struct device *dev, unsigned int reg) }static const struct regmap_config tegra210_ahub_regmap_config = { - .reg_bits =32 , - .val_bits =32 , - .reg_stride =4 , - .max_register =TEGRA210_MAX_REGISTER_ADDR , - .cache_type =REGCACHE_FLAT , + .reg_bits =32 , + .val_bits =32 , + .reg_stride =4 , + .max_register =TEGRA210_MAX_REGISTER_ADDR , + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };static const struct regmap_config tegra186_ahub_regmap_config = { - .reg_bits =32 , - .val_bits =32 , - .reg_stride =4 , - .max_register =TEGRA186_MAX_REGISTER_ADDR , - .cache_type =REGCACHE_FLAT , + .reg_bits =32 , + .val_bits =32 , + .reg_stride =4 , + .max_register =TEGRA186_MAX_REGISTER_ADDR , + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };static const struct regmap_config tegra264_ahub_regmap_config = { - .reg_bits =32 , - .val_bits =32 , - .reg_stride =4 , - .writeable_reg = tegra264_ahub_wr_reg, - .max_register =TEGRA264_MAX_REGISTER_ADDR , - .cache_type =REGCACHE_FLAT , + .reg_bits =32 , + .val_bits =32 , + .reg_stride =4 , + .writeable_reg = tegra264_ahub_wr_reg, + .max_register =TEGRA264_MAX_REGISTER_ADDR , + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };static const struct tegra_ahub_soc_data soc_data_tegra210 = {
sound/soc/tegra/tegra210_amx.c +33 -30
75 lines not on this page · raw message
sound/soc/tegra/tegra210_dmic.c +11 -10
@@ -474,16 +474,17 @@ static bool tegra210_dmic_volatile_reg(struct device *dev, unsigned int reg) }static const struct regmap_config tegra210_dmic_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =TEGRA210_DMIC_LP_BIQUAD_1_COEF_4 , - .writeable_reg = tegra210_dmic_wr_reg, - .readable_reg = tegra210_dmic_rd_reg, - .volatile_reg = tegra210_dmic_volatile_reg, - .reg_defaults = tegra210_dmic_reg_defaults, - .num_reg_defaults =ARRAY_SIZE (tegra210_dmic_reg_defaults), - .cache_type =REGCACHE_FLAT , + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .max_register =TEGRA210_DMIC_LP_BIQUAD_1_COEF_4 , + .writeable_reg = tegra210_dmic_wr_reg, + .readable_reg = tegra210_dmic_rd_reg, + .volatile_reg = tegra210_dmic_volatile_reg, + .reg_defaults = tegra210_dmic_reg_defaults, + .num_reg_defaults =ARRAY_SIZE (tegra210_dmic_reg_defaults), + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };static int tegra210_dmic_probe (struct platform_device *pdev)
sound/soc/tegra/tegra210_i2s.c +22 -20
54 lines not on this page · raw message
sound/soc/tegra/tegra210_mbdrc.c +13 -12
@@ -752,18 +752,19 @@ static bool tegra210_mbdrc_precious_reg(struct device *dev, unsigned int reg) }static const struct regmap_config tegra210_mbdrc_regmap_cfg = { - .name ="mbdrc" , - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =TEGRA210_MBDRC_MAX_REG , - .writeable_reg = tegra210_mbdrc_wr_reg, - .readable_reg = tegra210_mbdrc_rd_reg, - .volatile_reg = tegra210_mbdrc_volatile_reg, - .precious_reg = tegra210_mbdrc_precious_reg, - .reg_defaults = tegra210_mbdrc_reg_defaults, - .num_reg_defaults =ARRAY_SIZE (tegra210_mbdrc_reg_defaults), - .cache_type =REGCACHE_FLAT , + .name ="mbdrc" , + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .max_register =TEGRA210_MBDRC_MAX_REG , + .writeable_reg = tegra210_mbdrc_wr_reg, + .readable_reg = tegra210_mbdrc_rd_reg, + .volatile_reg = tegra210_mbdrc_volatile_reg, + .precious_reg = tegra210_mbdrc_precious_reg, + .reg_defaults = tegra210_mbdrc_reg_defaults, + .num_reg_defaults =ARRAY_SIZE (tegra210_mbdrc_reg_defaults), + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };int tegra210_mbdrc_hw_params (struct snd_soc_component *cmpnt)
sound/soc/tegra/tegra210_mixer.c +12 -11
@@ -598,17 +598,18 @@ static bool tegra210_mixer_precious_reg(struct device *dev, }static const struct regmap_config tegra210_mixer_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =TEGRA210_MIXER_CTRL , - .writeable_reg = tegra210_mixer_wr_reg, - .readable_reg = tegra210_mixer_rd_reg, - .volatile_reg = tegra210_mixer_volatile_reg, - .precious_reg = tegra210_mixer_precious_reg, - .reg_defaults = tegra210_mixer_reg_defaults, - .num_reg_defaults =ARRAY_SIZE (tegra210_mixer_reg_defaults), - .cache_type =REGCACHE_FLAT , + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .max_register =TEGRA210_MIXER_CTRL , + .writeable_reg = tegra210_mixer_wr_reg, + .readable_reg = tegra210_mixer_rd_reg, + .volatile_reg = tegra210_mixer_volatile_reg, + .precious_reg = tegra210_mixer_precious_reg, + .reg_defaults = tegra210_mixer_reg_defaults, + .num_reg_defaults =ARRAY_SIZE (tegra210_mixer_reg_defaults), + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };static const struct of_device_id tegra210_mixer_of_match[] = {
sound/soc/tegra/tegra210_mvc.c +11 -10
@@ -690,16 +690,17 @@ static bool tegra210_mvc_volatile_reg(struct device *dev, unsigned int reg) }static const struct regmap_config tegra210_mvc_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =TEGRA210_MVC_CONFIG_ERR_TYPE , - .writeable_reg = tegra210_mvc_wr_reg, - .readable_reg = tegra210_mvc_rd_reg, - .volatile_reg = tegra210_mvc_volatile_reg, - .reg_defaults = tegra210_mvc_reg_defaults, - .num_reg_defaults =ARRAY_SIZE (tegra210_mvc_reg_defaults), - .cache_type =REGCACHE_FLAT , + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .max_register =TEGRA210_MVC_CONFIG_ERR_TYPE , + .writeable_reg = tegra210_mvc_wr_reg, + .readable_reg = tegra210_mvc_rd_reg, + .volatile_reg = tegra210_mvc_volatile_reg, + .reg_defaults = tegra210_mvc_reg_defaults, + .num_reg_defaults =ARRAY_SIZE (tegra210_mvc_reg_defaults), + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };static const struct of_device_id tegra210_mvc_of_match[] = {
sound/soc/tegra/tegra210_ope.c +11 -10
@@ -288,16 +288,17 @@ static bool tegra210_ope_volatile_reg(struct device *dev, unsigned int reg) }static const struct regmap_config tegra210_ope_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =TEGRA210_OPE_DIR , - .writeable_reg = tegra210_ope_wr_reg, - .readable_reg = tegra210_ope_rd_reg, - .volatile_reg = tegra210_ope_volatile_reg, - .reg_defaults = tegra210_ope_reg_defaults, - .num_reg_defaults =ARRAY_SIZE (tegra210_ope_reg_defaults), - .cache_type =REGCACHE_FLAT , + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .max_register =TEGRA210_OPE_DIR , + .writeable_reg = tegra210_ope_wr_reg, + .readable_reg = tegra210_ope_rd_reg, + .volatile_reg = tegra210_ope_volatile_reg, + .reg_defaults = tegra210_ope_reg_defaults, + .num_reg_defaults =ARRAY_SIZE (tegra210_ope_reg_defaults), + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };static int tegra210_ope_probe (struct platform_device *pdev)
sound/soc/tegra/tegra210_peq.c +13 -12
@@ -295,18 +295,19 @@ static bool tegra210_peq_precious_reg(struct device *dev, unsigned int reg) }static const struct regmap_config tegra210_peq_regmap_config = { - .name ="peq" , - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =TEGRA210_PEQ_CFG_RAM_SHIFT_DATA , - .writeable_reg = tegra210_peq_wr_reg, - .readable_reg = tegra210_peq_rd_reg, - .volatile_reg = tegra210_peq_volatile_reg, - .precious_reg = tegra210_peq_precious_reg, - .reg_defaults = tegra210_peq_reg_defaults, - .num_reg_defaults =ARRAY_SIZE (tegra210_peq_reg_defaults), - .cache_type =REGCACHE_FLAT , + .name ="peq" , + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .max_register =TEGRA210_PEQ_CFG_RAM_SHIFT_DATA , + .writeable_reg = tegra210_peq_wr_reg, + .readable_reg = tegra210_peq_rd_reg, + .volatile_reg = tegra210_peq_volatile_reg, + .precious_reg = tegra210_peq_precious_reg, + .reg_defaults = tegra210_peq_reg_defaults, + .num_reg_defaults =ARRAY_SIZE (tegra210_peq_reg_defaults), + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, }; void tegra210_peq_restore(struct regmap *regmap, u32 *biquad_gains,
sound/soc/tegra/tegra210_sfc.c +12 -11
@@ -3559,17 +3559,18 @@ static bool tegra210_sfc_precious_reg(struct device *dev, unsigned int reg) }static const struct regmap_config tegra210_sfc_regmap_config = { - .reg_bits =32 , - .reg_stride =4 , - .val_bits =32 , - .max_register =TEGRA210_SFC_CFG_RAM_DATA , - .writeable_reg = tegra210_sfc_wr_reg, - .readable_reg = tegra210_sfc_rd_reg, - .volatile_reg = tegra210_sfc_volatile_reg, - .precious_reg = tegra210_sfc_precious_reg, - .reg_defaults = tegra210_sfc_reg_defaults, - .num_reg_defaults =ARRAY_SIZE (tegra210_sfc_reg_defaults), - .cache_type =REGCACHE_FLAT , + .reg_bits =32 , + .reg_stride =4 , + .val_bits =32 , + .max_register =TEGRA210_SFC_CFG_RAM_DATA , + .writeable_reg = tegra210_sfc_wr_reg, + .readable_reg = tegra210_sfc_rd_reg, + .volatile_reg = tegra210_sfc_volatile_reg, + .precious_reg = tegra210_sfc_precious_reg, + .reg_defaults = tegra210_sfc_reg_defaults, + .num_reg_defaults =ARRAY_SIZE (tegra210_sfc_reg_defaults), + .cache_type =REGCACHE_FLAT , + .flat_cache_default_is_zero = true, };static const struct of_device_id tegra210_sfc_of_match[] = {
Signature · 1 line
2.17.1
Mark Brown
maintainerRe: [RFC PATCH v2 3/3] ASoC: tegra: Enable flat_cache_default_is_zero for audio drivers
Quoted 4 lines · Sheetal .
From: Sheetal <[email protected]>
Set
flat_cache_default_is_zeroflag in Tegra audio driver regmap configurations.
This doesn't apply against current code, please check and resend.
Re: [RFC PATCH v2 3/3] ASoC: tegra: Enable flat_cache_default_is_zero for audio drivers
Quoted 7 lines · Mark Brown
Quoted 4 lines · Sheetal .
From: Sheetal <[email protected]>
Set
flat_cache_default_is_zeroflag in Tegra audio driver regmap configurations.This doesn't apply against current code, please check and resend.
As mentioned in the commit message,
This patch depends on:
https://patchwork.ozlabs.org/project/linux-tegra/patch/[email protected]/.
Kindly let me know if any additional action is required on my part.
Regards,
Sheetal
Mark Brown
maintainerRe: [RFC PATCH v2 3/3] ASoC: tegra: Enable flat_cache_default_is_zero for audio drivers
Quoted 8 lines · Sheetal .
Quoted 1 line · Mark Brown
This doesn't apply against current code, please check and resend.
As mentioned in the commit message,
This patch depends on:
https://patchwork.ozlabs.org/project/linux-tegra/patch/[email protected]/.
Please include human readable descriptions of things like commits and issues being discussed in e-mail in your mails, this makes them much easier for humans to read especially when they have no internet access. I do frequently catch up on my mail on flights or while otherwise travelling so this is even more pressing for me than just being about making things a bit easier to read.
Quoted 1 line
Kindly let me know if any additional action is required on my part.
Please resend when the dependencies are lined up.