提交 1b4ef487 编写于 作者: V Vignesh R 提交者: Xie XiuQi

mfd: ti_am335x_tscadc: Keep ADC interface on if child is wakeup capable

[ Upstream commit c974ac77 ]

If a child device like touchscreen is wakeup capable, then keep ADC
interface on, so that a touching resistive screen will generate wakeup
event to the system.
Signed-off-by: NVignesh R <vigneshr@ti.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 2ae25200
...@@ -295,11 +295,24 @@ static int ti_tscadc_remove(struct platform_device *pdev) ...@@ -295,11 +295,24 @@ static int ti_tscadc_remove(struct platform_device *pdev)
return 0; 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) static int __maybe_unused tscadc_suspend(struct device *dev)
{ {
struct ti_tscadc_dev *tscadc = dev_get_drvdata(dev); struct ti_tscadc_dev *tscadc = dev_get_drvdata(dev);
regmap_write(tscadc->regmap, REG_SE, 0x00); 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); pm_runtime_put_sync(dev);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册