From: Guenter Roeck <linux@roeck-us.net>
To: Colin Huang <u8813345@gmail.com>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
Colin.Huang2@amd.com, Carl.Lee@amd.com, Peter.Shen@amd.com
Subject: Re: [PATCH 1/3] hwmon: (pmbus) Add Delta Q54SN120A1 Q54SW120A7 driver
Date: Thu, 5 Feb 2026 07:01:40 -0800 [thread overview]
Message-ID: <fa95034e-2de9-46e6-bc4b-2f117df7b240@roeck-us.net> (raw)
In-Reply-To: <20260205-add-q54sn120a1-q54q54sw120a7-v1-1-09061ecacfc7@gmail.com>
On Thu, Feb 05, 2026 at 09:34:35PM +0800, Colin Huang wrote:
> Add the pmbus driver for DELTA Q54SN120A1, Q54SW120A7,
> 1/4 Brick DC/DC Regulated Power Module with PMBus support
>
This isn't adding the driver, it is adding support for the chips
to the q54sj108a2 driver.
> Signed-off-by: Colin Huang <u8813345@gmail.com>
> ---
> drivers/hwmon/pmbus/q54sj108a2.c | 47 ++++++++++++++++++++++++++++++++++++----
> 1 file changed, 43 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwmon/pmbus/q54sj108a2.c b/drivers/hwmon/pmbus/q54sj108a2.c
> index 4d7086d83aa3..dca084c98fba 100644
> --- a/drivers/hwmon/pmbus/q54sj108a2.c
> +++ b/drivers/hwmon/pmbus/q54sj108a2.c
> @@ -21,7 +21,9 @@
> #define PMBUS_FLASH_KEY_WRITE 0xEC
>
> enum chips {
> - q54sj108a2
> + q54sj108a2,
> + q54sn120a1,
> + q54sw120a7
> };
>
> enum {
> @@ -62,6 +64,34 @@ static struct pmbus_driver_info q54sj108a2_info[] = {
> .format[PSC_VOLTAGE_IN] = linear,
> .format[PSC_CURRENT_OUT] = linear,
>
> + .func[0] = PMBUS_HAVE_VIN |
> + PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
> + PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
> + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
> + PMBUS_HAVE_STATUS_INPUT,
> + },
> + [q54sn120a1] = {
> + .pages = 1,
> +
> + /* Source : Delta Q54SN120A1 */
> + .format[PSC_TEMPERATURE] = linear,
> + .format[PSC_VOLTAGE_IN] = linear,
> + .format[PSC_CURRENT_OUT] = linear,
> +
> + .func[0] = PMBUS_HAVE_VIN |
> + PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
> + PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
> + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP |
> + PMBUS_HAVE_STATUS_INPUT,
> + },
> + [q54sw120a7] = {
> + .pages = 1,
> +
> + /* Source : Delta Q54SW120A7 */
> + .format[PSC_TEMPERATURE] = linear,
> + .format[PSC_VOLTAGE_IN] = linear,
> + .format[PSC_CURRENT_OUT] = linear,
> +
Unless I am missing something, those are all the same. That means there is
no need for separate entries.
> .func[0] = PMBUS_HAVE_VIN |
> PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
> PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT |
> @@ -269,6 +299,8 @@ static const struct file_operations q54sj108a2_fops = {
>
> static const struct i2c_device_id q54sj108a2_id[] = {
> { "q54sj108a2", q54sj108a2 },
> + { "q54sn120a1", q54sn120a1 },
> + { "q54sw120a7", q54sw120a7 },
Delta sells a variety of power bricks, but a Google search for q54sn120a1 or
q54sw120a7 comes up empty. Worse, searching for the entire series (q54sn or
q54sw) comes up empty as well.
Please provide information confirming that the referenced chips do exist.
> { },
> };
>
> @@ -278,6 +310,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
> {
> struct device *dev = &client->dev;
> u8 buf[I2C_SMBUS_BLOCK_MAX + 1];
> + const struct i2c_device_id *mid;
> enum chips chip_id;
> int ret, i;
> struct dentry *debugfs;
> @@ -314,8 +347,12 @@ static int q54sj108a2_probe(struct i2c_client *client)
> dev_err(dev, "Failed to read Manufacturer Model\n");
> return ret;
> }
> - if (ret != 14 || strncmp(buf, "Q54SJ108A2", 10)) {
> - buf[ret] = '\0';
> + buf[ret] = '\0';
> + for (mid = q54sj108a2_id; mid->name[0]; mid++) {
> + if (!strncasecmp(mid->name, buf, strlen(mid->name)))
> + break;
> + }
> + if (!mid->name[0]) {
> dev_err(dev, "Unsupported Manufacturer Model '%s'\n", buf);
> return -ENODEV;
> }
> @@ -325,7 +362,7 @@ static int q54sj108a2_probe(struct i2c_client *client)
> dev_err(dev, "Failed to read Manufacturer Revision\n");
> return ret;
> }
> - if (ret != 4 || buf[0] != 'S') {
> + if (buf[0] != 'S') {
This relaxes the revision number checks significantly. Please provide evidence
explaining why this is needed.
> buf[ret] = '\0';
> dev_err(dev, "Unsupported Manufacturer Revision '%s'\n", buf);
> return -ENODEV;
> @@ -402,6 +439,8 @@ static int q54sj108a2_probe(struct i2c_client *client)
>
> static const struct of_device_id q54sj108a2_of_match[] = {
> { .compatible = "delta,q54sj108a2", .data = (void *)q54sj108a2 },
> + { .compatible = "delta,q54sn120a1", .data = (void *)q54sn120a1 },
> + { .compatible = "delta,q54sw120a7", .data = (void *)q54sw120a7 },
> { },
> };
>
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2026-02-05 15:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 13:34 [PATCH 0/3] Add support for Delta Q54SN120A1 and Q54SW120A7 Colin Huang
2026-02-05 13:34 ` [PATCH 1/3] hwmon: (pmbus) Add Delta Q54SN120A1 Q54SW120A7 driver Colin Huang
2026-02-05 15:01 ` Guenter Roeck [this message]
2026-02-05 13:34 ` [PATCH 2/3] dt-bindings: trivial-devices: Add Delta Q54SN120A1 and Q54SW120A7 Colin Huang
2026-02-05 14:33 ` Guenter Roeck
2026-02-05 18:40 ` Conor Dooley
2026-02-05 13:34 ` [PATCH 3/3] docs: hwmon: Add Q54SN120A1 and Q54SW120A7 to index Colin Huang
2026-02-05 14:32 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa95034e-2de9-46e6-bc4b-2f117df7b240@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Carl.Lee@amd.com \
--cc=Colin.Huang2@amd.com \
--cc=Peter.Shen@amd.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=u8813345@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox