summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regcache-flat.c
AgeCommit message (Collapse)AuthorFilesLines
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 <alexander.stein@systec-electronic.com> Signed-off-by: Mark Brown <broonie@kernel.org>
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 <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
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 <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
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 <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
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 <broonie@opensource.wolfsonmicro.com>