[PATCH 2/2] regulator: fixed: add off-on-delay-us device-tree parsing support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The core already handles the off_on_delay if we set it. So parse the
official device-tree property and set it if present.

Signed-off-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx>
---
 drivers/regulator/fixed.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 9c660d5781..ae16df8a0c 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -52,6 +52,7 @@ static int regulator_fixed_probe(struct device_d *dev)
 {
 	struct device_node *np = dev->device_node;
 	struct regulator_fixed *fix;
+	u32 delay;
 	int ret;
 
 	if (!dev->device_node)
@@ -72,6 +73,9 @@ static int regulator_fixed_probe(struct device_d *dev)
 	fix->rdev.desc = &fix->rdesc;
 	fix->rdev.dev = dev;
 
+	if (!of_property_read_u32(np, "off-on-delay-us", &delay))
+		fix->rdesc.off_on_delay = delay;
+
 	if (of_find_property(np, "regulator-always-on", NULL) ||
 	    of_find_property(np, "regulator-boot-on", NULL)) {
 		fix->always_on = 1;
-- 
2.30.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux