From: Anton Vorontsov <cbouatmailru@gmail.com>
To: rklein@nvidia.com
Cc: olof@lixom.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] power: bq20z75: add support for charge properties
Date: Fri, 14 Jan 2011 18:23:48 +0300 [thread overview]
Message-ID: <20110114152348.GB30831@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <1294944613-11006-1-git-send-email-rklein@nvidia.com>
On Thu, Jan 13, 2011 at 10:50:13AM -0800, rklein@nvidia.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!
--
Anton Vorontsov
Email: cbouatmailru@gmail.com
next prev parent reply other threads:[~2011-01-14 15:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-13 18:50 [PATCH 1/1] power: bq20z75: add support for charge properties rklein
2011-01-14 15:23 ` Anton Vorontsov [this message]
2011-01-14 18:32 ` rklein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110114152348.GB30831@oksana.dev.rtsoft.ru \
--to=cbouatmailru@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olof@lixom.net \
--cc=rklein@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox