* [PATCH 1/2] regulator: max8997: Remove is_enabled callback implementation for max8997_charger_fixedstate_ops
@ 2012-04-17 15:48 Axel Lin
2012-04-17 15:49 ` [PATCH 2/2] regulator: max8997: Remove empty set_suspend_enable callback implementation Axel Lin
2012-04-23 12:23 ` [PATCH 1/2] regulator: max8997: Remove is_enabled callback implementation for max8997_charger_fixedstate_ops Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-04-17 15:48 UTC (permalink / raw)
To: linux-kernel; +Cc: Kyungmin Park, Liam Girdwood, Mark Brown
If is_enabled callback is not implemented, the core assumes that the regulator
is on.
This is simpler than having a hack to retrun 1 in max8997_reg_is_enabled() if
max8997_get_enable_register() returns -EINVAL.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/max8997.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index 99d7cb3..0796ad8 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -278,9 +278,7 @@ static int max8997_reg_is_enabled(struct regulator_dev *rdev)
u8 val;
ret = max8997_get_enable_register(rdev, ®, &mask, &pattern);
- if (ret == -EINVAL)
- return 1; /* "not controllable" */
- else if (ret)
+ if (ret)
return ret;
ret = max8997_read_reg(i2c, reg, &val);
@@ -887,7 +885,6 @@ static struct regulator_ops max8997_charger_ops = {
};
static struct regulator_ops max8997_charger_fixedstate_ops = {
- .is_enabled = max8997_reg_is_enabled,
.get_current_limit = max8997_get_current_limit,
.set_current_limit = max8997_set_current_limit,
};
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] regulator: max8997: Remove empty set_suspend_enable callback implementation
2012-04-17 15:48 [PATCH 1/2] regulator: max8997: Remove is_enabled callback implementation for max8997_charger_fixedstate_ops Axel Lin
@ 2012-04-17 15:49 ` Axel Lin
2012-04-23 12:23 ` [PATCH 1/2] regulator: max8997: Remove is_enabled callback implementation for max8997_charger_fixedstate_ops Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Axel Lin @ 2012-04-17 15:49 UTC (permalink / raw)
To: linux-kernel; +Cc: Kyungmin Park, Liam Girdwood, Mark Brown
Since commit 8ac0e95 "regulator: core: Support setting suspend_[mode|voltage]
if set_suspend_[en|dis]able is NULL", now the regulator core can properly
handle the case set_suspend_enable callback is NULL.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/max8997.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index 0796ad8..f4ab2e3 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -766,11 +766,6 @@ static int max8997_set_voltage_safeout(struct regulator_dev *rdev,
return ret;
}
-static int max8997_reg_enable_suspend(struct regulator_dev *rdev)
-{
- return 0;
-}
-
static int max8997_reg_disable_suspend(struct regulator_dev *rdev)
{
struct max8997_data *max8997 = rdev_get_drvdata(rdev);
@@ -806,7 +801,6 @@ static struct regulator_ops max8997_ldo_ops = {
.get_voltage_sel = max8997_get_voltage_sel,
.set_voltage = max8997_set_voltage_ldobuck,
.set_voltage_time_sel = max8997_set_voltage_ldobuck_time_sel,
- .set_suspend_enable = max8997_reg_enable_suspend,
.set_suspend_disable = max8997_reg_disable_suspend,
};
@@ -818,7 +812,6 @@ static struct regulator_ops max8997_buck_ops = {
.get_voltage_sel = max8997_get_voltage_sel,
.set_voltage = max8997_set_voltage_buck,
.set_voltage_time_sel = max8997_set_voltage_ldobuck_time_sel,
- .set_suspend_enable = max8997_reg_enable_suspend,
.set_suspend_disable = max8997_reg_disable_suspend,
};
@@ -827,7 +820,6 @@ static struct regulator_ops max8997_fixedvolt_ops = {
.is_enabled = max8997_reg_is_enabled,
.enable = max8997_reg_enable,
.disable = max8997_reg_disable,
- .set_suspend_enable = max8997_reg_enable_suspend,
.set_suspend_disable = max8997_reg_disable_suspend,
};
@@ -838,7 +830,6 @@ static struct regulator_ops max8997_safeout_ops = {
.disable = max8997_reg_disable,
.get_voltage_sel = max8997_get_voltage_sel,
.set_voltage = max8997_set_voltage_safeout,
- .set_suspend_enable = max8997_reg_enable_suspend,
.set_suspend_disable = max8997_reg_disable_suspend,
};
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] regulator: max8997: Remove is_enabled callback implementation for max8997_charger_fixedstate_ops
2012-04-17 15:48 [PATCH 1/2] regulator: max8997: Remove is_enabled callback implementation for max8997_charger_fixedstate_ops Axel Lin
2012-04-17 15:49 ` [PATCH 2/2] regulator: max8997: Remove empty set_suspend_enable callback implementation Axel Lin
@ 2012-04-23 12:23 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-04-23 12:23 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Kyungmin Park, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 166 bytes --]
On Tue, Apr 17, 2012 at 11:48:27PM +0800, Axel Lin wrote:
> If is_enabled callback is not implemented, the core assumes that the regulator
> is on.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-23 12:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-17 15:48 [PATCH 1/2] regulator: max8997: Remove is_enabled callback implementation for max8997_charger_fixedstate_ops Axel Lin
2012-04-17 15:49 ` [PATCH 2/2] regulator: max8997: Remove empty set_suspend_enable callback implementation Axel Lin
2012-04-23 12:23 ` [PATCH 1/2] regulator: max8997: Remove is_enabled callback implementation for max8997_charger_fixedstate_ops Mark Brown
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).