LTC2983

LTC2983/LTC2984/LTC2986/LTM2985 Multi-Sensor Digital Temperature Measurement System Driver.

Supported Devices

Evaluation Boards

Description

This is a Linux industrial I/O (Linux Industrial I/O Subsystem) subsystem driver, targeting temperature sensors. The industrial I/O subsystem provides a unified framework for drivers for many different types of converters and sensors using a number of different physical interfaces (i2c, spi, etc). See Linux Industrial I/O Subsystem for more information.

Source Code

Status

Files

Function

File

driver

drivers/iio/temperature/ltc2983.c

Documentation

adi,ltc2983.yaml

Example SPI device initialization

The devices can only be instantiated via device tree, along with all the sensors attached to it.

Adding Linux driver support

Configure kernel with make menuconfig (alternatively use make xconfig or make qconfig). .. note:

The LTC2983 driver depends **CONFIG_SPI**.
Linux Kernel Configuration
    Device Drivers  --->
    <*>     Industrial I/O support --->
        --- Industrial I/O support
            [--snip--]
              Temperature sensors --->
        [--snip--]
            -*- Analog Devices Multi-Sensor Digital Temperature Measurement
            System
        [--snip--]

Hardware configuration

Driver testing

Each and every IIO device, typically a hardware chip, has a device folder under /sys/bus/iio/devices/iio:deviceX. Where X is the IIO index of the device. Under every of these directory folders reside a set of files, depending on the characteristics and features of the hardware device in question. These files are consistently generalized and documented in the IIO ABI documentation. In order to determine which IIO deviceX corresponds to which hardware device, the user can read the name file /sys/bus/iio/devices/iio:deviceX/name. In case the sequence in which the iio device drivers are loaded/registered is constant, the numbering is constant and may be known in advance.

root:/> cd /sys/bus/iio/devices/
root:/sys/bus/iio/devices> ls
iio:device0
root:/sys/bus/iio/devices> cd iio:device0
root:/sys/bus/iio/devices/iio:device0> ls -l
-r--r--r-- 1 root root 4096 Nov 16 11:17 dev
-rw-r--r-- 1 root root 4096 Nov 16 11:17 in_temp0_thermistor_raw
-rw-r--r-- 1 root root 4096 Nov 16 11:17 in_temp1_rtd_raw
-rw-r--r-- 1 root root 4096 Nov 16 11:17 in_temp2_diode_raw
-rw-r--r-- 1 root root 4096 Nov 16 11:17 in_temp3_thermocouple_raw
-rw-r--r-- 1 root root 4096 Nov 16 11:17 in_temp_scale
-rw-r--r-- 1 root root 4096 Nov 16 11:17 in_voltage0_direct_adc_raw
-rw-r--r-- 1 root root 4096 Nov 16 11:17 in_voltage_scale
-r--r--r-- 1 root root 4096 Nov 16 11:17 name
lrwxrwxrwx 1 root root    0 Nov 16 11:17 of_node -> ../../../../../../../../firmware/devicetree/base/soc/spi@7e204000/ltc2983@0
drwxr-xr-x 2 root root    0 Nov 16 11:17 power
lrwxrwxrwx 1 root root    0 Nov 16 11:17 subsystem -> ../../../../../../../../bus/iio
-rw-r--r-- 1 root root 4096 Nov 16 11:17 uevent
root:/sys/bus/iio/devices/iio:device0>

Show device name

root:/sys/bus/iio/devices/iio:device0> cat name
ltc2983

Show temperature

root:/sys/bus/iio/devices/iio:device0> cat in_temp0_thermistor_raw
1048576
Show temperature scale

Description: scale to be applied to in_tempX_${sensor_type}_raw in order to obtain the measured temperature in °C or °F (depending on chip configuration).

root:/sys/bus/iio/devices/iio:device0> cat in_temp_scale
0.000976562
Show voltage
root:/sys/bus/iio/devices/iio:device0> cat in_voltage0_direct_adc_raw
2621440
Show Voltage scale

Description: scale to be applied to in_voltageX_direct_adc_raw in order to obtain the measured voltage in Volts

root:/sys/bus/iio/devices/iio:device0> cat in_voltage_scale
0.000000476

More Information