[v4,9/9] iio: adc: palmas: don't alter event config on suspend/resume

Message ID 20230408114825.824505-10-risca@dalakolonin.se
State New
Headers
Series iio: adc: palmas_gpadc: add iio events |

Commit Message

Patrik Dahlström April 8, 2023, 11:48 a.m. UTC
  The event config is controlled through the IIO events subsystem and
device wakeup is controlled by /sys/devices/.../power/wakeup. Let's keep
those two knobs independent.

Signed-off-by: Patrik Dahlström <risca@dalakolonin.se>
---
 drivers/iio/adc/palmas_gpadc.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
  

Patch

diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c
index f16f4ef184e4..f2ea3f2de363 100644
--- a/drivers/iio/adc/palmas_gpadc.c
+++ b/drivers/iio/adc/palmas_gpadc.c
@@ -1134,16 +1134,10 @@  static int palmas_gpadc_suspend(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct palmas_gpadc *adc = iio_priv(indio_dev);
-	int wakeup = adc->event0.enabled || adc->event1.enabled;
-	int ret;
 
-	if (!device_may_wakeup(dev) || !wakeup)
+	if (!device_may_wakeup(dev))
 		return 0;
 
-	ret = palmas_adc_configure_events(adc);
-	if (ret < 0)
-		return ret;
-
 	if (adc->event0.enabled)
 		enable_irq_wake(adc->irq_auto_0);
 
@@ -1157,16 +1151,10 @@  static int palmas_gpadc_resume(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct palmas_gpadc *adc = iio_priv(indio_dev);
-	int wakeup = adc->event0.enabled || adc->event1.enabled;
-	int ret;
 
-	if (!device_may_wakeup(dev) || !wakeup)
+	if (!device_may_wakeup(dev))
 		return 0;
 
-	ret = palmas_adc_reset_events(adc);
-	if (ret < 0)
-		return ret;
-
 	if (adc->event0.enabled)
 		disable_irq_wake(adc->irq_auto_0);