Commit 03652e0a authored by Josh Wu's avatar Josh Wu Committed by Mauro Carvalho Chehab

[media] V4L: atmel-isi: add clk_prepare()/clk_unprepare() functions

Signed-off-by: default avatarJosh Wu <josh.wu@atmel.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 72565224
...@@ -922,7 +922,9 @@ static int __devexit atmel_isi_remove(struct platform_device *pdev) ...@@ -922,7 +922,9 @@ static int __devexit atmel_isi_remove(struct platform_device *pdev)
isi->fb_descriptors_phys); isi->fb_descriptors_phys);
iounmap(isi->regs); iounmap(isi->regs);
clk_unprepare(isi->mck);
clk_put(isi->mck); clk_put(isi->mck);
clk_unprepare(isi->pclk);
clk_put(isi->pclk); clk_put(isi->pclk);
kfree(isi); kfree(isi);
...@@ -955,6 +957,10 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev) ...@@ -955,6 +957,10 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
if (IS_ERR(pclk)) if (IS_ERR(pclk))
return PTR_ERR(pclk); return PTR_ERR(pclk);
ret = clk_prepare(pclk);
if (ret)
goto err_clk_prepare_pclk;
isi = kzalloc(sizeof(struct atmel_isi), GFP_KERNEL); isi = kzalloc(sizeof(struct atmel_isi), GFP_KERNEL);
if (!isi) { if (!isi) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -978,6 +984,10 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev) ...@@ -978,6 +984,10 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
goto err_clk_get; goto err_clk_get;
} }
ret = clk_prepare(isi->mck);
if (ret)
goto err_clk_prepare_mck;
/* Set ISI_MCK's frequency, it should be faster than pixel clock */ /* Set ISI_MCK's frequency, it should be faster than pixel clock */
ret = clk_set_rate(isi->mck, pdata->mck_hz); ret = clk_set_rate(isi->mck, pdata->mck_hz);
if (ret < 0) if (ret < 0)
...@@ -1059,10 +1069,14 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev) ...@@ -1059,10 +1069,14 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
isi->fb_descriptors_phys); isi->fb_descriptors_phys);
err_alloc_descriptors: err_alloc_descriptors:
err_set_mck_rate: err_set_mck_rate:
clk_unprepare(isi->mck);
err_clk_prepare_mck:
clk_put(isi->mck); clk_put(isi->mck);
err_clk_get: err_clk_get:
kfree(isi); kfree(isi);
err_alloc_isi: err_alloc_isi:
clk_unprepare(pclk);
err_clk_prepare_pclk:
clk_put(pclk); clk_put(pclk);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment