From 5a1b22beeff30d870bf2169a37e343e06cb5db3a Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 27 Apr 2009 18:21:18 +0100 Subject: regulator: Move regulator drivers to subsys_initcall() Regulators need to be available early in init in order to allow them to be available for consumers when requested. This is generally done by registering them at subsys_initcall() time but not all regulator drivers have done that. Convert these drivers to do so in order to mimimise future support. Signed-off-by: Mark Brown Acked-by: Mike Rapoport Signed-off-by: Liam Girdwood --- drivers/regulator/fixed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/regulator/fixed.c') diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 23d554628a7..6e0bede16ef 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -117,7 +117,7 @@ static int __init regulator_fixed_voltage_init(void) { return platform_driver_register(®ulator_fixed_voltage_driver); } -module_init(regulator_fixed_voltage_init); +subsys_initcall(regulator_fixed_voltage_init); static void __exit regulator_fixed_voltage_exit(void) { -- cgit v1.2.3-70-g09d2 From 9035cefc2d4b67591cbc2e4e8fbc8d73901ca9eb Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 28 Apr 2009 11:13:54 +0100 Subject: regulator: Support list_voltage for fixed voltage regulator Signed-off-by: Mark Brown Signed-off-by: Liam Girdwood --- drivers/regulator/fixed.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'drivers/regulator/fixed.c') diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 6e0bede16ef..4c525afb009 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -44,10 +44,22 @@ static int fixed_voltage_get_voltage(struct regulator_dev *dev) return data->microvolts; } +static int fixed_voltage_list_voltage(struct regulator_dev *dev, + unsigned selector) +{ + struct fixed_voltage_data *data = rdev_get_drvdata(dev); + + if (selector != 0) + return -EINVAL; + + return data->microvolts; +} + static struct regulator_ops fixed_voltage_ops = { .is_enabled = fixed_voltage_is_enabled, .enable = fixed_voltage_enable, .get_voltage = fixed_voltage_get_voltage, + .list_voltage = fixed_voltage_list_voltage, }; static int regulator_fixed_voltage_probe(struct platform_device *pdev) @@ -69,7 +81,8 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev) } drvdata->desc.type = REGULATOR_VOLTAGE; drvdata->desc.owner = THIS_MODULE; - drvdata->desc.ops = &fixed_voltage_ops, + drvdata->desc.ops = &fixed_voltage_ops; + drvdata->desc.n_voltages = 1; drvdata->microvolts = config->microvolts; -- cgit v1.2.3-70-g09d2 From 38c53c89139e6140b895b419b18c586e8593a6e8 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 28 Apr 2009 11:13:55 +0100 Subject: regulator: Set MODULE_ALIAS for regulator drivers Several of the regulator drivers didn't have MODULE_ALIAS so couldn't be auto loaded. Add the MODULE_ALIAS in case they do get built as modules. Signed-off-by: Mark Brown Signed-off-by: Liam Girdwood --- drivers/regulator/fixed.c | 1 + drivers/regulator/virtual.c | 1 + drivers/regulator/wm8350-regulator.c | 1 + 3 files changed, 3 insertions(+) (limited to 'drivers/regulator/fixed.c') diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index 4c525afb009..cdc674fb46c 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -141,3 +141,4 @@ module_exit(regulator_fixed_voltage_exit); MODULE_AUTHOR("Mark Brown "); MODULE_DESCRIPTION("Fixed voltage regulator"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:reg-fixed-voltage"); diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c index 71403fa3ffa..e7db5664722 100644 --- a/drivers/regulator/virtual.c +++ b/drivers/regulator/virtual.c @@ -347,3 +347,4 @@ module_exit(regulator_virtual_consumer_exit); MODULE_AUTHOR("Mark Brown "); MODULE_DESCRIPTION("Virtual regulator consumer"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:reg-virt-consumer"); diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 771eca1066b..17a00b0fafd 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c @@ -1570,3 +1570,4 @@ module_exit(wm8350_regulator_exit); MODULE_AUTHOR("Liam Girdwood"); MODULE_DESCRIPTION("WM8350 voltage and current regulator driver"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:wm8350-regulator"); -- cgit v1.2.3-70-g09d2