mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Christopher de Guzman <christopher.deguzman@analog.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Frank Li <Frank.Li@nxp.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>
Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH 2/3] hwmon: (pmbus/ltc2978) Add support for LT7175 and LT7176P
Date: Tue, 20 Oct 2026 08:13:59 -0700	[thread overview]
Message-ID: <62872394-e64e-4ed1-9d73-ccae1336d7bd@roeck-us.net> (raw)
In-Reply-To: <20261020-upstream-lt7175-lt7176p-v1-2-86b9b728b95d@analog.com>

On 10/20/26 04:45, Christopher de Guzman wrote:
> Add support for LT7175/LT7175-1 and LT7176P/LT7176P-1 PMBus buck
> regulators. These parts share the LT7170 family MFR_SPECIAL_ID
> (0x1C1D masked to 0x1C10) and use the same PMBus register layout,
> so they reuse the existing lt7170/lt7171 probe path. Variants are
> distinguished by reading the PMBUS_IC_DEVICE_ID ASCII string.
> 
> Signed-off-by: Christopher de Guzman <christopher.deguzman@analog.com>
> ---
>   drivers/hwmon/pmbus/Kconfig   |  6 +++---
>   drivers/hwmon/pmbus/ltc2978.c | 28 +++++++++++++++++++++++++++-
>   2 files changed, 30 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> index fd6641316454..63fb4d5dd87d 100644
> --- a/drivers/hwmon/pmbus/Kconfig
> +++ b/drivers/hwmon/pmbus/Kconfig
> @@ -306,9 +306,9 @@ config SENSORS_LTC2978_REGULATOR
>   	depends on SENSORS_LTC2978 && REGULATOR
>   	help
>   	  If you say yes here you get regulator support for Linear Technology
> -	  LT7170, LT7171, LTC3880, LTC3883, LTC3884, LTC3886, LTC3887, LTC3889,
> -	  LTC7841, LTC7880, LTM4644, LTM4673, LTM4675, LTM4676, LTM4677,
> -	  LTM4678, LTM4680, LTM4686, and LTM4700.
> +	  LT7170, LT7171, LT7175, LT7176P, LTC3880, LTC3883, LTC3884, LTC3886,
> +	  LTC3887, LTC3889, LTC7841, LTC7880, LTM4644, LTM4673, LTM4675, LTM4676,
> +	  LTM4677, LTM4678, LTM4680, LTM4686, and LTM4700.
>   
>   config SENSORS_LTC3815
>   	tristate "Linear Technologies LTC3815"
> diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c
> index aea7b6c93e74..a42cdc1fe124 100644
> --- a/drivers/hwmon/pmbus/ltc2978.c
> +++ b/drivers/hwmon/pmbus/ltc2978.c
> @@ -23,7 +23,7 @@ enum chips {
>   	/* Managers */
>   	ltc2972, ltc2974, ltc2975, ltc2977, ltc2978, ltc2979, ltc2980,
>   	/* Controllers */
> -	lt7170, lt7171, ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887,
> +	lt7170, lt7171, lt7175, lt7176p, ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887,
>   	ltc3889, ltc7132, ltc7841, ltc7880,
>   	/* Modules */
>   	ltm2987, ltm4664, ltm4673, ltm4675, ltm4676, ltm4677, ltm4678, ltm4680,
> @@ -540,6 +540,10 @@ static int ltc2978_write_word_data(struct i2c_client *client, int page,
>   static const struct i2c_device_id ltc2978_id[] = {
>   	{ .name = "lt7170", .driver_data = lt7170 },
>   	{ .name = "lt7171", .driver_data = lt7171 },
> +	{ .name = "lt7175", .driver_data = lt7175 },
> +	{ .name = "lt7175-1", .driver_data = lt7175 },
> +	{ .name = "lt7176p", .driver_data = lt7176p },
> +	{ .name = "lt7176p-1", .driver_data = lt7176p },

We don't usually add -x variants unless really needed.
Let's not start this here.

>   	{ .name = "ltc2972", .driver_data = ltc2972 },
>   	{ .name = "ltc2974", .driver_data = ltc2974 },
>   	{ .name = "ltc2975", .driver_data = ltc2975 },
> @@ -645,6 +649,10 @@ static int ltc2978_get_id(struct i2c_client *client)
>   			return lt7170;
>   		if (!strncmp(buf, "LT7171", 6))
>   			return lt7171;
> +		if (!strncmp(buf, "LT7175", 6))
> +			return lt7175;
> +		if (!strncmp(buf, "LT7176P", 7))
> +			return lt7176p;

Sashiko has a point. It may be better to start using
the same approach used for chips with no chip ID, which would
be something like

		for (id = &ltc2978_id[0]; strlen(id->name); id++) {
                         if (ret >= strlen(id->name) &&
			    !strncasecmp(id->name, buf, strlen(id->name)))
                                 return (int)id->driver_data;
                 }

>   
>   		return -ENODEV;
>   	}
> @@ -774,6 +782,20 @@ static int ltc2978_probe(struct i2c_client *client)
>   		  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
>   		  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
>   		break;
> +	case lt7175:
> +	case lt7176p:
> +		data->features |= FEAT_CLEAR_PEAKS | FEAT_NEEDS_POLLING;
> +		info->read_word_data = ltc3883_read_word_data;
> +		info->pages = LTC3883_NUM_PAGES;
> +		info->format[PSC_VOLTAGE_IN] = ieee754;
> +		info->format[PSC_VOLTAGE_OUT] = ieee754;
> +		info->format[PSC_CURRENT_OUT] = ieee754;
> +		info->format[PSC_TEMPERATURE] = ieee754;
> +		info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
> +		  | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
> +		  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
> +		  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;

Unless I am missing something, this is identical to lt7170 / lt71751.
No need to duplicate the code, just add the case statements.

> +		break;
>   	case ltc2972:
>   		info->read_word_data = ltc2975_read_word_data;
>   		info->pages = LTC2972_NUM_PAGES;
> @@ -962,6 +984,10 @@ static int ltc2978_probe(struct i2c_client *client)
>   static const struct of_device_id ltc2978_of_match[] = {
>   	{ .compatible = "lltc,lt7170" },
>   	{ .compatible = "lltc,lt7171" },
> +	{ .compatible = "lltc,lt7175" },
> +	{ .compatible = "lltc,lt7175-1" },
> +	{ .compatible = "lltc,lt7176p" },
> +	{ .compatible = "lltc,lt7176p-1" },

Same as above. Please do not add -1 variants.

Thanks,
Guenter

>   	{ .compatible = "lltc,ltc2972" },
>   	{ .compatible = "lltc,ltc2974" },
>   	{ .compatible = "lltc,ltc2975" },
> 


  reply	other threads:[~2026-10-20 15:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 11:45 [PATCH 0/3] " Christopher de Guzman
2026-10-20 11:45 ` [PATCH 1/3] dt-bindings: hwmon: ltc2978: " Christopher de Guzman
2026-10-20 15:14   ` Guenter Roeck
2026-10-20 11:45 ` [PATCH 2/3] hwmon: (pmbus/ltc2978) " Christopher de Guzman
2026-10-20 15:13   ` Guenter Roeck [this message]
2026-10-20 11:45 ` [PATCH 3/3] hwmon: ltc2978: Document LT7175 and LT7176P support Christopher de Guzman

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=62872394-e64e-4ed1-9d73-ccae1336d7bd@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Frank.Li@nxp.com \
    --cc=christopher.deguzman@analog.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=rdunlap@infradead.org \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /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

all inboxes | Powered by JetHome®