mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
ASoC: rockchip: i2s-tdm: Add support for platform shutdown
This patch allow driver to stop controller in shutdown flow. A clean stage is safety to reboot. otherwise, there maybe a risk to hang on DMAC-AXI-I2S state. Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Change-Id: I7d04d7a128004ef371cf94bec04aedc895370cd6
This commit is contained in:
parent
9c64acb34a
commit
f7d4e932d8
|
|
@ -2282,6 +2282,16 @@ static int rockchip_i2s_tdm_remove(struct platform_device *pdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void rockchip_i2s_tdm_platform_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct rk_i2s_tdm_dev *i2s_tdm = dev_get_drvdata(&pdev->dev);
|
||||
|
||||
pm_runtime_get_sync(i2s_tdm->dev);
|
||||
rockchip_i2s_tdm_stop(i2s_tdm, SNDRV_PCM_STREAM_PLAYBACK);
|
||||
rockchip_i2s_tdm_stop(i2s_tdm, SNDRV_PCM_STREAM_CAPTURE);
|
||||
pm_runtime_put(i2s_tdm->dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int rockchip_i2s_tdm_suspend(struct device *dev)
|
||||
{
|
||||
|
|
@ -2317,6 +2327,7 @@ static const struct dev_pm_ops rockchip_i2s_tdm_pm_ops = {
|
|||
static struct platform_driver rockchip_i2s_tdm_driver = {
|
||||
.probe = rockchip_i2s_tdm_probe,
|
||||
.remove = rockchip_i2s_tdm_remove,
|
||||
.shutdown = rockchip_i2s_tdm_platform_shutdown,
|
||||
.driver = {
|
||||
.name = DRV_NAME,
|
||||
.of_match_table = of_match_ptr(rockchip_i2s_tdm_match),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user