diff options
Diffstat (limited to 'drivers/media/platform/davinci/dm355_ccdc.c')
-rw-r--r-- | drivers/media/platform/davinci/dm355_ccdc.c | 49 |
1 files changed, 6 insertions, 43 deletions
diff --git a/drivers/media/platform/davinci/dm355_ccdc.c b/drivers/media/platform/davinci/dm355_ccdc.c index 4277e4ad810c..05f8fb7f7b70 100644 --- a/drivers/media/platform/davinci/dm355_ccdc.c +++ b/drivers/media/platform/davinci/dm355_ccdc.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/platform_device.h> | 37 | #include <linux/platform_device.h> |
38 | #include <linux/uaccess.h> | 38 | #include <linux/uaccess.h> |
39 | #include <linux/videodev2.h> | 39 | #include <linux/videodev2.h> |
40 | #include <linux/clk.h> | ||
41 | #include <linux/err.h> | 40 | #include <linux/err.h> |
42 | #include <linux/module.h> | 41 | #include <linux/module.h> |
43 | 42 | ||
@@ -59,10 +58,6 @@ static struct ccdc_oper_config { | |||
59 | struct ccdc_params_raw bayer; | 58 | struct ccdc_params_raw bayer; |
60 | /* YCbCr configuration */ | 59 | /* YCbCr configuration */ |
61 | struct ccdc_params_ycbcr ycbcr; | 60 | struct ccdc_params_ycbcr ycbcr; |
62 | /* Master clock */ | ||
63 | struct clk *mclk; | ||
64 | /* slave clock */ | ||
65 | struct clk *sclk; | ||
66 | /* ccdc base address */ | 61 | /* ccdc base address */ |
67 | void __iomem *base_addr; | 62 | void __iomem *base_addr; |
68 | } ccdc_cfg = { | 63 | } ccdc_cfg = { |
@@ -85,7 +80,7 @@ static struct ccdc_oper_config { | |||
85 | .mfilt1 = CCDC_NO_MEDIAN_FILTER1, | 80 | .mfilt1 = CCDC_NO_MEDIAN_FILTER1, |
86 | .mfilt2 = CCDC_NO_MEDIAN_FILTER2, | 81 | .mfilt2 = CCDC_NO_MEDIAN_FILTER2, |
87 | .alaw = { | 82 | .alaw = { |
88 | .gama_wd = 2, | 83 | .gamma_wd = 2, |
89 | }, | 84 | }, |
90 | .blk_clamp = { | 85 | .blk_clamp = { |
91 | .sample_pixel = 1, | 86 | .sample_pixel = 1, |
@@ -303,8 +298,8 @@ static int validate_ccdc_param(struct ccdc_config_params_raw *ccdcparam) | |||
303 | } | 298 | } |
304 | 299 | ||
305 | if (ccdcparam->alaw.enable) { | 300 | if (ccdcparam->alaw.enable) { |
306 | if (ccdcparam->alaw.gama_wd < CCDC_GAMMA_BITS_13_4 || | 301 | if (ccdcparam->alaw.gamma_wd < CCDC_GAMMA_BITS_13_4 || |
307 | ccdcparam->alaw.gama_wd > CCDC_GAMMA_BITS_09_0) { | 302 | ccdcparam->alaw.gamma_wd > CCDC_GAMMA_BITS_09_0) { |
308 | dev_dbg(ccdc_cfg.dev, "Invalid value of ALAW\n"); | 303 | dev_dbg(ccdc_cfg.dev, "Invalid value of ALAW\n"); |
309 | return -EINVAL; | 304 | return -EINVAL; |
310 | } | 305 | } |
@@ -680,8 +675,8 @@ static int ccdc_config_raw(void) | |||
680 | /* Enable and configure aLaw register if needed */ | 675 | /* Enable and configure aLaw register if needed */ |
681 | if (config_params->alaw.enable) { | 676 | if (config_params->alaw.enable) { |
682 | val |= (CCDC_ALAW_ENABLE | | 677 | val |= (CCDC_ALAW_ENABLE | |
683 | ((config_params->alaw.gama_wd & | 678 | ((config_params->alaw.gamma_wd & |
684 | CCDC_ALAW_GAMA_WD_MASK) << | 679 | CCDC_ALAW_GAMMA_WD_MASK) << |
685 | CCDC_GAMMAWD_INPUT_SHIFT)); | 680 | CCDC_GAMMAWD_INPUT_SHIFT)); |
686 | } | 681 | } |
687 | 682 | ||
@@ -997,32 +992,10 @@ static int dm355_ccdc_probe(struct platform_device *pdev) | |||
997 | goto fail_nomem; | 992 | goto fail_nomem; |
998 | } | 993 | } |
999 | 994 | ||
1000 | /* Get and enable Master clock */ | ||
1001 | ccdc_cfg.mclk = clk_get(&pdev->dev, "master"); | ||
1002 | if (IS_ERR(ccdc_cfg.mclk)) { | ||
1003 | status = PTR_ERR(ccdc_cfg.mclk); | ||
1004 | goto fail_nomap; | ||
1005 | } | ||
1006 | if (clk_prepare_enable(ccdc_cfg.mclk)) { | ||
1007 | status = -ENODEV; | ||
1008 | goto fail_mclk; | ||
1009 | } | ||
1010 | |||
1011 | /* Get and enable Slave clock */ | ||
1012 | ccdc_cfg.sclk = clk_get(&pdev->dev, "slave"); | ||
1013 | if (IS_ERR(ccdc_cfg.sclk)) { | ||
1014 | status = PTR_ERR(ccdc_cfg.sclk); | ||
1015 | goto fail_mclk; | ||
1016 | } | ||
1017 | if (clk_prepare_enable(ccdc_cfg.sclk)) { | ||
1018 | status = -ENODEV; | ||
1019 | goto fail_sclk; | ||
1020 | } | ||
1021 | |||
1022 | /* Platform data holds setup_pinmux function ptr */ | 995 | /* Platform data holds setup_pinmux function ptr */ |
1023 | if (NULL == pdev->dev.platform_data) { | 996 | if (NULL == pdev->dev.platform_data) { |
1024 | status = -ENODEV; | 997 | status = -ENODEV; |
1025 | goto fail_sclk; | 998 | goto fail_nomap; |
1026 | } | 999 | } |
1027 | setup_pinmux = pdev->dev.platform_data; | 1000 | setup_pinmux = pdev->dev.platform_data; |
1028 | /* | 1001 | /* |
@@ -1033,12 +1006,6 @@ static int dm355_ccdc_probe(struct platform_device *pdev) | |||
1033 | ccdc_cfg.dev = &pdev->dev; | 1006 | ccdc_cfg.dev = &pdev->dev; |
1034 | printk(KERN_NOTICE "%s is registered with vpfe.\n", ccdc_hw_dev.name); | 1007 | printk(KERN_NOTICE "%s is registered with vpfe.\n", ccdc_hw_dev.name); |
1035 | return 0; | 1008 | return 0; |
1036 | fail_sclk: | ||
1037 | clk_disable_unprepare(ccdc_cfg.sclk); | ||
1038 | clk_put(ccdc_cfg.sclk); | ||
1039 | fail_mclk: | ||
1040 | clk_disable_unprepare(ccdc_cfg.mclk); | ||
1041 | clk_put(ccdc_cfg.mclk); | ||
1042 | fail_nomap: | 1009 | fail_nomap: |
1043 | iounmap(ccdc_cfg.base_addr); | 1010 | iounmap(ccdc_cfg.base_addr); |
1044 | fail_nomem: | 1011 | fail_nomem: |
@@ -1052,10 +1019,6 @@ static int dm355_ccdc_remove(struct platform_device *pdev) | |||
1052 | { | 1019 | { |
1053 | struct resource *res; | 1020 | struct resource *res; |
1054 | 1021 | ||
1055 | clk_disable_unprepare(ccdc_cfg.sclk); | ||
1056 | clk_disable_unprepare(ccdc_cfg.mclk); | ||
1057 | clk_put(ccdc_cfg.mclk); | ||
1058 | clk_put(ccdc_cfg.sclk); | ||
1059 | iounmap(ccdc_cfg.base_addr); | 1022 | iounmap(ccdc_cfg.base_addr); |
1060 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1023 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1061 | if (res) | 1024 | if (res) |