Skip to contentSkip to conversation

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

PATCH Superseded Nitin Joshi 2 participants 4 messages Dec 24, 2025 – Jan 2

Subsystems (4)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 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

---
 .../admin-guide/laptops/thinkpad-acpi.rst     |  21 ++++
 drivers/platform/x86/lenovo/thinkpad_acpi.c   | 105 ++++++++++++++++++
 2 files changed, 126 insertions(+)
Documentation/admin-guide/laptops/thinkpad-acpi.rst +21 -0
index 4ab0fef7d440..2db05f718b11 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,26 @@ 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 v6 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

---
 .../admin-guide/laptops/thinkpad-acpi.rst     |  13 ++-
 drivers/platform/x86/lenovo/thinkpad_acpi.c   | 104 +++++++++++++++++-
 2 files changed, 114 insertions(+), 3 deletions(-)
Documentation/admin-guide/laptops/thinkpad-acpi.rst +12 -1
index 2db05f718b11..3a37b14863a8 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.
@@ -1594,6 +1594,17 @@ 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 47 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.

---
Changes since v1:

(quoted diff) +0 -2
-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:

(quoted diff) +0 -2
-Improved code indentation
---
 .../admin-guide/laptops/thinkpad-acpi.rst     |  21 ++++
 drivers/platform/x86/lenovo/thinkpad_acpi.c   | 105 ++++++++++++++++++
 2 files changed, 126 insertions(+)
Documentation/admin-guide/laptops/thinkpad-acpi.rst +7 -0
index 4ab0fef7d440..2db05f718b11 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,26 @@ 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.

Documentation/admin-guide/laptops/thinkpad-acpi.rst percentage level, above which charging will stop. · line 1595

Quoted 10 lines
Documentation/admin-guide/laptops/thinkpad-acpi.rst +10 -0
+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

This seems to result in not the best formatting for htmldocs:

"This value displays status of device damaged - 0 = Not Damaged - 1 = Damaged"

Signature · 1 line
 i.
author
#3 lore raw
Quoted 61 lines · Ilpo Järvinen
Quoted 47 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.

---
Changes since v1:

(quoted diff) +0 -2
-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:

(quoted diff) +0 -2
-Improved code indentation
---
  .../admin-guide/laptops/thinkpad-acpi.rst     |  21 ++++
  drivers/platform/x86/lenovo/thinkpad_acpi.c   | 105 ++++++++++++++++++
  2 files changed, 126 insertions(+)
Documentation/admin-guide/laptops/thinkpad-acpi.rst +7 -0
index 4ab0fef7d440..2db05f718b11 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,26 @@ 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.

Documentation/admin-guide/laptops/thinkpad-acpi.rst percentage level, above which charging will stop. · line 1595

Quoted 10 lines
Documentation/admin-guide/laptops/thinkpad-acpi.rst +10 -0
+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

This seems to result in not the best formatting for htmldocs:

Quoted 1 line

"This value displays status of device damaged - 0 = Not Damaged - 1 = Damaged"

Ack. I will modify it and send updated patch for this. I will also modify slightly for Patch 2/2 as well.

 Happy New Year !

Best Regards,

Nitin Joshi