diff options
author | Javier Martinez Canillas <javier.martinez@collabora.co.uk> | 2014-11-10 08:43:53 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-26 13:58:14 -0500 |
commit | 072e78b12bf5182a3e2e460388214a291023ef1c (patch) | |
tree | dea7a9970709db752d8b998adcc5615e844ddb87 /drivers/regulator/arizona-micsupp.c | |
parent | 87e1e0f29f703e91c54e81f05d831432ec659dde (diff) |
regulator: of: Add regulator desc param to of_get_regulator_init_data()
The of_get_regulator_init_data() function is used to extract the regulator
init_data but information on how to extract certain data is defined in the
static regulator descriptor (e.g: how to map the hardware operating modes).
Add a const struct regulator_desc * parameter to the function signature so
the parsing logic could use the information in the struct regulator_desc.
of_get_regulator_init_data() relies on of_get_regulation_constraints() to
actually extract the init_data so it has to pass the struct regulator_desc
but that is modified on a later patch.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/arizona-micsupp.c')
-rw-r--r-- | drivers/regulator/arizona-micsupp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/regulator/arizona-micsupp.c b/drivers/regulator/arizona-micsupp.c index ce9aca5f8ee7..c313ef4c3a2f 100644 --- a/drivers/regulator/arizona-micsupp.c +++ b/drivers/regulator/arizona-micsupp.c | |||
@@ -198,7 +198,8 @@ static const struct regulator_init_data arizona_micsupp_ext_default = { | |||
198 | }; | 198 | }; |
199 | 199 | ||
200 | static int arizona_micsupp_of_get_pdata(struct arizona *arizona, | 200 | static int arizona_micsupp_of_get_pdata(struct arizona *arizona, |
201 | struct regulator_config *config) | 201 | struct regulator_config *config, |
202 | const struct regulator_desc *desc) | ||
202 | { | 203 | { |
203 | struct arizona_pdata *pdata = &arizona->pdata; | 204 | struct arizona_pdata *pdata = &arizona->pdata; |
204 | struct arizona_micsupp *micsupp = config->driver_data; | 205 | struct arizona_micsupp *micsupp = config->driver_data; |
@@ -210,7 +211,7 @@ static int arizona_micsupp_of_get_pdata(struct arizona *arizona, | |||
210 | if (np) { | 211 | if (np) { |
211 | config->of_node = np; | 212 | config->of_node = np; |
212 | 213 | ||
213 | init_data = of_get_regulator_init_data(arizona->dev, np); | 214 | init_data = of_get_regulator_init_data(arizona->dev, np, desc); |
214 | 215 | ||
215 | if (init_data) { | 216 | if (init_data) { |
216 | init_data->consumer_supplies = &micsupp->supply; | 217 | init_data->consumer_supplies = &micsupp->supply; |
@@ -264,7 +265,8 @@ static int arizona_micsupp_probe(struct platform_device *pdev) | |||
264 | 265 | ||
265 | if (IS_ENABLED(CONFIG_OF)) { | 266 | if (IS_ENABLED(CONFIG_OF)) { |
266 | if (!dev_get_platdata(arizona->dev)) { | 267 | if (!dev_get_platdata(arizona->dev)) { |
267 | ret = arizona_micsupp_of_get_pdata(arizona, &config); | 268 | ret = arizona_micsupp_of_get_pdata(arizona, &config, |
269 | desc); | ||
268 | if (ret < 0) | 270 | if (ret < 0) |
269 | return ret; | 271 | return ret; |
270 | } | 272 | } |