* [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel
@ 2012-03-22 23:10 Axel Lin
2012-03-22 23:11 ` [PATCH 2/2] regulator: Convert tps6524x to get_voltage_sel Axel Lin
2012-03-26 17:50 ` [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel Mark Brown
0 siblings, 2 replies; 6+ messages in thread
From: Axel Lin @ 2012-03-22 23:10 UTC (permalink / raw)
To: linux-kernel; +Cc: Cyril Chemparathy, Liam Girdwood, Mark Brown
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/tps6524x-regulator.c | 18 +++---------------
1 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/regulator/tps6524x-regulator.c b/drivers/regulator/tps6524x-regulator.c
index 4a421be..3a4a1d5 100644
--- a/drivers/regulator/tps6524x-regulator.c
+++ b/drivers/regulator/tps6524x-regulator.c
@@ -458,12 +458,10 @@ static int list_voltage(struct regulator_dev *rdev, unsigned selector)
info->voltages[selector] : -EINVAL);
}
-static int set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
- unsigned *selector)
+static int set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
{
const struct supply_info *info;
struct tps6524x *hw;
- unsigned i;
hw = rdev_get_drvdata(rdev);
info = &supply_info[rdev_get_id(rdev)];
@@ -471,17 +469,7 @@ static int set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
if (info->flags & FIXED_VOLTAGE)
return -EINVAL;
- for (i = 0; i < info->n_voltages; i++)
- if (min_uV <= info->voltages[i] &&
- max_uV >= info->voltages[i])
- break;
-
- if (i >= info->n_voltages)
- i = info->n_voltages - 1;
-
- *selector = i;
-
- return write_field(hw, &info->voltage, i);
+ return write_field(hw, &info->voltage, selector);
}
static int get_voltage(struct regulator_dev *rdev)
@@ -588,7 +576,7 @@ static struct regulator_ops regulator_ops = {
.enable = enable_supply,
.disable = disable_supply,
.get_voltage = get_voltage,
- .set_voltage = set_voltage,
+ .set_voltage_sel = set_voltage_sel,
.list_voltage = list_voltage,
.set_current_limit = set_current_limit,
.get_current_limit = get_current_limit,
--
1.7.5.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] regulator: Convert tps6524x to get_voltage_sel
2012-03-22 23:10 [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel Axel Lin
@ 2012-03-22 23:11 ` Axel Lin
2012-03-26 17:50 ` [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel Mark Brown
1 sibling, 0 replies; 6+ messages in thread
From: Axel Lin @ 2012-03-22 23:11 UTC (permalink / raw)
To: linux-kernel; +Cc: Cyril Chemparathy, Liam Girdwood, Mark Brown
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/tps6524x-regulator.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/tps6524x-regulator.c b/drivers/regulator/tps6524x-regulator.c
index 3a4a1d5..2a828a0 100644
--- a/drivers/regulator/tps6524x-regulator.c
+++ b/drivers/regulator/tps6524x-regulator.c
@@ -472,7 +472,7 @@ static int set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
return write_field(hw, &info->voltage, selector);
}
-static int get_voltage(struct regulator_dev *rdev)
+static int get_voltage_sel(struct regulator_dev *rdev)
{
const struct supply_info *info;
struct tps6524x *hw;
@@ -490,7 +490,7 @@ static int get_voltage(struct regulator_dev *rdev)
if (WARN_ON(ret >= info->n_voltages))
return -EIO;
- return info->voltages[ret];
+ return ret;
}
static int set_current_limit(struct regulator_dev *rdev, int min_uA,
@@ -575,7 +575,7 @@ static struct regulator_ops regulator_ops = {
.is_enabled = is_supply_enabled,
.enable = enable_supply,
.disable = disable_supply,
- .get_voltage = get_voltage,
+ .get_voltage_sel = get_voltage_sel,
.set_voltage_sel = set_voltage_sel,
.list_voltage = list_voltage,
.set_current_limit = set_current_limit,
--
1.7.5.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel
2012-03-22 23:10 [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel Axel Lin
2012-03-22 23:11 ` [PATCH 2/2] regulator: Convert tps6524x to get_voltage_sel Axel Lin
@ 2012-03-26 17:50 ` Mark Brown
2012-03-27 0:52 ` Axel Lin
1 sibling, 1 reply; 6+ messages in thread
From: Mark Brown @ 2012-03-26 17:50 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Cyril Chemparathy, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 216 bytes --]
On Fri, Mar 23, 2012 at 07:10:28AM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
These don't apply any more due to some of your other cleanups which got
applied first, can you rebase please?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel
2012-03-26 17:50 ` [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel Mark Brown
@ 2012-03-27 0:52 ` Axel Lin
2012-03-28 10:58 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Axel Lin @ 2012-03-27 0:52 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, Cyril Chemparathy, Liam Girdwood
2012/3/27 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Fri, Mar 23, 2012 at 07:10:28AM +0800, Axel Lin wrote:
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
>
> These don't apply any more due to some of your other cleanups which got
> applied first, can you rebase please?
Hi Mark,
I tried to apply both patch to linux-next (20120326) and it looks ok.
I checked you tree and found:
Both patch are appliable to your topic/drivers branch but failed to apply
to your for-next branch.
It is because commit f03570cf "regulator: Fix setting selector in
tps6524x set_voltage function" is missing from your for-next branch. (
Note this commit already in Linus' tree, so I don't think I should
re-generate the patch against your for-next branch.)
I'm not sure if you still keep both patches, if a resend is required,
just let me know.
Thanks,
Axel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel
2012-03-27 0:52 ` Axel Lin
@ 2012-03-28 10:58 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2012-03-28 10:58 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Cyril Chemparathy, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 167 bytes --]
On Tue, Mar 27, 2012 at 08:52:25AM +0800, Axel Lin wrote:
> I'm not sure if you still keep both patches, if a resend is required,
> just let me know.
Please resend.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel
@ 2012-03-28 11:45 Axel Lin
0 siblings, 0 replies; 6+ messages in thread
From: Axel Lin @ 2012-03-28 11:45 UTC (permalink / raw)
To: linux-kernel; +Cc: Cyril Chemparathy, Liam Girdwood, Mark Brown
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/tps6524x-regulator.c | 18 +++---------------
1 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/regulator/tps6524x-regulator.c b/drivers/regulator/tps6524x-regulator.c
index 4a421be..3a4a1d5 100644
--- a/drivers/regulator/tps6524x-regulator.c
+++ b/drivers/regulator/tps6524x-regulator.c
@@ -458,12 +458,10 @@ static int list_voltage(struct regulator_dev *rdev, unsigned selector)
info->voltages[selector] : -EINVAL);
}
-static int set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
- unsigned *selector)
+static int set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
{
const struct supply_info *info;
struct tps6524x *hw;
- unsigned i;
hw = rdev_get_drvdata(rdev);
info = &supply_info[rdev_get_id(rdev)];
@@ -471,17 +469,7 @@ static int set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
if (info->flags & FIXED_VOLTAGE)
return -EINVAL;
- for (i = 0; i < info->n_voltages; i++)
- if (min_uV <= info->voltages[i] &&
- max_uV >= info->voltages[i])
- break;
-
- if (i >= info->n_voltages)
- i = info->n_voltages - 1;
-
- *selector = i;
-
- return write_field(hw, &info->voltage, i);
+ return write_field(hw, &info->voltage, selector);
}
static int get_voltage(struct regulator_dev *rdev)
@@ -588,7 +576,7 @@ static struct regulator_ops regulator_ops = {
.enable = enable_supply,
.disable = disable_supply,
.get_voltage = get_voltage,
- .set_voltage = set_voltage,
+ .set_voltage_sel = set_voltage_sel,
.list_voltage = list_voltage,
.set_current_limit = set_current_limit,
.get_current_limit = get_current_limit,
--
1.7.5.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-03-28 11:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-22 23:10 [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel Axel Lin
2012-03-22 23:11 ` [PATCH 2/2] regulator: Convert tps6524x to get_voltage_sel Axel Lin
2012-03-26 17:50 ` [PATCH 1/2] regulator: Convert tps6524x to set_voltage_sel Mark Brown
2012-03-27 0:52 ` Axel Lin
2012-03-28 10:58 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2012-03-28 11:45 Axel Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).