]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: temperature: mcp9600: add threshold events support
authorDimitri Fedrau <dima.fedrau@gmail.com>
Tue, 4 Jun 2024 13:36:39 +0000 (15:36 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 13 Jun 2024 18:19:25 +0000 (19:19 +0100)
commitdea750f8015b514923e57c0a992e8d5db41efbb4
tree4d90b7bb0087dd96616b785b6a52da9e62bbcc26
parent8af8d75e9f829fdd247c15145966e0a5c64668b6
iio: temperature: mcp9600: add threshold events support

The device has four programmable temperature alert outputs which can be
used to monitor hot or cold-junction temperatures and detect falling and
rising temperatures. It supports up to 255 degree celsius programmable
hysteresis. Each alert can be individually configured by setting following
options in the associated alert configuration register:
- monitor hot or cold junction temperature
- monitor rising or falling temperature
- set comparator or interrupt mode
- set output polarity
- enable alert

This patch binds alert outputs to iio events:
- alert1: hot junction, rising temperature
- alert2: hot junction, falling temperature
- alert3: cold junction, rising temperature
- alert4: cold junction, falling temperature

All outputs are set in comparator mode and polarity depends on interrupt
configuration.

Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
Link: https://lore.kernel.org/r/20240604133639.959682-1-dima.fedrau@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/mcp9600.c