Skip to contentSkip to conversation

platform/x86: thinkpad_acpi: Add support to detect hardware damage detection capability.

PATCH In review Nitin Joshi 2 participants 3 messages Jan 6 – Jan 12

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

PATCH v7 1/2 platform/x86: thinkpad_acpi: Add support to detect hardware damage detection capability.

Thinkpads are adding the ability to detect and report hardware damage status. Add new sysfs interface to identify whether hardware damage is detected or not.

Initial support is available for the USB-C replaceable connector.

---
Changes since v1:
-Split patch between hwdd_status and hwdd_detail -Incorporated review comments
Changes since v2:
-Control visibility of the sysfs attribute based upon ucdd_supported Changes since v3:
-Fix documentation build warning
Changes since v4:
-Removed extra line
Changes since v5:
-Improved code indentation
Changes since v6:
- Improved formatting for htmldocs

---
 .../admin-guide/laptops/thinkpad-acpi.rst     |  22 ++++
 drivers/platform/x86/lenovo/thinkpad_acpi.c   | 105 ++++++++++++++++++
 2 files changed, 127 insertions(+)
Documentation/admin-guide/laptops/thinkpad-acpi.rst +22 -0
index 4ab0fef7d440..2f910ff31b37 100644
@@ -54,6 +54,7 @@ detailed description):
 	- Setting keyboard language
 	- WWAN Antenna type
 	- Auxmac
+	- Hardware damage detection capability
 
 A compatibility table by model and feature is maintained on the web
 site, http://ibm-acpi.sf.net/. I appreciate any success or failure
@@ -1576,6 +1577,27 @@ percentage level, above which charging will stop.
 The exact semantics of the attributes may be found in
 Documentation/ABI/testing/sysfs-class-power.
 
+Hardware damage detection capability
+------------------------------------
+
+sysfs attributes: hwdd_status
+
+Thinkpads are adding the ability to detect and report hardware damage.
+Add new sysfs interface to identify the damaged device status.
+Initial support is available for the USB-C replaceable connector.
+
+The command to check device damaged status is::
+
+        cat /sys/devices/platform/thinkpad_acpi/hwdd_status
+
+This value displays status of device damaged.
+
+- 0 = Not Damaged
+- 1 = Damaged
+
+The property is read-only. If feature is not supported then sysfs
+attribute is not created.
+
 Multiple Commands, Module Parameters
 ------------------------------------
 
drivers/platform/x86/lenovo/thinkpad_acpi.c +105 -0

123 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw

PATCH v7 2/2 platform/x86: thinkpad_acpi: Add sysfs to display details of damaged device.

Add new sysfs interface to identify the impacted component with location of device.

---
Changes since v2:
-Control visibility of the sysfs attribute based upon ucdd_supported Changes since v3:
-Fix documentation build warning
Changes since v4:
-Improved indentation and removed extra line
Changes since v5:
-Improved indentation
Changes since v6:
- Improved formatting for htmldocs

---
 .../admin-guide/laptops/thinkpad-acpi.rst     |  17 ++-
 drivers/platform/x86/lenovo/thinkpad_acpi.c   | 104 +++++++++++++++++-
 2 files changed, 118 insertions(+), 3 deletions(-)
Documentation/admin-guide/laptops/thinkpad-acpi.rst +16 -1
index 2f910ff31b37..03951ed6b628 100644
@@ -1580,7 +1580,7 @@ Documentation/ABI/testing/sysfs-class-power.
 Hardware damage detection capability
 ------------------------------------
 
-sysfs attributes: hwdd_status
+sysfs attributes: hwdd_status, hwdd_detail
 
 Thinkpads are adding the ability to detect and report hardware damage.
 Add new sysfs interface to identify the damaged device status.
@@ -1595,6 +1595,21 @@ This value displays status of device damaged.
 - 0 = Not Damaged
 - 1 = Damaged
 
+The command to check location of damaged device is::
+
+        cat /sys/devices/platform/thinkpad_acpi/hwdd_detail
+
+This value displays location of damaged device having 1 line per damaged "item".
+For example:
+
+if no damage is detected:
+
+- No damage detected
+
+if damage detected:
+
+- TYPE-C: Base, Right side, Center port
+
 The property is read-only. If feature is not supported then sysfs
 attribute is not created.
 
drivers/platform/x86/lenovo/thinkpad_acpi.c +102 -2

125 lines not on this page · raw message

Signature · 1 line
2.43.0
maintainer
#2 lore raw
In reply to Nitin Joshi
Quoted 8 lines · Nitin Joshi

Thinkpads are adding the ability to detect and report hardware damage status. Add new sysfs interface to identify whether hardware damage is detected or not.

Initial support is available for the USB-C replaceable connector.

[...]

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/2] platform/x86: thinkpad_acpi: Add support to detect hardware damage detection capability.

      commit: f4afc36985365f2926fe5beaefbb99b97061378d
[2/2] platform/x86: thinkpad_acpi: Add sysfs to display details of damaged device.
      commit: c333c896ca30a1bfbd32927e3642e45f4d3cf0ac

--
i.