Commit Graph

5777 Commits

Author SHA1 Message Date
Wenliang Yan
024e5cf243 hwmon: (ina238) Add ina238_config to save configurations for different chips
Add structure ina238_config to store proprietary properties for different
chips to meet different chip adaptations

Signed-off-by: Wenliang Yan <wenliang202407@163.com>
Link: https://lore.kernel.org/r/20250506053741.4837-2-wenliang202407@163.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-05-12 09:40:56 -07:00
pkarc
0c0c84e486 hwmon: (ausus-ec-sensors) add MAXIMUS VI HERO.
Add support for MAXIMUS VI HERO.

Signed-off-by: pkarc <ivanchojara@gmail.com>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250503230020.1005801-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-05-04 02:20:28 -07:00
Xin Li (Intel)
efef7f184f x86/msr: Add explicit includes of <asm/msr.h>
For historic reasons there are some TSC-related functions in the
<asm/msr.h> header, even though there's an <asm/tsc.h> header.

To facilitate the relocation of rdtsc{,_ordered}() from <asm/msr.h>
to <asm/tsc.h> and to eventually eliminate the inclusion of
<asm/msr.h> in <asm/tsc.h>, add an explicit <asm/msr.h> dependency
to the source files that reference definitions from <asm/msr.h>.

[ mingo: Clarified the changelog. ]

Signed-off-by: Xin Li (Intel) <xin@zytor.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Uros Bizjak <ubizjak@gmail.com>
Link: https://lore.kernel.org/r/20250501054241.1245648-1-xin@zytor.com
2025-05-02 10:23:47 +02:00
Bo Liu
a92d87d2f9 hwmon: (isl28022, nct7363) Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250424010829.2610-1-liubo03@inspur.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-05-01 20:10:36 -07:00
Alexei Safin
25be318324 hwmon: (asus-ec-sensors) check sensor index in read_string()
Prevent a potential invalid memory access when the requested sensor
is not found.

find_ec_sensor_index() may return a negative value (e.g. -ENOENT),
but its result was used without checking, which could lead to
undefined behavior when passed to get_sensor_info().

Add a proper check to return -EINVAL if sensor_index is negative.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: d0ddfd241e ("hwmon: (asus-ec-sensors) add driver for ASUS EC")
Signed-off-by: Alexei Safin <a.safin@rosa.ru>
Link: https://lore.kernel.org/r/20250424202654.5902-1-a.safin@rosa.ru
[groeck: Return error code returned from find_ec_sensor_index]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-05-01 20:08:37 -07:00
Daniel Grainger
a60d965931 hwmon: (asus-ec-sensors) add ROG MAXIMUS Z90 Formula.
Board and chipset information is from LibreHardwareMonitor [1].

[1] https://github.com/LibreHardwareMonitor/LibreHardwareMonitor

Signed-off-by: Daniel Grainger <dagr@live.ca>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250501132009.726742-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-05-01 20:05:40 -07:00
Antheas Kapenekakis
3012bb3900
platform/x86: oxpec: Move hwmon/oxp-sensors to platform/x86
The EC of OneXPlayer devices used to only control the fan. This is no
longer the case, with the EC of OneXPlayer gaining additional
functionality (turbo button, turbo led, battery controls).

As it will be beneficial from a complexity perspective to retain this
driver as a single unit, move it out of hwmon, and into platform/x86.
Also, remove the hwmon documentation to prepare moving it to
Documentation/ABI/.

While at it, add myself to the maintainer's file.

Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://lore.kernel.org/r/20250425111821.88746-4-lkml@antheas.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30 14:04:56 +03:00
Antheas Kapenekakis
9f4c9ec158
hwmon: (oxp-sensors) Add all OneXFly variants
Currently, the driver only has the F1 OneXFly variant, which was based
on the 7000 AMD platform. Add its special editions: F1 EVA-01, F1 OLED.
F1 OLED might have been a dev unit, but it is supported by OneXConsole
with the same features so add it. Then add the F1L variant which is
based on the 8000 AMD platform and the F1Pro and its special edition
EVA-02.

One might ask why not just fuzzy match. Well, EVA-02 is a variant of
F1Pro which is a Strix Point handheld, but does not have F1Pro in its
name. This makes it risky to fuzzy match, as special variants in the
future from different platforms might not have the same feature set
or registers.

By happenstance, all current devices use the same registers. For the
charge limitting feature on this series, only F1Pro/X1 (AMD) were
released with it, but OneXPlayer is providing bios updates for F1, F1L,
X1 Mini units that use the same register, so treat all of them the same.

Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://lore.kernel.org/r/20250425111821.88746-3-lkml@antheas.dev
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-25 16:35:50 +03:00
Antheas Kapenekakis
217d55ca13
hwmon: (oxp-sensors) Distinguish the X1 variants
Currently, the oxp-sensors driver fuzzy matches the X1 variants. Luckily,
X1 and X1 mini share most hardware features so this works. However, they
are completely different product lines, and there is an expectation that
OneXPlayer will release more devices in the X1 line that may have
differences.

Therefore, distinguish the 3 devices that currently exist in the market.
These are the OneXPlayer X1 AMD and Intel variants, and the X1 mini which
only has an AMD variant. As far as registers go, all three support the
current driver functionality.

Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://lore.kernel.org/r/20250425111821.88746-2-lkml@antheas.dev
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-25 16:35:48 +03:00
Dzmitry Sankouski
8debd8511d hwmon: (max77705) Add initial support
Maxim MAX77705 is a Companion Power Management and Type-C interface IC.
It includes charger and fuel gauge blocks, and is capable of measuring
charger input current, system bus volatage and current, and bypass
voltage.

Add support for mentioned measurements.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Link: https://lore.kernel.org/r/20250423-initial-support-for-max77705-sensors-v6-1-ff379e1b06c5@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:21:15 -07:00
Peter Korsgaard
3e749ce132 hwmon: (tmp102) add vcc regulator support
Make it optional for backwards compatibility.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Link: https://lore.kernel.org/r/20250417180426.3872314-2-peter@korsgaard.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:33 -07:00
Cedric Encarnacion
c66c5bda7f hwmon: (pmbus/lt3074) add support for lt3074
Add hardware monitoring and regulator support for LT3074. The LT3074 is an
ultrafast, ultralow noise 3A, 5.5V dropout linear regulator. The PMBus
serial interface allows telemetry for input/output voltage, bias voltage,
output current, and die temperature.

Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
Link: https://lore.kernel.org/r/20250421-upstream-lt3074-v3-2-71636322f9fe@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Guenter Roeck
a852162efb hwmon: (spd5118) Detect and support 16-bit register addressing
Add support for SPD5118 compatible chips with 16-bit addressing enabled
which are connected to I2C controllers.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Guenter Roeck
be82d39c53 hwmon: (spd5118) Support 16-bit addressing for NVMEM accesses
I3C uses 16-bit register addresses. Setting the page through the legacy
mode access pointer in the legacy mode device configuration register (MR11)
is not needed. This is similar to 16-bit addressing in legacy mode.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Guenter Roeck
ae28532aff hwmon: (spd5118) Name chips taking the specification literally
The Renesas/IDT SPD5118 Hub Controller is known to take the specification
literally and does not permit access to volatile registers except for the
page register if the selected page is non-zero. Explicitly name the chip
to ensure that the information does not get lost.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Guenter Roeck
4cf1aab45c hwmon: (spd5118) Split into common and I2C specific code
Split spd5118 driver into common and I2C specific code to enable
adding support for I3C.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Armin Wolf
e799657a8a hwmon: (dell-smm) Add the Dell OptiPlex 7050 to the DMI whitelist
A user reported that the driver works on the OptiPlex 7050. Add this
machine to the DMI whitelist.

Closes: https://github.com/Wer-Wolf/i8kutils/issues/12
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Acked-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20250420223334.12920-1-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Guenter Roeck
41e743881e hwmon: (aht10) Drop doctype annotations from static functions
doctype annotations of static functions have little if any value.
Drop them to silence 0-day complaints.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202504161919.duDL1s2X-lkp@intel.com/
Cc: Johannes Cornelis Draaijer <jcdra1@gmail.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Chen Ni
38b5a5acab hwmon: (lm90) Use to_delayed_work()
Use to_delayed_work() instead of open-coding it.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://lore.kernel.org/r/20250414074739.3954203-1-nichen@iscas.ac.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Sudeep Holla
80fcd1e7f5 hwmon: (xgene-hwmon) Simplify PCC shared memory region handling
The PCC driver now handles mapping and unmapping of shared memory
areas as part of pcc_mbox_{request,free}_channel(). Without these before,
this xgene hwmon driver did handling of those mappings like several
other PCC mailbox client drivers.

There were redundant operations, leading to unnecessary code. Maintaining
the consistency across these driver was harder due to scattered handling
of shmem.

Just use the mapped shmem and remove all redundant operations from this
driver.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20250411112053.1148624-1-sudeep.holla@arm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
John Keeping
5659108384 hwmon: (pwm-fan) disable threaded interrupts
The interrupt handler here just increments an atomic counter, jumping to
a threaded handler risks missing tachometer pulses and is likely to be
more expensive than the simple atomic increment.

Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
Link: https://lore.kernel.org/r/20250410180357.2258822-1-jkeeping@inmusicbrands.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Gerhard Engleder
7e581c193b hwmon: Add KEBA battery monitoring controller support
The KEBA battery monitoring controller is found in the system FPGA of
KEBA PLC devices. It puts a load on the coin cell battery to check the
state of the battery. If the coin cell battery is nearly empty, then
the user space is signaled with a hwmon alarm.

The auxiliary device for this driver is instantiated by the cp500 misc
driver.

Signed-off-by: Gerhard Engleder <eg@keba.com>
Link: https://lore.kernel.org/r/20250409190830.60489-1-gerhard@engleder-embedded.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Alexander Stein
0d01110e63 hwmon: (gpio-fan) Add regulator support
FANs might be supplied by a regulator which needs to be enabled as well.
This is implemented using runtime PM. Every time speed_index changes from
0 to non-zero and vise versa RPM is resumed or suspended.
Intitial RPM state is determined by initial value of speed_index.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20250409065430.1413439-1-alexander.stein@ew.tq-group.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Ciprian Marian Costea
9b116ba6c9 hwmon: (ina2xx) make regulator 'vs' support optional
According to the 'ti,ina2xx' binding, the 'vs-supply' property is
optional. Use devm_regulator_get_enable_optional() to avoid a kernel
warning message if the property is not provided.

Co-developed-by: Florin Buica <florin.buica@nxp.com>
Tested-by: Enric Balletbo i Serra <eballetbo@kernel.org>
Signed-off-by: Florin Buica <florin.buica@nxp.com>
Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea@oss.nxp.com>
Link: https://lore.kernel.org/r/20250409074529.2233733-1-ciprianmarian.costea@oss.nxp.com
[groeck: Use standard multi-line comment]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Eugene Shalygin
0bf08f9e35 hwmon: (asus-ec-sensors) sort sensor definition arrays
The arrays have to be sorted by the sensor register bank and index
because this is what the sensor reading function expects. So sort them
and leave a comment for future contributors.

Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250408204505.11412-1-eugene.shalygin@gmail.com
[groeck: Fixed alignment of new  multi-line comment]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
William A. Kennington III
ab2f6bffe7 hwmon: (max34451) Work around lost page
When requesting new pages from the max34451 we sometimes see that the
firmware responds with stale or bad data to reads that happen
immediately after a page change. This is due to a lack of clock
stretching after page changing on the device side when it needs more
time to complete the operation.

To remedy this, the manufacturer recommends we wait 50us until
the firmware should be ready with the new page.

Signed-off-by: William A. Kennington III <william@wkennington.com>
Link: https://lore.kernel.org/r/20250408011006.1314622-1-william@wkennington.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Naresh Solanki
6de6868df1 hwmon: (max6639) Allow setting target RPM
Currently, during startup, the fan is set to its maximum RPM by default,
which may not be suitable for all use cases.
This patch introduces support for specifying a target RPM via the Device
Tree property "target-rpm".

Changes:
- Added `target_rpm` field to `max6639_data` structure to store the
  target RPM for each fan channel.
- Modified `max6639_probe_child_from_dt()` to read the `"target-rpm"`
  property from the Device Tree and set `target_rpm` accordingly.
- Updated `max6639_init_client()` to use `target_rpm` to compute the
  initial PWM duty cycle instead of defaulting to full speed (120/120).

Behavior:
- If `"target-rpm"` is specified, the fan speed is set accordingly.
- If `"target-rpm"` is not specified, the previous behavior (full speed
  at startup) is retained.

This allows better control over fan speed during system initialization.

Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
Link: https://lore.kernel.org/r/20250404115646.2000563-1-you@example.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Guenter Roeck
0b3c04c818 hwmon: (pmbus) Do not set regulators_node for single-channel chips
Single-channel regulators do not need and should not have a "regulators"
node. We can not entirely remove it due to existing bindings. To solve the
problem for new drivers, provide additional macros PMBUS_REGULATOR_ONE_NODE
and PMBUS_REGULATOR_STEP_ONE_NODE and convert existing drivers to use those
macros. The exception is the ir38064 driver because its devicetree files
and its description do not require or use the nested regulators node.

Modify PMBUS_REGULATOR_STEP_ONE and PMBUS_REGULATOR_ONE to set the
regulators_node pointer to NULL.

Cc: Cedricjustine.Encarnacion@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250322142602.560042-1-linux@roeck-us.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Alexis Czezar Torreno
629cf8f6c2 hwmon: (pmbus/max34440) Add support for ADPM12160
ADPM12160 is a quarter brick DC/DC Power Module. It is a high power
non-isolated converter capable of delivering a fully regulated 12V,
with continuous power level of 1600W with peak power at 2400W for
a limited time. Uses PMBus Configuration.

Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Link: https://lore.kernel.org/r/20250407-dev_adpm12160-v3-2-9cd3095445c8@analog.com
[groeck: The chip is "ADPM12160"]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Alexis Czezar Torreno
19932f844f hwmon: (pmbus/max34440) Fix support for max34451
The max344** family has an issue with some PMBUS address being switched.
This includes max34451 however version MAX34451-NA6 and later has this
issue fixed and this commit supports that update.

Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Link: https://lore.kernel.org/r/20250407-dev_adpm12160-v3-1-9cd3095445c8@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Bartosz Golaszewski
9c47e45de1 hwmon: (pmbus/ucd9000) Use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-hwmon-v1-2-1fa38f34dc07@linaro.org
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Bartosz Golaszewski
e894b6442a hwmon: (ltc2992) Use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-hwmon-v1-1-1fa38f34dc07@linaro.org
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
[groeck: Fixed multi-line alignment issue]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
William A. Kennington III
73e5b6b51f hwmon: (pmbus) Introduce page_change_delay
We have some buggy pmbus devices that require a delay after performing a
page change operation before trying to issue more commands to the
device.

This allows for a configurable delay after page changes, but not
affecting other read or write operations.

This makes a slight behavioral tweak to the existing delay logic, where
it considers the longest of delays between operations, instead of always
chosing the write delay over the access delay.

Signed-off-by: William A. Kennington III <william@wkennington.com>
Link: https://lore.kernel.org/r/20250407201002.1198092-1-william@wkennington.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
David Hows
2c183963fb hwmon: (k10temp) Add support for Zen5 Ryzen Desktop
Add support for retrieving CCD temperatures on Zen5 (Granite Ridge)
Desktop CPUs.

Signed-off-by: David Hows <david@hows.id.au>
Link: https://lore.kernel.org/r/Z-21SQkZpuWiWK06@archibald.hows.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Francesco Dolcini
cd17587272 hwmon: (amc6821) Add PWM polarity configuration with OF
Add support to configure the PWM-Out pin polarity based on the device
tree. The binding would allow also to configure the PWM period, this is
currently not implemented by the driver.

The driver has a module option to set the PWM polarity (normal=0,
inverted=1), when specified it always takes the precedence over the DT.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://lore.kernel.org/r/20250402102146.65406-3-francesco@dolcini.it
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Andy Shevchenko
f2053eea39 hwmon: (qnap-mcu) Remove (explicitly) unused header
The fwnode.h is not supposed to be used by the drivers as it
has the definitions for the core parts for different device
property provider implementations. Drop it.

Note, that fwnode API for drivers is provided in property.h
which is included here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250331070600.3985850-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:26 -07:00
Ingo Molnar
0a35c9280a x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h>
Collect AMD specific platform header files in <asm/amd/*.h>.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mario Limonciello <superm1@kernel.org>
Link: https://lore.kernel.org/r/20250413084144.3746608-7-mingo@kernel.org
2025-04-14 09:34:17 +02:00
Ingo Molnar
6fe22abacd x86/msr: Rename 'rdmsrl_safe()' to 'rdmsrq_safe()'
Suggested-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Xin Li <xin@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
2025-04-10 11:58:38 +02:00
Thomas Gleixner
8fa7292fee treewide: Switch/rename to timer_delete[_sync]()
timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree
over and remove the historical wrapper inlines.

Conversion was done with coccinelle plus manual fixups where necessary.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-04-05 10:30:12 +02:00
Linus Torvalds
fb1ceb29b2 platform-drivers-x86 for v6.15-1
Highlights:
 
  - alienware-wmi: Refactor and split WMAX/legacy drivers
 
  - dell-ddv:
 
     - Correct +0.1 offset in temperature
 
     - Use the power supply extension mechanism for battery temperatures
 
  - intel/pmc:
 
     - Refactor init to mostly use a common init function
 
     - Add support for Arrow Lake U/H
 
     - Add support for Panther Lake
 
  - intel/sst:
 
     - Improve multi die handling
 
     - Prefix header search path with sysroot (fixes cross-compiling)
 
  - lenovo-wmi-hotkey-utilities: Support for mic & audio mute LEDs
 
  - samsung-galaxybook: Add driver for Samsung Galaxy Book series
 
  - wmi:
 
     - Rework WCxx/WExx ACPI method handling
 
     - Enable data block collection when the data block is set
 
  - platform/arm:
 
     - Add Huawei Matebook E Go EC driver
 
  - platform/mellanox:
 
     - Relocate to drivers/platform/mellanox/
 
     - mlxbf-bootctl: RTC battery status sysfs support
 
  - Miscellaneous cleanups / refactoring / improvements
 
 The following is an automated shortlog grouped by driver:
 
 alienware-wmi:
  -  Add a state container for LED control feature
  -  Add a state container for thermal control methods
  -  Add alienware-wmi.h
  -  Add WMI Drivers
  -  Refactor hdmi, amplifier, deepslp methods
  -  Refactor LED control methods
  -  Refactor thermal control methods
  -  Rename alienware-wmi.c
  -  Split DMI table
  -  Split the alienware-wmi driver
  -  Update alienware-wmi config entries
  -  Update header and module information
 
 amd/pmc:
  -  fix leak in probe()
  -  Move macros and structures to the PMC header file
  -  Notify user when platform does not support s0ix transition
  -  Remove unnecessary line breaks
  -  Use managed APIs for mutex
 
 amd/pmf:
  -  convert timeouts to secs_to_jiffies()
 
 amd:
  -  Use *-y instead of *-objs in Makefiles
 
 arm64:
  -  add Huawei Matebook E Go EC driver
 
 arm64: dts: qcom: gaokun3:
  -  Add Embedded Controller node
 
 compal-laptop:
  -  Do not include <linux/fb.h>
 
 dell-ddv:
  -  Fix temperature calculation
  -  Use devm_battery_hook_register
  -  Use the power supply extension mechanism
 
 dell: dell-wmi-sysman:
  -  Use *-y instead of *-objs in Makefile
 
 dell:
  -  Modify Makefile alignment
  -  Use *-y instead of *-objs in Makefile
 
 dell-uart-backlight:
  -  Make dell_uart_bl_serdev_driver static
 
 dt-bindings: platform:
  -  Add Huawei Matebook E Go EC
 
 hp-bioscfg:
  -  Replace deprecated strncpy() with strscpy()
  -  Use wmi_instance_count()
 
 hp:
  -  Use *-y instead of *-objs in Makefile
 
 hwmon:
  -  (hp-wmi-sensors) Use the WMI bus API when accessing sensors
 
 ideapad-laptop:
  -  use dev_groups to register attribute groups
 
 int3472:
  -  Call "func" "con_id" instead
 
 intel/pmc:
  -  Add Arrow Lake U/H support to intel_pmc_core driver
  -  Add Panther Lake support to intel_pmc_core
  -  Create generic_core_init() for all platforms
  -  Make tgl_core_generic_init() static
  -  Move arch specific action to init function
  -  Remove duplicate enum
  -  Remove simple init functions
  -  Remove unnecessary declarations in header
  -  Remove unneeded extern keyword in header
 
 intel:
  -  Use *-y instead of *-objs in Makefile
 
 irqdomain: platform/x86:
  -  Switch to irq_domain_create_linear()
 
 lenovo-wmi-hotkey-utilities.c:
  -  Support for mic and audio mute LEDs
 
 lenovo-yoga-tab2-pro-1380-fastcharger:
  -  Make symbol static
 
 MAINTAINERS:
  -  Add documentation reference for Mellanox platform
  -  Update ALIENWARE WMI DRIVER entry
 
 mellanox:
  -  Relocate mlx-platform driver
 
 mlxbf-bootctl:
  -  Support sysfs entries for RTC battery status
 
 mlx-platform:
  -  Change register name
  -  Cosmetic changes
 
 samsung-galaxybook:
  -  Add samsung-galaxybook driver
  -  Fix block_recording not supported logic
 
 sonypi:
  -  Use str_on_off() helper in sonypi_display_info()
 
 think-lmi:
  -  Use ACPI object when extracting strings
  -  Use WMI bus API when accessing BIOS settings
 
 thinkpad_acpi:
  -  check the return value of devm_mutex_init()
  -  convert timeouts to secs_to_jiffies()
  -  Do not include <linux/fb.h>
  -  Move HWMON initialization to tpacpi_hwmon_pdriver's probe
  -  Move subdriver initialization to tpacpi_pdriver's probe.
 
 tools/power/x86/intel-speed-select:
  -  Die ID for IO dies
  -  Fix the condition to check multi die system
  -  Prefix header search path with sysroot
  -  Prevent increasing MAX_DIE_PER_PACKAGE
  -  v1.22 release
 
 wmi:
  -  Call WCxx methods when setting data blocks
  -  Rework WCxx/WExx ACPI method handling
  -  Update documentation regarding the GUID-based API
  -  Use devres to disable the WMI device
 
 x86-android-tablets:
  -  Add select POWER_SUPPLY to Kconfig
 
 Merges:
  -  Merge branch 'fixes' into for-next
  -  Merge branch 'intel-sst' of https://github.com/spandruvada/linux-kernel into review-ilpo-next
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSCSUwRdwTNL2MhaBlZrE9hU+XOMQUCZ+QJyQAKCRBZrE9hU+XO
 MUPYAP4sjtB8DKTIHgiQqado7PJZmdgpeJfAplitwKGe4BOcEQEA1mhuqMA5n6S+
 jvbTtRF+jiKxis/5zAtAdChScM/pIgo=
 =W+gy
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform drivers updates from Ilpo Järvinen:

 - alienware-wmi:
     - Refactor and split WMAX/legacy drivers

 - dell-ddv:
     - Correct +0.1 offset in temperature
     - Use the power supply extension mechanism for battery temperatures

 - intel/pmc:
     - Refactor init to mostly use a common init function
     - Add support for Arrow Lake U/H
     - Add support for Panther Lake

 - intel/sst:
     - Improve multi die handling
     - Prefix header search path with sysroot (fixes cross-compiling)

 - lenovo-wmi-hotkey-utilities:
     - Support for mic & audio mute LEDs

 - samsung-galaxybook:
     - Add driver for Samsung Galaxy Book series

 - wmi:
     - Rework WCxx/WExx ACPI method handling
     - Enable data block collection when the data block is set

 - platform/arm:
     - Add Huawei Matebook E Go EC driver

 - platform/mellanox:
     - Relocate to drivers/platform/mellanox/
     - mlxbf-bootctl:
     - RTC battery status sysfs support

 - Miscellaneous cleanups / refactoring / improvements

* tag 'platform-drivers-x86-v6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (75 commits)
  platform/x86: x86-android-tablets: Add select POWER_SUPPLY to Kconfig
  platform/x86/amd/pmf: convert timeouts to secs_to_jiffies()
  platform/x86: thinkpad_acpi: convert timeouts to secs_to_jiffies()
  irqdomain: platform/x86: Switch to irq_domain_create_linear()
  platform/x86/amd/pmc: fix leak in probe()
  tools/power/x86/intel-speed-select: v1.22 release
  tools/power/x86/intel-speed-select: Prefix header search path with sysroot
  tools/power/x86/intel-speed-select: Die ID for IO dies
  tools/power/x86/intel-speed-select: Fix the condition to check multi die system
  tools/power/x86/intel-speed-select: Prevent increasing MAX_DIE_PER_PACKAGE
  platform/x86/amd/pmc: Use managed APIs for mutex
  platform/x86/amd/pmc: Remove unnecessary line breaks
  platform/x86/amd/pmc: Move macros and structures to the PMC header file
  platform/x86/amd/pmc: Notify user when platform does not support s0ix transition
  platform/x86: dell-ddv: Use the power supply extension mechanism
  platform/x86: dell-ddv: Use devm_battery_hook_register
  platform/x86: dell-ddv: Fix temperature calculation
  platform/x86: thinkpad_acpi: check the return value of devm_mutex_init()
  platform/x86: samsung-galaxybook: Fix block_recording not supported logic
  platform/x86: dell-uart-backlight: Make dell_uart_bl_serdev_driver static
  ...
2025-03-26 09:54:40 -07:00
Linus Torvalds
c07666e29b hwmon updates for v6.15
- New drivers
 
   * Driver for HTU31
 
   * Congatec Board Controller monitoring driver
 
   * Driver for TI INA233 Current and Power Monitor
 
 - Support for additional chips or boards in existing drivers
 
   * pmbus/ltc2978: Add support for LT717x and LTM4673
 
   * asus-ec-sensors: Add PRIME X670E-PRO WIFI
 
   * k10temp: Add support for cyan skillfish
 
   * nct6683: Add customer ID for AMD BC-250
 
   * lm90: Add support for NCT7716, NCT7717 and NCT7718
 
 - Other notable improvements in existing drivers
 
   * emc2305: Add devicetree support, and use
     devm_thermal_of_cooling_device_register
 
   * acpi_power_meter: Convert to with_info API
 
   * dell-smm: Increase the number of fans
 
   * pmbus/core: Optimize debugfs support and use i2c_client debugfs
     directory
 
    * hwmon core: Fix the missing of 'average' word in
      hwmon_power_attr_templates
 
    * Various drivers: Use per-client debugfs entry provided by I2C
      subsystem
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmfh5YsACgkQyx8mb86f
 mYG/AA//Z8b43kMxImlQjw4SXFyp3lry2OoLBxJADDZk/gHAbGBtrzYv5FFrHs/c
 0YUNP2yGApQnl7iwnUTgmayCafsq+BO1TXLHrn9VwWsefDHNBUZO8PbdZOlmlJgG
 LIxeIBPgHhuNoLthrZIEzGzDqd2xfNURXnox1J2/uHE6ggor5ceXXcAjxeZtxh45
 WP9rwaypC189qmMyLnHGIqGKsiTjFUkri6miAM0UkaRnrR8ELeTCtGeXWA+54b9+
 uOq7VyLYfIV7CffxwFuPfIMXRs/0kye0Y5GMzRPLPXZuY//A1QcVW6OcN6/+8Rgm
 qxsp0uWfwuUYi8Tek+DaX9+vKPo9IoUOvYjKlQt6J55FdBnkvnL6uW430lXp/9O3
 JQnRGLXV0GEdf8aSEya9lfAF7kPl6K9HRlqYIG/DpSoLDqkvn1ArGiRzkUEGRFHc
 pyTwUalhyqxsL9mELuVscN4g4t+MqXld43o/YEqfU8bDsVGztStjJFtrd+XSroKH
 FcvZldoVz6H99n22U45YHzA5BqDn53vP67uqM180mx4yCKDJIEAAduD48TFNJExV
 l9QgPZPZuxch8saFn7IeFmRNNeF7Y0W/TjQ4rjXHaaZN4+elyAXl4wwKYM61xP9Y
 u2E8qXl8Nk2oyXFKNcc4BBIbCB4aaQ66RaK0pWxzFGQDCiR+IKs=
 =6HFa
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon updates from Guenter Roeck:
 "New drivers:

   - Driver for HTU31

   - Congatec Board Controller monitoring driver

   - Driver for TI INA233 Current and Power Monitor

  Support for additional chips or boards in existing drivers:

   - pmbus/ltc2978: Add support for LT717x and LTM4673

   - asus-ec-sensors: Add PRIME X670E-PRO WIFI

   - k10temp: Add support for cyan skillfish

   - nct6683: Add customer ID for AMD BC-250

   - lm90: Add support for NCT7716, NCT7717 and NCT7718

  Other notable improvements in existing drivers:

   - emc2305: Add devicetree support, and use
     devm_thermal_of_cooling_device_register

   - acpi_power_meter: Convert to with_info API

   - dell-smm: Increase the number of fans

   - pmbus/core: Optimize debugfs support and use i2c_client
     debugfs directory

   - hwmon core: Fix the missing of 'average' word in
     hwmon_power_attr_templates

   - Various drivers: Use per-client debugfs entry provided by
     I2C subsystem"

* tag 'hwmon-for-v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (49 commits)
  hwmon: emc2305: Use devm_thermal_of_cooling_device_register
  hwmon: emc2305: Add OF support
  dt-bindings: hwmon: Add Microchip emc2305 support
  dt-bindings: hwmon: Drop stray blank line in the header
  hwmon: (acpi_power_meter) Replace the deprecated hwmon_device_register
  hwmon: add driver for HTU31
  dt-bindings: hwmon: Add description for sensor HTU31
  hwmon: Add driver for TI INA233 Current and Power Monitor
  dt-bindings: hwmon: ti,ina2xx: Add INA233 device
  hwmon: Add Congatec Board Controller monitoring driver
  hwmon: (pmbus/ltc2978) add support for lt717x
  dt-bindings: hwmon: ltc2978: add support for LT717x
  hwmon: (pmbus/ltc2978) Add support for LT717x - docs
  hwmon: (dell-smm) Increment the number of fans
  hwmon: (ntc_thermistor) return error instead of clipping on OOB
  hwmon: (pt5161l) Use per-client debugfs entry
  hwmon: Fix the missing of 'average' word in hwmon_power_attr_templates
  hwmon: (acpi_power_meter) Fix the fake power alarm reporting
  hwmon: (gpio-fan) Add missing mutex locks
  dt-bindings: hwmon: gpio-fan: Add optional regulator support
  ...
2025-03-25 19:55:29 -07:00
Florin Leotescu
2115cbeec8 hwmon: emc2305: Use devm_thermal_of_cooling_device_register
Prepare the emc2305 driver to use configuration from Device Tree nodes.
Switch to devm_thermal_of_cooling_device_register to simplify the
cleanup procedure, allowing the removal of emc2305_unset_tz and
emc2305_remove, which are no longer needed.

Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250321143308.4008623-4-florin.leotescu@oss.nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-21 17:07:38 -07:00
Florin Leotescu
882bd6de1a hwmon: emc2305: Add OF support
Introduce OF support for Microchip emc2305 pwm fan controller.

Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250321143308.4008623-3-florin.leotescu@oss.nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-21 17:07:02 -07:00
Huisong Li
16746ce8ad hwmon: (acpi_power_meter) Replace the deprecated hwmon_device_register
When load this mode, we can see the following log:
"power_meter ACPI000D:00: hwmon_device_register() is deprecated. Please
 convert the driver to use hwmon_device_register_with_info()."

So replace hwmon_device_register with hwmon_device_register_with_info.

These attributes, 'power_accuracy', 'power_cap_hyst', 'power_average_min'
and 'power_average_max', should have been placed in hwmon_chip_info as
power data type. But these attributes are displayed as string format on
the following case:
a) power1_accuracy  --> display like '90.0%'
b) power1_cap_hyst  --> display 'unknown' when its value is 0xFFFFFFFF
c) power1_average_min/max --> display 'unknown' when its value is
			      negative.
To avoid any changes in the display of these sysfs interfaces, we can't
modifiy the type of these attributes in hwmon core and have to put them
to extra_groups.

Please note that the path of these sysfs interfaces are modified
accordingly if use hwmon_device_register_with_info():
old: all sysfs interfaces are under acpi device, namely,
     /sys/class/hwmon/hwmonX/device/
now: all sysfs interfaces are under hwmon device, namely,
     /sys/class/hwmon/hwmonX/
The new ABI does not guarantee that the underlying path remains the same.
But we have to accept this change so as to replace the deprecated API.
Fortunately, some userspace application, like libsensors, would scan
the two path and handles this automatically. So we can accept this change
so as to drop the deprecated message.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Link: https://lore.kernel.org/r/20250319020638.59925-1-lihuisong@huawei.com
[groeck: Fixed some multi-line alignment issues;
 reverted to 32-bit arithmetic in power1_accuracy_show()
 fixed bad return code from power_meter_is_visible()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-21 08:01:05 -07:00
Andrei Lalaev
bf1bb26f23 hwmon: add driver for HTU31
Add base support for HTU31 temperature and humidity sensor.

Besides temperature and humidity values, the driver also exports a 24-bit
heater control to sysfs and serial number to debugfs.

Signed-off-by: Andrei Lalaev <andrey.lalaev@gmail.com>
Link: https://lore.kernel.org/r/20250217051110.46827-2-andrey.lalaev@gmail.com
[groeck: Fixed continuation line alignment]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-18 08:03:40 -07:00
Leo Yang
b64b6cb163 hwmon: Add driver for TI INA233 Current and Power Monitor
Driver for Texas Instruments INA233 Current and Power Monitor
With I2C-, SMBus-, and PMBus-Compatible Interface

Signed-off-by: Leo Yang <leo.yang.sy0@gmail.com>
Link: https://lore.kernel.org/r/20250116085939.1235598-3-leo.yang.sy0@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-18 08:03:37 -07:00
Thomas Richard
08ebc9def7 hwmon: Add Congatec Board Controller monitoring driver
Add support for the Congatec Board Controller. This controller exposes
temperature, voltage, current and fan sensors.

The available sensors list cannot be predicted. Some sensors can be
present or not, depending the system.
The driver has an internal list of all possible sensors, for all Congatec
boards. The Board Controller gives to the driver its sensors list, and
their status (active or not).

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/r/20250203-congatec-board-controller-hwmon-v4-1-ff6c76a4662c@bootlin.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-17 11:15:53 -07:00
Kim Seer Paller
c1d6afdbb8 hwmon: (pmbus/ltc2978) add support for lt717x
Add support for LT7170 and LT7171. The LT7170 and LT7171 are 20 A, 16 V,
Single- or Dual-Phase, Silent Switcher Step-Down Regulators with Digital
Power System Management.

The relevant registers in the LT7170 and LT7171 are similar to those in
the LTC3887, but with fewer channels. This adds the chip ID and
identification of ASCII to differentiate between the LT7170 and LT7171.
These devices support polling for status updates and clearing peak
values. The data format for voltage, current, and temperature is set to
IEEE754 for precision and compatibility.

Co-developed-by: Cherrence Sarip <cherrence.sarip@analog.com>
Signed-off-by: Cherrence Sarip <cherrence.sarip@analog.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Link: https://lore.kernel.org/r/20250317-hwmon-next-v1-3-da0218c38197@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-17 08:05:08 -07:00
Tasos Sahanidis
815f80ad20 hwmon: (nct6775-core) Fix out of bounds access for NCT679{8,9}
pwm_num is set to 7 for these chips, but NCT6776_REG_PWM_MODE and
NCT6776_PWM_MODE_MASK only contain 6 values.

Fix this by adding another 0 to the end of each array.

Signed-off-by: Tasos Sahanidis <tasos@tasossah.com>
Link: https://lore.kernel.org/r/20250312030832.106475-1-tasos@tasossah.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-17 04:44:20 -07:00
Kurt Borja
dbcfcb239b hwmon: (dell-smm) Increment the number of fans
Some Alienware laptops that support the SMM interface, may have up to 4
fans.

Tested on an Alienware x15 r1.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://lore.kernel.org/r/20250304055249.51940-2-kuurtb@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-11 07:11:42 -07:00
Maud Spierings
7953605976 hwmon: (ntc_thermistor) return error instead of clipping on OOB
When the ntc is reading Out Of Bounds instead of clipping to the nearest
limit (min/max) return -ENODATA. This prevents malfunctioning sensors
from sending a device into a shutdown loop due to a critical trip.

This implementation will only work for ntc type thermistors if a ptc
type is to be implemented the min/max ohm calculation must be adjusted
to take that into account.

Signed-off-by: Maud Spierings <maudspierings@gocontroll.com>
Link: https://lore.kernel.org/r/20250307-ntc_oob-v2-1-bba2d32b1a8e@gocontroll.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-07 06:57:52 -08:00
Wolfram Sang
ee65d9e630 hwmon: (pt5161l) Use per-client debugfs entry
The I2C core now offers a debugfs-directory per client. Use it and
remove the custom handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250305123149.16990-2-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-05 21:17:56 -08:00
Huisong Li
232427772f hwmon: Fix the missing of 'average' word in hwmon_power_attr_templates
The string "power%d_interval_max" and "power%d_interval_min" in the
hwmon_power_attr_templates[] are corresponding to the sysfs interface name
of hwmon_power_average_interval_max and hwmon_power_average_interval_min.
But the 'average' word is missing in two strings. Fortunately, there is
no driver to use it yet.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Link: https://lore.kernel.org/r/20250304074640.2770353-1-lihuisong@huawei.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-04 03:13:18 -08:00
Xinghuo Chen
10fce7ebe8 hwmon: fix a NULL vs IS_ERR_OR_NULL() check in xgene_hwmon_probe()
The devm_memremap() function returns error pointers on error,
it doesn't return NULL.

Fixes: c7cefce03e ("hwmon: (xgene) access mailbox as RAM")
Signed-off-by: Xinghuo Chen <xinghuo.chen@foxmail.com>
Link: https://lore.kernel.org/r/tencent_9AD8E7683EC29CAC97496B44F3F865BA070A@qq.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-03 06:04:34 -08:00
Huisong Li
0ea627381e hwmon: (acpi_power_meter) Fix the fake power alarm reporting
We encountered a problem that a fake power alarm is reported to
user on the platform unsupported notifications at the second step
below:
1> Query 'power1_alarm' attribute when the power capping occurs.
2> Query 'power1_alarm' attribute when the power capping is over
   and the current average power is less then power cap value.

The root cause is that the resource->power_alarm is set to true
at the first step. And power meter use this old value to show
the power alarm state instead of the current the comparison value.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Link: https://lore.kernel.org/r/20250220030832.2976-1-lihuisong@huawei.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 10:31:26 -08:00
Alexander Stein
9fee7d19ba hwmon: (gpio-fan) Add missing mutex locks
set_fan_speed() is expected to be called with fan_data->lock being locked.
Add locking for proper synchronization.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20250210145934.761280-3-alexander.stein@ew.tq-group.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:52:39 -08:00
Guenter Roeck
c90a00368d hwmon: (pmbus/core) Report content of CAPABILITY register in debugfs
Report the value of the CAPABILITY register in debugfs if supported.
Only check if the register is supported if PMBUS_NO_CAPABILITY
is not set.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:49:10 -08:00
Guenter Roeck
64fbb4c42a hwmon: (pmbus/core) Optimize debugfs status attribute initialization
Define debugfs attributes used to access status registers in a data
structure and loop through it instead of creating debugfs files
one by one. This reduces code size and simplifies adding additional
attributes if needed.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:49:06 -08:00
Guenter Roeck
2a431adc96 hwmon: (pmbus/core) Optimize debugfs block data attribute initialization
Define debugfs attributes which need block data access in a data
structure and loop through it instead of creating debugfs files
one by one. This reduces code size and simplifies adding additional
attributes if needed.

While this is currently only used for manufacturer specific attributes,
the access code is generic and also works for other block attributes,
so rename operation functions from _mfg to _block.

While at it, rename the "revison" file to "pmbus_revision" to make its
meaning more obvious and to create a clear distinction against the
"mfg_revision" file.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:49:01 -08:00
Guenter Roeck
510db88a1c hwmon: (pmbus/core) Declare regulator notification function as void
The regulator notification function never returns an error.
Declare it as void.

While at it, fix its indentation.

No functional change.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:48:59 -08:00
Guenter Roeck
05452a3328 hwmon: (pmbus/core) Make debugfs code unconditional
Drop contitionals around debugfs code to compile it unconditionally.
In practice it will be optimized away by the compiler if CONFIG_DEBUG_FS
is not enabled, so the code size is not affected by this change.

Also silently ignore errors if debugfs initialization fails.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:48:32 -08:00
Guenter Roeck
de438ec92f hwmon: (pmbus/core) Use the new i2c_client debugfs directory
The I2C core now manages a debugfs directory per I2C client. PMBus has
its own debugfs hierarchy. Link the two, so a user will be pointed to
the I2C domain from the PMBus domain.

Suggested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:48:32 -08:00
Guenter Roeck
6625a059e6 hwmon: (pmbus/core) Use local debugfs variable in debugfs initialization
In preparation for the next patch in the series, use a local debugfs
variable during debugfs initialization.

No functional change intended.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:48:32 -08:00
Guenter Roeck
649b419f91 hwmon: (pmbus/core) Fix various coding style issues
Checkpatch reports bad multi-line comments, bad multi-line alignments,
missing blank lines after variable declarations, unnecessary empty lines,
unnecessary spaces, and unnecessary braces. Fix most of the reported
problems except for some multi-line alignment problems.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:48:32 -08:00
Erik Schumacher
e278d5e8ae hwmon: (ad7314) Validate leading zero bits and return error
Leading zero bits are sent on the bus before the temperature value is
transmitted. If any of these bits are high, the connection might be
unstable or there could be no AD7314 / ADT730x (or compatible) at all.
Return -EIO in that case.

Signed-off-by: Erik Schumacher <erik.schumacher@iris-sensing.com>
Fixes: 4f3a659581 ("hwmon: AD7314 driver (ported from IIO)")
Link: https://lore.kernel.org/r/24a50c2981a318580aca8f50d23be7987b69ea00.camel@iris-sensing.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:42:01 -08:00
Shengyu Qu
e0444758dd hwmon: (asus-ec-sensors) add PRIME X670E-PRO WIFI
Add support for PRIME X670E-PRO WIFI.

Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
Link: https://lore.kernel.org/r/TYCPR01MB84377BEADF97E8E7554EF0CF98C32@TYCPR01MB8437.jpnprd01.prod.outlook.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:39:03 -08:00
Maud Spierings
e3ff0c72cb hwmon: (ntc_thermistor) Fix module name in the Kconfig
The module name is incorrectly stated with a hyphen while it is an
underscore.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Maud Spierings <maudspierings@gocontroll.com>
Link: https://lore.kernel.org/r/20250227-ntc_thermistor_fixes-v1-1-70fa73200b52@gocontroll.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:36:08 -08:00
Maud Spierings
1c7932d5ae hwmon: (ntc_thermistor) Fix the ncpXXxh103 sensor table
I could not find a single table that has the values currently present in
the table, change it to the actual values that can be found in [1]/[2]
and [3] (page 15 column 2)

[1]: https://www.murata.com/products/productdetail?partno=NCP15XH103F03RC
[2]: https://www.murata.com/products/productdata/8796836626462/NTHCG83.txt?1437969843000
[3]: https://nl.mouser.com/datasheet/2/281/r44e-522712.pdf

Fixes: 54ce3a0d80 ("hwmon: (ntc_thermistor) Add support for ncpXXxh103")
Signed-off-by: Maud Spierings <maudspierings@gocontroll.com>
Link: https://lore.kernel.org/r/20250227-ntc_thermistor_fixes-v1-3-70fa73200b52@gocontroll.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:35:45 -08:00
Thorsten Blum
69af654bf9 hwmon: (pmbus/core) Replace deprecated strncpy() with strscpy()
strncpy() is deprecated for NUL-terminated destination buffers; use
strscpy() instead.

Compile-tested only.

Note(groeck): strscpy() uses sizeof() to determine the length of the
destination buffer if it is not provided as argument.

Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250227173936.7746-2-thorsten.blum@linux.dev
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:30:11 -08:00
Titus Rwantare
6b6e2e8fd0 hwmon: (pmbus) Initialise page count in pmbus_identify()
The `pmbus_identify()` function fails to correctly determine the number
of supported pages on PMBus devices. This occurs because `info->pages`
is implicitly zero-initialised, and `pmbus_set_page()` does not perform
writes to the page register if `info->pages` is not yet initialised.
Without this patch, `info->pages` is always set to the maximum after
scanning.

This patch initialises `info->pages` to `PMBUS_PAGES` before the probing
loop, enabling `pmbus_set_page()` writes to make it out onto the bus
correctly identifying the number of pages. `PMBUS_PAGES` seemed like a
reasonable non-zero number because that's the current result of the
identification process.

Testing was done with a PMBus device in QEMU.

Signed-off-by: Titus Rwantare <titusr@google.com>
Fixes: 442aba7872 ("hwmon: PMBus device driver")
Link: https://lore.kernel.org/r/20250227222455.2583468-1-titusr@google.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:27:22 -08:00
Mikhail Paulyshka
fafac0ebb2 hwmon: (k10temp) add support for cyan skillfish
Add support for Cyan Skillfish (AMD Family 17h Model 47h),
which appear to be Zen 2 based APU.

The patch was tested with an AMD BC-250 board.

Signed-off-by: Mikhail Paulyshka <me@mixaill.net>
Link: https://lore.kernel.org/r/20250302155009.49951-1-me@mixaill.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:15:21 -08:00
Mikhail Paulyshka
f392611e26 hwmon: (nct6683) Add customer ID for AMD BC-250
This value was found on an AMD BC-250 board with an
NCT6686D chip.

Signed-off-by: Mikhail Paulyshka <me@mixaill.net>
Link: https://lore.kernel.org/r/20250302155053.50096-1-me@mixaill.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02 08:14:41 -08:00
Paul Fertser
5797c04400 hwmon: (peci/dimmtemp) Do not provide fake thresholds data
When an Icelake or Sapphire Rapids CPU isn't providing the maximum and
critical thresholds for particular DIMM the driver should return an
error to the userspace instead of giving it stale (best case) or wrong
(the structure contains all zeros after kzalloc() call) data.

The issue can be reproduced by binding the peci driver while the host is
fully booted and idle, this makes PECI interaction unreliable enough.

Fixes: 73bc1b885d ("hwmon: peci: Add dimmtemp driver")
Fixes: 621995b6d7 ("hwmon: (peci/dimmtemp) Add Sapphire Rapids support")
Cc: stable@vger.kernel.org
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com>
Link: https://lore.kernel.org/r/20250123122003.6010-1-fercerpav@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-24 18:10:10 -08:00
Armin Wolf
27cc2914e4
hwmon: (hp-wmi-sensors) Use the WMI bus API when accessing sensors
Since the driver already binds to HP_WMI_NUMERIC_SENSOR_GUID, using
wmidev_block_query() allows for faster sensor access.

Acked-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: James Seo <james@equiv.tech>
Reviewed-by: James Seo <james@equiv.tech>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250216193251.866125-2-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-02-24 13:19:12 +02:00
Andrey Vatoropin
8df0f00282 hwmon: (xgene-hwmon) use appropriate type for the latency value
The expression PCC_NUM_RETRIES * pcc_chan->latency is currently being
evaluated using 32-bit arithmetic.

Since a value of type 'u64' is used to store the eventual result,
and this result is later sent to the function usecs_to_jiffies with
input parameter unsigned int, the current data type is too wide to
store the value of ctx->usecs_lat.

Change the data type of "usecs_lat" to a more suitable (narrower) type.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
Link: https://lore.kernel.org/r/20250204095400.95013-1-a.vatoropin@crpt.ru
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-06 18:52:38 -08:00
Arnd Bergmann
89cb3ca56c hwmon: (sg2042) Add back module description/author tags
A previous code reorganization inadvertently dropped the two tags,
which leads to a "make W=1" warning:

WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hwmon/sg2042-mcu.o

Add these back.

Fixes: cd4db38c43 ("hwmon: (sg2042) Use per-client debugfs entry")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Inochi Amaoto <inochiama@gmail.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250205121419.373464-1-arnd@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-06 18:51:18 -08:00
Wolfram Sang
bfbb730c42 hwmon: (sht3x) Use per-client debugfs entry
The I2C core now offers a debugfs-directory per client. Use it and
remove the custom handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250131095148.11973-2-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-02 17:34:06 -08:00
Wolfram Sang
84d867067b hwmon: (tps23861) Use per-client debugfs entry
The I2C core now offers a debugfs-directory per client. Use it and
remove the custom handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250125123941.36729-14-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-02 17:34:06 -08:00
Wolfram Sang
cd4db38c43 hwmon: (sg2042) Use per-client debugfs entry
The I2C core now offers a debugfs-directory per client. Use it and
remove the custom handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250125123941.36729-12-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-02 17:34:06 -08:00
Wolfram Sang
2e522c2933 hwmon: (ltc4282) Use per-client debugfs entry
The I2C core now offers a debugfs-directory per client. Use it and
remove the custom handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250125123941.36729-10-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-02 17:34:06 -08:00
Wolfram Sang
82dda5cb88 hwmon: (ina3221) Use per-client debugfs entry
The I2C core now offers a debugfs-directory per client. Use it and
remove the custom handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250125123941.36729-9-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-02 17:34:06 -08:00
Wolfram Sang
c36e0a1b26 hwmon: (isl28022) Use per-client debugfs entry
The I2C core now offers a debugfs-directory per client. Use it and
remove the custom handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20250123160347.44635-1-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-02 17:34:06 -08:00
Ming Yu
02778f69fd hwmon: (lm90): Add support for NCT7716, NCT7717 and NCT7718
NCT7716 is similar to NCT7717 but has one more address support,
both of them only have a 8 bit resolution local thermal sensor.

NCT7718 has 11 bit resoulution remote thermal sensor.

Signed-off-by: Ming Yu <a0282524688@gmail.com>
Link: https://lore.kernel.org/r/20250117100744.1571385-2-a0282524688@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-02 17:34:06 -08:00
Cedric Encarnacion
68b6f95861 hwmon: (pmbus/ltc2978) add support for ltm4673
Add support for LTM4673. The LTM4673 is a quad output, dual 12A and dual
5A, switching mode DC/DC step-down μModule regulator integrated with
4-channel power system manager.

This adds only the chip id, the checks for the manufacturer special id,
and the relevant attributes for the device's pmbus_driver_info.
The device does not support clear peaks.

Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
Link: https://lore.kernel.org/r/20250124-ltm4673-v1-2-a2c6aa37c903@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-02 17:34:06 -08:00
Andy Shevchenko
352a21d290 hwmon: (gsc) drop unneeded assignment for cache_type
REGCACHE_NONE is the default type of the cache when not provided.
Drop unneeded explicit assignment to it.

Note, it's defined to 0, and if ever be redefined, it will break
literally a lot of the drivers, so it very unlikely to happen.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250129152036.1797725-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-02 17:34:06 -08:00
Linus Torvalds
2ab002c755 Driver core and debugfs updates
Here is the big set of driver core and debugfs updates for 6.14-rc1.
 It's coming late in the merge cycle as there are a number of merge
 conflicts with your tree now, and I wanted to make sure they were
 working properly.  To resolve them, look in linux-next, and I will send
 the "fixup" patch as a response to the pull request.
 
 Included in here is a bunch of driver core, PCI, OF, and platform rust
 bindings (all acked by the different subsystem maintainers), hence the
 merge conflict with the rust tree, and some driver core api updates to
 mark things as const, which will also require some fixups due to new
 stuff coming in through other trees in this merge window.
 
 There are also a bunch of debugfs updates from Al, and there is at least
 one user that does have a regression with these, but Al is working on
 tracking down the fix for it.  In my use (and everyone else's linux-next
 use), it does not seem like a big issue at the moment.
 
 Here's a short list of the things in here:
   - driver core bindings for PCI, platform, OF, and some i/o functions.
     We are almost at the "write a real driver in rust" stage now,
     depending on what you want to do.
   - misc device rust bindings and a sample driver to show how to use
     them
   - debugfs cleanups in the fs as well as the users of the fs api for
     places where drivers got it wrong or were unnecessarily doing things
     in complex ways.
   - driver core const work, making more of the api take const * for
     different parameters to make the rust bindings easier overall.
   - other small fixes and updates
 
 All of these have been in linux-next with all of the aforementioned
 merge conflicts, and the one debugfs issue, which looks to be resolved
 "soon".
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZ5koPA8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymFHACfT5acDKf2Bov2Lc/5u3vBW/R6ChsAnj+LmgVI
 hcDSPodj4szR40RRnzBd
 =u5Ey
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core and debugfs updates from Greg KH:
 "Here is the big set of driver core and debugfs updates for 6.14-rc1.

  Included in here is a bunch of driver core, PCI, OF, and platform rust
  bindings (all acked by the different subsystem maintainers), hence the
  merge conflict with the rust tree, and some driver core api updates to
  mark things as const, which will also require some fixups due to new
  stuff coming in through other trees in this merge window.

  There are also a bunch of debugfs updates from Al, and there is at
  least one user that does have a regression with these, but Al is
  working on tracking down the fix for it. In my use (and everyone
  else's linux-next use), it does not seem like a big issue at the
  moment.

  Here's a short list of the things in here:

   - driver core rust bindings for PCI, platform, OF, and some i/o
     functions.

     We are almost at the "write a real driver in rust" stage now,
     depending on what you want to do.

   - misc device rust bindings and a sample driver to show how to use
     them

   - debugfs cleanups in the fs as well as the users of the fs api for
     places where drivers got it wrong or were unnecessarily doing
     things in complex ways.

   - driver core const work, making more of the api take const * for
     different parameters to make the rust bindings easier overall.

   - other small fixes and updates

  All of these have been in linux-next with all of the aforementioned
  merge conflicts, and the one debugfs issue, which looks to be resolved
  "soon""

* tag 'driver-core-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (95 commits)
  rust: device: Use as_char_ptr() to avoid explicit cast
  rust: device: Replace CString with CStr in property_present()
  devcoredump: Constify 'struct bin_attribute'
  devcoredump: Define 'struct bin_attribute' through macro
  rust: device: Add property_present()
  saner replacement for debugfs_rename()
  orangefs-debugfs: don't mess with ->d_name
  octeontx2: don't mess with ->d_parent or ->d_parent->d_name
  arm_scmi: don't mess with ->d_parent->d_name
  slub: don't mess with ->d_name
  sof-client-ipc-flood-test: don't mess with ->d_name
  qat: don't mess with ->d_name
  xhci: don't mess with ->d_iname
  mtu3: don't mess wiht ->d_iname
  greybus/camera - stop messing with ->d_iname
  mediatek: stop messing with ->d_iname
  netdevsim: don't embed file_operations into your structs
  b43legacy: make use of debugfs_get_aux()
  b43: stop embedding struct file_operations into their objects
  carl9170: stop embedding file_operations into their objects
  ...
2025-01-28 12:25:12 -08:00
Linus Torvalds
9d5db4e3fc I3C for 6.14
Core:
  - Improve initialization of numbered I2C adapters
 
 Drivers:
  - use parity8 helper
  - dw: fix possible use-after-free
  - mipi-i3c-hci: add support for PCI bus host
  - svc: many fixes for IBI and hotjoin
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEBqsFVZXh8s/0O5JiY6TcMGxwOjIFAmeSwjsACgkQY6TcMGxw
 OjJluBAAnw46F+qJM6XA1pPOYCc2uvVj6kmswMl5ZVWGplvY1qCnAq8PBHQTdKIY
 O7EV9QejCZZxMaa/ruh9VhyLyLNo8pm6wcCNXwufhDmH1kuAP+7cWjPh1qWsMBg6
 TaBD05mN7FC9YPPsAPnx9IJNSdsbrSF6bc8m+7xrweQa9guX3TH+aim/U1K4RSh4
 VnpiDKHRKaymoZ5Ldkny112/1/+L64bHnn/f4M5wNC6I9j3S/enmE3zKoi4UbeNR
 b73GqxjB8v9Er7Stafs8iHfboNfNKS9RiJDgFHg1+5eThbN9TTU3k2ym/osUCmet
 WJysSc88sp/vbr7BszDtTsAQb/p87WUFleU05rc0k+v0qF7GHH1wPrEjW46rfATL
 JgXbKEQK3vcoYsfQhnzJC6W5PhNHTP4VOlIiwZAeGjsVSkbVZHRNez1gQa77dYu/
 pTpVon6M83Mn6QLkq+LwSuO4ZkBEMna43j9hQ7OmjxKq7Xmf5WJfrd++yjjaMmbu
 OUbOOjDYL7D3q5t2QO96zHYXnPfZJ7BBw8J0XgyApNRcyWVXZ9iUKyP9TtI+V1Or
 /CUUk1tHnOZ7NcedCes0yIzrTRy0LXShHU6tioRKJCvG/PE06pIipfrJX8gtT7uz
 ybNaLDuLoUzIcsOGpBY2SPgirnYLxlnrITTTI7C9TFhCHPnYiSc=
 =esI9
 -----END PGP SIGNATURE-----

Merge tag 'i3c/for-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux

Pull i3c updates from Alexandre Belloni:
 "The main change is the addition of PCI bus support for mipi-i3c-hci.

  I'm also carrying an hwmon patch as it makes use of the bitops
  addition that is then mainly used by i3c drivers.

  Core:
   - Improve initialization of numbered I2C adapters

  Drivers:
   - use parity8 helper
   - dw: fix possible use-after-free
   - mipi-i3c-hci: add support for PCI bus host
   - svc: many fixes for IBI and hotjoin"

* tag 'i3c/for-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux:
  i3c: master: Improve initialization of numbered I2C adapters
  i3c: master: Fix missing 'ret' assignment in set_speed()
  i3c: cdns: use parity8 helper instead of open coding it
  i3c: mipi-i3c-hci: use parity8 helper instead of open coding it
  i3c: dw: use parity8 helper instead of open coding it
  hwmon: (spd5118) Use generic parity calculation
  bitops: add generic parity calculation for u8
  i3c: mipi-i3c-hci: Add support for MIPI I3C HCI on PCI bus
  i3c: mipi-i3c-hci: Add Intel specific quirk to ring resuming
  i3c: fix kdoc parameter description for module_i3c_i2c_driver()
  i3c: dw: Fix use-after-free in dw_i3c_master driver due to race condition
2025-01-24 15:48:01 -08:00
Linus Torvalds
a4910ed25d hwmon updates for v6.14-rc1
* New drivers
 
   - PMBus client driver for Intel CRPS185 power supply
 
   - PMBus client driver for Texas Instruments TPS25990
 
 * Chip support added to existing drivers
 
   - pmbus/max15301: Add support for MAX15303
 
   - pmbus/adm1275: Add adm1273 support
 
   - lm75: Add NXP P3T1755 support; with it, add I3C support to the driver
 
   - asus-ec-sensors: Add TUF GAMING X670E PLUS
 
 * Other notable changes
 
    - nct6683: Add customer IDs for several MSI and ASRock boards
 
    - tmp108: Add regulator support
 
    - Improve write protect support in PMBus core
 
    - pmbus/dps920ab: Add ability to instantiate through i2c
 
    - The hwmon core now accepts NULL as device name parameter to
      [devm_]hwmon_device_register_with_info ans uses the parent device
      name as fallback in that case
 
    - The PMBus core now provides the PMBUs revision in a debugfs file
 
    - asus-ec-sensors: Support for optional CPU fan on AMD 600 motherboards
 
    - raspberrypi: Add PM suspend/resume support
 
    - dell-smm: Enable manual fan control support on Dell XPS 9370
 
    - pwm-fan: Default to maximum cooling level if provided
 
 * Various other minor fixes and improvements
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmeOX+AACgkQyx8mb86f
 mYG4bA/+PJ4hkttSuwK6eR4F1o5l2VQhWPkWn2XzruEJGixhKLJKxKVkUCymmSsd
 hepHZnw+aUKUmVeb0StSReshp6oGeOHHlKXUM1zv95HI1NMxMrflzeRuqjVNUnDK
 ZitZkOb2WuUWhZIKIu82ole+3tw/0QyAYmSa9FPyp63rQ7C/QAWl2g4h6m3VdDLZ
 1ZOimR/OOFAesZMOuEIBMIHnIqzKLr2QEFd5cZVKM5JbpB7LAHah3fPOvRC3sKco
 02OOzFOrtZrXIIPDpsnznm6DF8jgbiKjGb8frR6DLAm/uGvPhuXuS0tYnWHAZs5D
 nJHDCud1XROK2r9NHDiMZGxCxGOXmB+Fx71jUvY9692NMD2XWUzrqqoOs+c97eeG
 YszAe1FL9QpgbLJnsFWurU72uvOMmkIeETZUE2cmkupwH+Ja5sc4sDPwf6S8Pwus
 Y0ZonVqsLQb4UasGcfvFUEb8P6LQdshWx5IWxhfDs+xBo+n5pOEtu+ZCF5Z18k6A
 A6g4SWWu8QtZOD9fEW0Rt/d9/QtPCTQc8UrJpCofWyKWpLzuoU0Xcs9g/ajLK3Vz
 +YxM5Pgj7XMWtvPVx2ntnr5VAVKWCUv/jchWuKYKrGI58g3laPagmJMVEy8wrW9+
 MpUGzaNDEMlvv7n4Jr4ipkYv9ltOIheu8pmzuI2PcadvAcKmF28=
 =/7Qs
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon updates from Guenter Roeck:
 "New drivers:

   - PMBus client driver for Intel CRPS185 power supply

   - PMBus client driver for Texas Instruments TPS25990

  Chip support added to existing drivers:

   - pmbus/max15301: Add support for MAX15303

   - pmbus/adm1275: Add adm1273 support

   - lm75: Add NXP P3T1755 support; with it, add I3C support to the
     driver

   - asus-ec-sensors: Add TUF GAMING X670E PLUS

  Other notable changes:

   - nct6683: Add customer IDs for several MSI and ASRock boards

   - tmp108: Add regulator support

   - Improve write protect support in PMBus core

   - pmbus/dps920ab: Add ability to instantiate through i2c

   - The hwmon core now accepts NULL as device name parameter to
     [devm_]hwmon_device_register_with_info ans uses the parent device
     name as fallback in that case

   - The PMBus core now provides the PMBUs revision in a debugfs file

   - asus-ec-sensors: Support for optional CPU fan on AMD 600
     motherboards

   - raspberrypi: Add PM suspend/resume support

   - dell-smm: Enable manual fan control support on Dell XPS 9370

   - pwm-fan: Default to maximum cooling level if provided

  And various other minor fixes and improvements"

* tag 'hwmon-for-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (44 commits)
  hwmon: pmbus: dps920ab: Add ability to instantiate through i2c
  hwmon: (pwm-fan) Default to the Maximum cooling level if provided
  hwmon: (asus_atk0110) Use str_enabled_disabled() and str_enable_disable() helpers
  hwmon: Fix help text for aspeed-g6-pwm-tach
  hwmon: (dell-smm) Add Dell XPS 9370 to fan control whitelist
  hwmon: (acpi_power_meter) Fix update the power trip points on failure
  hwmon: (acpi_power_meter) Fix uninitialized variables
  hwmon: (core) Use device name as a fallback in devm_hwmon_device_register_with_info
  hwmon: (pmbus/max15301) Add support for MAX15303
  hwmon: (pmbus/adm1275) add adm1273 support
  dt-bindings: hwmon: adm1275: add adm1273
  hwmon: (nct6683) Add another customer ID for MSI
  hwmon: (pwm-fan): Make use of device properties everywhere
  hwmon: (lm75) add I3C support for P3T1755
  hwmon: (lm75) separate probe into common and I2C parts
  hwmon: (lm75) Remove superfluous 'client' member from private struct
  hwmon: (lm75) simplify regulator handling
  hwmon: (lm75) simplify lm75_write_config()
  hwmon: (lm75) Hide register size differences in regmap access functions
  hwmon: (pmbus/crps) Add Intel CRPS185 power supply
  ...
2025-01-22 10:16:48 -08:00
Linus Torvalds
909fd2b89f - Fix race in device_node_get_regmap() using more extensive locking.
- Remove unused platform driver support for syscon.
 - Allow syscon nodes to be registered without a "syscon" compatible string.
 - Make `platform_data` pointer const in struct mfd_cell.
 - Revert support for multiple AXP PMICs to avoid regressions.
 - Increase SoundWire attach timeout and use gpiod_set_raw() for GPIO operation.
 - Store the result from fault_log() for use by other sub-components.
 - Fix an invalid regmap-config max_register value.
 - Add another Gemini Lake ISA bridge PCI device ID.
 - Use devm_register_power_off_handler() to simplify code.
 - Add support for QNAP microcontroller units, including LEDs, input, and hwmon.
 - Use MFD_CELL macros and remove unused code.
 - Add support for AAEON UP board FPGA.
 - Remove unused includes.
 - Fix various typos and compatibility issues in multiple bindings.
 - Add new bindings for rk3562 QoS, LED1202, and qcom,tcsr-ipq5424.
 - Convert several bindings to YAML schema.
 - Update sprd,sc2731 bindings to reference sprd,sc2731-efuse bindings directly.
 - Fix rohm,bd71815 bindings by correcting resistor values and typos.
 - Documentation improvements:
 - Add documentation for LED1202 and qnap-mcu-hwmon.
 - Adjust the file entry for the qnap-mcu header in MAINTAINERS.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmePbHkACgkQUa+KL4f8
 d2HQNw//fM3+JpyTUKjUtBl8YH0ilgZ2iKiXLHyJ6vMIqv+RfLlPAliM8f1bkEj8
 x/9kKp6ytdyAhQ/oAJW/vxRhWZVsfh9T7WSy/Q/WNChcGJ0KtUwtjWWuezdDJoyr
 6Ju4PhKHVz46cBW56u3OCbcogN8AHi1gZiAh8APwVhldUO6swaisPBvxw/4u4WMs
 HGviTLueXEptF4/actnArQ1YJ6tctY7C5tV06f6Irxn6hSz8EpGBRQ47S7Hom+mx
 aIyRLkERqhZ1FNBDfk2YERqaOyxzQRYy+PMNr6AtQ/TE+7pVBOz7xoSI3VH3k7mM
 k4u8Gau9qbnVi/pUkabgcdKOCGUYeZzXZgJT/Ttq5O9ddPE8sHMcLrxKMtUP2CBE
 6Zf0EljscGFOWise/ocNUblpy0rfXPl+wMiibxY5C+X56QkluDn2Q8ObGODt0bbR
 ACgPFL2S8m2MLEOTzBKDlSgeqoMZFKVWkqAry+yNUgIKbtM6pIdaM5ZCUhgdJ5GL
 CxGP6uw68oAUnr1lRCytgGR5XtmcIXS/Jo2u/T7cmucD3inuxQyt5TrZxma48QbL
 2+P2vmymn6ZWQb82OptrnKCMsBEXnNbWv+2BiRYoKXQt48BxIocVrsyEQIh4qGcP
 KPUB1aCxP/zJ2H7rTaK4QqM+fgOloShs5nI21v5EWSCQKvTN5ko=
 =3HQm
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull mfd updates from Lee Jones:

 - Fix race in device_node_get_regmap() using more extensive locking

 - Remove unused platform driver support for syscon

 - Allow syscon nodes to be registered without a "syscon" compatible
   string

 - Make `platform_data` pointer const in struct mfd_cell

 - Revert support for multiple AXP PMICs to avoid regressions

 - Increase SoundWire attach timeout and use gpiod_set_raw() for GPIO
   operation

 - Store the result from fault_log() for use by other sub-components

 - Fix an invalid regmap-config max_register value

 - Add another Gemini Lake ISA bridge PCI device ID

 - Use devm_register_power_off_handler() to simplify code

 - Add support for QNAP microcontroller units, including LEDs, input,
   and hwmon

 - Use MFD_CELL macros and remove unused code

 - Add support for AAEON UP board FPGA

 - Remove unused includes

 - Fix various typos and compatibility issues in multiple bindings

 - Add new bindings for rk3562 QoS, LED1202, and qcom,tcsr-ipq5424

 - Convert several bindings to YAML schema

 - Update sprd,sc2731 bindings to reference sprd,sc2731-efuse bindings
   directly

 - Fix rohm,bd71815 bindings by correcting resistor values and typos

 - Documentation improvements:
    - Add documentation for LED1202 and qnap-mcu-hwmon
    - Adjust the file entry for the qnap-mcu header in MAINTAINERS

* tag 'mfd-next-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (35 commits)
  MAINTAINERS: Adjust the file entry for the qnap-mcu header
  dt-bindings: mfd: syscon: Fix ti,j784s4-acspcie-proxy-ctrl compatible
  dt-bindings: mfd: syscon: Fix al,alpine-sysfabric-service compatible
  Revert "mfd: axp20x: Allow multiple regulators"
  dt-bindings: mfd: syscon: Add rk3562 QoS register compatible
  mfd: syscon: Allow syscon nodes without a "syscon" compatible
  mfd: syscon: Remove the platform driver support
  mfd: syscon: Fix race in device_node_get_regmap()
  dt-bindings: mfd: atmel: Convert to YAML schema
  dt-bindings: mfd: atmel,at91sam9260: Convert to YAML schema
  dt-bindings: mfd: sprd,sc2731: Reference sprd,sc2731-efuse bindings
  mfd: tps65219: Remove unused macros & add regmap.h
  mfd: tps65219: Use MFD_CELL macros
  leds: Add LED1202 I2C driver
  dt-bindings: leds: Add LED1202 LED Controller
  Documentation:leds: Add leds-st1202.rst
  mfd: Add support for AAEON UP board FPGA
  mfd: da9052: Store result from fault_log
  mfd: intel_soc_pmic_chtdc_ti: Fix invalid regmap-config max_register value
  mfd: cs42l43: Use devres for remove as well
  ...
2025-01-22 09:16:02 -08:00
Linus Torvalds
b9d8a295ed - The first part of a restructuring of AMD's representation of a northbridge
which is legacy now, and the creation of the new AMD node concept which
   represents the Zen architecture of having a collection of I/O devices within
   an SoC. Those nodes comprise the so-called data fabric on Zen. This has
   at least one practical advantage of not having to add a PCI ID each time
   a new data fabric PCI device releases. Eventually, the lot more uniform
   provider of data fabric functionality amd_node.c will be used by all the
   drivers which need it
 
 - Smaller cleanups
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmePuPIACgkQEsHwGGHe
 VUpU6Q//S9j9+YC9EpredFoJ5W0BfERR5XOum7YjlLxq2mVTStrf9Q1ecrwmS4Q6
 4mAydIDfhqNlouUjMBgNNFJcvm8lat+/pjY78oT8ZdjumslMbMxo81VmQ3fX+6fE
 izMrL81DG4j8zeleUyz5ecJEK/KPw1s3SkY736511PeJSalOU4hLYmU819imfAk/
 5c9os2GNhszIROE1YUYZQ3zXne1t2PNXKvctzVrJYjyKpIDgFNzTj6gXhePzXBNO
 iFdApqSgKdnnsD6VsfxYVnOKP+cSIl27Tbge6dm7DHQbSs00aVL64JPcX8/hWtp6
 ExrwBYiFk6yafwsNUu7/PmqbZNKYxDgvXFq8jSOFfioh6Km/QZYs8y1/qXN3qmSU
 78Ah5jyO+U+++FsSa2o9eRpU2l84UIQqvp84PeSLylzh7iLFyFCWsMfreNeIsF9v
 Jsost58JQOCufRK3qfMiDO88QUZRKyCfFymDAVcvPoBwp5nK9R1ohlbxgXrCPsE7
 Bd7J6jrlpcoRyYc8vhshkrnK2Sk6pP77OZOh5AZ9AybnALH0afUNLzk6sBtaObkZ
 xIJcSIBkKz3P4zWFKsXmqGYHWp1IsKsYRsNjCt5FExWOF+uKKKBjynHmlKeS0l/b
 J6bwDUPVW/gfkBqDV8bILultj9Gm8L5Z8SwvD1ww69OYN+c7oVk=
 =ZAjD
 -----END PGP SIGNATURE-----

Merge tag 'x86_misc_for_v6.14_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull misc x86 updates from Borislav Petkov:

 - The first part of a restructuring of AMD's representation of a
   northbridge which is legacy now, and the creation of the new AMD node
   concept which represents the Zen architecture of having a collection
   of I/O devices within an SoC. Those nodes comprise the so-called data
   fabric on Zen.

   This has at least one practical advantage of not having to add a PCI
   ID each time a new data fabric PCI device releases. Eventually, the
   lot more uniform provider of data fabric functionality amd_node.c
   will be used by all the drivers which need it

 - Smaller cleanups

* tag 'x86_misc_for_v6.14_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/amd_node: Use defines for SMN register offsets
  x86/amd_node: Remove dependency on AMD_NB
  x86/amd_node: Update __amd_smn_rw() error paths
  x86/amd_nb: Move SMN access code to a new amd_node driver
  x86/amd_nb, hwmon: (k10temp): Simplify amd_pci_dev_to_node_id()
  x86/amd_nb: Simplify function 3 search
  x86/amd_nb: Use topology info to get AMD node count
  x86/amd_nb: Simplify root device search
  x86/amd_nb: Simplify function 4 search
  x86: Start moving AMD node functionality out of AMD_NB
  x86/amd_nb: Clean up early_is_amd_nb()
  x86/amd_nb: Restrict init function to AMD-based systems
  x86/mtrr: Rename mtrr_overwrite_state() to guest_force_mtrr_state()
2025-01-21 09:38:52 -08:00
David Lechner
e9b24deb84 hwmon: (ltc2991) Fix mixed signed/unsigned in DIV_ROUND_CLOSEST
Fix use of DIV_ROUND_CLOSEST where a possibly negative value is divided
by an unsigned type by casting the unsigned type to the signed type of
the same size (st->r_sense_uohm[channel] has type of u32).

The docs on the DIV_ROUND_CLOSEST macro explain that dividing a negative
value by an unsigned type is undefined behavior. The actual behavior is
that it converts both values to unsigned before doing the division, for
example:

    int ret = DIV_ROUND_CLOSEST(-100, 3U);

results in ret == 1431655732 instead of -33.

Fixes: 2b9ea4262a ("hwmon: Add driver for ltc2991")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20250115-hwmon-ltc2991-fix-div-round-closest-v1-1-b4929667e457@baylibre.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-01-15 13:52:43 -08:00
Russell Harmon
b46ba47d7b hwmon: (drivetemp) Set scsi command timeout to 10s
There's at least one drive (MaxDigitalData OOS14000G) such that if it
receives a large amount of I/O while entering an idle power state will
first exit idle before responding, including causing SMART temperature
requests to be delayed.

This causes the drivetemp request to exceed its timeout of 1 second.

Signed-off-by: Russell Harmon <russ@har.mn>
Link: https://lore.kernel.org/r/20250115131340.3178988-1-russ@har.mn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-01-15 06:22:13 -08:00
Kazuhiro Abe
8d6bf2e105 hwmon: (acpi_power_meter) Fix a check for the return value of read_domain_devices().
After commit fabb1f813e ("hwmon: (acpi_power_meter) Fix fail to load
module on platform without _PMD method"),
the acpi_power_meter driver fails to load if the platform has _PMD method.

To address this, add a check for successful read_domain_devices().
Tested on Nvidia Grace machine.

Fixes: fabb1f813e ("hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method")
Signed-off-by: Kazuhiro Abe <fj1078ii@aa.jp.fujitsu.com>
Link: https://lore.kernel.org/r/20250115073532.3211000-1-fj1078ii@aa.jp.fujitsu.com
[groeck: Dropped unnecessary () from expression]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-01-15 06:21:19 -08:00
David Lechner
e2c68cea43 hwmon: (tmp513) Fix division of negative numbers
Fix several issues with division of negative numbers in the tmp513
driver.

The docs on the DIV_ROUND_CLOSEST macro explain that dividing a negative
value by an unsigned type is undefined behavior. The driver was doing
this in several places, i.e. data->shunt_uohms has type of u32. The
actual "undefined" behavior is that it converts both values to unsigned
before doing the division, for example:

    int ret = DIV_ROUND_CLOSEST(-100, 3U);

results in ret == 1431655732 instead of -33.

Furthermore the MILLI macro has a type of unsigned long. Multiplying a
signed long by an unsigned long results in an unsigned long.

So, we need to cast both MILLI and data data->shunt_uohms to long when
using the DIV_ROUND_CLOSEST macro.

Fixes: f07f9d2467 ("hwmon: (tmp513) Use SI constants from units.h")
Fixes: 59dfa75e5d ("hwmon: Add driver for Texas Instruments TMP512/513 sensor chips.")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20250114-fix-si-prefix-macro-sign-bugs-v1-1-696fd8d10f00@baylibre.com
[groeck: Drop some continuation lines]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-01-14 15:42:16 -08:00
Denis Kirjanov
a76539b293 hwmon: pmbus: dps920ab: Add ability to instantiate through i2c
Add support for instantiating the Delta DPS920AB PSU
through I2C on systems without devicetree support.

Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
Link: https://lore.kernel.org/r/20250113092846.10786-1-kirjanov@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-01-13 08:57:06 -08:00
Peter Korsgaard
ecf1cf1c58 hwmon: (pwm-fan) Default to the Maximum cooling level if provided
The pwm-fan driver uses full PWM (255) duty cycle at startup, which may not
always be desirable because of noise or power consumption peaks.

The driver optionally accept a list of "cooling-levels" for the thermal
subsystem.  If provided, use the PWM value corresponding to the maximum
cooling level rather than the full level as the initial PWM setting.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Link: https://lore.kernel.org/r/20250113135118.3994998-1-peter@korsgaard.com
[groeck: Dropped double empty line]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-01-13 08:55:46 -08:00
Greg Kroah-Hartman
dd19f4116e Merge 6.13-rc7 into driver-core-next
We need the debugfs / driver-core fixes in here as well for testing and
to build on top of.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-01-13 06:40:34 +01:00
Wolfram Sang
32a8d362b5 hwmon: (spd5118) Use generic parity calculation
Make use of the new generic helper for calculating the parity.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Link: https://lore.kernel.org/r/20250107090204.6593-3-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2025-01-12 23:55:50 +01:00
Thorsten Blum
74a2594a27 hwmon: (asus_atk0110) Use str_enabled_disabled() and str_enable_disable() helpers
Remove hard-coded strings by using the str_enabled_disabled() and
str_enable_disable() helper functions.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250112105128.86653-2-thorsten.blum@linux.dev
[groeck: Fixed subject and continuation line alignments]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-01-12 08:46:23 -08:00
Joel Stanley
c8571eab11 hwmon: Fix help text for aspeed-g6-pwm-tach
The help text has the wrong module name mentioned, and the capitalisation
of the title is inconsistent.

Fixes: 7e1449cd15 ("hwmon: (aspeed-g6-pwm-tacho): Support for ASPEED g6 PWM/Fan tach")
Signed-off-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20250110114737.64035-1-joel@jms.id.au
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-01-12 08:46:23 -08:00