[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1295029969.30634.0.camel@rklein-linux2>
Date: Fri, 14 Jan 2011 10:32:49 -0800
From: rklein <rklein@...dia.com>
To: Anton Vorontsov <cbouatmailru@...il.com>
Cc: "olof@...om.net" <olof@...om.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] power: bq20z75: add support for charge properties
On Fri, 2011-01-14 at 07:23 -0800, Anton Vorontsov wrote:
> On Thu, Jan 13, 2011 at 10:50:13AM -0800, rklein@...dia.com wrote:
> [...]
> > +#define PROP_NEEDS_AMPS(PSP) \
> > + ((PSP == POWER_SUPPLY_PROP_CHARGE_NOW) || \
> > + (PSP == POWER_SUPPLY_PROP_CHARGE_FULL) || \
> > + (PSP == POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN))
> > +
> > +#define PROP_NEEDS_WATTS(PSP) \
> > + ((PSP == POWER_SUPPLY_PROP_ENERGY_NOW) || \
> > + (PSP == POWER_SUPPLY_PROP_ENERGY_FULL) || \
> > + (PSP == POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN))
>
> Ugh. Please, implement it as a function.
>
> And maybe place it somewhere into linux/power_supply.h?
>
> Something like this maybe?
>
> static inline bool power_supply_is_amp_prop(enum power_supply_property psp)
> {
> switch (psp) {
> case POWER_SUPPLY_PROP_CHARGE_NOW:
> case POWER_SUPPLY_PROP_CHARGE_FULL:
> case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
> <...>
> return 1;
> }
> return 0;
> }
>
> Thanks!
>
Will do, that seems a much smarter idea as this could be reused.
-rhyland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists