Commit Graph

1249995 Commits

Author SHA1 Message Date
Billy Tsai 7e1449cd15 hwmon: (aspeed-g6-pwm-tacho): Support for ASPEED g6 PWM/Fan tach
The driver support two functions: PWM and Tachometer. The PWM feature can
handle up to 16 output ports, while the Tachometer can monitor to up to 16
input ports as well. This driver implements them by exposing two kernel
subsystems: PWM and HWMON. The PWM subsystem can be utilized alongside
existing drivers for controlling elements such as fans (pwm-fan.c),
beepers (pwm-beeper.c) and so on. Through the HWMON subsystem, the driver
provides sysfs interfaces for fan.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Link: https://lore.kernel.org/r/20240221104025.1306227-4-billy_tsai@aspeedtech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-03-07 10:50:16 -08:00
Billy Tsai df9d235c30 dt-bindings: hwmon: Support Aspeed g6 PWM TACH Control
Document the compatible for aspeed,ast2600-pwm-tach device, which can
support up to 16 PWM outputs and 16 fan tach input.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20240221104025.1306227-3-billy_tsai@aspeedtech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-03-07 10:47:07 -08:00
Naresh Solanki 3b0ac1f90c dt-bindings: hwmon: fan: Add fan binding to schema
Add common fan properties bindings to a schema.

Bindings for fan controllers can reference the common schema for the
fan

child nodes:

  patternProperties:
    "^fan@[0-2]":
      type: object
      $ref: fan-common.yaml#
      unevaluatedProperties: false

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Link: https://lore.kernel.org/r/20240221104025.1306227-2-billy_tsai@aspeedtech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-03-07 10:44:34 -08:00
Naresh Solanki c71d2502ed dt-bindings: hwmon: tda38640: Add interrupt & regulator properties
tda38640 has a single regulator output along with CAT_FAULT# pin to
report internal events. Hence add properties for regulator & interrupt.

Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240307113325.3800181-1-naresh.solanki@9elements.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-03-07 10:41:45 -08:00
Josua Mayer 3f003fda98 hwmon: (amc6821) add of_match table
Add of_match table for "ti,amc6821" compatible string.
This fixes automatic driver loading by userspace when using device-tree,
and if built as a module like major linux distributions do.

While devices probe just fine with i2c_device_id table, userspace can't
match the "ti,amc6821" compatible string from dt with the plain
"amc6821" device id. As a result, the kernel module can not be loaded.

Cc: stable@vger.kernel.org
Signed-off-by: Josua Mayer <josua@solid-run.com>
Link: https://lore.kernel.org/r/20240307-amc6821-of-match-v1-1-5f40464a3110@solid-run.com
[groeck: Cleaned up patch description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-03-07 09:17:40 -08:00
Théo Lebrun 78cc80d834 dt-bindings: hwmon: lm75: use common hwmon schema
Reference common hwmon schema which has the generic "label" property,
parsed by Linux hwmon subsystem.

To: Jean Delvare <jdelvare@suse.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240229-mbly-i2c-v2-2-b32ed18c098c@bootlin.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-03-01 11:21:31 -08:00
Krzysztof Kozlowski 5b1d7a0f90 hwmon: (sis5595) drop unused DIV_TO_REG function
'DIV_TO_REG' function is not used:

  sis5595.c:159:18: error: unused function 'DIV_TO_REG' [-Werror,-Wunused-function]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240225202841.60740-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:47 -08:00
Krzysztof Kozlowski a095d8c023 dt-bindings: hwmon: reference common hwmon schema
Reference common hwmon schema in the bindings which have and customize
the "shunt-resistor-micro-ohms" property.  While this does not make the
binding smaller, it brings common definition of that property and also
allows generic "label" (parsed by Linux hwmon core code).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240224-dt-bindings-hwmon-common-v2-5-b446eecf5480@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:47 -08:00
Krzysztof Kozlowski 2988ce56b5 dt-bindings: hwmon: lltc,ltc4286: use common hwmon schema
Reference common hwmon schema which allows to drop the
"shunt-resistor-micro-ohms" property.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240224-dt-bindings-hwmon-common-v2-4-b446eecf5480@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:47 -08:00
Krzysztof Kozlowski 09458a0e7c dt-bindings: hwmon: adi,adm1275: use common hwmon schema
Reference common hwmon schema which allows to drop the
"shunt-resistor-micro-ohms" property.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240224-dt-bindings-hwmon-common-v2-3-b446eecf5480@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Krzysztof Kozlowski 67db0ea3ec dt-bindings: hwmon: ti,ina2xx: use common hwmon schema
Reference common hwmon schema which allows to drop the "label" property.

Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240224-dt-bindings-hwmon-common-v2-2-b446eecf5480@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Krzysztof Kozlowski d590900b62 dt-bindings: hwmon: add common properties
Add a common hwmon schema for two properties:
1. "label", because Linux hwmon core code parses it.
2. "shunt-resistor-micro-ohms", because several devices already use it.

Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240224-dt-bindings-hwmon-common-v2-1-b446eecf5480@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Guenter Roeck cb7222997e hwmon: (pmbus/ir38064) Use PMBUS_REGULATOR_ONE to declare regulator
If a chip only provides a single regulator, it should be named 'vout'
and not 'vout0'. Declare regulator using PMBUS_REGULATOR_ONE() to make
that happen.

Cc: Conor Dooley <conor@kernel.org>
Cc: Naresh Solanki <naresh.solanki@9elements.com>
Cc: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240223-harmless-covenant-9cd3d4f1cfd2@spud
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Guenter Roeck 8f832d23ea hwmon: (pmbus/lm25066) Use PMBUS_REGULATOR_ONE to declare regulator
If a chip only provides a single regulator, it should be named 'vout'
and not 'vout0'. Declare regulator using PMBUS_REGULATOR_ONE() to make
that happen.

Cc: Conor Dooley <conor@kernel.org>
Cc: Naresh Solanki <naresh.solanki@9elements.com>
Cc: Zev Weiss <zev@bewilderbeest.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240223-player-buckskin-01405c5889c4@spud
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Guenter Roeck 8be143b978 hwmon: (pmbus/tda38640) Use PMBUS_REGULATOR_ONE to declare regulator
If a chip only provides a single regulator, it should be named 'vout'
and not 'vout0'. Declare regulator using PMBUS_REGULATOR_ONE() to make
that happen.

Cc: Conor Dooley <conor@kernel.org>
Cc: Naresh Solanki <naresh.solanki@9elements.com>
Cc: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240223-catnap-companion-c42fdd8ad110@spud
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Conor Dooley bad582f987 regulator: dt-bindings: promote infineon buck converters to their own binding
These devices are regulators may need to make use of the common
regulator properties, but these are not permitted while only documented
in trivial-devices.yaml

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240223-blabber-obnoxious-353e519541a6@spud
[groeck: Dropped empty line at end of patch]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Conor Dooley f1ed8af54b dt-bindings: hwmon/pmbus: ti,lm25066: document regulators
All devices documented in the lm25066 binding are intended for use with
a regulator, be that for purely monitoring purposes (lm25056) or, for
the other devices, as the controller of that regulator. The binding does
not currently allow regulator child nodes, so add one.

Each of these devices interacts with only a single regulator and
documentation refers to it as "Vout", hence the choice of child node
name.

Acked-by: Zev Weiss <zev@bewilderbeest.net>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240223-tingling-mutt-dd55dd87ff5e@spud
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Guenter Roeck 22d409ead1 dt-bindings: hwmon: nuvoton,nct6775: Add compatible value for NCT6799
While NCT6799 is mostly compatible to NCT6798, it needs a separate
compatible entry because it is not completely compatible and does
require chip specific code in the driver.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Zev Weiss <zev@bewilderbeest.net>
Link: https://lore.kernel.org/r/20240221155158.2234898-1-linux@roeck-us.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Guenter Roeck 4adee4e1a3 MAINTAINERS: Drop redundant hwmon entries
I am listed as maintainer of several individual hardware monitoring drivers
and for the hardware monitoring subsystem itself. That is redundant and
just bloats the MAINTAINERS file. Drop all the redundant entries.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Okan Akyuz d88cef1d17 hwmon: (max6620) Update broken Datasheet URL in driver documentation
The URL for the MAX6620 datasheet has changed. Update it to reflect the
current location.

Signed-off-by: Okan Akyuz <okanakyuz@okanakyuz.com>
Link: https://lore.kernel.org/r/20240216075212.69118-1-okanakyuz@okanakyuz.com
[groeck: Updated subject and patch description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Nuno Sa ec823656c1 hwmon: (axi-fan-control) Make use of dev_err_probe()
Use dev_err_probe() to slightly simplify printing errors during probe.
No functional changes intended.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240214-axi-fan-control-no-of-v1-3-43ca656fe2e3@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Nuno Sa 0b5f91d47d hwmon: (axi-fan-control) Make use of sysfs_emit()
Use sysfs_emit() instead of directly call sprintf().

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240214-axi-fan-control-no-of-v1-2-43ca656fe2e3@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Nuno Sa 1b5239f70f hwmon: (axi-fan-control) Use device firmware agnostic API
Don't directly use OF and use device property APIs. In addition, this
makes the probe() code neater and also allow us to move the
of_device_id table to it's natural place.

While at it, make sure to explicitly include mod_devicetable.h for the
of_device_id table.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240214-axi-fan-control-no-of-v1-1-43ca656fe2e3@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Sebastian Kranz 692cf83bc3 hwmon: (oxp-sensors) Add support for Ayaneo Air Plus 7320u.
Add support for handheld AYANEO AIR Plus with the same EC registers
to add proper fan control.

Functionality was tested successfully.

Signed-off-by: Sebastian Kranz <tklightforce@googlemail.com>
Link: https://lore.kernel.org/r/20240209090157.3232-1-tklightforce@googlemail.com
[groeck: Fixed up commit message]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Javier Carrasco efd49b8eef hwmon: (chipcap2) fix return path in cc2_request_alarm_irqs()
The return path can be improved by returning upon first failure. The
current implementation would try to register the second interrupt even
if the first one failed, which is unnecessary.

Moreover, if no irqs are available, the return value should be zero
(the driver supports the use case with no interrupts). Currently the
initial value is unassigned and that may lead to returning an unknown
value if stack variables are not automatically set to zero and no irqs
were provided.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-hwmon/294e4634-89d4-415e-a723-b208d8770d7c@gmail.com/T/#t
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240207-chipcap2_init_vars-v1-2-08cafe43e20e@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:42 -08:00
Javier Carrasco f16fb6d23b hwmon: (chipcap2) fix uninitialized variable in cc2_get_reg_val()
The reg_val variable in cc2_get_reg_val() might be used without a known
value if cc2_read_reg() fails. That leads to a useless data conversion
because the returned error means the read operation failed and the data is
not relevant.

That makes its initial value irrelevant as well, so skip the data
conversion instead. If no error happens, a value is assigned to reg_val
and the data conversion is required.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-hwmon/294e4634-89d4-415e-a723-b208d8770d7c@gmail.com/T/#t
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240207-chipcap2_init_vars-v1-1-08cafe43e20e@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:38 -08:00
Cosmo Chou 1b2ca93cd0 hwmon: Add driver for Astera Labs PT5161L retimer
This driver implements support for temperature monitoring of Astera Labs
PT5161L series PCIe retimer chips.

This driver implementation originates from the CSDK available at
Link: https://github.com/facebook/openbmc/tree/helium/common/recipes-lib/retimer-v2.14
The communication protocol utilized is based on the I2C/SMBus standard.

Signed-off-by: Cosmo Chou <chou.cosmo@gmail.com>
Link: https://lore.kernel.org/r/20240206125420.3884300-2-chou.cosmo@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Zhang Rui 1a793caf6f hwmon: (coretemp) Use dynamic allocated memory for core temp_data
The total memory needed for saving per core temperature data depends on
the number of cores in a package. Using static allocated memory wastes
memories on systems with low per package core count.

Improve the code to use dynamic allocated memory so that it can be
improved further when per package core count information becomes
available.

No functional change intended.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20240202092144.71180-12-rui.zhang@intel.com
[groeck: Fixed continuation line alignment]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Zhang Rui 18b24a5f9c hwmon: (coretemp) Remove redundant temp_data->is_pkg_data
temp_data->index saves the index in pdata->core_data[]. It is not used
by package temp_data.

Use temp_data->index as the indicator of package temp_data and remove
redundant temp_data->is_pkg_data.

No functional change.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20240202092144.71180-11-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Zhang Rui 326241f71f hwmon: (coretemp) Split package temp_data and core temp_data
Saving package temp_data and core temp_data in one array with different
offsets is fragile.

Split them and clean up crabbed maths and macros. This also fixes a
problem that pdata->core_data[0] was never used.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20240202092144.71180-10-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Zhang Rui b0b01414a2 hwmon: (coretemp) Abstract core_temp helpers
coretemp driver has an obscure and fragile logic for handling package
and core temperature data.

Place the logic in newly introduced helpers for further optimizations.

No functional change.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20240202092144.71180-9-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Zhang Rui 87eb801925 hwmon: (coretemp) Remove redundant pdata->cpu_map[]
pdata->cpu_map[] saves the mapping between cpu core id and the index in
pdata->core_data[]. This is used to find the temp_data structure using
cpu_core_id, by traversing the pdata->cpu_map[] array. But the same goal
can be achieved by traversing the pdata->core_temp[] array directly.

Remove redundant pdata->cpu_map[].

No functional change.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20240202092144.71180-8-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Zhang Rui 18d8f55833 hwmon: (coretemp) Replace sensor_device_attribute with device_attribute
Replace sensor_device_attribute with device_attribute because
sensor_device_attribute->index is no longer used.

No functional change.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20240202092144.71180-7-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Zhang Rui 25f8e01baa hwmon: (coretemp) Remove unnecessary dependency of array index
When sensor_device_attribute pointer is available, use container_of() to
get the temp_data address.

This removes the unnecessary dependency of cached index in
pdata->core_data[].

No functional change.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20240202092144.71180-6-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Zhang Rui c8c2074020 hwmon: (coretemp) Introduce enum for attr index
Introduce enum coretemp_attr_index to better describe the index of each
sensor attribute.

No functional change.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20240202092144.71180-5-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Aleksa Savic ed3e03790c hwmon: Add driver for ASUS ROG RYUJIN II 360 AIO cooler
This driver exposes hardware sensors of the ASUS ROG RYUJIN II 360
all-in-one CPU liquid cooler, which communicates through a proprietary
USB HID protocol. Report offsets were initially discovered in [1] by
Florian Freudiger.

Available sensors are pump, internal and external
(controller) fan speed in RPM, their duties in PWM, as well as
coolant temperature.

Attaching external fans to the controller is optional and allows them
to be controlled from the device. If not connected, the fan-related
sensors will report zeroes. The controller is a separate hardware unit
that comes bundled with the AIO and connects to it to allow fan control.

The addressable LCD screen is not supported in this
driver and should be controlled through userspace tools.

[1]: https://github.com/liquidctl/liquidctl/pull/653

Tested-by: Florian Freudiger <florian.freudiger@proton.me>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
Link: https://lore.kernel.org/r/20240108094453.22986-1-savicaleksa83@gmail.com
[groeck: Add HID dependency]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Aleksa Savic f3b4b146eb hwmon: Add driver for NZXT Kraken X and Z series AIO CPU coolers
This driver enables hardware monitoring support for NZXT Kraken
X53/X63/X73 and Z53/Z63/Z73 all-in-one CPU liquid coolers.

All models expose liquid temperature and pump speed (in RPM), as well as
PWM control (natively only through a temp-PWM curve, but the driver also
emulates fixed PWM control on top of that). The Z-series models
additionally expose the speed and duty of an optionally connected fan,
with the same PWM control capabilities.

Pump and fan duty control mode can be set through pwm[1-2]_enable,
where 1 is for the manual control mode and 2 is for the liquid temp
to PWM curve mode. Writing a 0 disables control of the channel through
the driver after setting its duty to 100%. As it is not possible to query
the device for the active mode, the driver keeps track of it.

The temperature of the curves relates to the fixed [20-59] C range, per
device limitations, and correlating to the detected liquid temperature.
Only PWM values (ranging from 0-255) can be set.

The addressable RGB LEDs and LCD screen, included only on Z-series models,
are not supported in this driver.

Co-developed-by: Jonas Malaco <jonas@protocubo.io>
Signed-off-by: Jonas Malaco <jonas@protocubo.io>
Co-developed-by: Yury Zhuravlev <stalkerg@gmail.com>
Signed-off-by: Yury Zhuravlev <stalkerg@gmail.com>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
Link: https://lore.kernel.org/r/20240129111932.368232-1-savicaleksa83@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Cosmo Chou 684a28759f dt-bindings: trivial-devices: add Astera Labs PT5161L
Add dt-bindings for pt5161l temperature monitoring.

Signed-off-by: Cosmo Chou <chou.cosmo@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240115100518.2887549-3-chou.cosmo@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Cosmo Chou 2948b88a5b dt-bindings: vendor-prefixes: add asteralabs
Add vendor prefix for Astera Labs, Inc.
https://www.asteralabs.com

Signed-off-by: Cosmo Chou <chou.cosmo@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240115100518.2887549-2-chou.cosmo@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Javier Carrasco 3af350929e hwmon: Add support for Amphenol ChipCap 2
The Amphenol ChipCap 2 is a capacitive polymer humidity and temperature
sensor with an integrated EEPROM and minimum/maximum humidity alarms.

All device variants offer an I2C interface and depending on the part
number, two different output modes:
- CC2D: digital output
- CC2A: analog (PDM) output

This driver adds support for the digital variant (CC2D part numbers),
which includes the following part numbers:
- non-sleep measurement mode (CC2D23, CC2D25, CC2D33, CC2D35)
- sleep measurement mode (CC2D23S, CC2D25S, CC2D33S, CC2D35S)

The Chipcap 2 EEPROM can be accessed to configure a series of parameters
like the minimum/maximum humidity alarm threshold and hysteresis. The
EEPROM is only accessible in the command window after a power-on reset.
The default window lasts 10 ms if no Start_CM command is sent. After the
command window is finished (either after the mentioned timeout of after
a Start_NOM command is sent), the device enters the normal operation
mode and makes a first measurement automatically.

Unfortunately, the device does not provide any hardware or software
reset and therefore the driver must trigger power cycles to enter the
command mode. A dedicated, external regulator is required for that.

This driver keeps the device off until a measurement or access to the
EEPROM is required, making use of the first automatic measurement to
avoid different code paths for sleep and non-sleep devices.

The minimum and maximum humidity alarms are configured with two
registers per alarm: one stores the alarm threshold and the other one
keeps the value that turns off the alarm. The alarm signals are only
updated when a measurement is carried out.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240130-topic-chipcap2-v6-5-260bea05cf9b@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Javier Carrasco 8f89ac2b9b dt-bindings: hwmon: Add Amphenol ChipCap 2
Add device tree bindings and an example for the ChipCap 2 humidity
and temperature sensor.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240130-topic-chipcap2-v6-4-260bea05cf9b@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Javier Carrasco b86d760153 ABI: sysfs-class-hwmon: add descriptions for humidity min/max alarms
This attributes have been recently introduced and require the
corresponding ABI documentation.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240130-topic-chipcap2-v6-3-260bea05cf9b@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Javier Carrasco 5f85c4d10e hwmon: (core) Add support for humidity min/max alarm
Add min_alarm and max_alarm attributes for humidityX to support devices
that can generate these alarms.
Such attributes already exist for other magnitudes such as tempX.

Tested with a ChipCap 2 temperature-humidity sensor.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240130-topic-chipcap2-v6-2-260bea05cf9b@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Javier Carrasco cc804e48fe dt-bindings: vendor-prefixes: add Amphenol
Add vendor prefix for Amphenol (https://www.amphenol-sensors.com)

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240130-topic-chipcap2-v6-1-260bea05cf9b@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:37 -08:00
Bo Liu cac78418e2 hwmon: (tmp401) 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/20240202072235.41614-1-liubo03@inspur.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:36 -08:00
Bo Liu 3d8e02bda1 hwmon: (sch5627) 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/20240202072039.41419-1-liubo03@inspur.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:36 -08:00
Bo Liu 23c7029f37 hwmon: (nct7802) 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/20240202072007.41316-1-liubo03@inspur.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:36 -08:00
Bo Liu 7a04f015d4 hwmon: (max31760) 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/20240202071927.41213-1-liubo03@inspur.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:36 -08:00
Bo Liu 6c224da4d7 hwmon: (lm83) 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/20240202071800.41113-1-liubo03@inspur.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:36 -08:00
Bo Liu f8fec5f317 hwmon: (jc42) 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/20240202071628.40990-1-liubo03@inspur.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:36 -08:00