@@ -13,6 +13,9 @@ Required properties:
- compatible: Should contain "syscon".
- reg: the register region can be accessed from syscon
+Optional properties:
+- stride : register address stride in bytes.
+
Examples:
gpr: iomuxc-gpr@020e0000 {
compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
@@ -48,6 +48,7 @@ static struct syscon *of_syscon_register(struct device_node *np)
struct regmap *regmap;
void __iomem *base;
int ret;
+ u32 stride;
struct regmap_config syscon_config = syscon_regmap_config;
if (!of_device_is_compatible(np, "syscon"))
@@ -69,6 +70,14 @@ static struct syscon *of_syscon_register(struct device_node *np)
else if (of_property_read_bool(np, "little-endian"))
syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;
+ if (!of_property_read_u32(np, "stride", &stride)) {
+ if (stride > 4)
+ stride = 4;
+
+ syscon_config.reg_stride = stride;
+ syscon_config.val_bits = 8 * stride;
+ }
+
regmap = regmap_init_mmio(NULL, base, &syscon_config);
if (IS_ERR(regmap)) {
pr_err("regmap init failed\n");
This patch adds register stride to dt bindings so that the consumers of the syscon could change it to there need. One of the the use case for this feature is Qualcomm qfprom which needs a byte access to regmap returned from syscon. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> --- Documentation/devicetree/bindings/mfd/syscon.txt | 3 +++ drivers/mfd/syscon.c | 9 +++++++++ 2 files changed, 12 insertions(+)