From: "Pali Rohár" <pali.rohar@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: "Andrew F. Davis" <afd@ti.com>,
Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>,
Sebastian Reichel <sre@kernel.org>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-pm@vger.kernel.org
Subject: Re: Should 9aafabc7fece be reverted?
Date: Fri, 20 May 2016 12:35:05 +0200 [thread overview]
Message-ID: <20160520103505.GW29844@pali> (raw)
In-Reply-To: <20160520093432.GC4580@amd>
On Friday 20 May 2016 11:34:32 Pavel Machek wrote:
> Hi!
>
> > > I think it is insane to starts generating random numbers for IDR... Hard
> > > to decide what happen if such situation occur...
> > >
> >
> > That's kind of what I'm looking for though, if the userspace break is
> > caused by software relying on the battery to be named "bq27200-0", then
> > nothing short of hard-coding this exact name will 100% safely fix the
> > N900 userspace software. And so using IDR and hoping it gives 0 is just
> > a hacky work-around way of just naming the device "bq27200-0".
>
> BTW proposals how to fix that userspace would be welcome.
>
> We have three "power supplies", but userspace does not know how they
> are connecting, resulting in strange results. For now, I have
> hardware-specific layer in userspace.
>
> https://gitlab.com/tui/tui/blob/master/ofone/hardware.py
>
> Kernel does not really give me other choice.
I have in my mind idea of "merged" power supply devices.
For Nokia N900 we have:
* bq27200 monitoring chip
* bq24150a charging chip
* isp1707 usb phy chargin chip (wallcharger detection + enable gpio)
* rx51_battery driver (export ADC values from battery pins: temperature + design capacity)
And each part export own power supply device in /sys/class/power_supply/
So there are 4 power supply devices!
In ideal world kernel should provide into userspace just two devices:
* power supply charger device (merged values from isp1707 and bq24150a)
* power supply battery device (merged values from rx51_battery and bq27200)
Problem is that e.g. design capacity value provide both drivers. But
bq27xxx just return constant and incorrect value from bq eeprom. Correct
design capacity return only rx51_battery (which read it via ADC, third
battery pin).
That should fix detection and discovery problem. On Nokia N900 there is
just one battery and one charger device.
--
Pali Rohár
pali.rohar@gmail.com
next prev parent reply other threads:[~2016-05-20 10:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-18 16:58 Should 9aafabc7fece be reverted? Andrew F. Davis
2016-05-19 6:44 ` Ivaylo Dimitrov
2016-05-19 9:17 ` Pali Rohár
2016-05-19 9:34 ` Ivaylo Dimitrov
2016-05-19 15:38 ` Andrew F. Davis
2016-05-19 15:44 ` Pali Rohár
2016-05-19 15:48 ` Andrew F. Davis
2016-05-19 15:51 ` Pali Rohár
2016-05-19 15:57 ` Andrew F. Davis
2016-05-19 16:06 ` Pali Rohár
2016-05-19 16:11 ` Andrew F. Davis
2016-05-19 16:18 ` Pali Rohár
2016-05-19 16:46 ` Andrew F. Davis
2016-05-20 9:29 ` Pavel Machek
2016-05-23 15:55 ` Andrew F. Davis
2016-05-23 16:10 ` Pali Rohár
2016-05-23 16:29 ` Andrew F. Davis
2016-05-20 9:34 ` Pavel Machek
2016-05-20 10:35 ` Pali Rohár [this message]
2016-05-23 16:05 ` Andrew F. Davis
2016-05-20 9:22 ` 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=20160520103505.GW29844@pali \
--to=pali.rohar@gmail.com \
--cc=afd@ti.com \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=ivo.g.dimitrov.75@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--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).