hwmon: Add driver for Astera Labs PT5161L retimer
Subsystems (4)
v4 cover hwmon: Add driver for Astera Labs PT5161L retimer
This driver implements support for temperature monitoring of Astera Labs PT5161L series PCIe retimer chips.
v4:
- Rebased
v3:
- Revise pt5161l.rst
- Revise the style of comments
- Remove unused pec_enable
- Add back safe access wide registers
- fix build warning
v2:
- Add "asteralabs,pt5161l" to trivial-devices.yaml
- Change naming PT516XX/pt516xx to PT5161L/pt5161l
- Separated debugfs files for health status
- Revise the style of comments
- Remove unused defines
- Remove including unused header files
- Remove unnecessary debugging messages
- Revise the data parsing for a big-endian system
- Use read_block_data instead of accessing wide registers
- Remove the debugfs files when the device is unloaded
- Add acpi_match_table
Cosmo Chou (3):
dt-bindings: vendor-prefixes: add asteralabs
dt-bindings: trivial-devices: add Astera Labs PT5161L
hwmon: Add driver for Astera Labs PT5161L retimer
.../devicetree/bindings/trivial-devices.yaml | 2 + .../devicetree/bindings/vendor-prefixes.yaml | 2 + Documentation/hwmon/index.rst | 1 + Documentation/hwmon/pt5161l.rst | 42 ++ MAINTAINERS | 7 + drivers/hwmon/Kconfig | 10 + drivers/hwmon/Makefile | 1 + drivers/hwmon/pt5161l.c | 670 ++++++++++++++++++ 8 files changed, 735 insertions(+) create mode 100644 Documentation/hwmon/pt5161l.rst create mode 100644 drivers/hwmon/pt5161l.c
Signature · 1 line
2.34.1
PATCH v4 1/3 dt-bindings: vendor-prefixes: add asteralabs
Add vendor prefix for Astera Labs, Inc.
https://www.asteralabs.com
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -157,6 +157,8 @@ patternProperties: description: ASPEED Technology Inc. "^asrock,.*": description: ASRock Inc. + "^asteralabs,.*": + description: Astera Labs, Inc. "^asus,.*": description: AsusTek Computer Inc. "^atheros,.*":
Signature · 1 line
2.34.1
Re: [PATCH v4 1/3] dt-bindings: vendor-prefixes: add asteralabs
Quoted 5 lines · Cosmo Chou
Add vendor prefix for Astera Labs, Inc.
https://www.asteralabs.comSigned-off-by Cosmo Chou <[email protected]>Acked-by Conor Dooley <[email protected]>
Applied.
Thanks,
Guenter
PATCH v4 2/3 dt-bindings: trivial-devices: add Astera Labs PT5161L
In reply to Cosmo ChouAdd dt-bindings for pt5161l temperature monitoring.
--- Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
@@ -47,6 +47,8 @@ properties: - adi,lt7182s # AMS iAQ-Core VOC Sensor - ams,iaq-core + # Temperature monitoring of Astera Labs PT5161L PCIe retimer + - asteralabs,pt5161l # i2c serial eeprom (24cxx) - at,24c08 # ATSHA204 - i2c h/w symmetric crypto module
Signature · 1 line
2.34.1
Re: [PATCH v4 2/3] dt-bindings: trivial-devices: add Astera Labs PT5161L
Quoted 4 lines · Cosmo Chou
Add dt-bindings for pt5161l temperature monitoring.
Signed-off-by Cosmo Chou <[email protected]>Acked-by Conor Dooley <[email protected]>
Applied.
Thanks,
Guenter
PATCH v4 3/3 hwmon: Add driver for Astera Labs PT5161L retimer
In reply to Cosmo ChouThis driver implements support for temperature monitoring of Astera Labs PT5161L series PCIe retimer chips.
This driver implementation originates from the CSDK available at
The communication protocol utilized is based on the I2C/SMBus standard.
--- Documentation/hwmon/index.rst | 1 + Documentation/hwmon/pt5161l.rst | 42 ++ MAINTAINERS | 7 + drivers/hwmon/Kconfig | 10 + drivers/hwmon/Makefile | 1 + drivers/hwmon/pt5161l.c | 670 ++++++++++++++++++++++++++++++++ 6 files changed, 731 insertions(+) create mode 100644 Documentation/hwmon/pt5161l.rst create mode 100644 drivers/hwmon/pt5161l.c
Documentation/hwmon/index.rst +1 -0
@@ -185,6 +185,7 @@ Hardware Monitoring Kernel Drivers pmbus powerz powr1220 + pt5161l pxe1610 pwm-fan q54sj108a2
Documentation/hwmon/pt5161l.rst new file +42 -0
42 lines not on this page · raw message
MAINTAINERS +7 -0
@@ -17568,6 +17568,13 @@ F: fs/pstore/ F: include/linux/pstore* K: \b(pstore|ramoops) +PT5161L HARDWARE MONITOR DRIVER +M: Cosmo Chou <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/hwmon/pt5161l.rst +F: drivers/hwmon/pt5161l.c + PTP HARDWARE CLOCK SUPPORT M: Richard Cochran <[email protected]> L: [email protected]
drivers/hwmon/Kconfig +10 -0
@@ -1714,6 +1714,16 @@ source "drivers/hwmon/peci/Kconfig" source "drivers/hwmon/pmbus/Kconfig" +config SENSORS_PT5161L + tristate "Astera Labs PT5161L PCIe retimer hardware monitoring" + depends on I2C + help + If you say yes here you get support for temperature monitoring + on the Astera Labs PT5161L PCIe retimer. + + This driver can also be built as a module. If so, the module + will be called pt5161l. + config SENSORS_PWM_FAN tristate "PWM fan" depends on (PWM && OF) || COMPILE_TEST
drivers/hwmon/Makefile +1 -0
@@ -180,6 +180,7 @@ obj-$(CONFIG_SENSORS_PC87427) += pc87427.o obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o obj-$(CONFIG_SENSORS_POWERZ) += powerz.o obj-$(CONFIG_SENSORS_POWR1220) += powr1220.o +obj-$(CONFIG_SENSORS_PT5161L) += pt5161l.o obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON) += raspberrypi-hwmon.o obj-$(CONFIG_SENSORS_SBTSI) += sbtsi_temp.o
drivers/hwmon/pt5161l.c new file +670 -0
670 lines not on this page · raw message
Signature · 1 line
2.34.1
Guenter Roeck
maintainerQuoted 8 lines · Cosmo Chou
This driver implements support for temperature monitoring of Astera Labs PT5161L series PCIe retimer chips.
This driver implementation originates from the CSDK available at
The communication protocol utilized is based on the I2C/SMBus standard.
Signed-off-by Cosmo Chou <[email protected]>
That gives me:
WARNING: Improper SPDX comment style for 'drivers/hwmon/pt5161l.c', please use '//' instead #237: FILE: drivers/hwmon/pt5161l.c:1:
+/* SPDX-License-Identifier: GPL-2.0-or-later */
WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #237: FILE: drivers/hwmon/pt5161l.c:1:
+/* SPDX-License-Identifier: GPL-2.0-or-later */
CHECK: struct mutex definition without comment
#304: FILE: drivers/hwmon/pt5161l.c:68:
+ struct mutex lock;
CHECK: Lines should not end with a '('
#419: FILE: drivers/hwmon/pt5161l.c:183:
+ ret = pt5161l_write_block_data(
and many more of the latter. I'd fix it up if it was just one or two, and I don't care about the mutex definition comment, but
total: 0 errors, 2 warnings, 9 checks, 755 lines checked
is just too much.
From Documentation/hwmon/submitting-patches.rst:
* Please run your patch through 'checkpatch --strict'. There should be no errors, no warnings, and few if any check messages. If there are any messages, please be prepared to explain.
Please fix and resubmit. No need to resubmit the other patches in the series, since I already applied those.
Thanks,
Guenter