From 7bef3f71fa38cc3c39953ec479dcfdcfa725be4d Mon Sep 17 00:00:00 2001 From: Mayuresh Kulkarni Date: Mon, 18 Jun 2012 12:35:40 +0530 Subject: video: tegra: use public APIs exposed by host1x driver Bug 961009 Change-Id: Ifdcc7bc8a40d270e70a63329f46caff541bf01e2 Signed-off-by: Mayuresh Kulkarni Reviewed-on: http://git-master/r/109461 Reviewed-by: Rohan Somvanshi Tested-by: Rohan Somvanshi --- drivers/media/video/tegra/nvavp/nvavp_dev.c | 22 ++++------------------ drivers/video/tegra/dc/bandwidth.c | 1 + drivers/video/tegra/dc/dc.c | 19 ++++++------------- drivers/video/tegra/dc/dc_priv.h | 13 ++++++------- drivers/video/tegra/dc/dsi.c | 25 ++++++++++--------------- 5 files changed, 27 insertions(+), 53 deletions(-) diff --git a/drivers/media/video/tegra/nvavp/nvavp_dev.c b/drivers/media/video/tegra/nvavp/nvavp_dev.c index cfe033249809..e0a3d897bcca 100644 --- a/drivers/media/video/tegra/nvavp/nvavp_dev.c +++ b/drivers/media/video/tegra/nvavp/nvavp_dev.c @@ -42,10 +42,6 @@ #include #include -#include "../../../../video/tegra/host/host1x/host1x_syncpt.h" -#include "../../../../video/tegra/host/dev.h" -#include "../../../../video/tegra/host/nvhost_acm.h" - #if defined(CONFIG_TEGRA_AVP_KERNEL_ON_MMU) #include "../avp/headavp.h" #endif @@ -135,7 +131,6 @@ struct nvavp_info { struct nvavp_channel channel_info[NVAVP_NUM_CHANNELS]; - struct nvhost_syncpt *nvhost_syncpt; u32 syncpt_id; u32 syncpt_value; @@ -243,7 +238,7 @@ static struct clk *nvavp_clk_get(struct nvavp_info *nvavp, int id) static void nvavp_clks_enable(struct nvavp_info *nvavp) { if (nvavp->clk_enabled++ == 0) { - nvhost_module_busy(nvhost_get_host(nvavp->nvhost_dev)->dev); + nvhost_module_busy_ext(nvhost_get_parent(nvavp->nvhost_dev)); clk_enable(nvavp->bsev_clk); clk_enable(nvavp->vde_clk); clk_set_rate(nvavp->emc_clk, nvavp->emc_clk_rate); @@ -262,7 +257,7 @@ static void nvavp_clks_disable(struct nvavp_info *nvavp) clk_disable(nvavp->vde_clk); clk_set_rate(nvavp->emc_clk, 0); clk_set_rate(nvavp->sclk, 0); - nvhost_module_idle(nvhost_get_host(nvavp->nvhost_dev)->dev); + nvhost_module_idle_ext(nvhost_get_parent(nvavp->nvhost_dev)); dev_dbg(&nvavp->nvhost_dev->dev, "%s: resetting emc_clk " "and sclk\n", __func__); } @@ -518,9 +513,8 @@ static int nvavp_pushbuffer_init(struct nvavp_info *nvavp) nvavp_set_channel_control_area(nvavp, channel_id); if (IS_VIDEO_CHANNEL_ID(channel_id)) { nvavp->syncpt_id = NVSYNCPT_AVP_0; - nvavp->syncpt_value = nvhost_syncpt_read( - nvavp->nvhost_syncpt, - nvavp->syncpt_id); + nvavp->syncpt_value = nvhost_syncpt_read_ext( + nvavp->nvhost_dev, nvavp->syncpt_id); } } @@ -1412,7 +1406,6 @@ static int tegra_nvavp_probe(struct nvhost_device *ndev, return -EINVAL; } - nvavp = kzalloc(sizeof(struct nvavp_info), GFP_KERNEL); if (!nvavp) { dev_err(&ndev->dev, "cannot allocate avp_info\n"); @@ -1421,13 +1414,6 @@ static int tegra_nvavp_probe(struct nvhost_device *ndev, memset(nvavp, 0, sizeof(*nvavp)); - nvavp->nvhost_syncpt = &nvhost_get_host(ndev)->syncpt; - if (!nvavp->nvhost_syncpt) { - dev_err(&ndev->dev, "cannot get syncpt handle\n"); - ret = -ENOENT; - goto err_get_syncpt; - } - nvavp->nvmap = nvmap_create_client(nvmap_dev, "nvavp_drv"); if (IS_ERR_OR_NULL(nvavp->nvmap)) { dev_err(&ndev->dev, "cannot create nvmap client\n"); diff --git a/drivers/video/tegra/dc/bandwidth.c b/drivers/video/tegra/dc/bandwidth.c index 5d0e5ee68bd6..785ec7cedfbd 100644 --- a/drivers/video/tegra/dc/bandwidth.c +++ b/drivers/video/tegra/dc/bandwidth.c @@ -16,6 +16,7 @@ #include #include +#include #include #include diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 834637db0f3a..39470e18215e 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -34,13 +34,13 @@ #include #include #include +#include #include