Commit graph

6 commits

Author SHA1 Message Date
Yikai Tsai
b2446a16db hwmon: (isl28022) Fix current reading calculation
According to the ISL28022 datasheet, bit15 of the current register is
representing -32768. Fix the calculation to properly handle this bit,
ensuring correct measurements for negative values.

Signed-off-by: Yikai Tsai <yikai.tsai.wiwynn@gmail.com>
Link: https://lore.kernel.org/r/20250519084055.3787-2-yikai.tsai.wiwynn@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-05-19 21:56:18 -07:00
Bo Liu
a92d87d2f9 hwmon: (isl28022, nct7363) Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250424010829.2610-1-liubo03@inspur.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-05-01 20:10:36 -07:00
Wolfram Sang
c36e0a1b26 hwmon: (isl28022) Use per-client debugfs entry
The I2C core now offers a debugfs-directory per client. Use it and
remove the custom handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20250123160347.44635-1-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-02 17:34:06 -08:00
Uwe Kleine-König
a4ea3e41be hwmon: (isl28022) Drop explicit initialization of struct i2c_device_id::driver_data to 0
This driver doesn't use the driver_data member of struct i2c_device_id,
so don't explicitly initialize it.

This prepares putting driver_data in an anonymous union which requires
either no initialization or named designators. But it's also a nice
cleanup on its own.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20241204140857.1691402-2-u.kleine-koenig@baylibre.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-12-14 08:00:44 -08:00
Wolfram Sang
10208399db hwmon: (isl28022) apply coding style to module init/exit
Function declarations can be in one line. module_init|exit macros should
be tied to the function.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-12-14 08:00:44 -08:00
Yikai Tsai
39671a14df hwmon: (isl28022) new driver for ISL28022 power monitor
Driver for Renesas ISL28022 power monitor with I2C interface.
The device monitors voltage, current via shunt resistor
and calculated power.

Signed-off-by: Carsten Spieß <mail@carsten-spiess.de>
Signed-off-by: Yikai Tsai <yikai.tsai.wiwynn@gmail.com>
Message-ID: <20241002081133.13123-3-yikai.tsai.wiwynn@gmail.com>
[groeck: Fixed alignment issues, dropped noise at end of probe]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-11-10 14:48:07 -08:00