forked from ChimeraOS/linux
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iio: bmi323: suspend and resume triggering on relevant pm operations
Prevent external trigger sources to stop working after the device entering sleep: use iio_device_suspend_triggering and iio_device_resume_triggering helpers. Signed-off-by: Denis Benato <[email protected]>
- Loading branch information
Denis Benato
committed
Jul 24, 2024
1 parent
ac5d0bd
commit 5ce4e83
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2121,6 +2121,38 @@ int bmi323_core_probe(struct device *dev) | |
} | ||
EXPORT_SYMBOL_NS_GPL(bmi323_core_probe, IIO_BMI323); | ||
|
||
#if defined(CONFIG_PM) | ||
static int bmi323_core_runtime_suspend(struct device *dev) | ||
{ | ||
struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
|
||
int ret = iio_device_suspend_triggering(indio_dev); | ||
|
||
return ret; | ||
} | ||
|
||
static int bmi323_core_runtime_resume(struct device *dev) | ||
{ | ||
struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
|
||
int ret = iio_device_resume_triggering(indio_dev); | ||
|
||
return ret; | ||
} | ||
|
||
const struct dev_pm_ops bmi323_core_pm_ops = { | ||
SET_RUNTIME_PM_OPS(bmi323_core_runtime_suspend, | ||
bmi323_core_runtime_resume, NULL) | ||
}; | ||
|
||
#else | ||
|
||
const struct dev_pm_ops bmi323_core_pm_ops = {}; | ||
|
||
#endif | ||
|
||
EXPORT_SYMBOL_NS_GPL(bmi323_core_pm_ops, IIO_BMI323); | ||
|
||
MODULE_DESCRIPTION("Bosch BMI323 IMU driver"); | ||
MODULE_AUTHOR("Jagath Jog J <[email protected]>"); | ||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters