All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: platform-driver-x86@vger.kernel.org
Subject: [Bug 216176] ideapad-laptop doesn't expose rapid charge
Date: Wed, 29 Jun 2022 19:49:22 +0000	[thread overview]
Message-ID: <bug-216176-215701-c6qC65kdFy@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-216176-215701@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=216176

--- Comment #5 from Hans de Goede (jwrdegoede@fedoraproject.org) ---
I agree that this should be a new userspace API under:
/sys/class/power_supply/<BAT-name>/<some-sysfs-attribute>

The best way to go about this is to first propose a new uAPI for this in the
form of a patch to:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-class-power

I think the best thing to do here is to add this as a 4th option to the
/sys/class/power_supply/<supply_name>/charge_behaviour attribute:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-class-power#n462

All the modes there are exclusive (so only mode can be active at a time) and I
think it would make sense to add a fast-charge option for this "rapid-charge"
mode.

Note for the driver patch that there are some helpers for implementing the
charge_behaviour attribute:

ssize_t power_supply_charge_behaviour_show(struct device *dev,
                                           unsigned int available_behaviours,
                                           enum power_supply_charge_behaviour
behaviour,
                                           char *buf);

int power_supply_charge_behaviour_parse(unsigned int available_behaviours,
const char *buf);

Notice the "unsigned int available_behaviours" this is a bit mask of supported
modes from the enum power_supply_charge_behaviour.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

  parent reply	other threads:[~2022-06-29 19:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-26 15:56 [Bug 216176] New: ideapad-laptop doesn't expose rapid charge bugzilla-daemon
2022-06-26 19:34 ` [Bug 216176] " bugzilla-daemon
2022-06-26 19:44 ` bugzilla-daemon
2022-06-27 13:49 ` bugzilla-daemon
2022-06-27 19:47 ` bugzilla-daemon
2022-06-29 19:49 ` bugzilla-daemon [this message]
2022-06-29 20:04 ` bugzilla-daemon
2022-06-29 21:10 ` bugzilla-daemon
2022-09-19  9:07 ` bugzilla-daemon
2023-07-20 21:16 ` bugzilla-daemon
2024-02-06 14:34 ` bugzilla-daemon

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=bug-216176-215701-c6qC65kdFy@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=platform-driver-x86@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.