Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1659497

Re: [PATCH 5/5] power: supply: bq27xxx: Correct supply status with current draw

From Pavel Machek <pavel@ucw.cz>
Newsgroups linux.kernel
Subject Re: [PATCH 5/5] power: supply: bq27xxx: Correct supply status with current draw
Date 2017-06-07 10:00 +0200
Message-ID <tPE2J-3Iv-11@gated-at.bofh.it> (permalink)
References (2 earlier) <tMbTj-66f-3@gated-at.bofh.it> <tNfrQ-7Ij-9@gated-at.bofh.it> <tNfLb-7R6-1@gated-at.bofh.it> <tNhtE-w5-17@gated-at.bofh.it> <tPDq1-3rU-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi!

> > > I'd pass to userspace what the controller reports. Yes, I seldom see
> > > "STATUS_FULL" but that may be a problem we need to track down.
> > 
> > The controller is known, from my experience, to not be reliable in that
> > regard,
> > so I don't think it makes sense to pass a state that doesn't reflect the
> > actual
> > state of charging just because the chip tells us so.
> > 
> > Worst case, we could also have a dt property to enable that kind of fixup
> > workaround and let every device maintainer decide whether it is relevant for
> > their device.
> 
> Actually, since a similar fix[0] was accepted in sbs-battery, I'd rather not
> make this optional but rather make it the default and perhaps have a dt prop to
> disable it.
> 
> [0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?
> h=v4.12-rc4&id=7f93e1fa032bb5ee19b868b9649bc98c82553003

Is there some documentation that explains what different power supply
statuses mean? Because without that, we can have long and useless
discussions.

If you have 40Wh battery, and you are charging it with 1mW, I don't
believe you should be indicating "charging". That battery is
full. Yes, even full batteries are sometimes charged with very low
currents to keep them full.

And I'm not sure what this is supposed to do, but its quite strange
code.

+static int sbs_status_correct(struct i2c_client *client, int *intval)
+{
+	int ret;
+
+	ret = sbs_read_word_data(client, sbs_data[REG_CURRENT].addr);
+	if (ret < 0)
+	   return ret;
+
+	ret = (s16)ret;
+

Best regards,
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 5/5] power: supply: bq27xxx: Correct supply status with  current draw Pavel Machek <pavel@ucw.cz> - 2017-05-28 21:20 +0200
  Re: [PATCH 5/5] power: supply: bq27xxx: Correct supply status with  current draw Paul Kocialkowski <contact@paulk.fr> - 2017-05-31 19:20 +0200
    Re: [PATCH 5/5] power: supply: bq27xxx: Correct supply status with  current draw Pavel Machek <pavel@ucw.cz> - 2017-05-31 19:40 +0200
      Re: [PATCH 5/5] power: supply: bq27xxx: Correct supply status with  current draw Paul Kocialkowski <contact@paulk.fr> - 2017-05-31 21:30 +0200
        Re: [PATCH 5/5] power: supply: bq27xxx: Correct supply status with  current draw Paul Kocialkowski <contact@paulk.fr> - 2017-06-07 09:20 +0200
          Re: [PATCH 5/5] power: supply: bq27xxx: Correct supply status with  current draw Pavel Machek <pavel@ucw.cz> - 2017-06-07 10:00 +0200
            Re: [PATCH 5/5] power: supply: bq27xxx: Correct supply status with  current draw Paul Kocialkowski <contact@paulk.fr> - 2017-06-07 17:30 +0200

csiph-web