aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/regmap/regcache-flat.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-05regmap: rework ->max_register handlingJan Dakinevich1-1/+1
When regmap consists of single register, 'regmap' subsystem is unable to understand whether ->max_register is set or not, because in both cases it is equal to zero. It leads to that the logic based on value of ->max_register doesn't work. For example using of REGCACHE_FLAT fails. This patch introduces an extra parameter to regmap config, indicating that zero value in ->max_register is authentic. Signed-off-by: Jan Dakinevich <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2019-04-25regmap: add proper SPDX identifiers on files that did not have them.Greg Kroah-Hartman1-11/+7
There were a few files in the regmap code that did not have SPDX identifiers on them, so fix that up. At the same time, remove the "free form" text that specified the license of the file, as that is impossible for any tool to properly parse. Also, as Mark loves // comment markers, convert all of the headers to be the same to make things look consistent :) Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-01-08regcache: flat: Un-inline index lookup from cache accessAndrew F. Davis1-5/+10
This makes the code slightly more readable and allows for cleaner addition of functionality in later patches. Signed-off-by: Andrew F. Davis <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-03-29regcache: flat: Require max_registers to be setAlexander Stein1-1/+1
If max_register is unset, regcache_flat_get_index will return 0 and only memory for 1 unsigned int will be allocated, resulting in writing out of bounds. Signed-off-by: Alexander Stein <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-02-20regcache: flat: Introduce register strider orderXiubo Li1-5/+15
Here we introduce regcache_flat_get_index(), which using register stride order and bit rotation, will save some memory spaces for flat cache. Though this will also lost some access performance, since the bit rotation is used to get the index of the cache array, and this could be ingored for memory I/O accessing. Signed-off-by: Xiubo Li <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-20regmap: replace kzalloc with kcalloclixiubo1-1/+1
Replace kzalloc with specialized function kcalloc when the size is a multiplication of : number * sizeof Signed-off-by: lixiubo <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2014-10-20regmap: cache: Sort include headers alphabeticallyXiubo Li1-1/+1
If the inlcude headers aren't sorted alphabetically, then the logical choice is to append new ones, however that creates a lot of potential for conflicts or duplicates because every change will then add new includes in the same location. Signed-off-by: Xiubo Li <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-01-02regmap: flat: Add flat cache typeMark Brown1-0/+72
While for I2C and SPI devices the overhead of using rbtree for devices with only one block of registers is negligible the same isn't always going to be true for MMIO devices where the I/O costs are very much lower. Cater for these devices by adding a simple flat array type for them where the lookups are simple array accesses, taking us right back to the original ASoC cache implementation. Thanks to Magnus Damm for the discussion which prompted this. Signed-off-by: Mark Brown <[email protected]>