linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: carl@uvos.xyz
To: Tony Lindgren <tony@atomide.com>
Cc: Pavel Machek <pavel@ucw.cz>,
	Arthur Demchenkov <spinal.by@gmail.com>,
	Merlijn Wajer <merlijn@wizzup.org>,
	Carl Philipp Klemm <philipp@uvos.xyz>,
	linux-omap@vger.kernel.org, Sebastian Reichel <sre@kernel.org>
Subject: Re: [PATCH v2 1/2] power: supply: cpcap-battery: Add battery type auto detection for mapphone devices
Date: Sat, 24 Apr 2021 09:00:13 +0200	[thread overview]
Message-ID: <17902adc982.11f94042187264621.8712932018769506839@zoho.eu> (raw)

On Apr 24, 2021 08:47, Tony Lindgren <tony@atomide.com> wrote:
>
> Hi, 
>
> * Carl Philipp Klemm <philipp@uvos.xyz> [210423 12:55]: 
> > +static void cpcap_battery_detect_battery_type(struct cpcap_battery_ddata *ddata) 
> > +{ 
> > + struct nvmem_device *nvmem; 
> > + u8 battery_id = 0; 
> > + 
> > + ddata->check_nvmem = false; 
> > + 
> > + nvmem = nvmem_device_find(NULL, &cpcap_battery_match_nvmem); 
> > + if (IS_ERR_OR_NULL(nvmem)) { 
> > + ddata->check_nvmem = true; 
> > + if (!ddata->no_nvmem_warned) { 
> > + dev_info(ddata->dev, "Can not find battery nvmem device. Assuming generic lipo battery\n"); 
> > + ddata->no_nvmem_warned = true; 
> > + } 
>
> Folks are also using the device with no battery at all to have it directly 
> connected to the power supply. This is handy for remotely power cycling 
> the device, and also for measuring power consumption with a bench power 
> supply. So by default I think we should continue assuming no battery is 
> inserted rather than assume a generic battery is inserted. 
>
> How about require configuring the undetected battery parameters via 
> /sys/class/power_supply to indicate a non-standard battery is inserted? 
>
> At least battery type, capacity, and voltage can depend on the generic 
> battery inserted. 
>
> Other than that, the NVRAM changes look nice to me. 
>
> Regards, 
>
> Tony 

The battery inserted property is still based on the presence of a thermistor, so I don't see how this patch changes the bevior with regards to this use case at all except for that info print. Previously the battery information struct was simply set to the values expected from eb41 no matter what.

             reply	other threads:[~2021-04-24  7:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-24  7:00 carl [this message]
2021-04-24  9:17 ` [PATCH v2 1/2] power: supply: cpcap-battery: Add battery type auto detection for mapphone devices Carl Philipp Klemm
2021-04-24 12:59   ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2021-04-23 12:55 Carl Philipp Klemm
2021-04-24  6:47 ` Tony Lindgren
2021-06-04 12:54 ` Sebastian Reichel

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=17902adc982.11f94042187264621.8712932018769506839@zoho.eu \
    --to=carl@uvos.xyz \
    --cc=linux-omap@vger.kernel.org \
    --cc=merlijn@wizzup.org \
    --cc=pavel@ucw.cz \
    --cc=philipp@uvos.xyz \
    --cc=spinal.by@gmail.com \
    --cc=sre@kernel.org \
    --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 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).