iio: adc: palmas: don't alter event config on suspend/resume

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>
Link: https://lore.kernel.org/r/20230408114825.824505-10-risca@dalakolonin.se
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Patrik Dahlström 2023-04-08 13:48:25 +02:00 committed by Jonathan Cameron
parent a99544c6c8
commit 52cc189b4f

View File

@ -1133,16 +1133,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);
@ -1156,16 +1150,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);