]> www.infradead.org Git - linux.git/log
linux.git
12 months agohwmon: (amc6821) Add support for pwm1_mode attribute
Guenter Roeck [Mon, 1 Jul 2024 15:57:58 +0000 (08:57 -0700)]
hwmon: (amc6821) Add support for pwm1_mode attribute

AMC6821 supports configuring if a fan is DC or PWM controlled.
Add support for the pwm1_mode attribute to make it runtime configurable.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (amc6821) Convert to with_info API
Guenter Roeck [Thu, 27 Jun 2024 00:20:40 +0000 (17:20 -0700)]
hwmon: (amc6821) Convert to with_info API

Convert to use with_info API to simplify the code and make it easier
to maintain. This also reduces code size by approximately 20%.

No functional change intended.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (amc6821) Convert to use regmap
Guenter Roeck [Thu, 27 Jun 2024 17:48:27 +0000 (10:48 -0700)]
hwmon: (amc6821) Convert to use regmap

Use regmap for register accesses and caching.

While at it, use sysfs_emit() instead of sprintf() to write sysfs
attribute data, and remove spurious debug messages which would only
be seen as result of a bug in the code. Also make sure that error
codes are propagated and not replaced with -EIO.

While at it, introduce rounding of written temperature values and for
internal calculations to reduce deviation from written values and as
much as possible.

No functional change intended except for differences introduced by
rounding.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (amc6821) Drop unnecessary enum chips
Guenter Roeck [Thu, 27 Jun 2024 18:08:14 +0000 (11:08 -0700)]
hwmon: (amc6821) Drop unnecessary enum chips

The driver only supports a single chip, so an enum
to determine the chip type is unnecessary. Drop it.

No functional change intended.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (amc6821) Use BIT() and GENMASK()
Guenter Roeck [Thu, 27 Jun 2024 16:46:12 +0000 (09:46 -0700)]
hwmon: (amc6821) Use BIT() and GENMASK()

Use BIT() and GENMASK() for bit and mask definitions
to help distinguish bit and mask definitions from other
defines and to make the code easier to read.

No functional change intended.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (amc6821) Use tabs for column alignment in defines
Guenter Roeck [Thu, 27 Jun 2024 16:41:41 +0000 (09:41 -0700)]
hwmon: (amc6821) Use tabs for column alignment in defines

Using tabs for column alignment makes the code easier to read.

No functional change intended.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (amc6821) Reorder include files, drop unnecessary ones
Guenter Roeck [Thu, 27 Jun 2024 15:27:53 +0000 (08:27 -0700)]
hwmon: (amc6821) Reorder include files, drop unnecessary ones

Reorder include files to alphabetic order to simplify maintenance,
and drop the unnecessary kernel.h include.

No functional change intended.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (amc6821) Add support for fan1_target and pwm1_enable mode 4
Guenter Roeck [Thu, 27 Jun 2024 14:50:48 +0000 (07:50 -0700)]
hwmon: (amc6821) Add support for fan1_target and pwm1_enable mode 4

After setting fan1_target and setting pwm1_enable to 4,
the fan controller tries to achieve the requested fan speed.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (amc6821) Rename fan1_div to fan1_pulses
Guenter Roeck [Thu, 27 Jun 2024 14:05:35 +0000 (07:05 -0700)]
hwmon: (amc6821) Rename fan1_div to fan1_pulses

The chip does not have a fan divisor. What it does have is a configuration
to set either 2 or 4 pulses per fan rotation. Rename the attribute to
reflect its use. Update documentation accordingly.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (amc6821) Make reading and writing fan speed limits consistent
Guenter Roeck [Thu, 27 Jun 2024 00:46:04 +0000 (17:46 -0700)]
hwmon: (amc6821) Make reading and writing fan speed limits consistent

The default value of the maximum fan speed limit register is 0,
essentially translating to an unlimited fan speed. When reading
the limit, a value of 0 is reported in this case. However, writing
a value of 0 results in writing a value of 0xffff into the register,
which is inconsistent.

To solve the problem, permit writing a limit of 0 for the maximim fan
speed, effectively translating to "no limit". Write 0 into the register
if a limit value of 0 is written. Otherwise limit the range to
<1..6000000> and write 1..0xffff into the register. This ensures that
reading and writing from and to a limit register return the same value
while at the same time not changing reported values when reading the
speed or limits.

While at it, restrict fan limit writes to non-negative numbers; writing
a negative limit does not make sense and should be reported instead of
being corrected.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (amc6821) Stop accepting invalid pwm values
Guenter Roeck [Thu, 27 Jun 2024 00:21:54 +0000 (17:21 -0700)]
hwmon: (amc6821) Stop accepting invalid pwm values

The pwm value range is well defined from 0..255. Don't accept any values
outside this range.

This changes the valid range of pwm1_auto_point2_pwm from 0..254 to 0..255,
meaning it can now be equivalent to not only pwm1_auto_point1_pwm (which is
always 0) but also to pwm1_auto_point3_pwm (which is always 255). While
that may not be practical, there seems to be no technical reason for
preventing a user from doing it.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (w83627ehf) Fix underflows seen when writing limit attributes
Guenter Roeck [Sun, 7 Jul 2024 06:51:34 +0000 (23:51 -0700)]
hwmon: (w83627ehf) Fix underflows seen when writing limit attributes

DIV_ROUND_CLOSEST() after kstrtol() results in an underflow if a large
negative number such as -9223372036854775808 is provided by the user.
Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (nct6775-core) Fix underflows seen when writing limit attributes
Guenter Roeck [Sun, 7 Jul 2024 06:50:08 +0000 (23:50 -0700)]
hwmon: (nct6775-core) Fix underflows seen when writing limit attributes

DIV_ROUND_CLOSEST() after kstrtol() results in an underflow if a large
negative number such as -9223372036854775808 is provided by the user.
Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (lm95234) Fix underflows seen when writing limit attributes
Guenter Roeck [Sun, 7 Jul 2024 06:48:42 +0000 (23:48 -0700)]
hwmon: (lm95234) Fix underflows seen when writing limit attributes

DIV_ROUND_CLOSEST() after kstrtol() results in an underflow if a large
negative number such as -9223372036854775808 is provided by the user.
Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (adc128d818) Fix underflows seen when writing limit attributes
Guenter Roeck [Sun, 7 Jul 2024 06:43:04 +0000 (23:43 -0700)]
hwmon: (adc128d818) Fix underflows seen when writing limit attributes

DIV_ROUND_CLOSEST() after kstrtol() results in an underflow if a large
negative number such as -9223372036854775808 is provided by the user.
Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (gsc-hwmon) constify read-only struct regmap_bus
Javier Carrasco [Fri, 5 Jul 2024 18:27:28 +0000 (20:27 +0200)]
hwmon: (gsc-hwmon) constify read-only struct regmap_bus

`gsc_hwmon_regmap_bus` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240705-hwmon-const-regmap-v1-1-7cde543ba818@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (ltc2991) re-order conditions to fix off by one bug
Dan Carpenter [Thu, 4 Jul 2024 15:18:59 +0000 (10:18 -0500)]
hwmon: (ltc2991) re-order conditions to fix off by one bug

LTC2991_T_INT_CH_NR is 4.  The st->temp_en[] array has LTC2991_MAX_CHANNEL
(4) elements.  Thus if "channel" is equal to LTC2991_T_INT_CH_NR then we
have read one element beyond the end of the array.  Flip the conditions
around so that we check if "channel" is valid before using it as an array
index.

Fixes: 2b9ea4262ae9 ("hwmon: Add driver for ltc2991")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/Zoa9Y_UMY4_ROfhF@stanley.mountain
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: add MP5920 driver
Alex Vdovydchenko [Tue, 2 Jul 2024 11:52:51 +0000 (14:52 +0300)]
hwmon: add MP5920 driver

Add support for MPS Hot-Swap controller mp5920. This driver exposes
telemetry and limit value readings and writings.

Signed-off-by: Alex Vdovydchenko <xzeol@yahoo.com>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20240702115252.981416-3-xzeol@yahoo.com
[groeck: Use min_t() to limit length of displayed model string]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agodt-bindings: hwmon: Add MPS mp5920
Alex Vdovydchenko [Tue, 2 Jul 2024 11:52:50 +0000 (14:52 +0300)]
dt-bindings: hwmon: Add MPS mp5920

Add support for MPS mp5920 controller

Signed-off-by: Alex Vdovydchenko <xzeol@yahoo.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240702115252.981416-2-xzeol@yahoo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (tps23861) Constify struct regmap_config
Javier Carrasco [Tue, 2 Jul 2024 10:09:32 +0000 (12:09 +0200)]
hwmon: (tps23861) Constify struct regmap_config

`tps23861_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240702-hwmon-const-regmap-v1-3-63f6d4765fe0@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (tmp513) Constify struct regmap_config
Javier Carrasco [Tue, 2 Jul 2024 10:09:31 +0000 (12:09 +0200)]
hwmon: (tmp513) Constify struct regmap_config

`tmp51x_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240702-hwmon-const-regmap-v1-2-63f6d4765fe0@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (ina238) Constify struct regmap_config
Javier Carrasco [Tue, 2 Jul 2024 10:09:30 +0000 (12:09 +0200)]
hwmon: (ina238) Constify struct regmap_config

`ina238_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240702-hwmon-const-regmap-v1-1-63f6d4765fe0@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (adt7475) Fix default duty on fan is disabled
Wayne Tung [Mon, 1 Jul 2024 07:32:52 +0000 (15:32 +0800)]
hwmon: (adt7475) Fix default duty on fan is disabled

According to the comments on fan is disabled, we change to manual mode
and set the duty cycle to 0.
For setting the duty cycle part, the register is wrong. Fix it.

Fixes: 1c301fc5394f ("hwmon: Add a driver for the ADT7475 hardware monitoring chip")
Signed-off-by: Wayne Tung <chineweff@gmail.com>
Link: https://lore.kernel.org/r/20240701073252.317397-1-chineweff@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (jc42) Strengthen detect function
Guenter Roeck [Sun, 30 Jun 2024 20:08:40 +0000 (13:08 -0700)]
hwmon: (jc42)  Strengthen detect function

Configuration register bit 5 must read 0 for all JC42.4 compliant chips.
Several capability register bits must be set for all TSE2004 compliant
chips. Use that information to strengthen the detect function.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (jc42) Use common device ID for TSE2004av compliant sensors
Guenter Roeck [Sun, 30 Jun 2024 16:32:10 +0000 (09:32 -0700)]
hwmon: (jc42) Use common device ID for TSE2004av compliant sensors

TSE2004av standardizes the device ID of compliant temperature sensors to
be 0x22xx, where xx is the device revision. Use a single define for all
TSE2004av compliant temperature sensors, and relax the device id mask to
match the upper 8 bit of the device id register.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: (dell-smm) Add Dell OptiPlex 7060 to DMI table
Armin Wolf [Fri, 28 Jun 2024 21:47:23 +0000 (23:47 +0200)]
hwmon: (dell-smm) Add Dell OptiPlex 7060 to DMI table

The BIOS on this machine is buggy and will in some cases return
an error when trying to get the fan state, but reading of the
RPM values and the temperature sensors still works.

Closes: https://github.com/vitorafsr/i8kutils/issues/38
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Acked-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20240628214723.19665-1-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: add MP2891 driver
Noah Wang [Wed, 26 Jun 2024 09:46:01 +0000 (17:46 +0800)]
hwmon: add MP2891 driver

Add support for MPS VR controller mp2891. This driver exposes
telemetry and limit value readings and writtings.

Signed-off-by: Noah Wang <noahwang.wang@outlook.com>
Link: https://lore.kernel.org/r/SEYPR04MB64828A352836982C0184AA10FAD62@SEYPR04MB6482.apcprd04.prod.outlook.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agodt-bindings: hwmon: Add MPS mp2891
Noah Wang [Wed, 26 Jun 2024 09:46:00 +0000 (17:46 +0800)]
dt-bindings: hwmon: Add MPS mp2891

Add support for MPS mp2891 controller

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Noah Wang <noahwang.wang@outlook.com>
Link: https://lore.kernel.org/r/SEYPR04MB6482BC95D1242A5675FF9DAEFAD62@SEYPR04MB6482.apcprd04.prod.outlook.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
12 months agohwmon: iio: Use iio_read_channel_processed_scale for IIO_POWER
Sean Anderson [Thu, 20 Jun 2024 21:20:05 +0000 (17:20 -0400)]
hwmon: iio: Use iio_read_channel_processed_scale for IIO_POWER

Instead of rescaling power channels after the fact, use the dedicated
scaling API. This should reduce any inaccuracies resulting from the
scaling.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Link: https://lore.kernel.org/r/20240620212005.821805-1-sean.anderson@linux.dev
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (spd5118) Add support for Renesas/ITD SPD5118 hub controllers
Guenter Roeck [Fri, 14 Jun 2024 15:27:21 +0000 (08:27 -0700)]
hwmon: (spd5118) Add support for Renesas/ITD SPD5118 hub controllers

The SPD5118 specification says, in its documentation of the page bits
in the MR11 register:

"
This register only applies to non-volatile memory (1024) Bytes) access of
SPD5 Hub device.
For volatile memory access, this register must be programmed to '000'.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"

Renesas/ITD SPD5118 hub controllers take this literally and disable access
to volatile memory if the page selected in MR11 is != 0. Since the BIOS or
ROMMON will access the non-volatile memory and likely select a page != 0,
this means that the driver will not instantiate since it can not identify
the chip. Even if the driver instantiates, access to volatile registers
is blocked after a nvram read operation which selects a page other than 0.

To solve the problem, add initialization code to select page 0 during
probe. Before doing that, use basic validation to ensure that this is
really a SPD5118 device and not some random EEPROM.

Cc: Sasha Kozachuk <skozachuk@google.com>
Cc: John Hamrick <johnham@google.com>
Cc: Chris Sarra <chrissarra@google.com>
Tested-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (spd5118) Use regmap to implement paging
Guenter Roeck [Tue, 18 Jun 2024 17:08:54 +0000 (10:08 -0700)]
hwmon: (spd5118) Use regmap to implement paging

Using regmap for paging significantly improves caching since the regmap
cache no longer needs to be cleared after changing the page, so let's
use it.

Suggested-by: Armin Wolf <W_Armin@gmx.de>
Tested-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agodt-bindings: hwmon: ti,tmp108: document V+ supply, add short description
Stanislav Jakubek [Mon, 17 Jun 2024 16:36:29 +0000 (18:36 +0200)]
dt-bindings: hwmon: ti,tmp108: document V+ supply, add short description

TMP108 is powered by its V+ supply, document it. The property is called
"vcc-supply" since the plus sign (+) is not an expected character.
While at it, add a short description with a link to its datasheets.

Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/ZnBmDXfnDQXNXz3k@standask-GA-A55M-S2HP
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (max6639) : Add additional hwmon attributes for fan and pwm
Naresh Solanki [Fri, 14 Jun 2024 05:55:31 +0000 (11:25 +0530)]
hwmon: (max6639) : Add additional hwmon attributes for fan and pwm

Add additional attributes for fan & pwm i.e.,
fanY_pulses
pwmY_freq

Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
Link: https://lore.kernel.org/r/20240614055533.2735210-2-naresh.solanki@9elements.com
[groeck: Fix value range for fanX_pulses]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (max6639) : Update hwmon init using info structure
Naresh Solanki [Fri, 14 Jun 2024 05:55:30 +0000 (11:25 +0530)]
hwmon: (max6639) : Update hwmon init using info structure

Update hwmon init with info instead of group. The hwmon info structure
in more flexible to describe sensor attribute & easy to maintian.

Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
Link: https://lore.kernel.org/r/20240614055533.2735210-1-naresh.solanki@9elements.com
[groeck: Replace clamp_val() with range check when writing pwmX_input]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (core) Make hwmon_class const
Thomas Weißschuh [Thu, 13 Jun 2024 23:01:42 +0000 (01:01 +0200)]
hwmon: (core) Make hwmon_class const

Now that the driver core allows for struct class to be in read-only
memory, mark hwmon_class as const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20240614-class-const-hwmon-v1-1-27b910d06a90@weissschuh.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: add MP9941 driver
Noah Wang [Tue, 11 Jun 2024 10:14:17 +0000 (18:14 +0800)]
hwmon: add MP9941 driver

Add support for MPS step-down converter mp9941. This driver exposes
telemetry and limit value readings and writtings.

Signed-off-by: Noah Wang <noahwang.wang@outlook.com>
Link: https://lore.kernel.org/r/SEYPR04MB648294005D55F70736B519F6FAC72@SEYPR04MB6482.apcprd04.prod.outlook.com
[groeck: Include bitfield.h (for FIELD_PREP) and bits.h (for GENMASK)]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agodt-bindings: hwmon: Add MPS mp9941
Noah Wang [Tue, 11 Jun 2024 10:14:16 +0000 (18:14 +0800)]
dt-bindings: hwmon: Add MPS mp9941

Add support for MPS mp9941 controller

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Noah Wang <noahwang.wang@outlook.com>
Link: https://lore.kernel.org/r/SEYPR04MB6482612BBD0421F5428092AEFAC72@SEYPR04MB6482.apcprd04.prod.outlook.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: add MP2993 driver
Noah Wang [Tue, 11 Jun 2024 10:14:15 +0000 (18:14 +0800)]
hwmon: add MP2993 driver

Add support for MPS VR controller mp2993. This driver exposes
telemetry and limits value readings and writtings.

Signed-off-by: Noah Wang <noahwang.wang@outlook.com>
Link: https://lore.kernel.org/r/SEYPR04MB648203DC017A514837DB1204FAC72@SEYPR04MB6482.apcprd04.prod.outlook.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agodt-bindings: hwmon: Add MPS mp2993
Noah Wang [Tue, 11 Jun 2024 10:14:14 +0000 (18:14 +0800)]
dt-bindings: hwmon: Add MPS mp2993

Add support for MPS mp2993 controller

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Noah Wang <noahwang.wang@outlook.com>
Link: https://lore.kernel.org/r/SEYPR04MB6482EE5CA0C9A3F14863B999FAC72@SEYPR04MB6482.apcprd04.prod.outlook.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (ina2xx) Add device tree support to pass alert polarity
Amna Waseem [Tue, 11 Jun 2024 09:36:26 +0000 (11:36 +0200)]
hwmon: (ina2xx) Add device tree support to pass alert polarity

The INA230 has an Alert pin which is asserted when the alert
function selected in the Mask/Enable register exceeds the
value programmed into the Alert Limit register. Assertion is based
on the Alert Polarity Bit (APOL, bit 1 of the Mask/Enable register).
It is default set to value 0 i.e Normal (active-low open collector).
However, hardware can be designed in such a way that expects Alert pin
to become active high if a user-defined threshold in Alert limit
register has been exceeded. This patch adds a way to pass alert polarity
value to the driver via device tree.

Signed-off-by: Amna Waseem <Amna.Waseem@axis.com>
Link: https://lore.kernel.org/r/20240611-apol-ina2xx-fix-v4-2-8df1d2282fc5@axis.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agodt-bindings: hwmon: ti,ina2xx: Add ti,alert-polarity-active-high property
Amna Waseem [Mon, 3 Jun 2024 10:08:34 +0000 (12:08 +0200)]
dt-bindings: hwmon: ti,ina2xx: Add ti,alert-polarity-active-high property

Add a property to the binding to configure the Alert Polarity.
Alert pin is asserted based on the value of Alert Polarity bit of
Mask/Enable register. It is by default 0 which means Alert pin is
configured to be active low open collector. Value of 1 maps to
Inverted (active high open collector).

Signed-off-by: Amna Waseem <Amna.Waseem@axis.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240603-apol-ina2xx-fix-v3-1-b9eff3158e4e@axis.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (pmbus/lm25066) Let enum chips start with index 0
Guenter Roeck [Thu, 6 Jun 2024 16:16:40 +0000 (09:16 -0700)]
hwmon: (pmbus/lm25066) Let enum chips start with index 0

Commit ac0c26bae662 ("hwmon: (lm25066) Use i2c_get_match_data()") changed
enum chips to start with 1 instead of 0, under the assumption that
the data pointer in of_device_id must not start with 0 (NULL) if
i2c_get_match_data() is used. However, that is perfectly fine as long as
there is also an i2c_device_id array with the same data which is used
as fallback in that case.

Let enum chips start with 0 to avoid confusion against other drivers
where the enum starts with 0 and i2c_get_match_data() is used as well.

Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (nct6775) Let enum kinds start with index 0
Guenter Roeck [Thu, 6 Jun 2024 16:23:44 +0000 (09:23 -0700)]
hwmon: (nct6775) Let enum kinds start with index 0

Commit 10a0575ea09d ("hwmon: (nct6775-i2c) Use i2c_get_match_data()")
introduced calling i2c_get_match_data() to the nct6775 driver. As part
of that commit, enum kinds was changed to start with 1, based on

    Adjust the 'kinds' enum to not use 0, so that no match data can be
    distinguished from a valid enum value.

The patch had to be fixed later with commit 2792fc8f8c83 ("hwmon:
(nct6775-core) Explicitly initialize nct6775_device_names indexes") and
commit efe86092ab31 ("hwmon: (nct6775-platform) Explicitly initialize
nct6775_sio_names indexes").

Various patches submitted later show that the change from 0 to 1 is
not really necessary. As it turns out, it is perfectly fine as long as
there is an i2c_device_id array with the same data as in the of_device_id
array. This data is used as fallback if the data pointer in struct
of_device_id is NULL (0).

Let enum chips start with 0 to avoid confusion against other drivers
where the enum starts with 0 and i2c_get_match_data() is used as well.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (pmbus/mp2856) Let enum chips start with index 0
Guenter Roeck [Thu, 6 Jun 2024 16:36:38 +0000 (09:36 -0700)]
hwmon: (pmbus/mp2856) Let enum chips start with index 0

Earlier it was assumed that the data pointer in of_device_id must not start
with 0 (NULL) if i2c_get_match_data() is used. However, it turns out that
this is perfectly fine as long as there is also an i2c_device_id array with
the same data, which is used as fallback in that case.

Let enum chips start with 0 to avoid confusion against other drivers
where the enum starts with 0 and i2c_get_match_data() is used as well.

While doing that, remove chip_id from struct mp2856_data since it is only
used in the probe function, and typecast the result of i2c_get_match_data()
to kernel_ulong_t to avoid the double typecast.

Cc: Peter Yin <peteryin.openbmc@gmail.com>
Cc: Potin Lai <potin.lai.pt@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (pmbus/max31827) Explain why enum chips must not start with 0
Guenter Roeck [Fri, 7 Jun 2024 13:32:04 +0000 (06:32 -0700)]
hwmon: (pmbus/max31827) Explain why enum chips must not start with 0

If a driver calls device_get_match_data(), the .data pointer in its id
data structures must not be NULL/0 because device_get_match_data()
returns NULL if an entry is not found. Explain that in a comment to avoid
confusion why this is required in this driver but not in other drivers.

Cc: Daniel Matyas <daniel.matyas@analog.com>
Acked-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (asus-ec-sensors) add ProArt X670E-CREATOR WIFI
Eugene Shalygin [Sat, 8 Jun 2024 08:50:05 +0000 (10:50 +0200)]
hwmon: (asus-ec-sensors) add ProArt X670E-CREATOR WIFI

Provided and tested by a user in a GitHub PR [1].

[1] https://github.com/zeule/asus-ec-sensors/pull/56

Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20240608085146.572777-2-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (spd5118) Add configuration option for auto-detection
Guenter Roeck [Mon, 3 Jun 2024 05:31:52 +0000 (22:31 -0700)]
hwmon: (spd5118) Add configuration option for auto-detection

With SPD5118 chip detection for the most part handled by the i2c-smbus
core using DMI information, the spd5118 driver no longer needs to
auto-detect spd5118 compliant chips.

Auto-detection by the driver is still needed on systems with no DMI support
or on systems with more than eight DIMMs and can not be removed entirely.
However, it affects boot time and introduces the risk of mis-identifying
chips. Add configuration option to be able to disable it on systems where
chip detection is handled outside the driver.

Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agoi2c: smbus: Support DDR5 and LPDDR5 SPD EEPROMs
Guenter Roeck [Sat, 1 Jun 2024 13:44:47 +0000 (06:44 -0700)]
i2c: smbus: Support DDR5 and LPDDR5 SPD EEPROMs

Detect (LP)DDR5 memory and instantiate the SPD5118 driver automatically.

Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (spd5118) Add support for reading SPD data
Guenter Roeck [Fri, 31 May 2024 16:55:37 +0000 (09:55 -0700)]
hwmon: (spd5118) Add support for reading SPD data

Add support for reading SPD NVMEM data from SPD5118 (Jedec JESD300)
compliant memory modules. NVMEM write operation is not supported.

NVMEM support is optional. If CONFIG_NVMEM is disabled, the driver will
still instantiate but not provide NVMEM attribute files.

Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (spd5118) Add suspend/resume support
Guenter Roeck [Thu, 30 May 2024 18:44:11 +0000 (11:44 -0700)]
hwmon: (spd5118) Add suspend/resume support

Add suspend/resume support to ensure that limit and configuration
registers are updated and synchronized after a suspend/resume cycle.

Cc: Armin Wolf <W_Armin@gmx.de>
Cc: Stephen Horvath <s.horvath@outlook.com.au>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Stephen Horvath <s.horvath@outlook.com.au>
Tested-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: Add support for SPD5118 compliant temperature sensors
Guenter Roeck [Mon, 27 May 2024 17:49:10 +0000 (10:49 -0700)]
hwmon: Add support for SPD5118 compliant temperature sensors

Add support for SPD5118 (Jedec JESD300) compliant temperature
sensors. Such sensors are typically found on DDR5 memory modules.

Cc: René Rebe <rene@exactcode.de>
Cc: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Stephen Horvath <s.horvath@outlook.com.au>
Tested-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agodt-bindings: trivial-devices: Add jedec,spd5118
Guenter Roeck [Mon, 8 May 2023 17:35:31 +0000 (20:35 +0300)]
dt-bindings: trivial-devices: Add jedec,spd5118

Add bindings for the SPD hub present in DDR5 modules.
(https://www.jedec.org/standards-documents/docs/jesd300-5b01).

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: add missing MODULE_DESCRIPTION() macros
Jeff Johnson [Fri, 7 Jun 2024 22:27:59 +0000 (15:27 -0700)]
hwmon: add missing MODULE_DESCRIPTION() macros

make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hwmon/asus_atk0110.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hwmon/corsair-cpro.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hwmon/mr75203.o

Add all missing invocations of the MODULE_DESCRIPTION() macro.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://lore.kernel.org/r/20240607-md-drivers-hwmon-v1-1-1ea6d6fe61e3@quicinc.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (gsc-hwmon) use device_for_each_child_node_scoped()
Javier Carrasco [Thu, 4 Apr 2024 11:13:28 +0000 (13:13 +0200)]
hwmon: (gsc-hwmon) use device_for_each_child_node_scoped()

Switch to the _scoped() version introduced in commit 365130fd47af
("device property: Introduce device_for_each_child_node_scoped()")
to remove the need for manual calling of fwnode_handle_put() in the
paths where the code exits the loop early.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240404-hwmon_device_for_each_child_node_scoped-v1-2-53997abde43c@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (ltc2991) use device_for_each_child_node_scoped()
Javier Carrasco [Thu, 4 Apr 2024 11:13:27 +0000 (13:13 +0200)]
hwmon: (ltc2991) use device_for_each_child_node_scoped()

Switch to the _scoped() version introduced in commit 365130fd47af
("device property: Introduce device_for_each_child_node_scoped()")
to remove the need for manual calling of fwnode_handle_put() in the
paths where the code exits the loop early.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240404-hwmon_device_for_each_child_node_scoped-v1-1-53997abde43c@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (w83795): Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:33 +0000 (15:36 -0500)]
hwmon: (w83795): Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-32-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (w83781d) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:32 +0000 (15:36 -0500)]
hwmon: (w83781d) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-31-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (tmp464) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:31 +0000 (15:36 -0500)]
hwmon: (tmp464) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-30-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (tmp421) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:30 +0000 (15:36 -0500)]
hwmon: (tmp421) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-29-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (tmp401) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:29 +0000 (15:36 -0500)]
hwmon: (tmp401) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-28-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (thmc50) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:28 +0000 (15:36 -0500)]
hwmon: (thmc50) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-27-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (shtc1) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:27 +0000 (15:36 -0500)]
hwmon: (shtc1) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-26-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (sht3x) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:26 +0000 (15:36 -0500)]
hwmon: (sht3x) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-25-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (powr1220) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:25 +0000 (15:36 -0500)]
hwmon: (powr1220) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-24-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (mcp3021) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:24 +0000 (15:36 -0500)]
hwmon: (mcp3021) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-23-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (max6697) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:23 +0000 (15:36 -0500)]
hwmon: (max6697) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-22-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (max1668) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:22 +0000 (15:36 -0500)]
hwmon: (max1668) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-21-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (max16065) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:21 +0000 (15:36 -0500)]
hwmon: (max16065) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-20-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (lm95234) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:20 +0000 (15:36 -0500)]
hwmon: (lm95234) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-19-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (lm90) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:19 +0000 (15:36 -0500)]
hwmon: (lm90) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-18-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (lm85) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:18 +0000 (15:36 -0500)]
hwmon: (lm85) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-17-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (lm83) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:17 +0000 (15:36 -0500)]
hwmon: (lm83) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-16-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (lm78) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:16 +0000 (15:36 -0500)]
hwmon: (lm78) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-15-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (lm75) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:15 +0000 (15:36 -0500)]
hwmon: (lm75) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-14-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (lm63) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:14 +0000 (15:36 -0500)]
hwmon: (lm63) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-13-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (ina2xx) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:13 +0000 (15:36 -0500)]
hwmon: (ina2xx) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-12-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (fschmd) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:12 +0000 (15:36 -0500)]
hwmon: (fschmd) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-11-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (f75375s) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:11 +0000 (15:36 -0500)]
hwmon: (f75375s) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-10-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (ds1621) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:10 +0000 (15:36 -0500)]
hwmon: (ds1621) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-9-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (dme1737) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:09 +0000 (15:36 -0500)]
hwmon: (dme1737) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-8-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (aht10) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:08 +0000 (15:36 -0500)]
hwmon: (aht10) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-7-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (adt7475) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:07 +0000 (15:36 -0500)]
hwmon: (adt7475) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-6-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (ads7828) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:06 +0000 (15:36 -0500)]
hwmon: (ads7828) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-5-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (adm1031) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:05 +0000 (15:36 -0500)]
hwmon: (adm1031) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-4-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (adm1021) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:04 +0000 (15:36 -0500)]
hwmon: (adm1021) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-3-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (ad7418) Remove use of i2c_match_id()
Andrew Davis [Wed, 3 Apr 2024 20:36:03 +0000 (15:36 -0500)]
hwmon: (ad7418) Remove use of i2c_match_id()

The function i2c_match_id() is used to fetch the matching ID from
the i2c_device_id table. This is often used to then retrieve the
matching driver_data. This can be done in one step with the helper
i2c_get_match_data().

This helper has a couple other benefits:
 * It doesn't need the i2c_device_id passed in so we do not need
   to have that forward declared, allowing us to remove those or
   move the i2c_device_id table down to its more natural spot
   with the other module info.
 * It also checks for device match data, which allows for OF and
   ACPI based probing. That means we do not have to manually check
   those first and can remove those checks.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240403203633.914389-2-afd@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: lm70: simplify with spi_get_device_match_data()
Krzysztof Kozlowski [Thu, 6 Jun 2024 14:25:15 +0000 (16:25 +0200)]
hwmon: lm70: simplify with spi_get_device_match_data()

Use spi_get_device_match_data() helper to simplify a bit the driver.
Also kernel_ulong_t type is preferred for kernel code over uintptr_t
(needed for the cast).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240606142515.132504-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: g672: add support for g761
Christian Marangi [Tue, 4 Jun 2024 16:43:43 +0000 (18:43 +0200)]
hwmon: g672: add support for g761

Add support for g761 PWM Fan Controller.

The g761 is a copy of the g763 with the only difference of supporting
and internal clock. The internal clock is used if no clocks property is
defined in device node and in such case the required bit is enabled and
clock handling is skipped.

The internal clock oscillator runs at 31KHz.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://lore.kernel.org/r/20240604164348.542-3-ansuelsmth@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agodt-bindings: hwmon: g76x: Add support for g761
Christian Marangi [Tue, 4 Jun 2024 16:43:42 +0000 (18:43 +0200)]
dt-bindings: hwmon: g76x: Add support for g761

Add support for g761 PWM Fan controller. This is an exact copy of g763
with the difference that it does also support an internal clock
oscillator.

With clocks property not defined, the internal clock oscillator is used.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240604164348.542-2-ansuelsmth@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agodt-bindings: hwmon: g762: Convert to yaml schema
Christian Marangi [Tue, 4 Jun 2024 16:43:41 +0000 (18:43 +0200)]
dt-bindings: hwmon: g762: Convert to yaml schema

Convert g762 Documentation to yaml schema and port all the custom
properties and info.

Add the vendor prefix to name to follow naming standard.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240604164348.542-1-ansuelsmth@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (max31827) Add PEC support
Radu Sabau [Fri, 31 May 2024 08:46:44 +0000 (11:46 +0300)]
hwmon: (max31827) Add PEC support

Add PEC support using the hwmon core infrastructure.

Signed-off-by: Radu Sabau <radu.sabau@analog.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240531084645.12935-2-radu.sabau@analog.com
[groeck: Adjusted subject; simplified description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (lm90) Convert to use PEC support from hwmon core
Guenter Roeck [Tue, 28 May 2024 20:42:42 +0000 (13:42 -0700)]
hwmon: (lm90) Convert to use PEC support from hwmon core

Replace driver specific PEC handling code with hardware monitoring core
functionality.

Cc: Radu Sabau <radu.sabau@analog.com>
Acked-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: Add PEC attribute support to hardware monitoring core
Guenter Roeck [Tue, 28 May 2024 20:33:29 +0000 (13:33 -0700)]
hwmon: Add PEC attribute support to hardware monitoring core

Several hardware monitoring chips optionally support Packet Error Checking
(PEC). For some chips, PEC support can be enabled simply by setting
I2C_CLIENT_PEC in the i2c client data structure. Others require chip
specific code to enable or disable PEC support.

Introduce hwmon_chip_pec and HWMON_C_PEC to simplify adding configurable
PEC support for hardware monitoring drivers. A driver can set HWMON_C_PEC
in its chip information data to indicate PEC support. If a chip requires
chip specific code to enable or disable PEC support, the driver only needs
to implement support for the hwmon_chip_pec attribute to its write
function.

Packet Error Checking is only supported for SMBus devices. HWMON_C_PEC
must therefore only be set by a driver if the parent device is an I2C
device. Attempts to set HWMON_C_PEC on any other device type is not
supported and rejected.

The code calls i2c_check_functionality() to check if PEC is supported
by the I2C/SMBus controller. This function is only available if CONFIG_I2C
is enabled and reachable. For this reason, the added code needs to depend
on reachability of CONFIG_I2C.

Cc: Radu Sabau <radu.sabau@analog.com>
Acked-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (nzxt-smart2) Add support for another version of NZXT RGB & Fan Controller
Aleksandr Mezin [Fri, 24 May 2024 00:39:58 +0000 (03:39 +0300)]
hwmon: (nzxt-smart2) Add support for another version of NZXT RGB & Fan Controller

Add support for NZXT RGB & Fan Controller with USB ID 1e71:2020.

Fan speed control reported to be working with existing userspace (hidraw)
software, so it should be compatible. Fan channel count is the same.
No known differences from already supported devices, at least regarding
fan speed control and initialization.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
Link: https://lore.kernel.org/r/20240524004040.121044-1-mezin.alexander@gmail.com
[groeck: Adjusted subject and description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: corsair-psu: add USB id of HX1200i Series 2023 psu
Wilken Gottwalt [Fri, 24 May 2024 04:38:11 +0000 (04:38 +0000)]
hwmon: corsair-psu: add USB id of HX1200i Series 2023 psu

Add the usb id of the HX1200i Series 2023. Update the documentation
accordingly. Also fix the version comments, there are no Series 2022
products. That are legacy or first version products going back many
many years.

Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net>
Link: https://lore.kernel.org/r/ZlAZs4u0dU7JxtDf@monster.localdomain
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agodt-bindings: hwmon: Add max6639
Naresh Solanki [Tue, 28 May 2024 12:51:21 +0000 (18:21 +0530)]
dt-bindings: hwmon: Add max6639

Add Devicetree binding documentation for Maxim MAX6639 temperature
monitor with PWM fan-speed controller.

Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240528125122.1129986-1-naresh.solanki@9elements.com
[groeck: Dropped unnecessary '|' after description:]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (nct6683) Display warning when enabling driver for unknown customer
Guenter Roeck [Fri, 24 May 2024 22:38:16 +0000 (15:38 -0700)]
hwmon: (nct6683) Display warning when enabling driver for unknown customer

Enabling the driver for devices with unknown customer ID is at least
somewhat risky, so add a warning to the kernel log.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agohwmon: (corsair-cpro) Add firmware and bootloader information
Marius Zachmann [Mon, 13 May 2024 19:47:34 +0000 (21:47 +0200)]
hwmon: (corsair-cpro) Add firmware and bootloader information

Add support for reporting firmware and bootloader version using debugfs.
Update documentation accordingly.

Signed-off-by: Marius Zachmann <mail@mariuszachmann.de>
Link: https://lore.kernel.org/r/20240513194734.43040-2-mail@mariuszachmann.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
13 months agoLinux 6.10-rc1
Linus Torvalds [Sun, 26 May 2024 22:20:12 +0000 (15:20 -0700)]
Linux 6.10-rc1

13 months agomm: percpu: Include smp.h in alloc_tag.h
Kent Overstreet [Fri, 24 May 2024 15:42:09 +0000 (11:42 -0400)]
mm: percpu: Include smp.h in alloc_tag.h

percpu.h depends on smp.h, but doesn't include it directly because of
circular header dependency issues; percpu.h is needed in a bunch of low
level headers.

This fixes a randconfig build error on mips:

  include/linux/alloc_tag.h: In function '__alloc_tag_ref_set':
  include/asm-generic/percpu.h:31:40: error: implicit declaration of function 'raw_smp_processor_id' [-Werror=implicit-function-declaration]

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 24e44cc22aa3 ("mm: percpu: enable per-cpu allocation tagging")
Closes: https://lore.kernel.org/oe-kbuild-all/202405210052.DIrMXJNz-lkp@intel.com/
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>