return ERR_PTR(rc);
map = *mapp;
- if (config)
+ if (config) {
map->width = config->width;
+ map->reg_offset_shift = config->reg_offset_shift;
+ }
devres_add(dev, mapp);
return *mapp;
}
range = &map->ranges[range_num];
+ offset <<= map->reg_offset_shift;
if (offset + val_len > range->size) {
debug("%s: offset/size combination invalid\n", __func__);
return -ERANGE;
}
range = &map->ranges[range_num];
+ offset <<= map->reg_offset_shift;
if (offset + val_len > range->size) {
debug("%s: offset/size combination invalid\n", __func__);
return -ERANGE;
*
* @width: Width of the read/write operations. Defaults to
* REGMAP_SIZE_32 if set to 0.
+ * @reg_offset_shift Left shift the register offset by this value before
+ * performing read or write.
*/
struct regmap_config {
enum regmap_size_t width;
+ u32 reg_offset_shift;
};
/**
*
* @width: Width of the read/write operations. Defaults to
* REGMAP_SIZE_32 if set to 0.
+ * @reg_offset_shift Left shift the register offset by this value before
+ * performing read or write.
* @range_count: Number of ranges available within the map
* @ranges: Array of ranges
*/
struct regmap {
enum regmap_endianness_t endianness;
enum regmap_size_t width;
+ u32 reg_offset_shift;
int range_count;
struct regmap_range ranges[0];
};