aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-01-23 15:13:33 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-23 15:13:33 -0500
commit3e9caa525147e28d032a8e413d9797c21cbaf88c (patch)
treeae92a81d643f8116ad23b9ea09f8fb8a7dd1a933 /drivers
parent59b30294e14fa6a370fdd2bc2921cca1f977ef16 (diff)
parent03652e0ad4b140523ec5ef7fec8d2b3c7218447b (diff)
Merge branch 'v4l_for_linus' into staging/for_v3.4
* v4l_for_linus: [media] V4L: atmel-isi: add clk_prepare()/clk_unprepare() functions
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/atmel-isi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/media/video/atmel-isi.c b/drivers/media/video/atmel-isi.c
index 9fe4519176a4..ec3f6a06f9c3 100644
--- a/drivers/media/video/atmel-isi.c
+++ b/drivers/media/video/atmel-isi.c
@@ -922,7 +922,9 @@ static int __devexit atmel_isi_remove(struct platform_device *pdev)
922 isi->fb_descriptors_phys); 922 isi->fb_descriptors_phys);
923 923
924 iounmap(isi->regs); 924 iounmap(isi->regs);
925 clk_unprepare(isi->mck);
925 clk_put(isi->mck); 926 clk_put(isi->mck);
927 clk_unprepare(isi->pclk);
926 clk_put(isi->pclk); 928 clk_put(isi->pclk);
927 kfree(isi); 929 kfree(isi);
928 930
@@ -955,6 +957,10 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
955 if (IS_ERR(pclk)) 957 if (IS_ERR(pclk))
956 return PTR_ERR(pclk); 958 return PTR_ERR(pclk);
957 959
960 ret = clk_prepare(pclk);
961 if (ret)
962 goto err_clk_prepare_pclk;
963
958 isi = kzalloc(sizeof(struct atmel_isi), GFP_KERNEL); 964 isi = kzalloc(sizeof(struct atmel_isi), GFP_KERNEL);
959 if (!isi) { 965 if (!isi) {
960 ret = -ENOMEM; 966 ret = -ENOMEM;
@@ -978,6 +984,10 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
978 goto err_clk_get; 984 goto err_clk_get;
979 } 985 }
980 986
987 ret = clk_prepare(isi->mck);
988 if (ret)
989 goto err_clk_prepare_mck;
990
981 /* Set ISI_MCK's frequency, it should be faster than pixel clock */ 991 /* Set ISI_MCK's frequency, it should be faster than pixel clock */
982 ret = clk_set_rate(isi->mck, pdata->mck_hz); 992 ret = clk_set_rate(isi->mck, pdata->mck_hz);
983 if (ret < 0) 993 if (ret < 0)
@@ -1059,10 +1069,14 @@ err_alloc_ctx:
1059 isi->fb_descriptors_phys); 1069 isi->fb_descriptors_phys);
1060err_alloc_descriptors: 1070err_alloc_descriptors:
1061err_set_mck_rate: 1071err_set_mck_rate:
1072 clk_unprepare(isi->mck);
1073err_clk_prepare_mck:
1062 clk_put(isi->mck); 1074 clk_put(isi->mck);
1063err_clk_get: 1075err_clk_get:
1064 kfree(isi); 1076 kfree(isi);
1065err_alloc_isi: 1077err_alloc_isi:
1078 clk_unprepare(pclk);
1079err_clk_prepare_pclk:
1066 clk_put(pclk); 1080 clk_put(pclk);
1067 1081
1068 return ret; 1082 return ret;