diff options
| author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2025-11-20 15:30:19 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-11-20 17:22:58 +0000 |
| commit | 5acf17b6df5e759bfb8bc0a75fadcbb3e363a17b (patch) | |
| tree | 41722b61172b3f46d3df180cc187bd758e4fe029 | |
| parent | 193c65ec8ed4d946b3f80b7d08e4320ded7ac4fa (diff) | |
ASoC: SDCA: Add helper to write initialization writes
Add a helper function to write out the SDCA blind initialization writes.
Acked-by: Vinod Koul <vkoul@kernel.org>
Tested-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Tested-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20251120153023.2105663-11-ckeepax@opensource.cirrus.com
Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | include/sound/sdca_regmap.h | 2 | ||||
| -rw-r--r-- | sound/soc/sdca/sdca_regmap.c | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/sound/sdca_regmap.h b/include/sound/sdca_regmap.h index b2e3c2ad2bb8..792540a530fc 100644 --- a/include/sound/sdca_regmap.h +++ b/include/sound/sdca_regmap.h @@ -27,5 +27,7 @@ int sdca_regmap_populate_constants(struct device *dev, struct sdca_function_data int sdca_regmap_write_defaults(struct device *dev, struct regmap *regmap, struct sdca_function_data *function); +int sdca_regmap_write_init(struct device *dev, struct regmap *regmap, + struct sdca_function_data *function); #endif // __SDCA_REGMAP_H__ diff --git a/sound/soc/sdca/sdca_regmap.c b/sound/soc/sdca/sdca_regmap.c index 6fbb241d9d35..2cca9a9c71ea 100644 --- a/sound/soc/sdca/sdca_regmap.c +++ b/sound/soc/sdca/sdca_regmap.c @@ -355,3 +355,19 @@ int sdca_regmap_write_defaults(struct device *dev, struct regmap *regmap, return 0; } EXPORT_SYMBOL_NS(sdca_regmap_write_defaults, "SND_SOC_SDCA"); + +int sdca_regmap_write_init(struct device *dev, struct regmap *regmap, + struct sdca_function_data *function) +{ + struct sdca_init_write *init = function->init_table; + int ret, i; + + for (i = 0; i < function->num_init_table; i++) { + ret = regmap_write(regmap, init[i].addr, init[i].val); + if (ret) + return ret; + } + + return 0; +} +EXPORT_SYMBOL_NS(sdca_regmap_write_init, "SND_SOC_SDCA"); |