Commit 52cc189b authored by Patrik Dahlström's avatar Patrik Dahlström Committed by Jonathan Cameron

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: default avatarPatrik Dahlström <risca@dalakolonin.se>
Link: https://lore.kernel.org/r/20230408114825.824505-10-risca@dalakolonin.seSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a99544c6
...@@ -1133,16 +1133,10 @@ static int palmas_gpadc_suspend(struct device *dev) ...@@ -1133,16 +1133,10 @@ static int palmas_gpadc_suspend(struct device *dev)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct palmas_gpadc *adc = iio_priv(indio_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; return 0;
ret = palmas_adc_configure_events(adc);
if (ret < 0)
return ret;
if (adc->event0.enabled) if (adc->event0.enabled)
enable_irq_wake(adc->irq_auto_0); enable_irq_wake(adc->irq_auto_0);
...@@ -1156,16 +1150,10 @@ static int palmas_gpadc_resume(struct device *dev) ...@@ -1156,16 +1150,10 @@ static int palmas_gpadc_resume(struct device *dev)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct palmas_gpadc *adc = iio_priv(indio_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; return 0;
ret = palmas_adc_reset_events(adc);
if (ret < 0)
return ret;
if (adc->event0.enabled) if (adc->event0.enabled)
disable_irq_wake(adc->irq_auto_0); disable_irq_wake(adc->irq_auto_0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment