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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.1206191743110.6204@axis700.grange>
Date:	Tue, 19 Jun 2012 17:44:39 +0200 (CEST)
From:	Guennadi Liakhovetski <g.liakhovetski@....de>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
cc:	linux-kernel@...r.kernel.org, Liam Girdwood <lrg@...com>
Subject: [PATCH 2/2 v3] regulator: extend the fixed dummy voltage regulator
 to accept voltage

Trivially extend the regulator_register_always_on() helper function to be
even more useful by adding a voltage parameter to it.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@....de>
---
 drivers/regulator/fixed-helper.c |    5 +++--
 include/linux/regulator/fixed.h  |    6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/fixed-helper.c b/drivers/regulator/fixed-helper.c
index 3aa268d..f9d0279 100644
--- a/drivers/regulator/fixed-helper.c
+++ b/drivers/regulator/fixed-helper.c
@@ -24,9 +24,10 @@ static void regulator_fixed_release(struct device *dev)
  * @name: name to be used for the regulator
  * @supplies: consumers for this regulator
  * @num_supplies: number of consumers
+ * @uv: voltage in microvolts
  */
 struct platform_device *regulator_register_always_on(int id, const char *name,
-		struct regulator_consumer_supply *supplies, int num_supplies)
+	struct regulator_consumer_supply *supplies, int num_supplies, int uv)
 {
 	struct fixed_regulator_data *data;
 
@@ -40,7 +41,7 @@ struct platform_device *regulator_register_always_on(int id, const char *name,
 		return NULL;
 	}
 
-	data->cfg.microvolts = 0;
+	data->cfg.microvolts = uv;
 	data->cfg.gpio = -EINVAL;
 	data->cfg.enabled_at_boot = 1;
 	data->cfg.init_data = &data->init_data;
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
index 6b9325b..680f24e 100644
--- a/include/linux/regulator/fixed.h
+++ b/include/linux/regulator/fixed.h
@@ -59,16 +59,16 @@ struct regulator_consumer_supply;
 
 #if IS_ENABLED(CONFIG_REGULATOR)
 struct platform_device *regulator_register_always_on(int id, const char *name,
-		struct regulator_consumer_supply *supplies, int num_supplies);
+		struct regulator_consumer_supply *supplies, int num_supplies, int uv);
 #else
 static inline struct platform_device *regulator_register_always_on(int id, const char *name,
-		struct regulator_consumer_supply *supplies, int num_supplies)
+		struct regulator_consumer_supply *supplies, int num_supplies, int uv)
 {
 	return NULL;
 }
 #endif
 
 #define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \
-						"fixed-dummy", s, ns)
+						"fixed-dummy", s, ns, 0)
 
 #endif
-- 
1.7.2.5

--
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