The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Waqar Hameed <waqar.hameed@axis.com>
Cc: kernel@axis.com, linux-pm@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/10] power: supply: Add sysfs entry for system load control
Date: Wed, 22 Jul 2026 03:25:16 +0200	[thread overview]
Message-ID: <amAPPg45CD8c2JX1@venus> (raw)
In-Reply-To: <pnda4sb3vyh.a.out@axis.com>

[-- Attachment #1: Type: text/plain, Size: 2080 bytes --]

Hi,

On Wed, Jul 01, 2026 at 11:23:02AM +0200, Waqar Hameed wrote:
> On Mon, Jun 29, 2026 at 17:44 +0200 Waqar Hameed <waqar.hameed@axis.com> wrote:
> 
> [...]
> 
> > diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power
> > index 32697b926cc8c..2287b207311cd 100644
> > --- a/Documentation/ABI/testing/sysfs-class-power
> > +++ b/Documentation/ABI/testing/sysfs-class-power
> > @@ -590,6 +590,30 @@ Description:
> >  
> >  		Valid values: 0 - 100 (percent)
> >  
> > +What:		/sys/class/power_supply/<supply_name>/load_switch
> > +Date:		June 2026
> > +Contact:	linux-pm@vger.kernel.org
> > +Description:
> > +		Devices can control the connection from power to system load.
> > +		For example, with a field-effect transistor between a battery
> > +		and the system load (BATFET). This entry controls such switch.
> > +		The obvious states are "on" and "off", i.e. there is a
> > +		connection or not, respectively. However, many devices can also
> > +		enter special modes such as "low-power", "shipping" or "deep
> > +		sleep". In these modes the switch is usually off and the
> > +		quiescent current quite low.
> > +
> > +		Access: Read, Write
> > +
> > +		Valid values:
> > +
> > +		============= ==================================
> > +		"On"      (1) Power is connected to the load.
> > +		"Off"     (2) Power is disconnected to the load.
> > +		"Standby" (3) Low-power mode.
> > +		"Ship"    (4) Ship mode.
> > +		============= ==================================
> 
> `"Unknown" (0)` needs to be added here as well...

I see the issue, that userspace has no idea, which values are
supported by a specific device. I think it's better to follow
the same style, that is already used for e.g. charge_types, so
that the file reads something like this:

[On] Standby Ship

E.g. provide all supported values for the specific device and
mark the current value with square brackets.

P.S.: I've applied the unrelated cleanup patches from this series.

Greetings,

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-07-22  1:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 15:44 [PATCH 00/10] Add sysfs entry for system load control Waqar Hameed
2026-06-29 15:44 ` [PATCH 01/10] power: supply: " Waqar Hameed
2026-07-01  9:23   ` Waqar Hameed
2026-07-22  1:25     ` Sebastian Reichel [this message]
2026-06-29 15:44 ` [PATCH 02/10] selftests: power_supply: Add tests for load_switch ABI Waqar Hameed
2026-06-29 15:44 ` [PATCH 04/10] power: supply: rt9471: Remove superfluous unpacking of propval Waqar Hameed
2026-06-29 15:44 ` [PATCH 03/10] power: supply: ltc4162-l: Use POWER_SUPPLY_PROP_LOAD_SWITCH Waqar Hameed
2026-06-29 15:44 ` [PATCH 07/10] power: supply: bq24257: " Waqar Hameed
2026-06-29 15:44 ` [PATCH 05/10] power: supply: rt9471: " Waqar Hameed
2026-06-29 15:44 ` [PATCH 06/10] power: supply: rt9467: " Waqar Hameed
2026-06-29 15:44 ` [PATCH 09/10] power: supply: bq24190: Disable watchdog with bq24190_write_mask() Waqar Hameed
2026-06-29 15:44 ` [PATCH 08/10] power: supply: bq24190: Remove unused watchdog struct field Waqar Hameed
2026-06-29 15:44 ` [PATCH 10/10] power: supply: bq24190: Use POWER_SUPPLY_PROP_LOAD_SWITCH Waqar Hameed
2026-07-22  0:30 ` (subset) [PATCH 00/10] Add sysfs entry for system load control 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=amAPPg45CD8c2JX1@venus \
    --to=sre@kernel.org \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=waqar.hameed@axis.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