* [PATCH RESEND 2/3] regulator: 88pm8607: Use enable_is_inverted flag with regulator_enable_regmap and friends APIs
2013-03-05 6:16 [PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable Axel Lin
@ 2013-03-05 6:16 ` Axel Lin
2013-03-05 6:17 ` [PATCH RESEND 3/3] regulator: max8649: " Axel Lin
2013-03-05 7:03 ` [PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable Mark Brown
2 siblings, 0 replies; 6+ messages in thread
From: Axel Lin @ 2013-03-05 6:16 UTC (permalink / raw)
To: Mark Brown; +Cc: Haojian Zhuang, Jett.Zhou, Liam Girdwood, linux-kernel
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Haojian Zhuang <haojian.zhuang@gmail.com>
---
drivers/regulator/88pm8607.c | 36 ++++--------------------------------
1 file changed, 4 insertions(+), 32 deletions(-)
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c
index c79ab84..493948a 100644
--- a/drivers/regulator/88pm8607.c
+++ b/drivers/regulator/88pm8607.c
@@ -220,35 +220,6 @@ static int pm8607_list_voltage(struct regulator_dev *rdev, unsigned index)
return ret;
}
-static int pm8606_preg_enable(struct regulator_dev *rdev)
-{
- struct pm8607_regulator_info *info = rdev_get_drvdata(rdev);
-
- return pm860x_set_bits(info->i2c, rdev->desc->enable_reg,
- 1 << rdev->desc->enable_mask, 0);
-}
-
-static int pm8606_preg_disable(struct regulator_dev *rdev)
-{
- struct pm8607_regulator_info *info = rdev_get_drvdata(rdev);
-
- return pm860x_set_bits(info->i2c, rdev->desc->enable_reg,
- 1 << rdev->desc->enable_mask,
- 1 << rdev->desc->enable_mask);
-}
-
-static int pm8606_preg_is_enabled(struct regulator_dev *rdev)
-{
- struct pm8607_regulator_info *info = rdev_get_drvdata(rdev);
- int ret;
-
- ret = pm860x_reg_read(info->i2c, rdev->desc->enable_reg);
- if (ret < 0)
- return ret;
-
- return !((unsigned char)ret & (1 << rdev->desc->enable_mask));
-}
-
static struct regulator_ops pm8607_regulator_ops = {
.list_voltage = pm8607_list_voltage,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
@@ -259,9 +230,9 @@ static struct regulator_ops pm8607_regulator_ops = {
};
static struct regulator_ops pm8606_preg_ops = {
- .enable = pm8606_preg_enable,
- .disable = pm8606_preg_disable,
- .is_enabled = pm8606_preg_is_enabled,
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .is_enabled = regulator_is_enabled_regmap,
};
#define PM8606_PREG(ereg, ebit) \
@@ -274,6 +245,7 @@ static struct regulator_ops pm8606_preg_ops = {
.owner = THIS_MODULE, \
.enable_reg = PM8606_##ereg, \
.enable_mask = (ebit), \
+ .enable_is_inverted = true, \
}, \
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH RESEND 3/3] regulator: max8649: Use enable_is_inverted flag with regulator_enable_regmap and friends APIs
2013-03-05 6:16 [PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable Axel Lin
2013-03-05 6:16 ` [PATCH RESEND 2/3] regulator: 88pm8607: Use enable_is_inverted flag with regulator_enable_regmap and friends APIs Axel Lin
@ 2013-03-05 6:17 ` Axel Lin
2013-03-05 7:03 ` [PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable Mark Brown
2 siblings, 0 replies; 6+ messages in thread
From: Axel Lin @ 2013-03-05 6:17 UTC (permalink / raw)
To: Mark Brown; +Cc: Haojian Zhuang, Jett.Zhou, Liam Girdwood, linux-kernel
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Haojian Zhuang <haojian.zhuang@gmail.com>
---
drivers/regulator/max8649.c | 39 ++++++---------------------------------
1 file changed, 6 insertions(+), 33 deletions(-)
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c
index 3ca1438..fdb67ff 100644
--- a/drivers/regulator/max8649.c
+++ b/drivers/regulator/max8649.c
@@ -60,36 +60,6 @@ struct max8649_regulator_info {
unsigned ramp_down:1;
};
-/* EN_PD means pulldown on EN input */
-static int max8649_enable(struct regulator_dev *rdev)
-{
- struct max8649_regulator_info *info = rdev_get_drvdata(rdev);
- return regmap_update_bits(info->regmap, MAX8649_CONTROL, MAX8649_EN_PD, 0);
-}
-
-/*
- * Applied internal pulldown resistor on EN input pin.
- * If pulldown EN pin outside, it would be better.
- */
-static int max8649_disable(struct regulator_dev *rdev)
-{
- struct max8649_regulator_info *info = rdev_get_drvdata(rdev);
- return regmap_update_bits(info->regmap, MAX8649_CONTROL, MAX8649_EN_PD,
- MAX8649_EN_PD);
-}
-
-static int max8649_is_enabled(struct regulator_dev *rdev)
-{
- struct max8649_regulator_info *info = rdev_get_drvdata(rdev);
- unsigned int val;
- int ret;
-
- ret = regmap_read(info->regmap, MAX8649_CONTROL, &val);
- if (ret != 0)
- return ret;
- return !((unsigned char)val & MAX8649_EN_PD);
-}
-
static int max8649_enable_time(struct regulator_dev *rdev)
{
struct max8649_regulator_info *info = rdev_get_drvdata(rdev);
@@ -151,9 +121,9 @@ static struct regulator_ops max8649_dcdc_ops = {
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
- .enable = max8649_enable,
- .disable = max8649_disable,
- .is_enabled = max8649_is_enabled,
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .is_enabled = regulator_is_enabled_regmap,
.enable_time = max8649_enable_time,
.set_mode = max8649_set_mode,
.get_mode = max8649_get_mode,
@@ -169,6 +139,9 @@ static struct regulator_desc dcdc_desc = {
.vsel_mask = MAX8649_VOL_MASK,
.min_uV = MAX8649_DCDC_VMIN,
.uV_step = MAX8649_DCDC_STEP,
+ .enable_reg = MAX8649_CONTROL,
+ .enable_mask = MAX8649_EN_PD,
+ .enable_is_inverted = true,
};
static struct regmap_config max8649_regmap_config = {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable
2013-03-05 6:16 [PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable Axel Lin
2013-03-05 6:16 ` [PATCH RESEND 2/3] regulator: 88pm8607: Use enable_is_inverted flag with regulator_enable_regmap and friends APIs Axel Lin
2013-03-05 6:17 ` [PATCH RESEND 3/3] regulator: max8649: " Axel Lin
@ 2013-03-05 7:03 ` Mark Brown
2013-03-05 7:09 ` Axel Lin
2 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2013-03-05 7:03 UTC (permalink / raw)
To: Axel Lin; +Cc: Haojian Zhuang, Jett.Zhou, Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 494 bytes --]
On Tue, Mar 05, 2013 at 02:16:00PM +0800, Axel Lin wrote:
> Add enable_is_inverted flag to indicate set enable_mask bits to disable
> when using regulator_enable_regmap and friends APIs.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> Reviewed-by: Haojian Zhuang <haojian.zhuang@gmail.com>
> ---
> This patch was sent on https://lkml.org/lkml/2013/2/16/14.
> This resend is against linux-next tree (20130305).
This doesn't apply against v3.9-rc1... what are the dependencies?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable
2013-03-05 7:03 ` [PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable Mark Brown
@ 2013-03-05 7:09 ` Axel Lin
2013-03-05 10:00 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Axel Lin @ 2013-03-05 7:09 UTC (permalink / raw)
To: Mark Brown; +Cc: Haojian Zhuang, Jett.Zhou, Liam Girdwood, linux-kernel
2013/3/5 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Tue, Mar 05, 2013 at 02:16:00PM +0800, Axel Lin wrote:
>> Add enable_is_inverted flag to indicate set enable_mask bits to disable
>> when using regulator_enable_regmap and friends APIs.
>>
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>> Reviewed-by: Haojian Zhuang <haojian.zhuang@gmail.com>
>> ---
>> This patch was sent on https://lkml.org/lkml/2013/2/16/14.
>> This resend is against linux-next tree (20130305).
>
> This doesn't apply against v3.9-rc1... what are the dependencies?
I think it is because of commit 5838b032fd
"regulator: core: update kernel documentation for regulator_desc".
I found the patch (sent on https://lkml.org/lkml/2013/2/16/14 ) does not apply
to today's linux-next tree. So I re-generate the patchs against linux-next.
Should I resend the previous version of this patch?
Axel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable
2013-03-05 7:09 ` Axel Lin
@ 2013-03-05 10:00 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2013-03-05 10:00 UTC (permalink / raw)
To: Axel Lin; +Cc: Haojian Zhuang, Jett.Zhou, Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
On Tue, Mar 05, 2013 at 03:09:51PM +0800, Axel Lin wrote:
> I think it is because of commit 5838b032fd
> "regulator: core: update kernel documentation for regulator_desc".
> I found the patch (sent on https://lkml.org/lkml/2013/2/16/14 ) does not apply
> to today's linux-next tree. So I re-generate the patchs against linux-next.
> Should I resend the previous version of this patch?
No, that's fine - I've applied them now, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread