Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MAX30210 #2544

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions Documentation/devicetree/bindings/iio/temperature/adi,max30210.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright 2024 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/temperature/adi,max30210.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices MAX30210 Low-Power I2C Digital Temperature Sensor

maintainers:
- Daniel Matyas <[email protected]>
- John Erasmus Mari Geronimo <[email protected]>

description: |
The MAX30210 operates from 1.7V to 2.0V supply voltage, and is a low-power,
high-accuracy digital temperature sensor with ±0.1°C accuracy from +20°C to
+50°C and ±0.15°C accuracy from -20°C to +85°C.
https://www.analog.com/media/en/technical-documentation/data-sheets/max30210.pdf

properties:
compatible:
enum:
- adi,max30210

reg:
maxItems: 1

vdd-supply:
description: |
Analog Supply Voltage Input. Must have values in the interval (1.7V; 5.5V)
in order for the device to function correctly.

powerdown-gpios:
description: |
GPIO spec for CVT/PDB pin. Should be configured with GPIO_ACTIVE_LOW.
maxItems: 1

interrupts:
description: |
Connected to INT pin. Should be configured with type IRQ_TYPE_EDGE_BOTH.
maxItems: 1

pwms:
description: |
If present, CVT/PDB pin is used for external temperature conversion. The
active edge of CVT/PDB pin is the polarity of the PWM. Name of PWM should
be "ext-cvt-pwm".

pwm-names:
const: ext-cvt-pwm

adi,ext-conv-rising-edge:
description:
It is used to set the active edge of the EXT CVT to rising. By default,
the active edge is falling.
type: boolean

adi,roc-en:
description: |
If present, temperature change detection is enabled.
type: boolean

adi,roc-len:
description: |
If present, this is the length of the rate of change filter. The rate of
change is calculated based on the number of samples selected in this
property. The user needs to set the appropriate number of samples to fit
the application needs. The default value is 2.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [2, 3, 5, 9, 17, 33, 65]

adi,comp-int:
description: |
If present, the device is in comparator mode. In this mode, the low
temperature threshold value acts as high temperature hysteresis. If not
present, interrupt mode is used (default).
type: boolean

required:
- compatible
- reg
- vdd-supply
- powerdown-gpios

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pwm/pwm.h>

i2c {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

temperature-sensor@40 {
compatible = "adi,max30210";
reg = <0x40>;
vdd-supply = <&vdd>;
powerdown-gpios = <&gpio 12 GPIO_ACTIVE_LOW>;

interrupt-parent = <&gpio>;
interrupts = <17 IRQ_TYPE_EDGE_BOTH>;

pwm-names = "ext-cvt-pwm";
pwms = <&pwm 0 0>;
adi,ext-conv-rising-edge;
adi,roc-en;
adi,comp-int;
};
};
...
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -12587,6 +12587,14 @@ F: Documentation/userspace-api/media/drivers/max2175.rst
F: drivers/media/i2c/max2175*
F: include/uapi/linux/max2175.h

MAX30210 IIO TEMPERATURE DRIVER
M: John Erasmus Mari Geronimo <[email protected]>
L: [email protected]
S: Supported
W: https://ez.analog.com/linux-software-drivers
F: Documentation/devicetree/bindings/iio/temperature/adi,max30210.yaml
F: drivers/iio/temperature/max30210.c
jemfgeronimo marked this conversation as resolved.
Show resolved Hide resolved

MAX31827 TEMPERATURE SWITCH DRIVER
M: Daniel Matyas <[email protected]>
L: [email protected]
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/Kconfig.adi
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,4 @@ config IIO_ALL_ADI_DRIVERS
imply ADRV9025
imply ADL5580
imply LTC2664
imply MAX30210
10 changes: 10 additions & 0 deletions drivers/iio/temperature/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,14 @@ config MAX31865
This driver can also be build as a module. If so, the module
will be called max31865.

config MAX30210
tristate "MAX30210 Low-Power I2C Digital Temperature Sensor"
depends on I2C
help
If you say yes here you get support for MAX30210 low-power digital
temperature sensor chip connected via I2C.

This driver can also be build as a module. If so, the module
will be called max30210.

endmenu
1 change: 1 addition & 0 deletions drivers/iio/temperature/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ obj-$(CONFIG_IQS620AT_TEMP) += iqs620at-temp.o
obj-$(CONFIG_LTC2983) += ltc2983.o
obj-$(CONFIG_HID_SENSOR_TEMP) += hid-sensor-temperature.o
obj-$(CONFIG_MAXIM_THERMOCOUPLE) += maxim_thermocouple.o
obj-$(CONFIG_MAX30210) += max30210.o
obj-$(CONFIG_MAX31856) += max31856.o
obj-$(CONFIG_MAX31865) += max31865.o
obj-$(CONFIG_MLX90614) += mlx90614.o
Expand Down
Loading