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.
bmi323-imu: use iio_suspend_triggering and iio_resume_triggering to e…
…nsure hrtimer is resumed after device sleep
- Loading branch information
1 parent
c4b2a54
commit 899d3c5
Showing
4 changed files
with
47 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 |
---|---|---|
|
@@ -2119,6 +2119,50 @@ int bmi323_core_probe(struct device *dev) | |
} | ||
EXPORT_SYMBOL_NS_GPL(bmi323_core_probe, IIO_BMI323); | ||
|
||
#if defined(CONFIG_PM_SLEEP) | ||
static int bmi323_core_suspend(struct device *dev) | ||
{ | ||
struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
struct bmi323_data *data = iio_priv(indio_dev); | ||
|
||
return 0; | ||
} | ||
|
||
static int bmi323_core_resume(struct device *dev) | ||
{ | ||
struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
struct bmi323_data *data = iio_priv(indio_dev); | ||
int ret = iio_resume_triggering(indio_dev); | ||
|
||
return ret; | ||
} | ||
#endif | ||
|
||
#if defined(CONFIG_PM) | ||
static int bmi323_core_runtime_suspend(struct device *dev) | ||
{ | ||
struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
struct bmi323_data *data = iio_priv(indio_dev); | ||
int ret = iio_suspend_triggering(indio_dev); | ||
|
||
return ret; | ||
} | ||
|
||
static int bmi323_core_runtime_resume(struct device *dev) | ||
{ | ||
struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
|
||
return 0; | ||
} | ||
#endif | ||
|
||
const struct dev_pm_ops bmi323_core_pm_ops = { | ||
SET_SYSTEM_SLEEP_PM_OPS(bmi323_core_suspend, bmi323_core_resume) | ||
SET_RUNTIME_PM_OPS(bmi323_core_runtime_suspend, | ||
bmi323_core_runtime_resume, NULL) | ||
}; | ||
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