* [PATCH v2 0/2] hwmon: pmbus: Add support for Richtek RTQ2886B
@ 2026-12-01 1:11 cy_huang
2026-12-01 1:11 ` [PATCH v2 1/2] dt-bindings: hwmon: pmbus/rtq2886b: Add Richtek RTQ2886B support cy_huang
2026-12-01 1:11 ` [PATCH v2 2/2] hwmon: (pmbus/rtq2886b) Add driver for Richtek RTQ2886B cy_huang
0 siblings, 2 replies; 5+ messages in thread
From: cy_huang @ 2026-12-01 1:11 UTC (permalink / raw)
To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jonathan Corbet
Cc: Shuah Khan, Randy Dunlap, Alexis Czezar Torreno, Sanman Pradhan,
Ashish Yadav, Matti Vaittinen, Colin Huang, Vincent Jardin,
Nuno Sá,
Abdurrahman Hussain, Ziming Zhu, Carlos Jones Jr, Wensheng Wang,
Charles Hsu, Brian Chiang, ChiYuan Huang, oliver_tai, lucas_tsai,
linux-hwmon, devicetree, linux-doc, linux-kernel
From: ChiYuan Huang <cy_huang@richtek.com>
The RTQ2886B is a PMBus-controlled single-output synchronous buck
regulator.
The RTQ2880B and RTQ2882B are register-compatible derivatives of the
RTQ2886B and are supported through the same driver.
This series adds the Devicetree binding, PMBus driver, regulator
integration, and MAINTAINERS entry for these devices.
v2
- Document the rtq2886 variant
- Move the default config into probe
- Remove weak MFR_ID identification
- Directly pass the rtq2886_info into pmbus_do_probe
- Add named initializaion for i2c_device_id
ChiYuan Huang (2):
dt-bindings: hwmon: pmbus/rtq2886b: Add Richtek RTQ2886B support
hwmon: (pmbus/rtq2886b) Add driver for Richtek RTQ2886B
.../hwmon/pmbus/richtek,rtq2886b.yaml | 60 +++++++++++
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/rtq2886b.rst | 58 ++++++++++
MAINTAINERS | 8 ++
drivers/hwmon/pmbus/Kconfig | 19 ++++
drivers/hwmon/pmbus/Makefile | 1 +
drivers/hwmon/pmbus/rtq2886b.c | 100 ++++++++++++++++++
7 files changed, 247 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/richtek,rtq2886b.yaml
create mode 100644 Documentation/hwmon/rtq2886b.rst
create mode 100644 drivers/hwmon/pmbus/rtq2886b.c
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] dt-bindings: hwmon: pmbus/rtq2886b: Add Richtek RTQ2886B support
2026-12-01 1:11 [PATCH v2 0/2] hwmon: pmbus: Add support for Richtek RTQ2886B cy_huang
@ 2026-12-01 1:11 ` cy_huang
2026-12-01 1:11 ` [PATCH v2 2/2] hwmon: (pmbus/rtq2886b) Add driver for Richtek RTQ2886B cy_huang
1 sibling, 0 replies; 5+ messages in thread
From: cy_huang @ 2026-12-01 1:11 UTC (permalink / raw)
To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jonathan Corbet
Cc: Shuah Khan, Randy Dunlap, Alexis Czezar Torreno, Sanman Pradhan,
Ashish Yadav, Matti Vaittinen, Colin Huang, Vincent Jardin,
Nuno Sá,
Abdurrahman Hussain, Ziming Zhu, Carlos Jones Jr, Wensheng Wang,
Charles Hsu, Brian Chiang, ChiYuan Huang, oliver_tai, lucas_tsai,
linux-hwmon, devicetree, linux-doc, linux-kernel
From: ChiYuan Huang <cy_huang@richtek.com>
Add a Devicetree binding schema for the Richtek RTQ2886B PMBus
buck regulator.
The RTQ2880B and RTQ2882B are register-compatible derivatives of the
RTQ2886B and use "richtek,rtq2886b" as a fallback compatible string.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
.../hwmon/pmbus/richtek,rtq2886b.yaml | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/richtek,rtq2886b.yaml
diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/richtek,rtq2886b.yaml b/Documentation/devicetree/bindings/hwmon/pmbus/richtek,rtq2886b.yaml
new file mode 100644
index 000000000000..ff6638ebbdbc
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/pmbus/richtek,rtq2886b.yaml
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/pmbus/richtek,rtq2886b.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Richtek RTQ2886B PMBus Buck Regulator
+
+maintainers:
+ - ChiYuan Huang <cy_huang@richtek.com>
+
+description: |
+ The RTQ2886B is a single-output synchronous buck regulator with a
+ PMBus interface.
+
+ The RTQ2880B and RTQ2882B are register-compatible derivatives of the
+ RTQ2886B and are supported through the same driver. The primary
+ difference among these devices is their maximum load current
+ capability and they shall use "richtek,rtq2886b" as a fallback
+ compatible string.
+
+allOf:
+ - $ref: /schemas/regulator/regulator.yaml#
+
+properties:
+ compatible:
+ oneOf:
+ - const: richtek,rtq2886b
+
+ - items:
+ - enum:
+ - richtek,rtq2880b
+ - richtek,rtq2882b
+ - const: richtek,rtq2886b
+
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ regulator@5e {
+ compatible = "richtek,rtq2882b", "richtek,rtq2886b";
+ reg = <0x5e>;
+ regulator-name = "vcore";
+ regulator-min-microvolt = <300000>;
+ regulator-max-microvolt = <5500000>;
+ regulator-boot-on;
+ };
+ };
+...
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] hwmon: (pmbus/rtq2886b) Add driver for Richtek RTQ2886B
2026-12-01 1:11 [PATCH v2 0/2] hwmon: pmbus: Add support for Richtek RTQ2886B cy_huang
2026-12-01 1:11 ` [PATCH v2 1/2] dt-bindings: hwmon: pmbus/rtq2886b: Add Richtek RTQ2886B support cy_huang
@ 2026-12-01 1:11 ` cy_huang
2026-12-01 6:45 ` Guenter Roeck
1 sibling, 1 reply; 5+ messages in thread
From: cy_huang @ 2026-12-01 1:11 UTC (permalink / raw)
To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jonathan Corbet
Cc: Shuah Khan, Randy Dunlap, Alexis Czezar Torreno, Sanman Pradhan,
Ashish Yadav, Matti Vaittinen, Colin Huang, Vincent Jardin,
Nuno Sá,
Abdurrahman Hussain, Ziming Zhu, Carlos Jones Jr, Wensheng Wang,
Charles Hsu, Brian Chiang, ChiYuan Huang, oliver_tai, lucas_tsai,
linux-hwmon, devicetree, linux-doc, linux-kernel
From: ChiYuan Huang <cy_huang@richtek.com>
Add a PMBus driver for the Richtek RTQ2886B single-output
synchronous buck regulator.
The RTQ2880B and RTQ2882B are register-compatible derivatives of
the RTQ2886B and are supported by the same driver.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
v2
- Document the rtq2886 variant
- Move the default config into probe
- Remove weak MFR_ID identification
- Directly pass the rtq2886_info into pmbus_do_probe
- Add named initializaion for i2c_device_id
---
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/rtq2886b.rst | 58 ++++++++++++++++++
MAINTAINERS | 8 +++
drivers/hwmon/pmbus/Kconfig | 19 ++++++
drivers/hwmon/pmbus/Makefile | 1 +
drivers/hwmon/pmbus/rtq2886b.c | 100 +++++++++++++++++++++++++++++++
6 files changed, 187 insertions(+)
create mode 100644 Documentation/hwmon/rtq2886b.rst
create mode 100644 drivers/hwmon/pmbus/rtq2886b.c
diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
index 199ca79621e9..ca8f30a48695 100644
--- a/Documentation/hwmon/index.rst
+++ b/Documentation/hwmon/index.rst
@@ -240,6 +240,7 @@ Hardware Monitoring Kernel Drivers
q54sj108a2
qnap-mcu-hwmon
raspberrypi-hwmon
+ rtq2886b
sbrmi
sbtsi_temp
sch5627
diff --git a/Documentation/hwmon/rtq2886b.rst b/Documentation/hwmon/rtq2886b.rst
new file mode 100644
index 000000000000..061199e0ce08
--- /dev/null
+++ b/Documentation/hwmon/rtq2886b.rst
@@ -0,0 +1,58 @@
+.. SPDX-License-Identifier: GPL-2.0-only
+
+====================================
+Kernel driver rtq2886b
+====================================
+
+Supported chips:
+ * Richtek RTQ2886B
+ * Richtek RTQ2882B
+ * Richtek RTQ2880B
+
+Only the B variants are supported by this driver. The corresponding
+RTQ2886A, RTQ2882A, and RTQ2880A devices support analog control only
+and do not provide a PMBus interface.
+
+ Prefix: 'rtq2886b'
+
+ Addresses scanned: -
+
+Author: ChiYuan Huang <cy_huang@richtek.com>
+
+Description
+-----------
+
+The RTQ2886B is a single-output synchronous buck regulator with a PMBus
+interface. It exposes voltage, current, power, and temperature telemetry through
+the standard PMBus hwmon interface.
+
+The primary difference among the devices in this series is their maximum load
+current capability. The RTQ2880B, RTQ2882B, and RTQ2886B support maximum load
+currents of 20 A, 16 A, and 8 A, respectively.
+
+Sysfs entries
+-------------
+
+======================= =======================================================
+curr1_crit Critical output current limit
+curr1_crit_alarm Output current critical alarm
+curr1_input Measured output current
+curr1_label "iout1"
+
+in1_alarm Input voltage alarm
+in1_input Measured input voltage
+in1_label "vin"
+
+in2_alarm Output voltage alarm
+in2_input Measured output voltage
+in2_label "vout1"
+in2_rated_max Maximum rated output voltage
+in2_rated_min Minimum rated output voltage
+
+power1_input Measured output power
+power1_label "pout1"
+
+temp1_alarm Temperature alarm
+temp1_input Measured chip temperature
+======================= =======================================================
+
diff --git a/MAINTAINERS b/MAINTAINERS
index 84cb98ef4c49..0bc9ee8c2b9d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -24074,6 +24074,14 @@ F: include/linux/rhashtable.h
F: lib/rhashtable.c
F: lib/test_rhashtable.c
+RICHTEK RTQ2886B HARDWARE MONITOR DRIVER
+M: ChiYuan Huang <cy_huang@richtek.com>
+L: linux-hwmon@vger.kernel.org
+S: Maintained
+F: Documentation/devicetree/bindings/hwmon/pmbus/richtek,rtq2886b.yaml
+F: Documentation/hwmon/rtq2886b.rst
+F: drivers/hwmon/pmbus/rtq2886b.c
+
RICOH R5C592 MEMORYSTICK DRIVER
M: Maxim Levitsky <maximlevitsky@gmail.com>
S: Maintained
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index fd6641316454..876e389a7ec9 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -728,6 +728,25 @@ config SENSORS_Q54SJ108A2
This driver can also be built as a module. If so, the module will
be called q54sj108a2.
+config SENSORS_RTQ2886B
+ tristate "Richtek RTQ2886B"
+ help
+ If you say yes here, you get hardware monitoring support for the
+ Richtek RTQ2886B and compatible PMBus regulators.
+
+ This driver can also be built as a module. If so, the module will
+ be called rtq2886b.
+
+config SENSORS_RTQ2886B_REGULATOR
+ bool "Regulator support for Richtek RTQ2886B and compatible devices"
+ depends on SENSORS_RTQ2886B && REGULATOR
+ help
+ If you say yes here, the driver registers a regulator device for
+ the Richtek RTQ2886B through the PMBus regulator framework.
+
+ This allows the regulator output to be controlled through the
+ regulator subsystem.
+
config SENSORS_STEF48H28
tristate "ST STEF48H28"
help
diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
index b67ec382328e..88fbde32f212 100644
--- a/drivers/hwmon/pmbus/Makefile
+++ b/drivers/hwmon/pmbus/Makefile
@@ -67,6 +67,7 @@ obj-$(CONFIG_SENSORS_PLI1209BC) += pli1209bc.o
obj-$(CONFIG_SENSORS_PM6764TR) += pm6764tr.o
obj-$(CONFIG_SENSORS_PXE1610) += pxe1610.o
obj-$(CONFIG_SENSORS_Q54SJ108A2) += q54sj108a2.o
+obj-$(CONFIG_SENSORS_RTQ2886B) += rtq2886b.o
obj-$(CONFIG_SENSORS_STEF48H28) += stef48h28.o
obj-$(CONFIG_SENSORS_SQ24860) += sq24860.o
obj-$(CONFIG_SENSORS_STPDDC60) += stpddc60.o
diff --git a/drivers/hwmon/pmbus/rtq2886b.c b/drivers/hwmon/pmbus/rtq2886b.c
new file mode 100644
index 000000000000..fce225b5111b
--- /dev/null
+++ b/drivers/hwmon/pmbus/rtq2886b.c
@@ -0,0 +1,100 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Hardware monitoring driver for Richtek RTQ2886B
+ *
+ * Copyright (C) 2026 Richtek Technology Corp.
+ */
+
+#include <linux/errno.h>
+#include <linux/i2c.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include "pmbus.h"
+
+#define RTQ2886B_PMBUS_VOUT_MIN 0x2B
+#define RTQ2886B_ONOFF_DEFAULT 0x1E
+#define RTQ2886B_N_VOLTS 65535
+#define RTQ2886B_STEP_UV (1000000 / 1024)
+
+#if IS_ENABLED(CONFIG_SENSORS_RTQ2886B_REGULATOR)
+static const struct regulator_desc rtq2886b_reg_desc[] = {
+ PMBUS_REGULATOR_STEP_ONE("regulator", RTQ2886B_N_VOLTS, RTQ2886B_STEP_UV, 0),
+};
+#endif
+
+static int rtq2886b_read_word_data(struct i2c_client *i2c, int page, int phase, int reg)
+{
+ switch (reg) {
+ case PMBUS_MFR_VOUT_MIN:
+ return pmbus_read_word_data(i2c, page, phase, RTQ2886B_PMBUS_VOUT_MIN);
+ case PMBUS_MFR_VOUT_MAX:
+ return pmbus_read_word_data(i2c, page, phase, PMBUS_VOUT_MAX);
+ default:
+ return -ENODATA;
+ }
+}
+
+static struct pmbus_driver_info rtq2886b_info = {
+ .pages = 1,
+ .format[PSC_VOLTAGE_IN] = linear,
+ .format[PSC_VOLTAGE_OUT] = linear,
+ .format[PSC_CURRENT_OUT] = linear,
+ .format[PSC_POWER] = linear,
+ .format[PSC_TEMPERATURE] = linear,
+ .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT |
+ PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_STATUS_IOUT |
+ PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP,
+ .read_word_data = rtq2886b_read_word_data,
+#if IS_ENABLED(CONFIG_SENSORS_RTQ2886B_REGULATOR)
+ .num_regulators = ARRAY_SIZE(rtq2886b_reg_desc),
+ .reg_desc = rtq2886b_reg_desc,
+#endif
+ .have_pmbus_revision = true,
+ .pmbus_revision = PMBUS_REV_14,
+};
+
+static int rtq2886b_probe(struct i2c_client *i2c)
+{
+ int ret;
+
+ /* The device requires SMBus PEC for PMBus transactions. */
+ i2c->flags |= I2C_CLIENT_PEC;
+
+ /*
+ * The device powers up with PMBUS_ON_OFF_CONFIG configured for
+ * hardware control. Configure it for PMBus-controlled operation
+ * to allow regulator output enable/disable management.
+ */
+ ret = i2c_smbus_write_byte_data(i2c, PMBUS_ON_OFF_CONFIG, RTQ2886B_ONOFF_DEFAULT);
+ if (ret)
+ return dev_err_probe(&i2c->dev, ret, "Failed to configure device\n");
+
+ return pmbus_do_probe(i2c, &rtq2886b_info);
+}
+
+static const struct i2c_device_id rtq2886b_id[] = {
+ { .name = "rtq2886b" },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, rtq2886b_id);
+
+static const struct of_device_id rtq2886b_of_match[] = {
+ { .compatible = "richtek,rtq2886b" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, rtq2886b_of_match);
+
+static struct i2c_driver rtq2886b_driver = {
+ .driver = {
+ .name = "rtq2886b",
+ .of_match_table = rtq2886b_of_match,
+ },
+ .probe = rtq2886b_probe,
+ .id_table = rtq2886b_id,
+};
+module_i2c_driver(rtq2886b_driver);
+
+MODULE_AUTHOR("ChiYuan Huang <cy_huang@richtek.com>");
+MODULE_DESCRIPTION("PMBus driver for Richtek RTQ2886B");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS("PMBUS");
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] hwmon: (pmbus/rtq2886b) Add driver for Richtek RTQ2886B
2026-12-01 1:11 ` [PATCH v2 2/2] hwmon: (pmbus/rtq2886b) Add driver for Richtek RTQ2886B cy_huang
@ 2026-12-01 6:45 ` Guenter Roeck
2026-12-01 8:40 ` ChiYuan Huang
0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2026-12-01 6:45 UTC (permalink / raw)
To: cy_huang, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jonathan Corbet
Cc: Shuah Khan, Randy Dunlap, Alexis Czezar Torreno, Sanman Pradhan,
Ashish Yadav, Matti Vaittinen, Colin Huang, Vincent Jardin,
Nuno Sá,
Abdurrahman Hussain, Ziming Zhu, Carlos Jones Jr, Wensheng Wang,
Charles Hsu, Brian Chiang, oliver_tai, lucas_tsai, linux-hwmon,
devicetree, linux-doc, linux-kernel
Hi,
On 11/30/26 17:11, cy_huang@richtek.com wrote:
> From: ChiYuan Huang <cy_huang@richtek.com>
>
> Add a PMBus driver for the Richtek RTQ2886B single-output
> synchronous buck regulator.
>
> The RTQ2880B and RTQ2882B are register-compatible derivatives of
> the RTQ2886B and are supported by the same driver.
>
> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
>
> ---
> v2
> - Document the rtq2886 variant
> - Move the default config into probe
> - Remove weak MFR_ID identification
> - Directly pass the rtq2886_info into pmbus_do_probe
> - Add named initializaion for i2c_device_id
> ---
> Documentation/hwmon/index.rst | 1 +
> Documentation/hwmon/rtq2886b.rst | 58 ++++++++++++++++++
> MAINTAINERS | 8 +++
> drivers/hwmon/pmbus/Kconfig | 19 ++++++
> drivers/hwmon/pmbus/Makefile | 1 +
> drivers/hwmon/pmbus/rtq2886b.c | 100 +++++++++++++++++++++++++++++++
> 6 files changed, 187 insertions(+)
> create mode 100644 Documentation/hwmon/rtq2886b.rst
> create mode 100644 drivers/hwmon/pmbus/rtq2886b.c
>
> diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
> index 199ca79621e9..ca8f30a48695 100644
> --- a/Documentation/hwmon/index.rst
> +++ b/Documentation/hwmon/index.rst
> @@ -240,6 +240,7 @@ Hardware Monitoring Kernel Drivers
> q54sj108a2
> qnap-mcu-hwmon
> raspberrypi-hwmon
> + rtq2886b
> sbrmi
> sbtsi_temp
> sch5627
> diff --git a/Documentation/hwmon/rtq2886b.rst b/Documentation/hwmon/rtq2886b.rst
> new file mode 100644
> index 000000000000..061199e0ce08
> --- /dev/null
> +++ b/Documentation/hwmon/rtq2886b.rst
> @@ -0,0 +1,58 @@
> +.. SPDX-License-Identifier: GPL-2.0-only
> +
> +====================================
> +Kernel driver rtq2886b
> +====================================
> +
> +Supported chips:
> + * Richtek RTQ2886B
> + * Richtek RTQ2882B
> + * Richtek RTQ2880B
> +
> +Only the B variants are supported by this driver. The corresponding
> +RTQ2886A, RTQ2882A, and RTQ2880A devices support analog control only
> +and do not provide a PMBus interface.
> +
> + Prefix: 'rtq2886b'
> +
> + Addresses scanned: -
> +
> +Author: ChiYuan Huang <cy_huang@richtek.com>
> +
> +Description
> +-----------
> +
> +The RTQ2886B is a single-output synchronous buck regulator with a PMBus
> +interface. It exposes voltage, current, power, and temperature telemetry through
> +the standard PMBus hwmon interface.
> +
> +The primary difference among the devices in this series is their maximum load
> +current capability. The RTQ2880B, RTQ2882B, and RTQ2886B support maximum load
> +currents of 20 A, 16 A, and 8 A, respectively.
> +
> +Sysfs entries
> +-------------
> +
> +======================= =======================================================
> +curr1_crit Critical output current limit
> +curr1_crit_alarm Output current critical alarm
> +curr1_input Measured output current
> +curr1_label "iout1"
> +
> +in1_alarm Input voltage alarm
> +in1_input Measured input voltage
> +in1_label "vin"
> +
> +in2_alarm Output voltage alarm
> +in2_input Measured output voltage
> +in2_label "vout1"
> +in2_rated_max Maximum rated output voltage
> +in2_rated_min Minimum rated output voltage
> +
> +power1_input Measured output power
> +power1_label "pout1"
> +
> +temp1_alarm Temperature alarm
> +temp1_input Measured chip temperature
> +======================= =======================================================
> +
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 84cb98ef4c49..0bc9ee8c2b9d 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -24074,6 +24074,14 @@ F: include/linux/rhashtable.h
> F: lib/rhashtable.c
> F: lib/test_rhashtable.c
>
> +RICHTEK RTQ2886B HARDWARE MONITOR DRIVER
> +M: ChiYuan Huang <cy_huang@richtek.com>
> +L: linux-hwmon@vger.kernel.org
> +S: Maintained
> +F: Documentation/devicetree/bindings/hwmon/pmbus/richtek,rtq2886b.yaml
> +F: Documentation/hwmon/rtq2886b.rst
> +F: drivers/hwmon/pmbus/rtq2886b.c
> +
> RICOH R5C592 MEMORYSTICK DRIVER
> M: Maxim Levitsky <maximlevitsky@gmail.com>
> S: Maintained
> diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> index fd6641316454..876e389a7ec9 100644
> --- a/drivers/hwmon/pmbus/Kconfig
> +++ b/drivers/hwmon/pmbus/Kconfig
> @@ -728,6 +728,25 @@ config SENSORS_Q54SJ108A2
> This driver can also be built as a module. If so, the module will
> be called q54sj108a2.
>
> +config SENSORS_RTQ2886B
> + tristate "Richtek RTQ2886B"
> + help
> + If you say yes here, you get hardware monitoring support for the
> + Richtek RTQ2886B and compatible PMBus regulators.
> +
> + This driver can also be built as a module. If so, the module will
> + be called rtq2886b.
> +
> +config SENSORS_RTQ2886B_REGULATOR
> + bool "Regulator support for Richtek RTQ2886B and compatible devices"
> + depends on SENSORS_RTQ2886B && REGULATOR
> + help
> + If you say yes here, the driver registers a regulator device for
> + the Richtek RTQ2886B through the PMBus regulator framework.
> +
> + This allows the regulator output to be controlled through the
> + regulator subsystem.
> +
> config SENSORS_STEF48H28
> tristate "ST STEF48H28"
> help
> diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
> index b67ec382328e..88fbde32f212 100644
> --- a/drivers/hwmon/pmbus/Makefile
> +++ b/drivers/hwmon/pmbus/Makefile
> @@ -67,6 +67,7 @@ obj-$(CONFIG_SENSORS_PLI1209BC) += pli1209bc.o
> obj-$(CONFIG_SENSORS_PM6764TR) += pm6764tr.o
> obj-$(CONFIG_SENSORS_PXE1610) += pxe1610.o
> obj-$(CONFIG_SENSORS_Q54SJ108A2) += q54sj108a2.o
> +obj-$(CONFIG_SENSORS_RTQ2886B) += rtq2886b.o
> obj-$(CONFIG_SENSORS_STEF48H28) += stef48h28.o
> obj-$(CONFIG_SENSORS_SQ24860) += sq24860.o
> obj-$(CONFIG_SENSORS_STPDDC60) += stpddc60.o
> diff --git a/drivers/hwmon/pmbus/rtq2886b.c b/drivers/hwmon/pmbus/rtq2886b.c
> new file mode 100644
> index 000000000000..fce225b5111b
> --- /dev/null
> +++ b/drivers/hwmon/pmbus/rtq2886b.c
> @@ -0,0 +1,100 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Hardware monitoring driver for Richtek RTQ2886B
> + *
> + * Copyright (C) 2026 Richtek Technology Corp.
> + */
> +
> +#include <linux/errno.h>
> +#include <linux/i2c.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include "pmbus.h"
> +
> +#define RTQ2886B_PMBUS_VOUT_MIN 0x2B
> +#define RTQ2886B_ONOFF_DEFAULT 0x1E
> +#define RTQ2886B_N_VOLTS 65535
> +#define RTQ2886B_STEP_UV (1000000 / 1024)
> +
> +#if IS_ENABLED(CONFIG_SENSORS_RTQ2886B_REGULATOR)
> +static const struct regulator_desc rtq2886b_reg_desc[] = {
> + PMBUS_REGULATOR_STEP_ONE("regulator", RTQ2886B_N_VOLTS, RTQ2886B_STEP_UV, 0),
> +};
> +#endif
> +
> +static int rtq2886b_read_word_data(struct i2c_client *i2c, int page, int phase, int reg)
> +{
> + switch (reg) {
> + case PMBUS_MFR_VOUT_MIN:
> + return pmbus_read_word_data(i2c, page, phase, RTQ2886B_PMBUS_VOUT_MIN);
Is this the configured minimum output voltage, or the rated minimum
output voltage ? Normally 0x2b would be the _configured_ minimum
output voltage, and reporting it as rated minimum output voltage would
be wrong.
> + case PMBUS_MFR_VOUT_MAX:
> + return pmbus_read_word_data(i2c, page, phase, PMBUS_VOUT_MAX);
PMBUS_MFR_VOUT_MAX is supposed to report the _rated_ maximum output
voltage for a chip. PMBUS_VOUT_MAX is a configurable value that limits
the output voltage that can be set on a given board. Both may be the
same for a chip, but usually that is not the case. The datasheet
is not public, so I can not know what is correct here. If the chip
reports the _rated_ maximum output voltage (read-only) with
PMBUS_VOUT_MAX, the code is ok, but this would require a comment.
> + default:
> + return -ENODATA;
> + }
> +}
> +
> +static struct pmbus_driver_info rtq2886b_info = {
> + .pages = 1,
> + .format[PSC_VOLTAGE_IN] = linear,
> + .format[PSC_VOLTAGE_OUT] = linear,
> + .format[PSC_CURRENT_OUT] = linear,
> + .format[PSC_POWER] = linear,
> + .format[PSC_TEMPERATURE] = linear,
> + .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT |
> + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_STATUS_IOUT |
> + PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP,
> + .read_word_data = rtq2886b_read_word_data,
> +#if IS_ENABLED(CONFIG_SENSORS_RTQ2886B_REGULATOR)
> + .num_regulators = ARRAY_SIZE(rtq2886b_reg_desc),
> + .reg_desc = rtq2886b_reg_desc,
> +#endif
> + .have_pmbus_revision = true,
> + .pmbus_revision = PMBUS_REV_14,
> +};
> +
> +static int rtq2886b_probe(struct i2c_client *i2c)
> +{
> + int ret;
> +
> + /* The device requires SMBus PEC for PMBus transactions. */
> + i2c->flags |= I2C_CLIENT_PEC;
> +
If this is mandatory, something like
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_PEC))
return -ENODEV;
is needed above. If it is not mandatory, the PMBus core sets the flag
automatically if supported by the I2C/SMBus controller, and the code above
is not needed.
It seems likely that it is not mandatory, because pmbus_init_common()
clears the flag before reading PMBUS_CAPABILITY, and does not re-enable
it if reading PMBUS_CAPABILITY (without it) fails. Of course, it might
be that it is only mandatory for I2C writes, but if so that should be
explained with a comment.
Sorry, but since the datasheet is not public (actually, the chip
does not even exist in public), you'll have to explain such details
in the driver.
Thanks,
Guenter
> + /*
> + * The device powers up with PMBUS_ON_OFF_CONFIG configured for
> + * hardware control. Configure it for PMBus-controlled operation
> + * to allow regulator output enable/disable management.
> + */
> + ret = i2c_smbus_write_byte_data(i2c, PMBUS_ON_OFF_CONFIG, RTQ2886B_ONOFF_DEFAULT);
> + if (ret)
> + return dev_err_probe(&i2c->dev, ret, "Failed to configure device\n");
> +
> + return pmbus_do_probe(i2c, &rtq2886b_info);
> +}
> +
> +static const struct i2c_device_id rtq2886b_id[] = {
> + { .name = "rtq2886b" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(i2c, rtq2886b_id);
> +
> +static const struct of_device_id rtq2886b_of_match[] = {
> + { .compatible = "richtek,rtq2886b" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, rtq2886b_of_match);
> +
> +static struct i2c_driver rtq2886b_driver = {
> + .driver = {
> + .name = "rtq2886b",
> + .of_match_table = rtq2886b_of_match,
> + },
> + .probe = rtq2886b_probe,
> + .id_table = rtq2886b_id,
> +};
> +module_i2c_driver(rtq2886b_driver);
> +
> +MODULE_AUTHOR("ChiYuan Huang <cy_huang@richtek.com>");
> +MODULE_DESCRIPTION("PMBus driver for Richtek RTQ2886B");
> +MODULE_LICENSE("GPL");
> +MODULE_IMPORT_NS("PMBUS");
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] hwmon: (pmbus/rtq2886b) Add driver for Richtek RTQ2886B
2026-12-01 6:45 ` Guenter Roeck
@ 2026-12-01 8:40 ` ChiYuan Huang
0 siblings, 0 replies; 5+ messages in thread
From: ChiYuan Huang @ 2026-12-01 8:40 UTC (permalink / raw)
To: Guenter Roeck
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonathan Corbet,
Shuah Khan, Randy Dunlap, Alexis Czezar Torreno, Sanman Pradhan,
Ashish Yadav, Matti Vaittinen, Colin Huang, Vincent Jardin,
Nuno Sá,
Abdurrahman Hussain, Ziming Zhu, Carlos Jones Jr, Wensheng Wang,
Charles Hsu, Brian Chiang, oliver_tai, lucas_tsai, linux-hwmon,
devicetree, linux-doc, linux-kernel
On Mon, Nov 30, 2026 at 10:45:04PM -0800, Guenter Roeck wrote:
> Hi,
>
> On 11/30/26 17:11, cy_huang@richtek.com wrote:
> > From: ChiYuan Huang <cy_huang@richtek.com>
> >
[...]
> > +static int rtq2886b_read_word_data(struct i2c_client *i2c, int page, int phase, int reg)
> > +{
> > + switch (reg) {
> > + case PMBUS_MFR_VOUT_MIN:
> > + return pmbus_read_word_data(i2c, page, phase, RTQ2886B_PMBUS_VOUT_MIN);
>
> Is this the configured minimum output voltage, or the rated minimum
> output voltage ? Normally 0x2b would be the _configured_ minimum
> output voltage, and reporting it as rated minimum output voltage would
> be wrong.
>
For RTQ2886B, PMBUS_MFR_VOUT_MIN/MAX are not implemented.
The device provides the minimum and maximum supported output voltage
capability through command 0x2b and PMBUS_VOUT_MAX respectively.
Both values are fixed device capabilities and are not board-specific
configurable limits.
The driver maps those values to PMBUS_MFR_VOUT_MIN/MAX so that the
rated voltage range can be exposed through the standard hwmon
attributes.
I'll add comments in the code to clarify this behavior.
> > + case PMBUS_MFR_VOUT_MAX:
> > + return pmbus_read_word_data(i2c, page, phase, PMBUS_VOUT_MAX);
>
> PMBUS_MFR_VOUT_MAX is supposed to report the _rated_ maximum output
> voltage for a chip. PMBUS_VOUT_MAX is a configurable value that limits
> the output voltage that can be set on a given board. Both may be the
> same for a chip, but usually that is not the case. The datasheet
> is not public, so I can not know what is correct here. If the chip
> reports the _rated_ maximum output voltage (read-only) with
> PMBUS_VOUT_MAX, the code is ok, but this would require a comment.
>
Like as the last comment.
> > + default:
> > + return -ENODATA;
> > + }
> > +}
> > +
[...]
> > +static int rtq2886b_probe(struct i2c_client *i2c)
> > +{
> > + int ret;
> > +
> > + /* The device requires SMBus PEC for PMBus transactions. */
> > + i2c->flags |= I2C_CLIENT_PEC;
> > +
>
> If this is mandatory, something like
>
> if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_PEC))
> return -ENODEV;
>
> is needed above. If it is not mandatory, the PMBus core sets the flag
> automatically if supported by the I2C/SMBus controller, and the code above
> is not needed.
>
> It seems likely that it is not mandatory, because pmbus_init_common()
> clears the flag before reading PMBUS_CAPABILITY, and does not re-enable
> it if reading PMBUS_CAPABILITY (without it) fails. Of course, it might
> be that it is only mandatory for I2C writes, but if so that should be
> explained with a comment.
>
> Sorry, but since the datasheet is not public (actually, the chip
> does not even exist in public), you'll have to explain such details
> in the driver.
>
The RTQ2886B powers up with PEC enabled by default.
As a result, writes to PMBUS_ON_OFF_CONFIG are rejected if PEC is not
enabled on the host side. Since the driver needs to switch the device
from hardware-controlled mode to PMBus-controlled operation during
probe, I2C_CLIENT_PEC is enabled before issuing that write.
I'll update the code comment to clarify this requirement.
> Thanks,
> Guenter
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-12-01 8:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01 1:11 [PATCH v2 0/2] hwmon: pmbus: Add support for Richtek RTQ2886B cy_huang
2026-12-01 1:11 ` [PATCH v2 1/2] dt-bindings: hwmon: pmbus/rtq2886b: Add Richtek RTQ2886B support cy_huang
2026-12-01 1:11 ` [PATCH v2 2/2] hwmon: (pmbus/rtq2886b) Add driver for Richtek RTQ2886B cy_huang
2026-12-01 6:45 ` Guenter Roeck
2026-12-01 8:40 ` ChiYuan Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®