All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] platform/x86: dell: Add new dell-wmi-ddv driver
@ 2022-09-27 20:45 Armin Wolf
  2022-09-27 20:45 ` [PATCH v2 1/2] ACPI: battery: Pass battery hook pointer to hook callbacks Armin Wolf
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Armin Wolf @ 2022-09-27 20:45 UTC (permalink / raw)
  To: hdegoede, markgross
  Cc: rafael, lenb, hmh, matan, corentin.chary, jeremy, productdev,
	mario.limonciello, pobrn, coproscefalo, platform-driver-x86,
	linux-acpi, linux-kernel

This patch series adds a new driver for a WMI interface found in
many newer Dell machines. This interface allows to read battery
properties like temperature and the ePPID (Dell-specific), while
also providing fan and thermal sensor information.

The interface does support multiple batteries which are indentified
by an "index", which appears to be the battery ACPI UID. Since
the interface also appears to omit any bounts checking of the
index, the ACPI battery hook mechanism is used to discover batteries.

Since the information returned when querying fan/thermal sensor
information is currently unknown, a debugfs entry is created to
allow for easier reverse engineering. The interface is likely
to be replaced by a proper hwmon interface in the future.

Since the driver can potentially be instantiated multiple times,
the ACPI battery hook mechanism had to be extended.

The first patch passes a pointer to the battery hook to the
hook callbacks, so that they can access instance-specific data
with container_of().

The second patch finally adds the new driver. It was called
dell-wmi-ddv since the interface is called "DDV" by Dell software,
likely meaning "Dell Data Vault".

The driver was tested, together with the changes made to the
ACPI battery driver, on a Dell Inspiron 3505. Other drivers
already using the battery hook mechanism where changed as well,
but could only be compile-tested due to missing hardware.

---
Changes in v2:
- Significantly lower the amount of changes being made to the
acpi battery driver
- drop unnecessary ABI description of the temp attribute
- return 0 when a unsupported battery is found to avoid being
unloaded

Armin Wolf (2):
  ACPI: battery: Pass battery hook pointer to hook callbacks
  platform/x86: dell: Add new dell-wmi-ddv driver

 .../ABI/testing/debugfs-dell-wmi-ddv          |  21 +
 .../ABI/testing/sysfs-platform-dell-wmi-ddv   |   7 +
 MAINTAINERS                                   |   7 +
 drivers/acpi/battery.c                        |   8 +-
 drivers/platform/x86/asus-wmi.c               |   4 +-
 drivers/platform/x86/dell/Kconfig             |  13 +
 drivers/platform/x86/dell/Makefile            |   1 +
 drivers/platform/x86/dell/dell-wmi-ddv.c      | 361 ++++++++++++++++++
 drivers/platform/x86/huawei-wmi.c             |   4 +-
 drivers/platform/x86/lg-laptop.c              |   4 +-
 drivers/platform/x86/system76_acpi.c          |   4 +-
 drivers/platform/x86/thinkpad_acpi.c          |   4 +-
 drivers/platform/x86/toshiba_acpi.c           |   4 +-
 drivers/platform/x86/wmi.c                    |   1 +
 include/acpi/battery.h                        |   4 +-
 15 files changed, 429 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/ABI/testing/debugfs-dell-wmi-ddv
 create mode 100644 Documentation/ABI/testing/sysfs-platform-dell-wmi-ddv
 create mode 100644 drivers/platform/x86/dell/dell-wmi-ddv.c

--
2.30.2


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

end of thread, other threads:[~2022-10-24 19:48 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 20:45 [PATCH v2 0/2] platform/x86: dell: Add new dell-wmi-ddv driver Armin Wolf
2022-09-27 20:45 ` [PATCH v2 1/2] ACPI: battery: Pass battery hook pointer to hook callbacks Armin Wolf
2022-10-24 13:19   ` Rafael J. Wysocki
2022-10-24 13:47   ` Hans de Goede
2022-09-27 20:45 ` [PATCH v2 2/2] platform/x86: dell: Add new dell-wmi-ddv driver Armin Wolf
2022-09-28 10:47   ` Andy Shevchenko
2022-09-28 11:33     ` Hans de Goede
2022-09-28 14:16       ` Andy Shevchenko
2022-09-28 20:57     ` Armin Wolf
2022-09-29  9:50       ` Andy Shevchenko
2022-09-29 13:12         ` Hans de Goede
2022-10-21  9:34           ` Armin Wolf
2022-10-21  9:58             ` Hans de Goede
2022-09-29  9:51       ` Andy Shevchenko
2022-09-28  9:52 ` [PATCH v2 0/2] " Hans de Goede
2022-09-28 10:48   ` Andy Shevchenko
2022-09-28 11:37     ` Hans de Goede

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.