- 14 Jul, 2024 3 commits
-
-
Guenter Roeck authored
The critical alarm bit for the local temperature sensor (temp1) is in bit 7 of register 0x45 (not bit 6), and the critical alarm bit for remote temperature sensor 7 (temp8) is in bit 6 (not bit 7). This only affects MAX6581 since all other chips supported by this driver do not support those critical alarms. Fixes: 5372d2d7 ("hwmon: Driver for Maxim MAX6697 and compatibles") Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
Using DIV_ROUND_CLOSEST() on an unbound value can result in underflows. Indeed, module test scripts report: temp1_max: Suspected underflow: [min=0, read 255000, written -9223372036854775808] temp1_crit: Suspected underflow: [min=0, read 255000, written -9223372036854775808] Fix by introducing an extra set of clamping. Fixes: 5372d2d7 ("hwmon: Driver for Maxim MAX6697 and compatibles") Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
ADM1021, MAX6642, and compatible chips are supported by the lm90 driver. Remove the obsolete stand-alone drivers to reduce maintenance overhead. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 10 Jul, 2024 1 commit
-
-
Uwe Kleine-König authored
The driver doesn't make use of the different numbers assigned to the different devices. So drop them. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://lore.kernel.org/r/9a48ba0368e0c8cddc94c5e4cf3edd7eadc03a2d.1720600141.git.u.kleine-koenig@baylibre.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 09 Jul, 2024 1 commit
-
-
Guenter Roeck authored
Adding support for G761 included adding support for an internal clock. Enabling the internal clock requires setting a bit in the FAN_CMD2 register. This is implemented in g762_fan_init(). However, g762_fan_init() is called before clock support is selected, and the flag indicating that the internal clock should be used is not yet set. Initialize the clock before initializing the fan to solve the problem. While at it, also add "g7621" to the i2c_device_id array. Cc: Christian Marangi <ansuelsmth@gmail.com> Fixes: 6ce40232 ("hwmon: g672: add support for g761") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 08 Jul, 2024 11 commits
-
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
- 07 Jul, 2024 4 commits
-
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
- 05 Jul, 2024 2 commits
-
-
Javier Carrasco authored
`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.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Dan Carpenter authored
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: 2b9ea426 ("hwmon: Add driver for ltc2991") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/Zoa9Y_UMY4_ROfhF@stanley.mountainSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 02 Jul, 2024 5 commits
-
-
Alex Vdovydchenko authored
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>
-
Alex Vdovydchenko authored
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.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Javier Carrasco authored
`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.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Javier Carrasco authored
`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.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Javier Carrasco authored
`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.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 01 Jul, 2024 1 commit
-
-
Wayne Tung authored
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: 1c301fc5 ("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.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 30 Jun, 2024 3 commits
-
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
Armin Wolf authored
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/38Signed-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.deSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 28 Jun, 2024 2 commits
-
-
Noah Wang authored
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.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Noah Wang authored
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.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 21 Jun, 2024 1 commit
-
-
Sean Anderson authored
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.devSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 19 Jun, 2024 2 commits
-
-
Guenter Roeck authored
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>
-
Guenter Roeck authored
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>
-
- 18 Jun, 2024 1 commit
-
-
Stanislav Jakubek authored
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-S2HPSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 14 Jun, 2024 2 commits
-
-
Naresh Solanki authored
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>
-
Naresh Solanki authored
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 Jun, 2024 1 commit
-
-
Thomas Weißschuh authored
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.netSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-