- Dec 13, 2021
-
-
Guenter Roeck authored
Bit 7 of the status register indicates that the chip is busy doing a conversion. It does not indicate an alarm status. Stop reporting it as alarm status bit. Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
Tests with a real chip and a closer look into the datasheet reveals that the local and remote critical alarm status bits are swapped for MAX6680/MAX6681. Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
Tests with a real chip and a closer look into the datasheet show that MAX6654 does not support CRIT/THERM/OVERTEMP limits, so drop support of the respective attributes for this chip. Introduce LM90_HAVE_CRIT flag and use it to instantiate critical limit attributes to solve the problem. Cc: Josh Lehan <krellan@google.com> Fixes: 229d495d ("hwmon: (lm90) Add max6654 support to lm90 driver") Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
Commit b50aa496 ("hwmon: (lm90) Prevent integer underflows of temperature calculations") addressed a number of underflow situations when writing temperature limits. However, it missed one situation, seen when an attempt is made to set the hysteresis value to MAX_LONG and the critical temperature limit is negative. Use clamp_val() when setting the hysteresis temperature to ensure that the provided value can never overflow or underflow. Fixes: b50aa496 ("hwmon: (lm90) Prevent integer underflows of temperature calculations") Cc: Dmitry Osipenko <digetx@gmail.com> Reviewed-by:
Dmitry Osipenko <digetx@gmail.com> Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
The detect function had a comment "Make compiler happy" when id did not read the second configuration register. As it turns out, the code was checking the contents of this register for manufacturer ID 0xA1 (NXP Semiconductor/Philips), but never actually read the register. So it wasn't surprising that the compiler complained, and it indeed had a point. Fix the code to read the register contents for manufacturer ID 0xa1. At the same time, the code was reading the register for manufacturer ID 0x41 (Analog Devices), but it was not using the results. In effect it was just checking if reading the register returned an error. That doesn't really add much if any value, so stop doing that. Fixes: f90be42f ("hwmon: (lm90) Refactor reading of config2 register") Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Nov 30, 2021
-
-
Billy Tsai authored
Before commit 86585c61 ("hwmon: (pwm-fan) stop using legacy PWM functions and some cleanups") pwm_apply_state() was called unconditionally in pwm_fan_probe(). In this commit this direct call was replaced by a call to __set_pwm(ct, MAX_PWM) which however is a noop if ctx->pwm_value already matches the value to set. After probe the fan is supposed to run at full speed, and the internal driver state suggests it does, but this isn't asserted and depending on bootloader and pwm low-level driver, the fan might just be off. So drop setting pwm_value to MAX_PWM to ensure the check in __set_pwm doesn't make it exit early and the fan goes on as intended. Cc: stable@vger.kernel.org Fixes: 86585c61 ("hwmon: (pwm-fan) stop using legacy PWM functions and some cleanups") Signed-off-by:
Billy Tsai <billy_tsai@aspeedtech.com> Reviewed-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20211130092212.17783-1-billy_tsai@aspeedtech.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Nov 20, 2021
-
-
David Mosberger-Tang authored
Per datasheet, SHT4x may need up to 8.2ms for a "high repeatability" measurement to complete. Attempting to read the result too early triggers a NAK which then causes an EREMOTEIO error. This behavior has been confirmed with a logic analyzer while running the I2C bus at only 40kHz. The low frequency precludes any signal-integrity issues, which was also confirmed by the absence of any CRC8 errors. In this configuration, a NAK occurred on any read that followed the measurement command within less than 8.2ms. Signed-off-by:
David Mosberger-Tang <davidm@egauge.net> Link: https://lore.kernel.org/r/20211120212849.2300854-2-davidm@egauge.net Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Nov 15, 2021
-
-
Zev Weiss authored
The first call to nct6775_asuswmi_read() in nct6775_wmi_read_value() had been passing the full bank+register number instead of just the lower 8 bits. It didn't end up actually causing problems because the second argument of that function is a u8 anyway, but it seems preferable to be explicit about it at the call site (and consistent with the rest of the code). Signed-off-by:
Zev Weiss <zev@bewilderbeest.net> Fixes: 3fbbfc27 ("hwmon: (nct6775) Support access via Asus WMI") Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20211111025339.27520-1-zev@bewilderbeest.net Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Armin Wolf authored
The removal function is called regardless of whether /proc/i8k was created successfully or not, the later causing a WARN() on module removal. Fix that by only registering the removal function if /proc/i8k was created successfully. Tested on a Inspiron 3505. Fixes: 039ae585 ("hwmon: Allow to compile dell-smm-hwmon driver without /proc/i8k") Signed-off-by:
Armin Wolf <W_Armin@gmx.de> Acked-by:
Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/20211112171440.59006-1-W_Armin@gmx.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Wilken Gottwalt authored
sparse warnings: (new ones prefixed by >>) >> drivers/hwmon/corsair-psu.c:536:82: sparse: sparse: Using plain integer as NULL pointer Fixes: d115b51e ("hwmon: add Corsair PSU HID controller driver") Reported-by:
kernel test robot <lkp@intel.com> Signed-off-by:
Wilken Gottwalt <wilken.gottwalt@posteo.net> Link: https://lore.kernel.org/r/YY9hAL8MZEQYLYPf@monster.localdomain Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Nov 06, 2021
-
-
Matthew Wilcox (Oracle) authored
Not all files in the kernel should include mm.h. Migrating callers from kmalloc to kvmalloc is easier if the kvmalloc functions are in slab.h. [akpm@linux-foundation.org: move the new kvrealloc() also] [akpm@linux-foundation.org: drivers/hwmon/occ/p9_sbe.c needs slab.h] Link: https://lkml.kernel.org/r/20210622215757.3525604-1-willy@infradead.org Signed-off-by:
Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by:
Pekka Enberg <penberg@kernel.org> Cc: Christoph Lameter <cl@linux.com> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Oct 30, 2021
-
-
Sudeep Holla authored
Now that we have all the shared memory region information populated in the pcc_mbox_chan, let us propagate the pointer to the same as the return value to pcc_mbox_request channel. This eliminates the need for the individual users of PCC mailbox to parse the PCCT subspace entries and fetch the shmem information. This also eliminates the need for PCC mailbox controller to set con_priv to PCCT subspace entries. This is required as con_priv is private to the controller driver to attach private data associated with the channel and not meant to be used by the mailbox client/users. Let us convert all the users of pcc_mbox_{request,free}_channel to use new interface. Cc: Jean Delvare <jdelvare@suse.com> Signed-off-by:
Sudeep Holla <sudeep.holla@arm.com> Acked-by:
Wolfram Sang <wsa@kernel.org> Acked-by:
Guenter Roeck <linux@roeck-us.net> Signed-off-by:
Jassi Brar <jaswinder.singh@linaro.org>
-
- Oct 29, 2021
-
-
Wan Jiabing authored
Fix following coccicheck warning: ./drivers/hwmon/nct7802.c:1152:2-24: WARNING: Function for_each_child_of_node should have of_node_put() before return. Early exits from for_each_child_of_node should decrement the node reference counter. Signed-off-by:
Wan Jiabing <wanjiabing@vivo.com> Link: https://lore.kernel.org/r/20211029024918.5161-1-wanjiabing@vivo.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Oct 28, 2021
-
-
Guenter Roeck authored
TMP461 is almost identical to TMP451, which is already supported by the lm90 driver. At the same time, unlike other sensors from the TMP401 compatible series, it only supports 8-bit temperature read operations, and it supports negative temperatures when configured for its default temperature range, and it supports a temperature offset register. Supporting this chip in the tmp401 driver adds unnecessary complexity. Remove its support from this driver and support the chip with the lm90 driver instead. Fixes: 24333ac2 ("hwmon: (tmp401) use smb word operations instead of 2 smb byte operations") Reported-by:
David T. Wilson <david.wilson@nasa.gov> Cc: David T. Wilson <david.wilson@nasa.gov> Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
TMP461 is almost identical to TMP451 and was actually detected as TMP451 with the existing lm90 driver if its I2C address is 0x4c. Add support for it to the lm90 driver. At the same time, improve the chip detection function to at least try to distinguish between TMP451 and TMP461. As a side effect, this fixes commit 24333ac2 ("hwmon: (tmp401) use smb word operations instead of 2 smb byte operations"). TMP461 does not support word operations on temperature registers, which causes bad temperature readings with the tmp401 driver. The lm90 driver does not perform word operations on temperature registers and thus does not have this problem. Support is listed as basic because TMP461 supports a sensor resolution of 0.0625 degrees C, while the lm90 driver assumes a resolution of 0.125 degrees C. Also, the TMP461 supports negative temperatures with its default temperature range, which is not the case for similar chips supported by the lm90 and the tmp401 drivers. Those limitations will be addressed with follow-up patches. Fixes: 24333ac2 ("hwmon: (tmp401) use smb word operations instead of 2 smb byte operations") Reported-by:
David T. Wilson <david.wilson@nasa.gov> Cc: David T. Wilson <david.wilson@nasa.gov> Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
A flag indicating extended temperature support makes it easier to add support for additional chips with this functionality. Cc: David T. Wilson <david.wilson@nasa.gov> Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Oct 27, 2021
-
-
Denis Pauk authored
ASUS ProArt X570-CREATOR WIFI board has got an nct6775 chip, but by default there's no use of it because of resource conflict with WMI method. This commit adds ProArt X570-CREATOR WIFI to the list of boards that can be monitored using ASUS WMI. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by:
Denis Pauk <pauk.denis@gmail.com> Tested-by:
Joel Wirāmu Pauling <jwp@redhat.com> Link: https://lore.kernel.org/r/20211025194748.6784-1-pauk.denis@gmail.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Oskar Senft authored
This change allows LTD and RTD inputs to be configured via device tree bindings. If the DT bindings are not present or invalid, the input configuration is not modified and left at HW defaults. Signed-off-by:
Oskar Senft <osk@google.com> Reviewed-by:
Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20211020164213.174597-2-osk@google.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Oct 21, 2021
-
-
Save any FFDC provided by the OCC driver, and provide it to userspace through a binary sysfs entry. Notify userspace pollers when there is an error too. Signed-off-by:
Eddie James <eajames@linux.ibm.com> Reviewed-by:
Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20211019205307.36946-5-eajames@linux.ibm.com Signed-off-by:
Joel Stanley <joel@jms.id.au>
-
Armin Wolf authored
When setting the fan speed, i8k_set_fan() calls i8k_get_fan_status(), causing an unnecessary SMM call since from the two users of this function, only i8k_ioctl_unlocked() needs to know the new fan status while dell_smm_write() ignores the new fan status. Since SMM calls can be very slow while also making error reporting difficult for dell_smm_write(), remove the function call from i8k_set_fan() and call it separately in i8k_ioctl_unlocked(). Tested on a Dell Inspiron 3505. Signed-off-by:
Armin Wolf <W_Armin@gmx.de> Reviewed-by:
Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/20211021190531.17379-6-W_Armin@gmx.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Armin Wolf authored
i8k_config_data[] should only be used for applying device specific quirks in case autoconfig does not work properly on certain devices. Signed-off-by:
Armin Wolf <W_Armin@gmx.de> Reviewed-by:
Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/20211021190531.17379-5-W_Armin@gmx.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Armin Wolf authored
Returning -ENOIOCTLCMD gives the callers a better hint of what went wrong and is the recommended behavior. Signed-off-by:
Armin Wolf <W_Armin@gmx.de> Acked-by:
Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/20211021190531.17379-4-W_Armin@gmx.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Armin Wolf authored
Using strscpy_pad() allows for fewer memory accesses since memset() will not unconditionally zero-out the whole buffer. Signed-off-by:
Armin Wolf <W_Armin@gmx.de> Acked-by:
Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/20211021190531.17379-3-W_Armin@gmx.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Armin Wolf authored
Sort includes for better overview. Signed-off-by:
Armin Wolf <W_Armin@gmx.de> Acked-by:
Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/20211021190531.17379-2-W_Armin@gmx.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Oct 18, 2021
-
-
Wan Jiabing authored
Fix following coccicheck warning: ./drivers/hwmon/tmp421.c:416:1-23: WARNING: Function for_each_child_of_node should have of_node_put() before return. Early exits from for_each_child_of_node should decrement the node reference counter. Signed-off-by:
Wan Jiabing <wanjiabing@vivo.com> Link: https://lore.kernel.org/r/20211018121538.16482-1-wanjiabing@vivo.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Oct 17, 2021
-
-
Uwe Kleine-König authored
When an spi driver's remove function returns a non-zero error code nothing happens apart from emitting a generic error message. Make this error message more device specific and return zero instead. Acked-by:
Michael Hennerich <michael.hennerich@analog.com> Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20211012153945.2651412-5-u.kleine-koenig@pengutronix.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Rafael J. Wysocki authored
In read_domain_devices(), acpi_bus_get_device() is called to obtain the ACPI device object attached to the given ACPI handle and subsequently that object is passed to get_device() for reference counting, but there is a window between the acpi_bus_get_device() and get_device() calls in which the ACPI device object in question may go away. To address this issue, make read_domain_devices() use acpi_bus_get_acpi_device() to reference count and return the given ACPI device object in one go and export that function to modules. While at it, also make read_domain_devices() and remove_domain_devices() use acpi_dev_put() instead of calling put_device() directly on the ACPI device objects returned by acpi_bus_get_acpi_device(). Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/11871063.O9o76ZdvQC@kreacher Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Oct 16, 2021
-
-
Armin Wolf authored
The nominal speed of each fan can be obtained with i8k_get_fan_nominal_speed(), however the result is not available from userspace. Change that by adding fanX_min, fanX_max and fanX_target attributes. All are RO since fan control happens over pwm. Tested on a Dell Inspiron 3505 and a Dell Latitude C600. Signed-off-by:
Armin Wolf <W_Armin@gmx.de> Reviewed-by:
Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/20210926221044.14327-2-W_Armin@gmx.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
- Oct 15, 2021
-
-
Krzysztof Adamski authored
In case the DT contains some nodes not describing the input channels, ignore them instead of exiting with error. Signed-off-by:
Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/8e9e332b18dc2cf545f8e8255157e408d356f916.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Krzysztof Adamski authored
Since the recent patches added possibility of disabling sensor channels via DT, it only make sense to allow controlling that from userspace via HWMON_T_ENABLE mechanism. This patches adds support for that. Signed-off-by:
Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/a64c22e7323bd5a083f37aaaca91a745ac1beef3.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Krzysztof Adamski authored
Recent patch added possibility to disable selected channels. That would only make sure that the ENODATA is returned for those channels but would not configure the actual hardware. With this patch, the config register is written to make sure the channels are disabled also at hardware level. Signed-off-by:
Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/d451cacdf21bf8eff38a47c055aad8c0c6e8755a.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Krzysztof Adamski authored
Previous patches added a way to specify some channel specific parameters in DT and n-factor is definitely one of them. This calibration mechanism is board specific as its value depends on the diodes/transistors being connected to the sensor and thus the DT seems like a right fit for that information. It is very similar to the value of shunt resistor that some drivers allows specifying in DT. This patch adds a possibility to set n-factor for each channel via "n-factor" DT property in each channel subnode. Signed-off-by:
Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/69d0bfcc5ba27c67f21d3eabfb100656a14c75b9.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Krzysztof Adamski authored
The previous patch introduced per channel subnodes in DT that let us specify some channel specific properties. This built a ground for easily disabling individual channels of the sensor that may not be connected to any external diode and thus are not returning any meaningful data. This patch adds support for parsing the "status" property of channels DT subnodes and makes sure the -ENODATA is returned when disabled channels value is read. Signed-off-by:
Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/a85d623f0792b862870933a875bdf802f4c017f1.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Krzysztof Adamski authored
tmp42x is a multichannel temperature sensor with several external channels. Since those channels can be used to connect diodes placed anywhere in the system, their meaning will vary depending on the project. For this case, the hwmon framework has an idea of labels which allows us to assign the meaning to each channel. The similar concept is already implemented in ina3221 - the label for each channel can be defined via device tree. See commit a9e9dd9c ("hwmon: (ina3221) Read channel input source info from DT") This patch adds support for similar feature to tmp421. Signed-off-by:
Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/dab0fda6ac0e8d7f163c3762a7fb1e595a4d8159.1634206677.git.krzysztof.adamski@nokia.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Checksumming of the request and sequence numbering is now done in the OCC interface driver in order to keep unique sequence numbers. So remove those in the hwmon driver. Also, add the command length to the send_cmd function pointer, since the checksum must be placed in the last two bytes of the command. The submit interface must receive the exact size of the command - previously it could be rounded to the nearest 8 bytes with no consequence. Signed-off-by:
Eddie James <eajames@linux.ibm.com> Acked-by:
Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210721190231.117185-3-eajames@linux.ibm.com Signed-off-by:
Joel Stanley <joel@jms.id.au>
-
- Oct 12, 2021
-
-
Krzysztof Adamski authored
This is a preparatory change. Upcoming patches will introduce more per-channel parameters so it's worth organizing them into a struct. Signed-off-by:
Krzysztof Adamski <krzysztof.adamski@nokia.com> Link: https://lore.kernel.org/r/baf34d95983a6b58a3e39e4c098e5979e541572e.1634029538.git.krzysztof.adamski@nokia.com Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Uwe Kleine-König authored
Up to now adt7x10_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20211011132754.2479853-3-u.kleine-koenig@pengutronix.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Armin Wolf authored
sched.h and io.h are not used anywhere in dell-smm-hwmon.c. Signed-off-by:
Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20210926221044.14327-3-W_Armin@gmx.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Paul Fertser authored
We have bool so use it consistently in all the drivers. The following Coccinelle script was used: @@ identifier T; type t = { char, int }; @@ struct T { ... - t valid; + bool valid; ... } @@ identifier v; @@ ( - v->valid = 0 + v->valid = false | - v->valid = 1 + v->valid = true ) followed by sed to fixup the comments: sed '/bool valid;/{s/!=0/true/;s/zero/false/}' Few whitespace changes were fixed manually. All modified drivers were compile-tested. Signed-off-by:
Paul Fertser <fercerpav@gmail.com> Link: https://lore.kernel.org/r/20210924195202.27917-1-fercerpav@gmail.com [groeck: Fixed up 'u8 valid' to 'boool valid' in atxp1.c] Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-
Oleksij Rempel authored
Use devm_hwmon_device_register_with_info() which will make thermal framework work. Signed-off-by:
Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.kernel.org/r/20211007125301.3030-1-o.rempel@pengutronix.de Signed-off-by:
Guenter Roeck <linux@roeck-us.net>
-