public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>,
	nuno.sa@analog.com,  linux-hwmon@vger.kernel.org,
	linux-gpio@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-doc@vger.kernel.org
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	 Jean Delvare <jdelvare@suse.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Linus Walleij <linus.walleij@linaro.org>,
	 Bartosz Golaszewski	 <brgl@bgdev.pl>,
	"Rob Herring (Arm)" <robh@kernel.org>,
	Linus Walleij	 <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>
Subject: Re: [PATCH v5 0/3] hwmon: Add support for the LTC4283 Hot Swap Controller
Date: Sun, 18 Jan 2026 10:12:43 +0000	[thread overview]
Message-ID: <91c052abe2f88be12ef9f557120d540373471d67.camel@gmail.com> (raw)
In-Reply-To: <0ae2d448-06e3-41f6-89aa-8aa3f939d64f@roeck-us.net>

On Sat, 2026-01-17 at 16:27 -0800, Guenter Roeck wrote:
> Hi Nuno,
> 
> On 12/23/25 04:21, Nuno Sá via B4 Relay wrote:
> > This is v3 for the LTC4283 how swap controller. Main change is that I'm
> > now using the auxiliary bus for adding the GPIO device (done depending
> > on FW properties).
> > 
> > Similar to the LTC4282 device, we're clearing some fault logs in the
> > reset_history attributes.
> > 
> > Guenter, in [1] you can find some replies for some questions you had in
> > v2 that likely you don't remember anymore. Regarding the regmap story I
> > ended up adding a secong regmap for the 16 bit wide registers which
> > seems like a clean solution (if I'm not missing nothing).
> > 
> 
> Sorry for the long delay.
> 
> Actually I prefer the solution used in the lm75 driver: Map all registers
> to 16-bit registers using a regmap bus. Would that be possible ?

I do like the current approach as we get the proper i2c functionality checks from
regmap and it actually maps the device register layout. But no strong feeling so
obvioulsy I'll try the lm75 way. However looking at code, something come to mind.
Won't the below break on big endian machines (assuming big endian device)?

https://elixir.bootlin.com/linux/v6.19-rc4/source/drivers/hwmon/lm75.c#L594

Sunday morning for me so I might be missing something :). FWIW, if I'ḿ right about
the above, then regmap i2c has the same issue (tough the issue seems to be on the i2c
API - at first glance).

Will also look at the below feedback.

Thanks!
- Nuno Sá

> 
> Other than that, I ran the series through an AI review. This is what it told me:
> 
>    Identified Violations and Observations:
> 
>     * Alphabetical Order of Includes: In drivers/hwmon/ltc4283.c, the include files
> are not strictly in alphabetical order.
>         * #include <linux/hwmon.h> is listed before #include <linux/hwmon-sysfs.h>.
> 
> -> Actually, linux/hwmon-sysfs.h> does not have to be included in the first place.
> 
>         * According to strict ASCII sorting (e.g., LC_ALL=C sort), hwmon-sysfs.h
> should come first because the hyphen - (ASCII 45) precedes the dot . (ASCII 46).
>     * Documentation Discrepancy: The file Documentation/hwmon/ltc4283.rst includes
> a section for "Addresses scanned" listing I2C addresses 0x10-0x17 and 0x20-0x2E.
>         * Inaccuracy: The driver does not implement a .detect function, meaning no
> I2C address scanning is actually performed.
>         * Guideline Violation: The submitting-patches.rst guideline states that
> only specific I2C addresses (0x18-0x1f, 0x28-0x2f, etc.) shall be probed. The
> addresses listed in the documentation (specifically 0x10-0x17) are outside of this
>           approved range. While the driver doesn't probe, the documentation
> misleadingly suggests it does so on non-approved addresses.
> 
> -> Please fix.
> 
> Thanks,
> Guenter
> 
> > [1]:
> > https://lore.kernel.org/linux-hwmon/0765a0b89779331c62a3f136ef030f7f2f40ea47.camel@gmail.com/
> > [2]:
> > https://lore.kernel.org/linux-iio/cover.1761588465.git.geert+renesas@glider.be/
> > 
> > ---
> > Changes in v5:
> > - Patch 2:
> >    * Added a secong regmap for the 16bit wide registers;
> >    * Add default value for rsense so that we can probe without FW
> >      properties;
> >    * Make sure to give the right file permissions to the reset_history
> >      attrs.
> > - Patch 3:
> >    * Make sure to get the right regmap (given that the device now has 2);
> >    * Add error handling for getting the regmap.
> > - Link to v4:
> > https://lore.kernel.org/r/20251204-ltc4283-support-v4-0-db0197fd7984@analog.com
> > 
> > ---
> > Nuno Sá (3):
> >        dt-bindings: hwmon: Document the LTC4283 Swap Controller
> >        hwmon: ltc4283: Add support for the LTC4283 Swap Controller
> >        gpio: gpio-ltc4283: Add support for the LTC4283 Swap Controller
> > 
> >   .../devicetree/bindings/hwmon/adi,ltc4283.yaml     |  272 +++
> >   Documentation/hwmon/index.rst                      |    1 +
> >   Documentation/hwmon/ltc4283.rst                    |  266 +++
> >   MAINTAINERS                                        |    9 +
> >   drivers/gpio/Kconfig                               |   15 +
> >   drivers/gpio/Makefile                              |    1 +
> >   drivers/gpio/gpio-ltc4283.c                        |  218 +++
> >   drivers/hwmon/Kconfig                              |   12 +
> >   drivers/hwmon/Makefile                             |    1 +
> >   drivers/hwmon/ltc4283.c                            | 1766 ++++++++++++++++++++
> >   10 files changed, 2561 insertions(+)
> > ---
> > base-commit: bc04acf4aeca588496124a6cf54bfce3db327039
> > change-id: 20250812-ltc4283-support-27c8c4e69c6b
> > --
> > 
> > Thanks!
> > - Nuno Sá
> > 
> > 
> > 

  reply	other threads:[~2026-01-18 10:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23 12:21 [PATCH v5 0/3] hwmon: Add support for the LTC4283 Hot Swap Controller Nuno Sá via B4 Relay
2025-12-23 12:21 ` [PATCH v5 1/3] dt-bindings: hwmon: Document the LTC4283 " Nuno Sá via B4 Relay
2025-12-23 12:21 ` [PATCH v5 2/3] hwmon: ltc4283: Add support for " Nuno Sá via B4 Relay
2025-12-23 12:21 ` [PATCH v5 3/3] gpio: gpio-ltc4283: " Nuno Sá via B4 Relay
2026-01-18  0:27 ` [PATCH v5 0/3] hwmon: Add support for the LTC4283 Hot " Guenter Roeck
2026-01-18 10:12   ` Nuno Sá [this message]
2026-01-18 15:39     ` Guenter Roeck
2026-02-17 13:39   ` Nuno Sá
2026-02-21  1:17     ` Guenter Roeck
2026-01-27 17:39 ` Guenter Roeck
2026-01-28  9:44   ` Nuno Sá
2026-01-28 10:04     ` Guenter Roeck
2026-01-28 16:55       ` Guenter Roeck
2026-01-28 18:07         ` Nuno Sá
2026-01-28 18:22           ` Guenter Roeck
2026-02-02  9:40             ` Nuno Sá

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=91c052abe2f88be12ef9f557120d540373471d67.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=brgl@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linusw@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.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