From d8babb9598ce237ffb1feccb576c66a21c52e5f7 Mon Sep 17 00:00:00 2001 From: Pratyush Yadav Date: Thu, 24 Sep 2020 10:04:15 +0530 Subject: regmap: Allow devices to specify regmap range start and size in config Some devices need to calculate the regmap base address at runtime. This makes it impossible to use device tree to get the regmap base. Instead, allow devices to specify it in the regmap config. This will create a regmap with a single range that corresponds to the start and size given by the driver. Signed-off-by: Pratyush Yadav Reviewed-by: Simon Glass --- include/regmap.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/regmap.h') diff --git a/include/regmap.h b/include/regmap.h index 7c8ad04..7a6fcc7 100644 --- a/include/regmap.h +++ b/include/regmap.h @@ -84,10 +84,16 @@ struct regmap_bus; * REGMAP_SIZE_32 if set to 0. * @reg_offset_shift Left shift the register offset by this value before * performing read or write. + * @r_start: If specified, the regmap is created with one range + * which starts at this address, instead of finding the + * start from device tree. + * @r_size: Same as above for the range size */ struct regmap_config { enum regmap_size_t width; u32 reg_offset_shift; + ulong r_start; + ulong r_size; }; /** -- cgit v1.1