summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regcache-flat.c
Commit message (Collapse)AuthorAgeFilesLines
* regcache: flat: Un-inline index lookup from cache accessAndrew F. Davis2018-01-081-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 <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regcache: flat: Require max_registers to be setAlexander Stein2016-03-291-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 <alexander.stein@systec-electronic.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regcache: flat: Introduce register strider orderXiubo Li2016-02-201-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 <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regmap: replace kzalloc with kcalloclixiubo2015-11-201-1/+1
| | | | | | | | Replace kzalloc with specialized function kcalloc when the size is a multiplication of : number * sizeof Signed-off-by: lixiubo <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regmap: cache: Sort include headers alphabeticallyXiubo Li2014-10-201-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 <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regmap: flat: Add flat cache typeMark Brown2013-01-021-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 <broonie@opensource.wolfsonmicro.com>
OpenPOWER on IntegriCloud