* [PATCH] power_supply: Add new power supply VALID property
@ 2012-07-29 3:31 Ramakrishna Pallala
2012-08-23 1:58 ` Anton Vorontsov
0 siblings, 1 reply; 3+ messages in thread
From: Ramakrishna Pallala @ 2012-07-29 3:31 UTC (permalink / raw)
To: linux-kernel; +Cc: Anton Vorontsov, Anton Vorontsov, Ramakrishna Pallala
It is possible that users can use non-standard chargers
or use invalid batteries especially with mobile devices.
This patch adds a new power supply property called 'VALID' to
indicate this to the user(user space).
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
---
Documentation/power/power_supply_class.txt | 2 ++
drivers/power/power_supply_sysfs.c | 1 +
include/linux/power_supply.h | 1 +
3 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt
index 2f0ddc1..272b122 100644
--- a/Documentation/power/power_supply_class.txt
+++ b/Documentation/power/power_supply_class.txt
@@ -81,6 +81,8 @@ This defines trickle and fast charges. For batteries that
are already charged or discharging, 'n/a' can be displayed (or
'unknown', if the status is not known).
+VALID - indicates the power supply connected is valid(1) or invalid(0)
+
HEALTH - represents health of the battery, values corresponds to
POWER_SUPPLY_HEALTH_*, defined in battery.h.
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index 1d96614..797639e 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -138,6 +138,7 @@ static struct device_attribute power_supply_attrs[] = {
POWER_SUPPLY_ATTR(health),
POWER_SUPPLY_ATTR(present),
POWER_SUPPLY_ATTR(online),
+ POWER_SUPPLY_ATTR(valid),
POWER_SUPPLY_ATTR(technology),
POWER_SUPPLY_ATTR(cycle_count),
POWER_SUPPLY_ATTR(voltage_max),
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 3cfee0c..e7edcb3 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -88,6 +88,7 @@ enum power_supply_property {
POWER_SUPPLY_PROP_HEALTH,
POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_ONLINE,
+ POWER_SUPPLY_PROP_VALID,
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_VOLTAGE_MAX,
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] power_supply: Add new power supply VALID property
2012-07-29 3:31 [PATCH] power_supply: Add new power supply VALID property Ramakrishna Pallala
@ 2012-08-23 1:58 ` Anton Vorontsov
2012-08-23 2:13 ` Pallala, Ramakrishna
0 siblings, 1 reply; 3+ messages in thread
From: Anton Vorontsov @ 2012-08-23 1:58 UTC (permalink / raw)
To: Ramakrishna Pallala; +Cc: linux-kernel
On Sun, Jul 29, 2012 at 09:01:54AM +0530, Ramakrishna Pallala wrote:
> It is possible that users can use non-standard chargers
> or use invalid batteries especially with mobile devices.
Maybe 'original' or 'authentic' would be a better term for this?
For me, 'valid' is kind of too broad and confusing. :-/
[...]
> +VALID - indicates the power supply connected is valid(1) or invalid(0)
> +
But if you still think that 'valid' is a better term, can you please
document it in more detail?
Thanks!
Anton.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] power_supply: Add new power supply VALID property
2012-08-23 1:58 ` Anton Vorontsov
@ 2012-08-23 2:13 ` Pallala, Ramakrishna
0 siblings, 0 replies; 3+ messages in thread
From: Pallala, Ramakrishna @ 2012-08-23 2:13 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linux-kernel@vger.kernel.org
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 767 bytes --]
> On Sun, Jul 29, 2012 at 09:01:54AM +0530, Ramakrishna Pallala wrote:
> > It is possible that users can use non-standard chargers or use invalid
> > batteries especially with mobile devices.
>
> Maybe 'original' or 'authentic' would be a better term for this?
> For me, 'valid' is kind of too broad and confusing. :-/
>
> [...]
> > +VALID - indicates the power supply connected is valid(1) or
> > +invalid(0)
> > +
>
> But if you still think that 'valid' is a better term, can you please document it in
> more detail?
Authentic looks fine too. I will resubmit the patch with more details.
Thanks,
Ram
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-23 2:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-29 3:31 [PATCH] power_supply: Add new power supply VALID property Ramakrishna Pallala
2012-08-23 1:58 ` Anton Vorontsov
2012-08-23 2:13 ` Pallala, Ramakrishna
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).