platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug 216176] New: ideapad-laptop doesn't expose rapid charge
@ 2022-06-26 15:56 bugzilla-daemon
  2022-06-26 19:34 ` [Bug 216176] " bugzilla-daemon
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: bugzilla-daemon @ 2022-06-26 15:56 UTC (permalink / raw)
  To: platform-driver-x86

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

            Bug ID: 216176
           Summary: ideapad-laptop doesn't expose rapid charge
           Product: Drivers
           Version: 2.5
    Kernel Version: 5.18.5
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Platform_x86
          Assignee: drivers_platform_x86@kernel-bugs.osdl.org
          Reporter: tinozzo123@tutanota.com
        Regression: No

Lenovo IdeaPad laptops support a feature named "Rapid Charge", normally usable
on Windows via Lenovo Vantage. However, this feature isn't exposed on
idepad-laptop.c.
According to the Arch Wiki, this feature is still usable via ACPI commands:

To enable:
# echo '\_SB.PCI0.LPC0.EC0.VPC0.SBMC 0x07' > /proc/acpi/call

To disable:
# echo '\_SB.PCI0.LPC0.EC0.VPC0.SBMC 0x08' > /proc/acpi/call

To check, the wiki uses different commands for different laptops. Three of them
are (on all of them, 0x0 stands for off and 0x1 stands for on):
Lenovo IdeaPad 5 14are05
# echo '\_SB.PCI0.LPC0.EC0.FCGM' | tee /proc/acpi/call
# cat /proc/acpi/call; printf '\n'

Lenovo IdeaPad 5 15are05
# echo '\_SB.PCI0.LPC0.EC0.QCHO' > /proc/acpi/call
# cat /proc/acpi/call; printf '\n'

Lenovo IdeaPad Flex 5 14alc05
# echo '\_SB.PCI0.LPC0.EC0.QKCM' | tee /proc/acpi/call
# cat /proc/acpi/call | cut -d '' -f1

Small note, on Lenovo Vantage enabling Rapid Charge disables Battery
Conservation automatically, and enabling Battery Conservation disables Rapid
Charge automatically. The ACPI commands don't have this limitation.

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

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

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

* [Bug 216176] ideapad-laptop doesn't expose rapid charge
  2022-06-26 15:56 [Bug 216176] New: ideapad-laptop doesn't expose rapid charge bugzilla-daemon
@ 2022-06-26 19:34 ` bugzilla-daemon
  2022-06-26 19:44 ` bugzilla-daemon
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bugzilla-daemon @ 2022-06-26 19:34 UTC (permalink / raw)
  To: platform-driver-x86

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

Hans de Goede (jwrdegoede@fedoraproject.org) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jwrdegoede@fedoraproject.or
                   |                            |g

--- Comment #1 from Hans de Goede (jwrdegoede@fedoraproject.org) ---
Link to arch wiki page?

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

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

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

* [Bug 216176] ideapad-laptop doesn't expose rapid charge
  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
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bugzilla-daemon @ 2022-06-26 19:44 UTC (permalink / raw)
  To: platform-driver-x86

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

--- Comment #2 from tinozzo123@tutanota.com ---
There are multiple of them.
https://wiki.archlinux.org/title/Lenovo_IdeaPad_5_14are05#Rapid_Charge
https://wiki.archlinux.org/title/Lenovo_IdeaPad_5_15are05#Rapid_Charge
https://wiki.archlinux.org/title/Lenovo_IdeaPad_Flex_5_14alc05#Rapid_Charge

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

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

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

* [Bug 216176] ideapad-laptop doesn't expose rapid charge
  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
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bugzilla-daemon @ 2022-06-27 13:49 UTC (permalink / raw)
  To: platform-driver-x86

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

Barnabás Pőcze (pobrn@protonmail.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pobrn@protonmail.com

--- Comment #3 from Barnabás Pőcze (pobrn@protonmail.com) ---
I have a device that supports this (YOGA 520-14IKB), so I think I can prepare a
patch until the next merge window. The biggest question - I think - is where
should this be exposed? Another attribute on the platform device, or maybe on
the battery power supply device somehow?

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

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

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

* [Bug 216176] ideapad-laptop doesn't expose rapid charge
  2022-06-26 15:56 [Bug 216176] New: ideapad-laptop doesn't expose rapid charge bugzilla-daemon
                   ` (2 preceding siblings ...)
  2022-06-27 13:49 ` bugzilla-daemon
@ 2022-06-27 19:47 ` bugzilla-daemon
  2022-06-29 19:49 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bugzilla-daemon @ 2022-06-27 19:47 UTC (permalink / raw)
  To: platform-driver-x86

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

--- Comment #4 from tinozzo123@tutanota.com ---
My take on where it should be exposed.

Something related to the battery, which are charge thresholds, are supported in
multiple laptop brands (Lenovo ThinkPad, ASUS, System76...) and are thus are
exposed in the battery power supply device
(/sys/class/power_supply/BAT0/charge_control_{start,end}_threshold)

conservation_mode is basically an equivalent with a fixed value (60%) that is
exclusive to IdeaPads, and it's exposed in the platform device
(/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode).

I guess that my the verdict is that, because rapid charging is supported on
multiple laptop series (both ThinkPads and IdeaPads, which use different
drivers, and maybe there are more brands, though I couldn't find anything on
Google), so it should be exposed in the battery power supply device.

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

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

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

* [Bug 216176] ideapad-laptop doesn't expose rapid charge
  2022-06-26 15:56 [Bug 216176] New: ideapad-laptop doesn't expose rapid charge bugzilla-daemon
                   ` (3 preceding siblings ...)
  2022-06-27 19:47 ` bugzilla-daemon
@ 2022-06-29 19:49 ` bugzilla-daemon
  2022-06-29 20:04 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bugzilla-daemon @ 2022-06-29 19:49 UTC (permalink / raw)
  To: platform-driver-x86

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.

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

* [Bug 216176] ideapad-laptop doesn't expose rapid charge
  2022-06-26 15:56 [Bug 216176] New: ideapad-laptop doesn't expose rapid charge bugzilla-daemon
                   ` (4 preceding siblings ...)
  2022-06-29 19:49 ` bugzilla-daemon
@ 2022-06-29 20:04 ` bugzilla-daemon
  2022-06-29 21:10 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bugzilla-daemon @ 2022-06-29 20:04 UTC (permalink / raw)
  To: platform-driver-x86

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

--- Comment #6 from Barnabás Pőcze (pobrn@protonmail.com) ---
My concern is that there is already a "charge_type" attribute which can take
the "Fast" value among others: Unknown, N/A, Trickle, Fast, Standard, Adaptive,
Custom, Long Life, Bypass.

It might even make sense to wire up the so-called "conservation mode" to this
attribute as well ("Long Life") .

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

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

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

* [Bug 216176] ideapad-laptop doesn't expose rapid charge
  2022-06-26 15:56 [Bug 216176] New: ideapad-laptop doesn't expose rapid charge bugzilla-daemon
                   ` (5 preceding siblings ...)
  2022-06-29 20:04 ` bugzilla-daemon
@ 2022-06-29 21:10 ` bugzilla-daemon
  2022-09-19  9:07 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bugzilla-daemon @ 2022-06-29 21:10 UTC (permalink / raw)
  To: platform-driver-x86

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

--- Comment #7 from Hans de Goede (jwrdegoede@fedoraproject.org) ---
(In reply to Barnabás Pőcze from comment #6)
> My concern is that there is already a "charge_type" attribute which can take
> the "Fast" value among others: Unknown, N/A, Trickle, Fast, Standard,
> Adaptive, Custom, Long Life, Bypass.
> 
> It might even make sense to wire up the so-called "conservation mode" to
> this attribute as well ("Long Life") .

That is a good point, although AFAIK that is more intended for charger-type
power_supply devices then for batteries...

Either way I think it is best to just write a proposal in the form of a
Documentation patch to Documentation/ABI/testing/sysfs-class-power and then
discuss this further on the mailinglist.

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

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

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

* [Bug 216176] ideapad-laptop doesn't expose rapid charge
  2022-06-26 15:56 [Bug 216176] New: ideapad-laptop doesn't expose rapid charge bugzilla-daemon
                   ` (6 preceding siblings ...)
  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
  9 siblings, 0 replies; 11+ messages in thread
From: bugzilla-daemon @ 2022-09-19  9:07 UTC (permalink / raw)
  To: platform-driver-x86

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

--- Comment #8 from Hans de Goede (jwrdegoede@fedoraproject.org) ---
A quick update on the conversation-mode thing. Since the conversation-mode in
essence sets a charge star/end threshold it really should just use that
interface. This is what has been done for the similar eco mode on toshiba
laptops:

https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?id=18ef1bb093ab1e0a74d146cbf4a9d132d01374d8
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?id=8ef5db9eb084f6212345a7b09355c78ce05f71e2

Note there this is setting the end-threshold, not sure what this does in
ideapad-laptop.

Also we may want to add some extension to the start/end threshold API to query
valid values, so that we can e.g. do:

# cat
/sys/class/power_supply/BAT1/charge_control_end_threshold_supported_values
80,100

In the Toshiba case.

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

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

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

* [Bug 216176] ideapad-laptop doesn't expose rapid charge
  2022-06-26 15:56 [Bug 216176] New: ideapad-laptop doesn't expose rapid charge bugzilla-daemon
                   ` (7 preceding siblings ...)
  2022-09-19  9:07 ` bugzilla-daemon
@ 2023-07-20 21:16 ` bugzilla-daemon
  2024-02-06 14:34 ` bugzilla-daemon
  9 siblings, 0 replies; 11+ messages in thread
From: bugzilla-daemon @ 2023-07-20 21:16 UTC (permalink / raw)
  To: platform-driver-x86

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

Swapnil Devesh (sid.swapnildevesh@gmail.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sid.swapnildevesh@gmail.com

--- Comment #9 from Swapnil Devesh (sid.swapnildevesh@gmail.com) ---
Is there any progress on this ? I think exposing rapid change in ideapad-laptop
makes sense similar to conservation_mode until a better api is implemented.

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

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

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

* [Bug 216176] ideapad-laptop doesn't expose rapid charge
  2022-06-26 15:56 [Bug 216176] New: ideapad-laptop doesn't expose rapid charge bugzilla-daemon
                   ` (8 preceding siblings ...)
  2023-07-20 21:16 ` bugzilla-daemon
@ 2024-02-06 14:34 ` bugzilla-daemon
  9 siblings, 0 replies; 11+ messages in thread
From: bugzilla-daemon @ 2024-02-06 14:34 UTC (permalink / raw)
  To: platform-driver-x86

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

Amir Khayatzadeh (amirkh20@protonmail.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amirkh20@protonmail.com

--- Comment #10 from Amir Khayatzadeh (amirkh20@protonmail.com) ---
Any news on this? please if you can do anything let us know. thanks!

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

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

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

end of thread, other threads:[~2024-02-06 14:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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