meta-freescale.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* Charger / Battery detection
@ 2022-11-20 13:36 Andy Pont
  2022-11-20 13:44 ` [meta-freescale] " Fabio Estevam
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Pont @ 2022-11-20 13:36 UTC (permalink / raw)
  To: meta-freescale

Hello,

Is there standard functionality to build into an image for an i.MX8 that 
will allow me to detect, at application level, whether the device is 
running on charger, battery, and what the battery level is?  Does it 
depend on what is used as the PMIC and charging device?

-Andy.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [meta-freescale] Charger / Battery detection
  2022-11-20 13:36 Charger / Battery detection Andy Pont
@ 2022-11-20 13:44 ` Fabio Estevam
  0 siblings, 0 replies; 2+ messages in thread
From: Fabio Estevam @ 2022-11-20 13:44 UTC (permalink / raw)
  To: Andy Pont; +Cc: meta-freescale

Hi Andy,

On Sun, Nov 20, 2022 at 10:36 AM Andy Pont <andy.pont@sdcsystems.com> wrote:
>
> Hello,
>
> Is there standard functionality to build into an image for an i.MX8 that
> will allow me to detect, at application level, whether the device is
> running on charger, battery, and what the battery level is?  Does it
> depend on what is used as the PMIC and charging device?

Yes, you need a charger device driver. Take a look at
drivers/power/supply/ for some examples.

The charger devices can expose to userspace information as you describe above.

You can check details at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/ABI/testing/sysfs-class-power?h=v6.0.9

BTW, this is off-topic on this list.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-20 13:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-20 13:36 Charger / Battery detection Andy Pont
2022-11-20 13:44 ` [meta-freescale] " Fabio Estevam

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).