lkml.org 
[lkml]   [2011]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] REGULATOR: TWL6025: add support to twl-regulator
Hi,

On Wed, Apr 27, 2011 at 10:39:50AM +0100, Graeme Gregory wrote:
> Adding support for the twl6025. Major difference in the twl6025 is the
> group functionality has been removed from the chip so this affects how
> regulators are enabled and disabled.
>
> The names of the regulators also changed.
>
> The DCDCs of the 6025 are software controllable as well.
>
> Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
> ---
> drivers/regulator/twl-regulator.c | 447 ++++++++++++++++++++++++++++++++++---
> 1 files changed, 412 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
> index 2a808c2..c08a0de 100644
> --- a/drivers/regulator/twl-regulator.c
> +++ b/drivers/regulator/twl-regulator.c
> @@ -144,11 +158,14 @@ static int twl6030reg_is_enabled(struct regulator_dev *rdev)
> struct twlreg_info *info = rdev_get_drvdata(rdev);
> int grp, val;
>
> - grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
> - if (grp < 0)
> - return grp;
> + if (!(twl_features() & TWL6025_SUBCLASS)) {

instead, why don't you pass some flag as platform_data to this driver,
which gets used to initialize a fiel in struct twlreg_info, then you use
that to do the checking.

> + grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
> + if (grp < 0)
> + return grp;
>
> - grp &= P1_GRP_6030;
> + grp &= P1_GRP_6030;
> + } else
> + grp = 1;

if one branch has {} add it to both.

--
balbi


\
 
 \ /
  Last update: 2011-04-27 12:45    [W:3.052 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site