提交 ca7734ad 编写于 作者: A Andrey Smirnov 提交者: Mark Brown

regulator: anatop: Add support for "anatop-enable-bit"

Add code to support support for "anatop-enable-bit" device-tree
property. This property translates to LINREG_ENABLE bit in real hardware
and is present on 1p1, 2p5 and 3p0 regulators on i.MX6 and 1p0d regulator
on i.MX7.
Signed-off-by: NAndrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 d00b7461
...@@ -14,6 +14,7 @@ Optional properties: ...@@ -14,6 +14,7 @@ Optional properties:
- anatop-delay-bit-shift: Bit shift for the step time register - anatop-delay-bit-shift: Bit shift for the step time register
- anatop-delay-bit-width: Number of bits used in the step time register - anatop-delay-bit-width: Number of bits used in the step time register
- vin-supply: The supply for this regulator - vin-supply: The supply for this regulator
- anatop-enable-bit: Regulator enable bit offset
Any property defined as part of the core regulator Any property defined as part of the core regulator
binding, defined in regulator.txt, can also be used. binding, defined in regulator.txt, can also be used.
......
...@@ -301,7 +301,19 @@ static int anatop_regulator_probe(struct platform_device *pdev) ...@@ -301,7 +301,19 @@ static int anatop_regulator_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
} else { } else {
u32 enable_bit;
rdesc->ops = &anatop_rops; rdesc->ops = &anatop_rops;
if (!of_property_read_u32(np, "anatop-enable-bit",
&enable_bit)) {
anatop_rops.enable = regulator_enable_regmap;
anatop_rops.disable = regulator_disable_regmap;
anatop_rops.is_enabled = regulator_is_enabled_regmap;
rdesc->enable_reg = sreg->control_reg;
rdesc->enable_mask = BIT(enable_bit);
}
} }
/* register regulator */ /* register regulator */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册