mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-01 10:04:00 +08:00
media: cedrus: Fix clock/reset sequence
[ Upstream commit36fe515c1a
] According to H6 user manual, resets should always be de-asserted before clocks are enabled. This is also consistent with vendor driver. Fixes:d5aecd289b
("media: cedrus: Implement runtime PM") Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
980be4c3b0
commit
a0beda1847
@ -147,12 +147,12 @@ int cedrus_hw_suspend(struct device *device)
|
||||
{
|
||||
struct cedrus_dev *dev = dev_get_drvdata(device);
|
||||
|
||||
reset_control_assert(dev->rstc);
|
||||
|
||||
clk_disable_unprepare(dev->ram_clk);
|
||||
clk_disable_unprepare(dev->mod_clk);
|
||||
clk_disable_unprepare(dev->ahb_clk);
|
||||
|
||||
reset_control_assert(dev->rstc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -161,11 +161,18 @@ int cedrus_hw_resume(struct device *device)
|
||||
struct cedrus_dev *dev = dev_get_drvdata(device);
|
||||
int ret;
|
||||
|
||||
ret = reset_control_reset(dev->rstc);
|
||||
if (ret) {
|
||||
dev_err(dev->dev, "Failed to apply reset\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = clk_prepare_enable(dev->ahb_clk);
|
||||
if (ret) {
|
||||
dev_err(dev->dev, "Failed to enable AHB clock\n");
|
||||
|
||||
return ret;
|
||||
goto err_rst;
|
||||
}
|
||||
|
||||
ret = clk_prepare_enable(dev->mod_clk);
|
||||
@ -182,21 +189,14 @@ int cedrus_hw_resume(struct device *device)
|
||||
goto err_mod_clk;
|
||||
}
|
||||
|
||||
ret = reset_control_reset(dev->rstc);
|
||||
if (ret) {
|
||||
dev_err(dev->dev, "Failed to apply reset\n");
|
||||
|
||||
goto err_ram_clk;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_ram_clk:
|
||||
clk_disable_unprepare(dev->ram_clk);
|
||||
err_mod_clk:
|
||||
clk_disable_unprepare(dev->mod_clk);
|
||||
err_ahb_clk:
|
||||
clk_disable_unprepare(dev->ahb_clk);
|
||||
err_rst:
|
||||
reset_control_assert(dev->rstc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user