Skip to contentSkip to conversation

hwmon: Add driver for Astera Labs PT5161L retimer

PATCH In review Cosmo Chou 2 participants 3 messages Aug 22, 2024 – Aug 23, 2024

Subsystems (3)
lore
Share & tools
lore

Cosmo Chou

author
#0 lore raw

cover hwmon: Add driver for Astera Labs PT5161L retimer

This driver implements support for temperature monitoring of Astera Labs PT5161L series PCIe retimer chips.

v6:
- Remove unnecessary return value checking
- Correct the available size for simple_read_from_buffer()

v5:
- Fix warning and check messages of 'checkpatch --strict'
- Without resubmitting the applied patches

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 (1):
hwmon: Add driver for Astera Labs PT5161L retimer

 Documentation/hwmon/index.rst   |   1 +
 Documentation/hwmon/pt5161l.rst |  42 ++
 MAINTAINERS                     |   7 +
 drivers/hwmon/Kconfig           |  10 +
 drivers/hwmon/Makefile          |   1 +
 drivers/hwmon/pt5161l.c         | 667 ++++++++++++++++++++++++++++++++
 6 files changed, 728 insertions(+)
 create mode 100644 Documentation/hwmon/pt5161l.rst
 create mode 100644 drivers/hwmon/pt5161l.c
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/1 hwmon: Add driver for Astera Labs PT5161L retimer

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.

---
 Documentation/hwmon/index.rst   |   1 +
 Documentation/hwmon/pt5161l.rst |  42 ++
 MAINTAINERS                     |   7 +
 drivers/hwmon/Kconfig           |  10 +
 drivers/hwmon/Makefile          |   1 +
 drivers/hwmon/pt5161l.c         | 667 ++++++++++++++++++++++++++++++++
 6 files changed, 728 insertions(+)
 create mode 100644 Documentation/hwmon/pt5161l.rst
 create mode 100644 drivers/hwmon/pt5161l.c
Documentation/hwmon/index.rst +1 -0
index c7ed1f73ac06..9f5f215fcb2d 100644
@@ -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
index 960512bec428..a656b98971ca 100644
@@ -17679,6 +17679,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
index a608264da87d..c8d86a695f66 100644
@@ -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
index 47be39af5c03..0554d3ccb09a 100644
@@ -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 +667 -0

667 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw
In reply to Cosmo Chou

Hi Cosmo,

Quoted 4 lines · Cosmo Chou

This driver implements support for temperature monitoring of Astera Labs PT5161L series PCIe retimer chips.

Thanks for the link. However, I have a few concerns as a result:

- Why have you only sent the one patch in this series? What about the other two?

- Does what you've sent here address the feedback from Guenter? If not, can you please continue to work upstream? I'd prefer to backport merged patches unless there's some critical reason why we must apply something immediately.

Andrew