All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Marangoni <thomas.marangoni@mec.at>
To: linux-pm@vger.kernel.org
Subject: Re: Communication between kernel and user-space
Date: Tue, 31 Aug 2021 08:49:04 +0200	[thread overview]
Message-ID: <1a26c976-81da-c29d-948f-fb879ecc1aaa@mec.at> (raw)
In-Reply-To: <CAJZ5v0ijNPY+33yYPZR03ZEQbCXLog32aqjU0LMTPkcvDwvNYA@mail.gmail.com>


> What kind of devices is it going to handle, specifically?

The AXP209 is a power management chip for e.g. Allwinner A20 (ARM 
architecture), I want to focus on the axp20x-battery driver.

>> The device has multiple
>> warnings like: temperature too high or low,
> You should be able to use the existing thermal framework for this.
>
>> over-voltage, under-voltage
> But there's no generic way to communicate those AFAICS.
>
> The question here is what user space is going to do about them, though.

Events I like to communicate to the user-space:

- Battery Temperature to high (as already mentioned, possible with 
thermal framework)
- Battery Temperature to low (as already mentioned, possible with 
thermal framework)
- AXP209Internal over-temperature (should also be possible with thermal 
framework)
- Low Voltage Level 2 (shuts down the device)

- Low Voltage Level 1
- Over Voltage
- Under Voltage
- Chargingcurrent shortage

In my case the application would prepare for a shutdown if the low 
voltage warning level 1 event is received. For the other events the user 
would get a warning with instruction how to handle them from the 
application.

>> etc. What is the recommended way to communicate such warnings to the
>> user-space, besides dmesg, so programs can handle them? Or should I just
>> create my own attribute for each warning and set it to a specific value
>> from the kernel and let user-space applications reset them to
>> acknowledge them? And if there is a recommended way can you name me a
>> driver that is using it?
>>
>> Thanks for your help!

  reply	other threads:[~2021-08-31  6:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 13:51 Communication between kernel and user-space Thomas Marangoni
2021-08-30 15:02 ` Rafael J. Wysocki
2021-08-31  6:49   ` Thomas Marangoni [this message]
2021-09-27 15:03     ` 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=1a26c976-81da-c29d-948f-fb879ecc1aaa@mec.at \
    --to=thomas.marangoni@mec.at \
    --cc=linux-pm@vger.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 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.