Re: [PATCH v5 0/3] hwmon: Add support for the LTC4283 Hot Swap Controller
From: Guenter Roeck <linux@roeck-us.net>
Date: 2026-01-18 15:39:42
Also in:
linux-devicetree, linux-gpio, linux-hwmon
On 1/18/26 02:12, Nuno Sá wrote:
On Sat, 2026-01-17 at 16:27 -0800, Guenter Roeck wrote:quoted
Hi Nuno, On 12/23/25 04:21, Nuno Sá via B4 Relay wrote:quoted
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).
Technically possible, but the driver used i2c_smbus_{read,write}_word_swapped
since 2011 (even in pre-regmap times). Before that it used essentially the
same code (i2c_smbus_read_word_data followed by swab16), only it was hand-coded.
I would assume that someone would have noticed that problem in all that time.
Guenter