mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
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>
This commit is contained in:
committed by
Guenter Roeck
parent
8f89ac2b9b
commit
3af350929e
@@ -0,0 +1,73 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
Kernel driver ChipCap2
|
||||
======================
|
||||
|
||||
Supported chips:
|
||||
|
||||
* Amphenol CC2D23, CC2D23S, CC2D25, CC2D25S, CC2D33, CC2D33S, CC2D35, CC2D35S
|
||||
|
||||
Prefix: 'chipcap2'
|
||||
|
||||
Addresses scanned: -
|
||||
|
||||
Datasheet: https://www.amphenol-sensors.com/en/telaire/humidity/527-humidity-sensors/3095-chipcap-2
|
||||
|
||||
Author:
|
||||
|
||||
- Javier Carrasco <javier.carrasco.cruz@gmail.com>
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
This driver implements support for the Amphenol ChipCap 2, a humidity and
|
||||
temperature chip family. Temperature is measured in milli degrees celsius,
|
||||
relative humidity is expressed as a per cent mille. The measurement ranges
|
||||
are the following:
|
||||
|
||||
- Relative humidity: 0 to 100000 pcm (14-bit resolution)
|
||||
- Temperature: -40000 to +125000 m°C (14-bit resolution)
|
||||
|
||||
The device communicates with the I2C protocol and uses the I2C address 0x28
|
||||
by default.
|
||||
|
||||
Depending on the hardware configuration, up to two humidity alarms to control
|
||||
minimum and maximum values are provided. Their thresholds and hystersis can be
|
||||
configured via sysfs.
|
||||
|
||||
Thresholds and hysteris must be provided as a per cent mille. These values
|
||||
might be truncated to match the 14-bit device resolution (6.1 pcm/LSB)
|
||||
|
||||
Known Issues
|
||||
------------
|
||||
|
||||
The driver does not support I2C address and command window length modification.
|
||||
|
||||
sysfs-Interface
|
||||
---------------
|
||||
|
||||
The following list includes the sysfs attributes that the driver always provides,
|
||||
their permissions and a short description:
|
||||
|
||||
=============================== ======= ========================================
|
||||
Name Perm Description
|
||||
=============================== ======= ========================================
|
||||
temp1_input: RO temperature input
|
||||
humidity1_input: RO humidity input
|
||||
=============================== ======= ========================================
|
||||
|
||||
The following list includes the sysfs attributes that the driver may provide
|
||||
depending on the hardware configuration:
|
||||
|
||||
=============================== ======= ========================================
|
||||
Name Perm Description
|
||||
=============================== ======= ========================================
|
||||
humidity1_min: RW humidity low limit. Measurements under
|
||||
this limit trigger a humidity low alarm
|
||||
humidity1_max: RW humidity high limit. Measurements above
|
||||
this limit trigger a humidity high alarm
|
||||
humidity1_min_hyst: RW humidity low hystersis
|
||||
humidity1_max_hyst: RW humidity high hystersis
|
||||
humidity1_min_alarm: RO humidity low alarm indicator
|
||||
humidity1_max_alarm: RO humidity high alarm indicator
|
||||
=============================== ======= ========================================
|
||||
@@ -51,6 +51,7 @@ Hardware Monitoring Kernel Drivers
|
||||
bel-pfe
|
||||
bpa-rs600
|
||||
bt1-pvt
|
||||
chipcap2
|
||||
coretemp
|
||||
corsair-cpro
|
||||
corsair-psu
|
||||
|
||||
@@ -1098,6 +1098,14 @@ F: Documentation/devicetree/bindings/perf/amlogic,g12-ddr-pmu.yaml
|
||||
F: drivers/perf/amlogic/
|
||||
F: include/soc/amlogic/
|
||||
|
||||
AMPHENOL CHIPCAP 2 HUMIDITY-TEMPERATURE IIO DRIVER
|
||||
M: Javier Carrasco <javier.carrasco.cruz@gmail.com>
|
||||
L: linux-hwmon@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/hwmon/amphenol,chipcap2.yaml
|
||||
F: Documentation/hwmon/chipcap2.rst
|
||||
F: drivers/hwmon/chipcap2.c
|
||||
|
||||
AMPHION VPU CODEC V4L2 DRIVER
|
||||
M: Ming Qian <ming.qian@nxp.com>
|
||||
M: Zhou Peng <eagle.zhou@nxp.com>
|
||||
|
||||
@@ -452,6 +452,16 @@ config SENSORS_BT1_PVT_ALARMS
|
||||
the data conversion will be periodically performed and the data will be
|
||||
saved in the internal driver cache.
|
||||
|
||||
config SENSORS_CHIPCAP2
|
||||
tristate "Amphenol ChipCap 2 relative humidity and temperature sensor"
|
||||
depends on I2C
|
||||
help
|
||||
Say yes here to build support for the Amphenol ChipCap 2
|
||||
relative humidity and temperature sensor.
|
||||
|
||||
To compile this driver as a module, choose M here: the module
|
||||
will be called chipcap2.
|
||||
|
||||
config SENSORS_CORSAIR_CPRO
|
||||
tristate "Corsair Commander Pro controller"
|
||||
depends on HID
|
||||
|
||||
@@ -58,6 +58,7 @@ obj-$(CONFIG_SENSORS_ASPEED) += aspeed-pwm-tacho.o
|
||||
obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o
|
||||
obj-$(CONFIG_SENSORS_AXI_FAN_CONTROL) += axi-fan-control.o
|
||||
obj-$(CONFIG_SENSORS_BT1_PVT) += bt1-pvt.o
|
||||
obj-$(CONFIG_SENSORS_CHIPCAP2) += chipcap2.o
|
||||
obj-$(CONFIG_SENSORS_CORETEMP) += coretemp.o
|
||||
obj-$(CONFIG_SENSORS_CORSAIR_CPRO) += corsair-cpro.o
|
||||
obj-$(CONFIG_SENSORS_CORSAIR_PSU) += corsair-psu.o
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user