|
@@ -293,11 +293,24 @@ static int ti_tscadc_remove(struct platform_device *pdev)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static int __maybe_unused ti_tscadc_can_wakeup(struct device *dev, void *data)
|
|
|
+{
|
|
|
+ return device_may_wakeup(dev);
|
|
|
+}
|
|
|
+
|
|
|
static int __maybe_unused tscadc_suspend(struct device *dev)
|
|
|
{
|
|
|
struct ti_tscadc_dev *tscadc = dev_get_drvdata(dev);
|
|
|
|
|
|
regmap_write(tscadc->regmap, REG_SE, 0x00);
|
|
|
+ if (device_for_each_child(dev, NULL, ti_tscadc_can_wakeup)) {
|
|
|
+ u32 ctrl;
|
|
|
+
|
|
|
+ regmap_read(tscadc->regmap, REG_CTRL, &ctrl);
|
|
|
+ ctrl &= ~(CNTRLREG_POWERDOWN);
|
|
|
+ ctrl |= CNTRLREG_TSCSSENB;
|
|
|
+ regmap_write(tscadc->regmap, REG_CTRL, ctrl);
|
|
|
+ }
|
|
|
pm_runtime_put_sync(dev);
|
|
|
|
|
|
return 0;
|