]> git.ipfire.org Git - thirdparty/linux.git/commit
iio: mpl3115: add threshold events support
authorAntoni Pokusinski <apokusinski01@gmail.com>
Wed, 12 Nov 2025 22:57:00 +0000 (23:57 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 15 Nov 2025 18:06:47 +0000 (18:06 +0000)
commit6062cd20cbea6006d30af50e6f7d2a8722baa81b
tree895017e12a5565f6e5055e890bd16669b82927b4
parent47e4b1ca441cc4f1d9db13ff5e9b89e53aae0198
iio: mpl3115: add threshold events support

Add support for pressure and temperature rising threshold events. For
both channels *_en and *_value (in raw units) attributes are exposed.

Since in write_event_config() the ctrl_reg1.active and ctrl_reg4
are modified, accessing the data->ctrl_reg{1,4} in set_trigger_state()
and write_event_config() needs to be now guarded by data->lock.
Otherwise, it would be possible that 2 concurrent threads executing
these functions would access the data->ctrl_reg{1,4} at the same time
and then one would overwrite the other's result.

Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/mpl3115.c