diff options
author | Mayuresh Kulkarni <mkulkarni@nvidia.com> | 2012-06-18 12:35:40 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-06-26 07:14:03 -0700 |
commit | 7bef3f71fa38cc3c39953ec479dcfdcfa725be4d (patch) | |
tree | db00c32ad7633f8ded1896d15eec8a6878b472fb /drivers/video/tegra/dc/dsi.c | |
parent | 81a8d469a7e9d70d0a2cc0345ddf509038bb620a (diff) |
video: tegra: use public APIs exposed by host1x driver
Bug 961009
Change-Id: Ifdcc7bc8a40d270e70a63329f46caff541bf01e2
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/109461
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/dsi.c')
-rw-r--r-- | drivers/video/tegra/dc/dsi.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/video/tegra/dc/dsi.c b/drivers/video/tegra/dc/dsi.c index 26301abe4222..ff80aac7149d 100644 --- a/drivers/video/tegra/dc/dsi.c +++ b/drivers/video/tegra/dc/dsi.c @@ -14,18 +14,19 @@ * */ +#include <linux/kernel.h> #include <linux/clk.h> #include <linux/delay.h> #include <linux/err.h> #include <linux/fb.h> #include <linux/gpio.h> #include <linux/interrupt.h> -#include <linux/kernel.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/workqueue.h> #include <linux/debugfs.h> #include <linux/seq_file.h> +#include <linux/nvhost.h> #include <mach/clk.h> #include <mach/dc.h> @@ -36,8 +37,6 @@ #include "dc_reg.h" #include "dc_priv.h" -#include "host1x/host1x.h" -#include "host1x/host1x_syncpt.h" #include "dsi_regs.h" #include "dsi.h" @@ -298,7 +297,7 @@ inline unsigned long tegra_dsi_readl(struct tegra_dc_dsi_data *dsi, u32 reg) { unsigned long ret; - BUG_ON(!nvhost_module_powered(nvhost_get_host(dsi->dc->ndev)->dev)); + BUG_ON(!nvhost_module_powered_ext(nvhost_get_parent(dsi->dc->ndev))); ret = readl(dsi->base + reg * 4); trace_printk("readl %p=%#08lx\n", dsi->base + reg * 4, ret); return ret; @@ -307,7 +306,7 @@ EXPORT_SYMBOL(tegra_dsi_readl); inline void tegra_dsi_writel(struct tegra_dc_dsi_data *dsi, u32 val, u32 reg) { - BUG_ON(!nvhost_module_powered(nvhost_get_host(dsi->dc->ndev)->dev)); + BUG_ON(!nvhost_module_powered_ext(nvhost_get_parent(dsi->dc->ndev))); trace_printk("writel %p=%#08x\n", dsi->base + reg * 4, val); writel(val, dsi->base + reg * 4); } @@ -441,17 +440,15 @@ static int tegra_dsi_syncpt(struct tegra_dc_dsi_data *dsi) ret = 0; - dsi->syncpt_val = nvhost_syncpt_read( - &nvhost_get_host(dsi->dc->ndev)->syncpt, - dsi->syncpt_id); + dsi->syncpt_val = nvhost_syncpt_read_ext(dsi->dc->ndev, dsi->syncpt_id); val = DSI_INCR_SYNCPT_COND(OP_DONE) | DSI_INCR_SYNCPT_INDX(dsi->syncpt_id); tegra_dsi_writel(dsi, val, DSI_INCR_SYNCPT); /* TODO: Use interrupt rather than polling */ - ret = nvhost_syncpt_wait(&nvhost_get_host(dsi->dc->ndev)->syncpt, - dsi->syncpt_id, dsi->syncpt_val + 1); + ret = nvhost_syncpt_wait_timeout_ext(dsi->dc->ndev, dsi->syncpt_id, + dsi->syncpt_val + 1, MAX_SCHEDULE_TIMEOUT, NULL); if (ret < 0) { dev_err(&dsi->dc->ndev->dev, "DSI sync point failure\n"); goto fail; @@ -2277,9 +2274,7 @@ static int tegra_dsi_bta(struct tegra_dc_dsi_data *dsi) tegra_dsi_writel(dsi, val, DSI_HOST_DSI_CONTROL); #if DSI_USE_SYNC_POINTS - /* FIXME: Workaround for nvhost_syncpt_read */ - dsi->syncpt_val = nvhost_syncpt_update_min( - &nvhost_get_host(dsi->dc->ndev)->syncpt, + dsi->syncpt_val = nvhost_syncpt_read_ext(dsi->dc->ndev, dsi->syncpt_id); val = DSI_INCR_SYNCPT_COND(OP_DONE) | @@ -2287,8 +2282,8 @@ static int tegra_dsi_bta(struct tegra_dc_dsi_data *dsi) tegra_dsi_writel(dsi, val, DSI_INCR_SYNCPT); /* TODO: Use interrupt rather than polling */ - err = nvhost_syncpt_wait(&nvhost_get_host(dsi->dc->ndev)->syncpt, - dsi->syncpt_id, dsi->syncpt_val + 1); + err = nvhost_syncpt_wait_timeout_ext(dsi->dc->ndev, dsi->syncpt_id, + dsi->syncpt_val + 1, MAX_SCHEDULE_TIMEOUT, NULL); if (err < 0) dev_err(&dsi->dc->ndev->dev, "DSI sync point failure\n"); |