diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2019-01-02 18:50:16 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2019-01-02 18:50:16 +0000 |
commit | 7f41acdb97d77e6be67605fb43b70ef0c939528d (patch) | |
tree | d52fbe7bb61183e84ce734c910e9be501ac4c0c9 /sys/dev/ofw/ofw_regulator.c | |
parent | 225e685eb07cad1449971b5128fea9cb024081a2 (diff) |
Setting a fixed voltage regulator to the voltage it is fixed to
should not throw an error.
ok kettenis@
Diffstat (limited to 'sys/dev/ofw/ofw_regulator.c')
-rw-r--r-- | sys/dev/ofw/ofw_regulator.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/ofw/ofw_regulator.c b/sys/dev/ofw/ofw_regulator.c index 83e4eb1274e..a07cf629037 100644 --- a/sys/dev/ofw/ofw_regulator.c +++ b/sys/dev/ofw/ofw_regulator.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_regulator.c,v 1.9 2019/01/02 18:48:06 patrick Exp $ */ +/* $OpenBSD: ofw_regulator.c,v 1.10 2019/01/02 18:50:15 patrick Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -188,6 +188,10 @@ regulator_set_voltage(uint32_t phandle, uint32_t voltage) if (node == 0) return ENODEV; + if (OF_is_compatible(node, "regulator-fixed") && + OF_getpropint(node, "regulator-min-microvolt", 0) == voltage) + return 0; + if (OF_is_compatible(node, "regulator-gpio")) return regulator_gpio_set_voltage(node, voltage); |