lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <A874F61F95741C4A9BA573A70FE3998F82E5C95D@DQHE06.ent.ti.com>
Date:	Tue, 7 May 2013 13:09:14 +0000
From:	"Kim, Milo" <Milo.Kim@...com>
To:	"broonie@...nel.org" <broonie@...nel.org>
CC:	Liam Girdwood <lgirdwood@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/2] regulator: support operating mode in the device tree
 structure

For better power efficiency, regulator subsystem provides operating mode.
(fast, normal, idle and standby)
The operating mode is selective by a regulator consumer.

With this patch, regulator operating mode can be set in the DT structure.
If any operating mode is configured, then 'valid_ops_mask' should be set with
REGULATOR_CHANGE_MODE.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@...com>
---
 .../devicetree/bindings/regulator/regulator.txt    |    4 ++++
 drivers/regulator/of_regulator.c                   |   13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/regulator/regulator.txt b/Documentation/devicetree/bindings/regulator/regulator.txt
index ecfc6cc..2b89616 100644
--- a/Documentation/devicetree/bindings/regulator/regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/regulator.txt
@@ -11,6 +11,10 @@ Optional properties:
 - regulator-boot-on: bootloader/firmware enabled regulator
 - <name>-supply: phandle to the parent supply/regulator node
 - regulator-ramp-delay: ramp delay for regulator(in uV/uS)
+- regulator-mode-fast: fast operating mode
+- regulator-mode-normal: normal operating mode
+- regulator-mode-idle: idle operating mode
+- regulator-mode-standby: standby operating mode
 
 Deprecated properties:
 - regulator-compatible: If a regulator chip contains multiple
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 66ca769..aebe9a4 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -64,6 +64,19 @@ static void of_get_regulation_constraints(struct device_node *np,
 	ramp_delay = of_get_property(np, "regulator-ramp-delay", NULL);
 	if (ramp_delay)
 		constraints->ramp_delay = be32_to_cpu(*ramp_delay);
+
+	/* Operation mode configuration */
+	if (of_find_property(np, "regulator-mode-fast", NULL))
+		constraints->valid_modes_mask |= REGULATOR_MODE_FAST;
+	if (of_find_property(np, "regulator-mode-normal", NULL))
+		constraints->valid_modes_mask |= REGULATOR_MODE_NORMAL;
+	if (of_find_property(np, "regulator-mode-idle", NULL))
+		constraints->valid_modes_mask |= REGULATOR_MODE_IDLE;
+	if (of_find_property(np, "regulator-mode-standby", NULL))
+		constraints->valid_modes_mask |= REGULATOR_MODE_STANDBY;
+
+	if (constraints->valid_modes_mask)
+		constraints->valid_ops_mask |= REGULATOR_CHANGE_MODE;
 }
 
 /**
-- 
1.7.9.5


Best Regards,
Milo


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ