diff options
| author | Denis Benato <[email protected]> | 2024-08-07 20:56:18 +0200 |
|---|---|---|
| committer | Jonathan Cameron <[email protected]> | 2024-08-10 11:19:36 +0100 |
| commit | 2837efdc7cef5b86b0c4d94a7410bc03cc2f003f (patch) | |
| tree | 634b2424844d3a81a32077231dd2fa3c79c66540 /include/linux | |
| parent | b4b4817bbf9aebb2071d8b887a970610ee943f91 (diff) | |
iio: trigger: allow devices to suspend/resume theirs associated trigger
When a machine enters a sleep state while a trigger is associated to
an iio device that trigger is not resumed after exiting the sleep state:
provide iio device drivers a way to suspend and resume
the associated trigger to solve the aforementioned bug.
Each iio driver supporting external triggers is expected to call
iio_device_suspend_triggering before suspending,
and iio_device_resume_triggering upon resuming.
Signed-off-by: Denis Benato <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/iio/iio.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 3a735a9a9eae..18779b631e90 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -810,6 +810,23 @@ static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) } #endif +/** + * iio_device_suspend_triggering() - suspend trigger attached to an iio_dev + * @indio_dev: iio_dev associated with the device that will have triggers suspended + * + * Return 0 if successful, negative otherwise + **/ +int iio_device_suspend_triggering(struct iio_dev *indio_dev); + +/** + * iio_device_resume_triggering() - resume trigger attached to an iio_dev + * that was previously suspended with iio_device_suspend_triggering() + * @indio_dev: iio_dev associated with the device that will have triggers resumed + * + * Return 0 if successful, negative otherwise + **/ +int iio_device_resume_triggering(struct iio_dev *indio_dev); + #ifdef CONFIG_ACPI bool iio_read_acpi_mount_matrix(struct device *dev, struct iio_mount_matrix *orientation, |