mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Matti Vaittinen <mazziesaccount@gmail.com>,
	Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	Matti Vaittinen <matti.vaittinen@linux.dev>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Wensheng Wang <wenswang@yeah.net>,
	Ashish Yadav <ashish.yadav@infineon.com>,
	Kim Seer Paller <kimseer.paller@analog.com>,
	Cedric Encarnacion <cedricjustine.encarnacion@analog.com>,
	Chris Packham <chris.packham@alliedtelesis.co.nz>,
	Yuxi Wang <Yuxi.Wang@monolithicpower.com>,
	Charles Hsu <hsu.yungteng@gmail.com>,
	ChiShih Tsai <tomtsai764@gmail.com>,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH 6/7] hwmon: adm1275: Support ROHM BD12790
Date: Tue, 16 Jun 2026 07:15:11 -0700	[thread overview]
Message-ID: <d66b9de3-db06-4f83-9c2a-b45e341bfc9c@roeck-us.net> (raw)
In-Reply-To: <8ca875d21f2d9a4d53a87b47a5e6efab48266178.1781591132.git.mazziesaccount@gmail.com>

On 6/15/26 23:44, Matti Vaittinen wrote:
> From: Matti Vaittinen <mazziesaccount@gmail.com>
> 
> Add support for ROHM BD12790 hot-swap controller which is largely
> similar to Analog Devices adm1272.
> 
> The BD12790 uses the same selectable 60V/100V voltage ranges and
> 15mV/30mV current-sense ranges as the ADM1272, and the same VRANGE
> (bit 5) and IRANGE (bit 0) layout in PMON_CONFIG. It therefore uses
> a dedicated coefficient table that mirrors adm1272_coefficients, with
> the following differences derived from BD12790 datasheet Table 1 (p.18):
> - power 60V/30mV: m=17560 (vs. 17561)
> - power 100V/30mV: m=10536 (vs. 10535)
> - temperature: b=31880 (vs. 31871, reflecting T[11:0] = 4.2*T + 3188)
> 
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
> Assisted-by: GitHub Copilot:claude-sonnet-4.6
> 
> ---
> Originally this patch was AI-generated. I did pretty much re-write the
> probe changes by hand, and also fixed some of the coefficient math
> afterwards :/ But yeah, this one was AI "assisted". :)
> 
>   drivers/hwmon/pmbus/Kconfig   |  4 +--
>   drivers/hwmon/pmbus/adm1275.c | 53 +++++++++++++++++++++++++++++------
>   2 files changed, 47 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
> index b3c27f3b2712..6ebc01e26db3 100644
> --- a/drivers/hwmon/pmbus/Kconfig
> +++ b/drivers/hwmon/pmbus/Kconfig
> @@ -52,8 +52,8 @@ config SENSORS_ADM1275
>   	help
>   	  If you say yes here you get hardware monitoring support for Analog
>   	  Devices ADM1075, ADM1272, ADM1273, ADM1275, ADM1276, ADM1278, ADM1281,
> -	  ADM1293, ADM1294, ROHM BD12780, and SQ24905C Hot-Swap Controller and
> -	  Digital Power Monitors.
> +	  ADM1293, ADM1294, ROHM BD12780, ROHM BD12790, and SQ24905C
> +	  Hot-Swap Controller and Digital Power Monitors.
>   
>   	  This driver can also be built as a module. If so, the module will
>   	  be called adm1275.
> diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c
> index 838b8827eb76..9e21dd4083e9 100644
> --- a/drivers/hwmon/pmbus/adm1275.c
> +++ b/drivers/hwmon/pmbus/adm1275.c
> @@ -19,7 +19,7 @@
>   #include "pmbus.h"
>   
>   enum chips { adm1075, adm1272, adm1273, adm1275, adm1276, adm1278, adm1281,
> -	 adm1293, adm1294, bd12780, sq24905c };
> +	 adm1293, adm1294, bd12780, bd12790, sq24905c };
>   
>   #define ADM1275_MFR_STATUS_IOUT_WARN2	BIT(0)
>   #define ADM1293_MFR_STATUS_VAUX_UV_WARN	BIT(5)
> @@ -47,8 +47,8 @@ enum chips { adm1075, adm1272, adm1273, adm1275, adm1276, adm1278, adm1281,
>   #define ADM1278_VOUT_EN			BIT(1)
>   
>   #define ADM1278_PMON_DEFCONFIG		(ADM1278_VOUT_EN | ADM1278_TEMP1_EN | ADM1278_TSFILT)
> -/* The BD12780 data sheets mark TSFILT bit as reserved. */
> -#define BD12780_PMON_DEFCONFIG		(ADM1278_VOUT_EN | ADM1278_TEMP1_EN)
> +/* The BD127x0 data sheets mark TSFILT bit as reserved. */
> +#define BD127X0_PMON_DEFCONFIG		(ADM1278_VOUT_EN | ADM1278_TEMP1_EN)

Please don't use such placeholders. Just use BD12780_PMON_DEFCONFIG
for both chips, similar to how the defines for all other chips
are handled.

Thanks,
Guenter


  parent reply	other threads:[~2026-06-16 14:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16  6:33 [PATCH 0/7] Support ROHM BD127x0 hot-swap controllers Matti Vaittinen
2026-06-16  6:35 ` [PATCH 1/7] dt-bindings: adm1275: ROHM BD12780 hot-swap controller Matti Vaittinen
2026-06-17 10:28   ` Krzysztof Kozlowski
2026-06-25  7:05     ` Matti Vaittinen
2026-06-25  7:21       ` Krzysztof Kozlowski
2026-06-16  6:36 ` [PATCH 2/7] doc: Add ROHM BD12780 and BD12780A Matti Vaittinen
2026-06-16  6:36 ` [PATCH 3/7] hwmon: adm1275: Support ROHM BD12780 Matti Vaittinen
2026-06-16 14:13   ` Guenter Roeck
2026-06-17  5:48     ` Matti Vaittinen
2026-06-17 13:50       ` Guenter Roeck
2026-06-16  6:37 ` [PATCH 4/7] dt-bindings: adm1275: ROHM BD12790 hot-swap controller Matti Vaittinen
2026-06-16 15:54   ` Conor Dooley
2026-06-16  6:38 ` [PATCH 5/7] doc: adm1275: Add ROHM BD12790 Matti Vaittinen
2026-06-16  6:44 ` [PATCH 6/7] hwmon: adm1275: Support " Matti Vaittinen
2026-06-16 14:08   ` Guenter Roeck
2026-06-17  5:56     ` Matti Vaittinen
2026-06-17 13:54       ` Guenter Roeck
2026-06-16 14:15   ` Guenter Roeck [this message]
2026-06-17  5:57     ` Matti Vaittinen
2026-06-16  6:47 ` [PATCH 7/7] hwmon: adm1275: Support module auto-loading Matti Vaittinen
2026-06-16 14:04   ` Guenter Roeck
2026-06-17  6:00     ` Matti Vaittinen

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=d66b9de3-db06-4f83-9c2a-b45e341bfc9c@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Yuxi.Wang@monolithicpower.com \
    --cc=ashish.yadav@infineon.com \
    --cc=cedricjustine.encarnacion@analog.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=hsu.yungteng@gmail.com \
    --cc=kimseer.paller@analog.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=matti.vaittinen@linux.dev \
    --cc=mazziesaccount@gmail.com \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tomtsai764@gmail.com \
    --cc=wenswang@yeah.net \
    /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®