[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4a2f44d1-e81c-48e8-a8ba-1ed66bfde7b8@gmail.com>
Date: Wed, 3 Dec 2025 19:53:17 +0900
From: Nitin <nitjoshi@...il.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: Hans de Goede <hansg@...nel.org>, platform-driver-x86@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>, njoshi1@...ovo.com,
Mark Pearson <mpearson-lenovo@...ebb.ca>
Subject: Re: [PATCH] platform/x86: thinkpad_acpi: Add support to detect
hardware damage detection capability.
On 12/3/25 19:39, Ilpo Järvinen wrote:
> On Wed, 3 Dec 2025, Nitin wrote:
>
>> Hi Ilpo,
>>
>> Thank you for reviewing the patch.
>>
>> On 12/3/25 18:44, Ilpo Järvinen wrote:
>>> On Wed, 3 Dec 2025, Nitin Joshi wrote:
>>>
>>>> Thinkpads are adding the ability to detect and report hardware damage
>>>> status. Add new sysfs interface to identify the impacted component
>>>> with status.
>>>> Initial support is available for the USB-C replaceable connector.
>>>>
>>>> Reviewed-by: Mark Pearson <mpearson-lenovo@...ebb.ca>
>>>> Signed-off-by: Nitin Joshi<nitjoshi@...il.com>
>>>> ---
>>>> .../admin-guide/laptops/thinkpad-acpi.rst | 26 +++
>>>> drivers/platform/x86/lenovo/thinkpad_acpi.c | 179 ++++++++++++++++++
>>>> 2 files changed, 205 insertions(+)
>>>>
>>>> diff --git a/Documentation/admin-guide/laptops/thinkpad-acpi.rst
>>>> b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
>>>> index 4ab0fef7d440..4a3220529489 100644
>>>> --- a/Documentation/admin-guide/laptops/thinkpad-acpi.rst
>>>> +++ b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
>>>> @@ -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,31 @@ 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 impacted component.
>>>> +Initial support is available for the USB-C replaceable connector.
>>>> +
>>>> +The available commands are::
>>>> +
>>>> + cat /sys/devices/platform/thinkpad_acpi/hwdd_status
>>>> +
>>>> +This value displays device type and location of device with damage
>>>> status.
>>>> +For example:
>>>> +if no damage is detected:
>>>> + No damage detected
>>>> +if damage detected:
>>>> + Damage detected:
>>>> + Device: TYPE-C
>>>> + Location: Base, Right side, Center port
>>>> +
>>>> +The property is read-only. If feature is not supported then sysfs
>>>> +class is not created.
>>>> +
>>>> Multiple Commands, Module Parameters
>>>> ------------------------------------
>>>> diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c
>>>> b/drivers/platform/x86/lenovo/thinkpad_acpi.c
>>>> index cc19fe520ea9..c3629bed9a8e 100644
>>>> --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
>>>> +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
>>>> @@ -11080,6 +11080,180 @@ static const struct attribute_group
>>>> auxmac_attr_group = {
>>>> .attrs = auxmac_attributes,
>>>> };
>>>> +/*************************************************************************
>>>> + * HWDD subdriver, for the Lenovo Hardware Damage Detection feature.
>>>> + */
>>>> +
>>>> +#define HWDD_GET_DMG_USBC 0x80000001
>>>> +#define HWDD_GET_CAP 0
>>>> +#define HWDD_NOT_SUPPORTED BIT(31)
>>>> +#define HWDD_SUPPORT_USBC BIT(0)
>>> Align values.
>> Ack, i will align values like below:
>>
>> #define HWDD_GET_CAP 0
>> #define HWDD_GET_DMG_USBC 0x80000001
>> #define HWDD_SUPPORT_USBC BIT(0)
>> #define HWDD_NOT_SUPPORTED BIT(31)
> These are not aligned as values starts from different columns. Please
> put a tab char there in between so the values start at the same column (or
> varying number of tabs depending on the length of the name).
>
> There are plenty of good examples in the code, including in this file
> you're modifying.
Ack, i will modify it . Thank you !
>
Powered by blists - more mailing lists