diff mbox

[v2,6/7] regulator: tps65218: Add get_voltage ops for dcdc5 and dcdc6

Message ID 1404814597-4404-7-git-send-email-j-keerthy@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

J, KEERTHY July 8, 2014, 10:16 a.m. UTC
Add get_voltage ops for dcdc5 and dcdc6. Both dcdc5 and 6 are fixed regulators
and hence return min_uV (or max_uV).

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/regulator/tps65218-regulator.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Felipe Balbi July 8, 2014, 1:39 p.m. UTC | #1
On Tue, Jul 08, 2014 at 03:46:36PM +0530, Keerthy wrote:
> Add get_voltage ops for dcdc5 and dcdc6. Both dcdc5 and 6 are fixed regulators
> and hence return min_uV (or max_uV).
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>

Reviewed-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/regulator/tps65218-regulator.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
> index 9effe48..700c652 100644
> --- a/drivers/regulator/tps65218-regulator.c
> +++ b/drivers/regulator/tps65218-regulator.c
> @@ -151,6 +151,14 @@ static int tps65218_pmic_disable(struct regulator_dev *dev)
>  				   dev->desc->enable_mask, TPS65218_PROTECT_L1);
>  }
>  
> +static int tps65218_pmic_dcdc56_get_voltage(struct regulator_dev *dev)
> +{
> +	struct tps65218 *tps = rdev_get_drvdata(dev);
> +	unsigned int rid = rdev_get_id(dev);
> +
> +	return tps->info[rid]->min_uV;
> +}
> +
>  /* Operations permitted on DCDC1, DCDC2 */
>  static struct regulator_ops tps65218_dcdc12_ops = {
>  	.is_enabled		= regulator_is_enabled_regmap,
> @@ -179,6 +187,7 @@ static struct regulator_ops tps65218_dcdc56_pmic_ops = {
>  	.is_enabled		= regulator_is_enabled_regmap,
>  	.enable			= tps65218_pmic_enable,
>  	.disable		= tps65218_pmic_disable,
> +	.get_voltage		= tps65218_pmic_dcdc56_get_voltage,
>  };
>  
>  static const struct regulator_desc regulators[] = {
> -- 
> 1.7.9.5
>
Mark Brown July 8, 2014, 2:11 p.m. UTC | #2
On Tue, Jul 08, 2014 at 03:46:36PM +0530, Keerthy wrote:

> +static int tps65218_pmic_dcdc56_get_voltage(struct regulator_dev *dev)
> +{
> +	struct tps65218 *tps = rdev_get_drvdata(dev);
> +	unsigned int rid = rdev_get_id(dev);
> +
> +	return tps->info[rid]->min_uV;
> +}

Set fixed_uV in the descriptor.
Keerthy July 9, 2014, 3:40 a.m. UTC | #3
On Tuesday 08 July 2014 07:41 PM, Mark Brown wrote:
> On Tue, Jul 08, 2014 at 03:46:36PM +0530, Keerthy wrote:
>
>> +static int tps65218_pmic_dcdc56_get_voltage(struct regulator_dev *dev)
>> +{
>> +	struct tps65218 *tps = rdev_get_drvdata(dev);
>> +	unsigned int rid = rdev_get_id(dev);
>> +
>> +	return tps->info[rid]->min_uV;
>> +}
> Set fixed_uV in the descriptor.
Okay. I will do that. Thanks for the review.

Regards,
Keerthy
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
index 9effe48..700c652 100644
--- a/drivers/regulator/tps65218-regulator.c
+++ b/drivers/regulator/tps65218-regulator.c
@@ -151,6 +151,14 @@  static int tps65218_pmic_disable(struct regulator_dev *dev)
 				   dev->desc->enable_mask, TPS65218_PROTECT_L1);
 }
 
+static int tps65218_pmic_dcdc56_get_voltage(struct regulator_dev *dev)
+{
+	struct tps65218 *tps = rdev_get_drvdata(dev);
+	unsigned int rid = rdev_get_id(dev);
+
+	return tps->info[rid]->min_uV;
+}
+
 /* Operations permitted on DCDC1, DCDC2 */
 static struct regulator_ops tps65218_dcdc12_ops = {
 	.is_enabled		= regulator_is_enabled_regmap,
@@ -179,6 +187,7 @@  static struct regulator_ops tps65218_dcdc56_pmic_ops = {
 	.is_enabled		= regulator_is_enabled_regmap,
 	.enable			= tps65218_pmic_enable,
 	.disable		= tps65218_pmic_disable,
+	.get_voltage		= tps65218_pmic_dcdc56_get_voltage,
 };
 
 static const struct regulator_desc regulators[] = {