[PATCH v3 7/7] iio: adc: palmas: don't alter event config on suspend/resume

From: Patrik Dahlström
Date: Wed Apr 05 2023 - 17:24:08 EST


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@xxxxxxxxxxxxxx>
---
drivers/iio/adc/palmas_gpadc.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c
index 2e0755e9e3a4..ba3cc0e68197 100644
--- a/drivers/iio/adc/palmas_gpadc.c
+++ b/drivers/iio/adc/palmas_gpadc.c
@@ -1137,16 +1137,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);

@@ -1160,16 +1154,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);

--
2.25.1