[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1415365205-27630-5-git-send-email-javier.martinez@collabora.co.uk>
Date: Fri, 7 Nov 2014 14:00:04 +0100
From: Javier Martinez Canillas <javier.martinez@...labora.co.uk>
To: Mark Brown <broonie@...nel.org>
Cc: Kukjin Kim <kgene.kim@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
Olof Johansson <olof@...om.net>,
Chris Zhong <zyw@...k-chips.com>,
Krzysztof Kozlowski <k.kozlowski@...sung.com>,
Abhilash Kesavan <kesavan.abhilash@...il.com>,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org,
Javier Martinez Canillas <javier.martinez@...labora.co.uk>
Subject: [PATCH v5 4/5] regulator: of: Pass the regulator description in the match table
Drivers can use the of_regulator_match() function to parse the regulator
init_data from DT. A match table is used to specify the name of the node
containing the regulators, the device node and to return the init_data
to the caller.
But also the static regulator descriptor is needed to correctly extract
some DT properties like the regulator initial and suspend modes. Use the
match table to pass that information.
Signed-off-by: Javier Martinez Canillas <javier.martinez@...labora.co.uk>
---
This patch only adds the struct regulator_desc pointer to the struct
of_regulator_match and does not fill this info in all drivers using
the of_regulator_match() function to keep the series short.
A following series will change all regulator drivers calling this
function so the descriptor is passed even when currently isn't used.
drivers/regulator/of_regulator.c | 3 ++-
include/linux/regulator/of_regulator.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 945486f..cbc1d71 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -221,7 +221,8 @@ int of_regulator_match(struct device *dev, struct device_node *node,
continue;
match->init_data =
- of_get_regulator_init_data(dev, child, NULL);
+ of_get_regulator_init_data(dev, child,
+ match->desc);
if (!match->init_data) {
dev_err(dev,
"failed to parse DT for regulator %s\n",
diff --git a/include/linux/regulator/of_regulator.h b/include/linux/regulator/of_regulator.h
index 3bbfb1b..ce0877d 100644
--- a/include/linux/regulator/of_regulator.h
+++ b/include/linux/regulator/of_regulator.h
@@ -13,6 +13,7 @@ struct of_regulator_match {
void *driver_data;
struct regulator_init_data *init_data;
struct device_node *of_node;
+ const struct regulator_desc *desc;
};
#if defined(CONFIG_OF)
--
2.1.0
--
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