From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796107519; b=f6Di9pE0uHjoTygt7GeyEFxEuLBhzTzB29VQplb8p00wbuXIWSSqQ8RKF1Ca2oJQbdml vNXpPR/0G11P57ab6bkbr+MZXqBzevB8/jPsU1kxYdPgPdvgH3FkKZRqPdYwBIil7Msos grrcgwb7GrAnhDVDNdkxqVUyaUSqj1o4AU/igf7w5YvaQFZKaNuoyEdNa8eBeYuZtQcFi Kh60BeZAl2y2TQOVmjNcwOdGdeCZ2O9qzzlrwtA4vGtCqmIcmD7IVneMZS6kdz9Ag/VvI KAUB4zp9UnZbNt38iCrFkDYfL6L17600LVn7sy4R4z9tmgbUUqRzoBRpSgmnyNgx17A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107519; h=DMARC-Filter:Received:Received:X-Authority-Analysis:DKIM-Signature: Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc: References:Content-Language:From:Autocrypt:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-AntiAbuse:X-AntiAbuse:X-AntiAbuse: X-AntiAbuse:X-AntiAbuse:X-BWhitelist:X-Source-IP:X-Source-L:X-Exim-ID: X-Source:X-Source-Args:X-Source-Dir:X-Source-Sender:X-Source-Auth: X-Email-Count:X-Org:X-Source-Cap:X-Local-Domain:X-CMAE-Envelope; bh=cpILbYlyNnx0yfmegzBXaH6Vgp+6EpYdX2BCdFC1qDs=; b=wz9LvhLZ6I1/JZHeOefG2qqmP0PkarIplgUMNgAVkEelmDFLBvXy5fG+bR8xyft9HHlU yMzzvt+75Bs0WgPWDBOQ0+QDIuFFDzB5xkFvOeD0twvWa+Vsyulf/TedisgyXsfejs1ow SdTCRRBP7/nkLFWLsrGNiyDy8CKaKJdt0n6TYmhy3D/OFVRYErxE3ifN894Idy6PfTgGd Azkw2HTiazHK9vBcm1wt7vTJzpduPWVzHThQX6HNgOE9PrHYxPOVJ/54XdyrKaVI6VJDu R1F7VnhZccCKxQ6KC0gwVwsAGjW0vZP8eeAT0ECksNYXF8l1uI3ygF707OxJEIYmDpg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=roeck-us.net; spf=fail smtp.mailfrom=roeck-us.net; dkim=pass header.d=roeck-us.net header.i=@roeck-us.net header.a=rsa-sha256 header.s=default header.b=UwYXe6sj; arc=none smtp.remote-ip=44.202.169.39 Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C39F606A320 for ; Tue, 1 Dec 2026 06:45:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9C39F606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=roeck-us.net header.i=@roeck-us.net header.a=rsa-sha256 header.s=default header.b=UwYXe6sj Received: from eig-obgw-6007b.ext.cloudfilter.net ([10.0.30.166]) by cmsmtp with ESMTPS id YCDyxuWUzOOJnYHbzx8ZCA; Tue, 01 Dec 2026 06:45:12 +0000 Received: from 162-215-252-36.unifiedlayer.com ([208.91.199.152]) by cmsmtp with ESMTPS id YHbzxRaBv3nNNYHbzxo8Dv; Tue, 01 Dec 2026 06:45:11 +0000 X-Authority-Analysis: v=2.4 cv=TuLmhCXh c=1 sm=1 tr=0 ts=6b0e6cf7 a=QNED+QcLUkoL9qulTODnwA==:117 a=2cfIYNtKkjgZNaOwnGXpGw==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=M0FbrtG7MMAA:10 a=l0hiEBf7AAAA:8 a=VwQbUJbxAAAA:8 a=pGLkceISAAAA:8 a=303D4Lv13f685x3k2kUA:9 a=QEXdDO2ut3YA:10 a=ynCB8LqupOr-u-Kv-6Up:22 a=KPbNTLLc3YvdawN95zVk:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner: List-Archive; bh=cpILbYlyNnx0yfmegzBXaH6Vgp+6EpYdX2BCdFC1qDs=; b=UwYXe6sjJ82M WR75Sgbzb6lq9Ss2WO8mHD9O8rBvCeJDe9XjkCkqNILalah0vnZfr6Iux8pujUYyy37bdh32jEU5N KrC311UNHE+O5hnQowSfXkSt63yu0JDjSo31qgUaSw+NVAfTdu1/xEp7+WV+gGsyMvLtkUCWIi5p1 yvTFn+DG+ex8BDxRqVLIlcCxWYGIng3kIZ16E04rh/GbdwJ7WkXJkEsjiSCE/xxl3xc8YTWvq7siF EQeWJs3QSrc/GoykMsFFHRL7vCcxFQIdCppncWuixnqStqzTdpuIhmD7ayhhmAvvivj6yXnoAgdgF XLF0xrKGSU6KrhNm52kyww==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:60010) by bh-25.webhostbox.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.2) (envelope-from ) id 1xYHbu-00000004Bnk-1raE; Tue, 01 Dec 2026 12:15:06 +0530 Message-ID: Date: Mon, 30 Nov 2026 22:45:04 -0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] hwmon: (pmbus/rtq2886b) Add driver for Richtek RTQ2886B To: cy_huang@richtek.com, 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 , =?UTF-8?Q?Nuno_S=C3=A1?= , Abdurrahman Hussain , Ziming Zhu , Carlos Jones Jr , Wensheng Wang , Charles Hsu , Brian Chiang , oliver_tai@richtek.com, lucas_tsai@richtek.com, linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <9fb5fb44c4b9e38986ef2fb29d09672b130fe313.1796086906.git.cy_huang@richtek.com> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJ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iLXp84130yxAKXfluax9sZhhrhKT6VrD45S6N3HxJpXQ/RY/EX35neH2/F7B RgSloce2+zWfpELyS1qRkCUTt1tlGV2p+y2BPfXzrHn2vxvbhEn1QpQ6t+85FKN8YEhJEygJ F0WaMvQMNrk9UAUziVcUkLU52NS9SXqpVg8vgrO0JKx97IXFPcNh0DWsSj/0Y8HO/RDkGXYn FDMj7fZSPKyPQPmEHg+W/KzxSSfdgWIHF2QaQ0b2q1wOSec4Rti52ohmNSY+KNIW/zODhugJ np3900V20aS7eD9K8GTU0TGC1pyz6IVJwIE= In-Reply-To: <9fb5fb44c4b9e38986ef2fb29d09672b130fe313.1796086906.git.cy_huang@richtek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-BWhitelist: no X-Source-IP: 108.223.40.66 X-Source-L: No X-Exim-ID: 1xYHbu-00000004Bnk-1raE X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 108-223-40-66.lightspeed.sntcca.sbcglobal.net [108.223.40.66]:60010 X-Source-Auth: guenter@roeck-us.net X-Email-Count: 2 X-Org: HG=direseller_whb_net_legacy;ORG=directi; X-Source-Cap: cm9lY2s7YWN0aXZzdG07YmgtMjUud2ViaG9zdGJveC5uZXQ= X-Local-Domain: yes X-CMAE-Envelope: MS4xfEKgC81J9yXGxuxqCJC9/IYNkkuNSiM9DJ5qgv3bZqK8FZSOS3JGo437BLVaxYb+WHvdLDWGRI+hasPcldb1JxGQ3qX2jbE/D1KkVR/9ULSDH1d0UVol NT0iixUsAkt1W1VfaVS3evH+bmvWnpgEyJWAiMYLqcPbgZMoouciBvDfbWcLC8QxKF7+xxdersYM0OWn2xu2bAmpXYEGXg22s19Pf0BfuMNpwkOWtUmXhgGU Hi, On 11/30/26 17:11, cy_huang@richtek.com wrote: > From: ChiYuan Huang > > 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 > > --- > 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 > + > +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 > +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 > 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 > +#include > +#include > +#include > +#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 "); > +MODULE_DESCRIPTION("PMBus driver for Richtek RTQ2886B"); > +MODULE_LICENSE("GPL"); > +MODULE_IMPORT_NS("PMBUS");