mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: Support list_voltage for fixed voltage regulator
@ 2009-04-28 10:13 Mark Brown
  2009-04-28 10:13 ` [PATCH 2/2] regulator: Set MODULE_ALIAS for regulator drivers Mark Brown
  2009-04-28 13:24 ` [PATCH 1/2] regulator: Support list_voltage for fixed voltage regulator Liam Girdwood
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Brown @ 2009-04-28 10:13 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, Mark Brown

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/regulator/fixed.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 6e0bede..4c525af 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;
 
-- 
1.6.2.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] regulator: Set MODULE_ALIAS for regulator drivers
  2009-04-28 10:13 [PATCH 1/2] regulator: Support list_voltage for fixed voltage regulator Mark Brown
@ 2009-04-28 10:13 ` Mark Brown
  2009-04-28 13:24   ` Liam Girdwood
  2009-04-28 13:24 ` [PATCH 1/2] regulator: Support list_voltage for fixed voltage regulator Liam Girdwood
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2009-04-28 10:13 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, Mark Brown

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 <broonie@opensource.wolfsonmicro.com>
---
 drivers/regulator/fixed.c            |    1 +
 drivers/regulator/virtual.c          |    1 +
 drivers/regulator/wm8350-regulator.c |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 4c525af..cdc674f 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 <broonie@opensource.wolfsonmicro.com>");
 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 3d08348..8820900 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 <broonie@opensource.wolfsonmicro.com>");
 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 771eca1..17a00b0 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");
-- 
1.6.2.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] regulator: Support list_voltage for fixed voltage regulator
  2009-04-28 10:13 [PATCH 1/2] regulator: Support list_voltage for fixed voltage regulator Mark Brown
  2009-04-28 10:13 ` [PATCH 2/2] regulator: Set MODULE_ALIAS for regulator drivers Mark Brown
@ 2009-04-28 13:24 ` Liam Girdwood
  1 sibling, 0 replies; 4+ messages in thread
From: Liam Girdwood @ 2009-04-28 13:24 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel

On Tue, 2009-04-28 at 11:13 +0100, Mark Brown wrote:
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  drivers/regulator/fixed.c |   15 ++++++++++++++-
>  1 files changed, 14 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
> index 6e0bede..4c525af 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;
>  

Applied.

Thanks

Liam


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] regulator: Set MODULE_ALIAS for regulator drivers
  2009-04-28 10:13 ` [PATCH 2/2] regulator: Set MODULE_ALIAS for regulator drivers Mark Brown
@ 2009-04-28 13:24   ` Liam Girdwood
  0 siblings, 0 replies; 4+ messages in thread
From: Liam Girdwood @ 2009-04-28 13:24 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel

On Tue, 2009-04-28 at 11:13 +0100, Mark Brown wrote:
> 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 <broonie@opensource.wolfsonmicro.com>
> ---
>  drivers/regulator/fixed.c            |    1 +
>  drivers/regulator/virtual.c          |    1 +
>  drivers/regulator/wm8350-regulator.c |    1 +
>  3 files changed, 3 insertions(+), 0 deletions(-)
> 

Applied.

Thanks

Liam


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-28 13:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-28 10:13 [PATCH 1/2] regulator: Support list_voltage for fixed voltage regulator Mark Brown
2009-04-28 10:13 ` [PATCH 2/2] regulator: Set MODULE_ALIAS for regulator drivers Mark Brown
2009-04-28 13:24   ` Liam Girdwood
2009-04-28 13:24 ` [PATCH 1/2] regulator: Support list_voltage for fixed voltage regulator Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®