From: "Pali Rohár" <pali.rohar@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org,
linux-pm@vger.kernel.org, sre@debian.org, sre@ring0.de,
kernel list <linux-kernel@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
linux-omap@vger.kernel.org, tony@atomide.com, khilman@kernel.org,
aaro.koskinen@iki.fi, ivo.g.dimitrov.75@gmail.com
Subject: Re: bq2415x_charger.c: battery is discharged (fast, 224mA) when it should be charged
Date: Sun, 1 Feb 2015 11:08:16 +0100 [thread overview]
Message-ID: <201502011108.16071@pali> (raw)
In-Reply-To: <20150201094702.GA21628@amd>
[-- Attachment #1: Type: Text/Plain, Size: 3036 bytes --]
Hello,
On Sunday 01 February 2015 10:47:02 Pavel Machek wrote:
> Hi!
>
> I connected N900 with full battery using USB. For some reason,
> charge limit was set to 100mA, battery was "full" and was
> discharging:
>
Make sure you have loaded some usb gadget. Without it battery
charging via dedicated wallcharger (and probably also usb host
charger) does not working. g_nokia should be OK.
Try also compiling kernel with CONFIG_USB_GADGET_VBUS_DRAW=500
Also for charger autodetection you need to have loaded
isp1704_charer.ko module (or compiled into kernel).
And make sure that isp1704_charger is loaded before module
bq2415x_charger (there is some probe defer, no idea if it works
as excepted).
> root@n900:/my/tui/ofone# ./tefone
> Ready.
> Battery 4.017 V 4.039 V 81 % 0 % 0 / 0 / 2056 mAh Full
> -242.224 / 550 / 100 mA
>
> I adjusted the current limit, but got no change, battery is
> still discharging, fast:
>
> root@n900:/my/tui/ofone# echo 500 >
> /sys/class/power_supply/bq24150a-0/current_limit
You can try to write "host" to sysfs entry "mode". Another value
is "dedicated" for wallchargers.
> root@n900:/my/tui/ofone# ./tefone
> Ready.
> Battery 3.994 V 4.034 V 78 % 0 % 0 / 0 / 2056 mAh Full
> -251.506 / 550 / 500 mA Battery 4.0 V 4.037 V 79 % 0 %
> 0 / 0 / 2056 mAh Full -223.125 / 550 / 500 mA Battery
> 4.005 V 4.037 V 79 % 0 % 0 / 0 / 2056 mAh Full -224.91
> / 550 / 500 mA Battery 3.994 V 4.037 V 78 % 0 % 0 / 0 /
> 2056 mAh Full -224.91 / 550 / 500 mA Battery 4.023 V
> 4.037 V 81 % 0 % 0 / 0 / 2056 mAh Full -224.91 / 550 /
> 500 mA Battery 4.011 V 4.037 V 80 % 0 % 0 / 0 / 2056
> mAh Full -224.91 / 550 / 500 mA Battery 3.994 V 4.031 V
> 78 % 0 % 0 / 0 / 2056 mAh Full -256.504 / 550 / 500 mA
> Battery 3.994 V 4.029 V 78 % 0 % 0 / 0 / 2056 mAh Full
> -224.017 / 550 / 500 mA Battery 3.988 V 4.029 V 77 % 0
> % 0 / 0 / 2056 mAh Full -224.731 / 550 / 500 mA Battery
> 4.005 V 4.023 V 79 % 0 % 0 / 0 / 2056 mAh Full -223.66
> / 550 / 500 mA
>
> I'm getting a lot of
>
> [ 208.037719] bq27x00-battery 2-0055: battery is not
> calibrated! ignoring capacity values [ 238.038024]
> bq27x00-battery 2-0055: battery is not calibrated! ignoring
> capacity values
>
Message is print every time when somebody try to read those
properties. I think that printing it only one time should be
enough. Change to WARN_ONCE?
Also design capacity from bq27x00_battery is incorrect (2056) on
all N900 devices. It comes from some EEPROM memory stored in N900
and without HW hacking it is not possible to rewrite.
I would suggest to add support for bq27x00_battery module to do
not report design capacity. Maybe in N900 DT file can be property
which tell driver to ignore it.
> messages, that's why all the 0s in battery information dump.
>
> Any ideas?
>
> Thanks,
> Pavel
--
Pali Rohár
pali.rohar@gmail.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: pali.rohar@gmail.com (Pali Rohár)
To: linux-arm-kernel@lists.infradead.org
Subject: bq2415x_charger.c: battery is discharged (fast, 224mA) when it should be charged
Date: Sun, 1 Feb 2015 11:08:16 +0100 [thread overview]
Message-ID: <201502011108.16071@pali> (raw)
In-Reply-To: <20150201094702.GA21628@amd>
Hello,
On Sunday 01 February 2015 10:47:02 Pavel Machek wrote:
> Hi!
>
> I connected N900 with full battery using USB. For some reason,
> charge limit was set to 100mA, battery was "full" and was
> discharging:
>
Make sure you have loaded some usb gadget. Without it battery
charging via dedicated wallcharger (and probably also usb host
charger) does not working. g_nokia should be OK.
Try also compiling kernel with CONFIG_USB_GADGET_VBUS_DRAW=500
Also for charger autodetection you need to have loaded
isp1704_charer.ko module (or compiled into kernel).
And make sure that isp1704_charger is loaded before module
bq2415x_charger (there is some probe defer, no idea if it works
as excepted).
> root at n900:/my/tui/ofone# ./tefone
> Ready.
> Battery 4.017 V 4.039 V 81 % 0 % 0 / 0 / 2056 mAh Full
> -242.224 / 550 / 100 mA
>
> I adjusted the current limit, but got no change, battery is
> still discharging, fast:
>
> root at n900:/my/tui/ofone# echo 500 >
> /sys/class/power_supply/bq24150a-0/current_limit
You can try to write "host" to sysfs entry "mode". Another value
is "dedicated" for wallchargers.
> root at n900:/my/tui/ofone# ./tefone
> Ready.
> Battery 3.994 V 4.034 V 78 % 0 % 0 / 0 / 2056 mAh Full
> -251.506 / 550 / 500 mA Battery 4.0 V 4.037 V 79 % 0 %
> 0 / 0 / 2056 mAh Full -223.125 / 550 / 500 mA Battery
> 4.005 V 4.037 V 79 % 0 % 0 / 0 / 2056 mAh Full -224.91
> / 550 / 500 mA Battery 3.994 V 4.037 V 78 % 0 % 0 / 0 /
> 2056 mAh Full -224.91 / 550 / 500 mA Battery 4.023 V
> 4.037 V 81 % 0 % 0 / 0 / 2056 mAh Full -224.91 / 550 /
> 500 mA Battery 4.011 V 4.037 V 80 % 0 % 0 / 0 / 2056
> mAh Full -224.91 / 550 / 500 mA Battery 3.994 V 4.031 V
> 78 % 0 % 0 / 0 / 2056 mAh Full -256.504 / 550 / 500 mA
> Battery 3.994 V 4.029 V 78 % 0 % 0 / 0 / 2056 mAh Full
> -224.017 / 550 / 500 mA Battery 3.988 V 4.029 V 77 % 0
> % 0 / 0 / 2056 mAh Full -224.731 / 550 / 500 mA Battery
> 4.005 V 4.023 V 79 % 0 % 0 / 0 / 2056 mAh Full -223.66
> / 550 / 500 mA
>
> I'm getting a lot of
>
> [ 208.037719] bq27x00-battery 2-0055: battery is not
> calibrated! ignoring capacity values [ 238.038024]
> bq27x00-battery 2-0055: battery is not calibrated! ignoring
> capacity values
>
Message is print every time when somebody try to read those
properties. I think that printing it only one time should be
enough. Change to WARN_ONCE?
Also design capacity from bq27x00_battery is incorrect (2056) on
all N900 devices. It comes from some EEPROM memory stored in N900
and without HW hacking it is not possible to rewrite.
I would suggest to add support for bq27x00_battery module to do
not report design capacity. Maybe in N900 DT file can be property
which tell driver to ignore it.
> messages, that's why all the 0s in battery information dump.
>
> Any ideas?
>
> Thanks,
> Pavel
--
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150201/d652accd/attachment.sig>
next prev parent reply other threads:[~2015-02-01 10:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-01 9:47 bq2415x_charger.c: battery is discharged (fast, 224mA) when it should be charged Pavel Machek
2015-02-01 9:47 ` Pavel Machek
2015-02-01 10:08 ` Pali Rohár [this message]
2015-02-01 10:08 ` Pali Rohár
2015-02-01 11:38 ` Pavel Machek
2015-02-01 11:38 ` Pavel Machek
2015-02-01 19:17 ` Pavel Machek
2015-02-01 19:17 ` Pavel Machek
2015-02-01 20:56 ` Pavel Machek
2015-02-01 20:56 ` 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=201502011108.16071@pali \
--to=pali.rohar@gmail.com \
--cc=aaro.koskinen@iki.fi \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=ivo.g.dimitrov.75@gmail.com \
--cc=khilman@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=sre@debian.org \
--cc=sre@kernel.org \
--cc=sre@ring0.de \
--cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.