Skip to content

Commit

Permalink
RVAS driver update
Browse files Browse the repository at this point in the history
Enable vclk after video engine initialization
to fix memory corruption issue after cold boot

Change-Id: I4f972b0f2601958ea4d5557b8569f76452eed2ef
  • Loading branch information
yvettewu1 committed Dec 12, 2022
1 parent 5a41e23 commit b3fa0ba
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions drivers/soc/aspeed/rvas/video_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,9 +1312,22 @@ static int video_drv_get_irqs(struct platform_device *pdev)
return 0;
}

static int video_drv_get_clock(struct platform_device *pdev)
static int video_drv_enable_vclk(struct platform_device *pdev)
{
pAstRVAS->vclk = devm_clk_get(&pdev->dev, "vclk");
if (IS_ERR(pAstRVAS->vclk)) {
dev_err(&pdev->dev, "no vclk clock defined\n");
return PTR_ERR(pAstRVAS->vclk);
}

VIDEO_DBG("clk_prepare_enable: vclk\n");
clk_prepare_enable(pAstRVAS->vclk);

return 0;
}

static int video_drv_get_clock(struct platform_device *pdev)
{
pAstRVAS->eclk = devm_clk_get(&pdev->dev, "eclk");
if (IS_ERR(pAstRVAS->eclk)) {
dev_err(&pdev->dev, "no eclk clock defined\n");
Expand All @@ -1323,13 +1336,6 @@ static int video_drv_get_clock(struct platform_device *pdev)

clk_prepare_enable(pAstRVAS->eclk);

pAstRVAS->vclk = devm_clk_get(&pdev->dev, "vclk");
if (IS_ERR(pAstRVAS->vclk)) {
dev_err(&pdev->dev, "no vclk clock defined\n");
return PTR_ERR(pAstRVAS->vclk);
}

clk_prepare_enable(pAstRVAS->vclk);

pAstRVAS->rvasclk = devm_clk_get(&pdev->dev, "rvasclk-gate");
if (IS_ERR(pAstRVAS->rvasclk)) {
Expand Down Expand Up @@ -1414,7 +1420,6 @@ static int video_drv_probe(struct platform_device *pdev)
return result;
}


pAstRVAS->rvas_reset = devm_reset_control_get_by_index(&pdev->dev, 0);
if (IS_ERR(pAstRVAS->rvas_reset)) {
dev_err(&pdev->dev, "can't get rvas reset\n");
Expand Down Expand Up @@ -1505,7 +1510,7 @@ static int video_drv_probe(struct platform_device *pdev)
video_engine_reserveMem(pAstRVAS);
video_engine_init();


video_drv_enable_vclk(pdev);
pr_info("RVAS: driver successfully loaded.\n");
return result;
}
Expand Down

0 comments on commit b3fa0ba

Please sign in to comment.