Skip to contentSkip to conversation

platform/x86: samsung-laptop: Expose charge_types

PATCH In review Jelle van der Waa 2 participants 2 messages Jul 2, 2025 – Jul 22, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: samsung-laptop: Expose charge_types

Support the newly introduced charge_types sysfs attribute as a replacement for the custom battery_life_extender attribute. Setting charge_types to Long Life enables battery life extending mode.

This change is similar to the recent Ideapad patch adding support for charge_types.

---
 .../ABI/obsolete/sysfs-driver-samsung-laptop  |  10 ++
 .../ABI/testing/sysfs-driver-samsung-laptop   |  11 --
 drivers/platform/x86/Kconfig                  |   1 +
 drivers/platform/x86/samsung-laptop.c         | 110 ++++++++++++++++++
 4 files changed, 121 insertions(+), 11 deletions(-)
 create mode 100644 Documentation/ABI/obsolete/sysfs-driver-samsung-laptop
Documentation/ABI/obsolete/sysfs-driver-samsung-laptop new file +10 -0
new file mode 100644
index 000000000000..204c3f3a1d78
@@ -0,0 +1,10 @@
+What:		/sys/devices/platform/samsung/battery_life_extender
+Date:		December 1, 2011
+KernelVersion:	3.3
+Contact:	Corentin Chary <[email protected]>
+Description:	Max battery charge level can be modified, battery cycle
+		life can be extended by reducing the max battery charge
+		level.
+
+		- 0 means normal battery mode (100% charge)
+		- 1 means battery life extender mode (80% charge)
Documentation/ABI/testing/sysfs-driver-samsung-laptop +0 -11
index 28c9c040de5d..408cb0ddf4aa 100644
@@ -20,17 +20,6 @@ Description:	Some Samsung laptops have different "performance levels"
 		and it's still unknown if this value even changes
 		anything, other than making the user feel a bit better.
 
-What:		/sys/devices/platform/samsung/battery_life_extender
-Date:		December 1, 2011
-KernelVersion:	3.3
-Contact:	Corentin Chary <[email protected]>
-Description:	Max battery charge level can be modified, battery cycle
-		life can be extended by reducing the max battery charge
-		level.
-
-		- 0 means normal battery mode (100% charge)
-		- 1 means battery life extender mode (80% charge)
-
 What:		/sys/devices/platform/samsung/usb_charge
 Date:		December 1, 2011
 KernelVersion:	3.3
drivers/platform/x86/Kconfig +1 -0
index e5cbd58a99f3..f9fc09a034a0 100644
@@ -825,6 +825,7 @@ config SAMSUNG_LAPTOP
 	tristate "Samsung Laptop driver"
 	depends on RFKILL || RFKILL = n
 	depends on ACPI_VIDEO || ACPI_VIDEO = n
+	depends on ACPI_BATTERY
 	depends on BACKLIGHT_CLASS_DEVICE
 	select LEDS_CLASS
 	select NEW_LEDS
drivers/platform/x86/samsung-laptop.c +110 -0

164 lines not on this page · raw message

Signature · 1 line
2.49.0
maintainer
#1 lore raw
Quoted 8 lines · Jelle van der Waa

Support the newly introduced charge_types sysfs attribute as a replacement for the custom battery_life_extender attribute. Setting charge_types to Long Life enables battery life extending mode.

This change is similar to the recent Ideapad patch adding support for charge_types.

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: samsung-laptop: Expose charge_types

      commit: de2884c6cdd3d133704ce37393590dd1c761500c

--
i.