linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dannenberg <dannenberg@ti.com>
To: Sebastian Reichel <sre@kernel.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Cc: linux-pm@vger.kernel.org, Dan Murphy <dmurphy@ti.com>,
	Andrew Davis <afd@ti.com>, Andreas Dannenberg <dannenberg@ti.com>
Subject: [PATCH RESEND] power: bq24190_charger: Fix charge type sysfs property
Date: Tue, 4 Aug 2015 11:36:17 -0500	[thread overview]
Message-ID: <1438706177-8115-1-git-send-email-dannenberg@ti.com> (raw)

Access to the BQ24190's configurable charge type property (none, trickle,
fast) is being masked by an incorrect power_supply_property entry. After
applying this patch a new 'charge_type' property will appear in the
bq24190-charger sysfs folder backed up by getters/setters already
present in the driver.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
---
This is a RESEND of yesterday's patch that for some reason did not seem to
have gotten picked up correctly...

The current driver incorrectly tries to declare the charge type property
using POWER_SUPPLY_PROP_TYPE which is the wrong declaration for this
(actually POWER_SUPPLY_PROP_TYPE itself has been superseeded by
power_supply.type and isn't even used anymore as part of the power
supply property declarations).

After implementing the fix tested this aspect of the driver using an
actual BQ24190 device and could witness the impact the change of charge
type has on the battery (writing '1' to the new sysfs property means
charging off, '2' will do trickle charging, and '3' will result in
fast charging).


 drivers/power/bq24190_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/bq24190_charger.c b/drivers/power/bq24190_charger.c
index 052db78..40ae47c 100644
--- a/drivers/power/bq24190_charger.c
+++ b/drivers/power/bq24190_charger.c
@@ -902,7 +902,7 @@ static int bq24190_charger_property_is_writeable(struct power_supply *psy,
 }
 
 static enum power_supply_property bq24190_charger_properties[] = {
-	POWER_SUPPLY_PROP_TYPE,
+	POWER_SUPPLY_PROP_CHARGE_TYPE,
 	POWER_SUPPLY_PROP_HEALTH,
 	POWER_SUPPLY_PROP_ONLINE,
 	POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT,
-- 
1.9.1


             reply	other threads:[~2015-08-04 16:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 16:36 Andreas Dannenberg [this message]
2015-08-04 16:45 ` [PATCH RESEND] power: bq24190_charger: Fix charge type sysfs property Dan Murphy
2015-08-04 16:54 ` Andrew F. Davis
2015-08-05  4:09 ` Sebastian Reichel
2015-08-05 16:05 ` [RFC] TI BQ242xx Battery Charger Development/Consolidation Plans Andreas Dannenberg
2015-08-07  8:58   ` Laurentiu Palcu
2015-08-11 11:12     ` Pallala, Ramakrishna
2015-08-12 16:20       ` Andreas Dannenberg
2015-08-13 16:19         ` Pallala, Ramakrishna
2015-08-12 16:10     ` Andreas Dannenberg

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=1438706177-8115-1-git-send-email-dannenberg@ti.com \
    --to=dannenberg@ti.com \
    --cc=afd@ti.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dmurphy@ti.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).