提交 4f86a724 编写于 作者: P Patrick Delaunay 提交者: Simon Glass

power: regulator: denied disable on always-on regulator

Don't disable regulator which are tagged as "regulator-always-on" in DT.
Signed-off-by: NPatrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: NSimon Glass <sjg@chromium.org>
Reviewed-by: NJack Mitchell <jack@embed.me.uk>
Tested-by: NJack Mitchell <jack@embed.me.uk>
Signed-off-by: NPatrice Chotard <patrice.chotard@st.com>
Reviewed-by: NRichard Röjfors <richard@puffinpack.se>
Tested-by: NRichard Röjfors <richard@puffinpack.se>
Reviewed-by: NFelix Brack <fb@ltec.ch>
Tested-by: NFelix Brack <fb@ltec.ch>
上级 79598820
......@@ -106,10 +106,15 @@ int regulator_get_enable(struct udevice *dev)
int regulator_set_enable(struct udevice *dev, bool enable)
{
const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
struct dm_regulator_uclass_platdata *uc_pdata;
if (!ops || !ops->set_enable)
return -ENOSYS;
uc_pdata = dev_get_uclass_platdata(dev);
if (!enable && uc_pdata->always_on)
return -EACCES;
return ops->set_enable(dev, enable);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册