From: Paul Fertser <fercerpav@gmail.com>
To: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>,
linux-kernel@vger.kernel.org,
Nelson Castillo <arhuaco@freaks-unidos.net>,
Paul Fertser <fercerpav@gmail.com>
Subject: [PATCH] power: pcf50633: properly reenable charging when the supply conditions change
Date: Wed, 14 Oct 2009 01:59:07 +0400 [thread overview]
Message-ID: <1255471148-29047-5-git-send-email-fercerpav@gmail.com> (raw)
In-Reply-To: <1255471148-29047-4-git-send-email-fercerpav@gmail.com>
If chgmod == BATFULL, setting chgena has no effect. Datasheet says we
need to set resume instead but when autoresume is used resume doesn't
work. Clear and set chgena instead.
This enables a user to force charging by re-plugging USB even when the
charger entered Battery Full mode, might be handy before a long trip.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
---
drivers/power/pcf50633-charger.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/power/pcf50633-charger.c b/drivers/power/pcf50633-charger.c
index 644c7eb..e0115d7 100644
--- a/drivers/power/pcf50633-charger.c
+++ b/drivers/power/pcf50633-charger.c
@@ -92,14 +92,18 @@ int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma)
chgmod = (mbcs2 & PCF50633_MBCS2_MBC_MASK);
/* If chgmod == BATFULL, setting chgena has no effect.
- * We need to set resume instead.
+ * Datasheet says we need to set resume instead but when autoresume is
+ * used resume doesn't work. Clear and set chgena instead.
*/
if (chgmod != PCF50633_MBCS2_MBC_BAT_FULL)
pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC1,
PCF50633_MBCC1_CHGENA, PCF50633_MBCC1_CHGENA);
- else
+ else {
+ pcf50633_reg_clear_bits(pcf, PCF50633_REG_MBCC1,
+ PCF50633_MBCC1_CHGENA);
pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC1,
- PCF50633_MBCC1_RESUME, PCF50633_MBCC1_RESUME);
+ PCF50633_MBCC1_CHGENA, PCF50633_MBCC1_CHGENA);
+ }
mbc->usb_active = charging_start;
--
1.6.0.6
next prev parent reply other threads:[~2009-10-13 22:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-13 21:59 [PATCH] power: pcf50633: add ac power supply class to the charger Paul Fertser
2009-10-13 21:59 ` [PATCH] power: pcf50633: introduces battery charging current control Paul Fertser
2009-10-13 21:59 ` [PATCH] gta02: set pcf50633 chg_ref_current_ma Paul Fertser
2009-10-13 21:59 ` [PATCH] power: pcf50633: get rid of charging restart software auto-triggering Paul Fertser
2009-10-13 21:59 ` Paul Fertser [this message]
2009-10-13 21:59 ` [PATCH] power: pcf50633: query charger status directly Paul Fertser
2009-10-15 17:15 ` [PATCH] gta02: set pcf50633 chg_ref_current_ma Anton Vorontsov
2009-10-17 17:01 ` [PATCH] power: pcf50633: introduces battery charging current control Pavel Machek
2009-10-20 0:01 ` Paul Fertser
2009-10-20 7:26 ` Pavel Machek
2009-10-19 21:35 ` Pavel Machek
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=1255471148-29047-5-git-send-email-fercerpav@gmail.com \
--to=fercerpav@gmail.com \
--cc=arhuaco@freaks-unidos.net \
--cc=cbou@mail.ru \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.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
Powered by JetHome