[media] media: davinci: vpss: enable vpss clocks
By default the VPSS clocks were enabled in capture driver for davinci family which creates duplicates for dm355/dm365/dm644x. This patch adds support to enable the VPSS clocks in VPSS driver, which avoids duplication of code and also adding clock aliases. This patch uses PM runtime API to enable/disable clock, instead of DaVinci clock framework. con_ids for master and slave clocks of vpss is added in pm_domain. This patch cleanups the VPSS clock enabling in the capture driver, and also removes the clock alias in machine file. Along side adds a vpss slave clock for DM365 as mentioned by Sekhar (https://patchwork.kernel.org/patch/1221261/). The Suspend/Resume in dm644x_ccdc.c which enabled/disabled the VPSS clock is now implemented as part of the VPSS driver. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
407ccc65bf
commit
9a3e89b10f
@@ -32,7 +32,6 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/videodev2.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
@@ -88,8 +87,6 @@ static struct isif_oper_config {
|
||||
struct isif_ycbcr_config ycbcr;
|
||||
struct isif_params_raw bayer;
|
||||
enum isif_data_pack data_pack;
|
||||
/* Master clock */
|
||||
struct clk *mclk;
|
||||
/* ISIF base address */
|
||||
void __iomem *base_addr;
|
||||
/* ISIF Linear Table 0 */
|
||||
@@ -1039,6 +1036,10 @@ static int isif_probe(struct platform_device *pdev)
|
||||
void *__iomem addr;
|
||||
int status = 0, i;
|
||||
|
||||
/* Platform data holds setup_pinmux function ptr */
|
||||
if (!pdev->dev.platform_data)
|
||||
return -ENODEV;
|
||||
|
||||
/*
|
||||
* first try to register with vpfe. If not correct platform, then we
|
||||
* don't have to iomap
|
||||
@@ -1047,22 +1048,6 @@ static int isif_probe(struct platform_device *pdev)
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
/* Get and enable Master clock */
|
||||
isif_cfg.mclk = clk_get(&pdev->dev, "master");
|
||||
if (IS_ERR(isif_cfg.mclk)) {
|
||||
status = PTR_ERR(isif_cfg.mclk);
|
||||
goto fail_mclk;
|
||||
}
|
||||
if (clk_prepare_enable(isif_cfg.mclk)) {
|
||||
status = -ENODEV;
|
||||
goto fail_mclk;
|
||||
}
|
||||
|
||||
/* Platform data holds setup_pinmux function ptr */
|
||||
if (NULL == pdev->dev.platform_data) {
|
||||
status = -ENODEV;
|
||||
goto fail_mclk;
|
||||
}
|
||||
setup_pinmux = pdev->dev.platform_data;
|
||||
/*
|
||||
* setup Mux configuration for ccdc which may be different for
|
||||
@@ -1124,9 +1109,6 @@ fail_nobase_res:
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
i--;
|
||||
}
|
||||
fail_mclk:
|
||||
clk_disable_unprepare(isif_cfg.mclk);
|
||||
clk_put(isif_cfg.mclk);
|
||||
vpfe_unregister_ccdc_device(&isif_hw_dev);
|
||||
return status;
|
||||
}
|
||||
@@ -1146,8 +1128,6 @@ static int isif_remove(struct platform_device *pdev)
|
||||
i++;
|
||||
}
|
||||
vpfe_unregister_ccdc_device(&isif_hw_dev);
|
||||
clk_disable_unprepare(isif_cfg.mclk);
|
||||
clk_put(isif_cfg.mclk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user