]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
iio: adc: ti_am335x_adc: Disable ADC during suspend unconditionally
authorVignesh R <vigneshr@ti.com>
Sat, 30 Jun 2018 10:33:17 +0000 (16:03 +0530)
committerLee Jones <lee.jones@linaro.org>
Tue, 9 Oct 2018 10:28:26 +0000 (11:28 +0100)
Parent MFD device takes care of enabling ADC interface whenever
touchscreen is marked wakeup capable. Therefore, unconditionally disable
ADC interface during system suspend to save power in case of system with
just ADC and no TSC.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/iio/adc/ti_am335x_adc.c

index 80df5a377d30a335d601a94aa9d1d2e0925aff13..cafb1dcadc488c4af2664d66409f0eb02d12d16f 100644 (file)
@@ -693,16 +693,12 @@ static int __maybe_unused tiadc_suspend(struct device *dev)
 {
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
        struct tiadc_device *adc_dev = iio_priv(indio_dev);
-       struct ti_tscadc_dev *tscadc_dev;
        unsigned int idle;
 
-       tscadc_dev = ti_tscadc_dev_get(to_platform_device(dev));
-       if (!device_may_wakeup(tscadc_dev->dev)) {
-               idle = tiadc_readl(adc_dev, REG_CTRL);
-               idle &= ~(CNTRLREG_TSCSSENB);
-               tiadc_writel(adc_dev, REG_CTRL, (idle |
-                               CNTRLREG_POWERDOWN));
-       }
+       idle = tiadc_readl(adc_dev, REG_CTRL);
+       idle &= ~(CNTRLREG_TSCSSENB);
+       tiadc_writel(adc_dev, REG_CTRL, (idle |
+                       CNTRLREG_POWERDOWN));
 
        return 0;
 }