summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2012-01-02 11:14:26 +0200
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-01-24 10:50:35 -0800
commit3a74a9a1c0f6337f5c970de4d890f8f6841dc12f (patch)
treeaea0ca0cac1ec2760ec289fd6b85643db453b3ee /drivers/video/tegra/dc
parent5665ef5e26fa8e3fd802153af908a39ea64c55c7 (diff)
video: tegra: host: Access nvhost_master via drvdata
Use standard drvdata interface for storing and accessing nvhost_master. Reviewed-on: http://git-master/r/72846 Change-Id: I191987c8f6d313a6ede9b59f723269cb6a197e8a Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/76815 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/video/tegra/dc')
-rw-r--r--drivers/video/tegra/dc/dc.c13
-rw-r--r--drivers/video/tegra/dc/dc_priv.h8
-rw-r--r--drivers/video/tegra/dc/dsi.c10
-rw-r--r--drivers/video/tegra/dc/ext/dev.c9
4 files changed, 23 insertions, 17 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index 7bbf103..951e8ca 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -1283,7 +1283,7 @@ u32 tegra_dc_incr_syncpt_max(struct tegra_dc *dc, int i)
u32 max;
mutex_lock(&dc->lock);
- max = nvhost_syncpt_incr_max(&dc->ndev->host->syncpt,
+ max = nvhost_syncpt_incr_max(&nvhost_get_host(dc->ndev)->syncpt,
dc->syncpt[i].id, ((dc->enabled) ? 1 : 0));
dc->syncpt[i].max = max;
mutex_unlock(&dc->lock);
@@ -1297,7 +1297,8 @@ void tegra_dc_incr_syncpt_min(struct tegra_dc *dc, int i, u32 val)
if ( dc->enabled )
while (dc->syncpt[i].min < val) {
dc->syncpt[i].min++;
- nvhost_syncpt_cpu_incr(&dc->ndev->host->syncpt,
+ nvhost_syncpt_cpu_incr(
+ &nvhost_get_host(dc->ndev)->syncpt,
dc->syncpt[i].id);
}
mutex_unlock(&dc->lock);
@@ -2125,7 +2126,7 @@ static irqreturn_t tegra_dc_irq(int irq, void *ptr)
unsigned long underflow_mask;
u32 val;
- if (!nvhost_module_powered(dc->ndev->host->dev)) {
+ if (!nvhost_module_powered(nvhost_get_host(dc->ndev)->dev)) {
WARN(1, "IRQ when DC not powered!\n");
tegra_dc_io_start(dc);
status = tegra_dc_readl(dc, DC_CMD_INT_STATUS);
@@ -2333,7 +2334,8 @@ static void tegra_dc_init(struct tegra_dc *dc)
dc->syncpt[i].id = syncpt;
dc->syncpt[i].min = dc->syncpt[i].max =
- nvhost_syncpt_read(&dc->ndev->host->syncpt, syncpt);
+ nvhost_syncpt_read(&nvhost_get_host(dc->ndev)->syncpt,
+ syncpt);
}
print_mode(dc, &dc->mode, __func__);
@@ -2480,7 +2482,8 @@ static void _tegra_dc_controller_disable(struct tegra_dc *dc)
/* flush any pending syncpt waits */
while (dc->syncpt[i].min < dc->syncpt[i].max) {
dc->syncpt[i].min++;
- nvhost_syncpt_cpu_incr(&dc->ndev->host->syncpt,
+ nvhost_syncpt_cpu_incr(
+ &nvhost_get_host(dc->ndev)->syncpt,
dc->syncpt[i].id);
}
}
diff --git a/drivers/video/tegra/dc/dc_priv.h b/drivers/video/tegra/dc/dc_priv.h
index e516bfd..2a01a83 100644
--- a/drivers/video/tegra/dc/dc_priv.h
+++ b/drivers/video/tegra/dc/dc_priv.h
@@ -143,25 +143,25 @@ struct tegra_dc {
static inline void tegra_dc_io_start(struct tegra_dc *dc)
{
- nvhost_module_busy(dc->ndev->host->dev);
+ nvhost_module_busy(nvhost_get_host(dc->ndev)->dev);
}
static inline void tegra_dc_io_end(struct tegra_dc *dc)
{
- nvhost_module_idle(dc->ndev->host->dev);
+ nvhost_module_idle(nvhost_get_host(dc->ndev)->dev);
}
static inline unsigned long tegra_dc_readl(struct tegra_dc *dc,
unsigned long reg)
{
- BUG_ON(!nvhost_module_powered(dc->ndev->host->dev));
+ BUG_ON(!nvhost_module_powered(nvhost_get_host(dc->ndev)->dev));
return readl(dc->base + reg * 4);
}
static inline void tegra_dc_writel(struct tegra_dc *dc, unsigned long val,
unsigned long reg)
{
- BUG_ON(!nvhost_module_powered(dc->ndev->host->dev));
+ BUG_ON(!nvhost_module_powered(nvhost_get_host(dc->ndev)->dev));
writel(val, dc->base + reg * 4);
}
diff --git a/drivers/video/tegra/dc/dsi.c b/drivers/video/tegra/dc/dsi.c
index 5c12034..8290275 100644
--- a/drivers/video/tegra/dc/dsi.c
+++ b/drivers/video/tegra/dc/dsi.c
@@ -303,14 +303,15 @@ static int tegra_dsi_syncpt(struct tegra_dc_dsi_data *dsi)
ret = 0;
dsi->syncpt_val = nvhost_syncpt_read(
- &dsi->dc->ndev->host->syncpt, dsi->syncpt_id);
+ &nvhost_get_host(dsi->dc->ndev)->syncpt,
+ 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(&dsi->dc->ndev->host->syncpt,
+ ret = nvhost_syncpt_wait(&nvhost_get_host(dsi->dc->ndev)->syncpt,
dsi->syncpt_id, dsi->syncpt_val + 1);
if (ret < 0) {
dev_err(&dsi->dc->ndev->dev, "DSI sync point failure\n");
@@ -1742,14 +1743,15 @@ static int tegra_dsi_bta(struct tegra_dc_dsi_data *dsi)
#if DSI_USE_SYNC_POINTS
/* FIXME: Workaround for nvhost_syncpt_read */
dsi->syncpt_val = nvhost_syncpt_update_min(
- &dsi->dc->ndev->host->syncpt, dsi->syncpt_id);
+ &nvhost_get_host(dsi->dc->ndev)->syncpt,
+ 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 */
- err = nvhost_syncpt_wait(&dsi->dc->ndev->host->syncpt,
+ err = nvhost_syncpt_wait(&nvhost_get_host(dsi->dc->ndev)->syncpt,
dsi->syncpt_id, dsi->syncpt_val + 1);
if (err < 0)
dev_err(&dsi->dc->ndev->dev,
diff --git a/drivers/video/tegra/dc/ext/dev.c b/drivers/video/tegra/dc/ext/dev.c
index 2148c0b..ca4ca53 100644
--- a/drivers/video/tegra/dc/ext/dev.c
+++ b/drivers/video/tegra/dc/ext/dev.c
@@ -224,10 +224,11 @@ static int tegra_dc_ext_set_windowattr(struct tegra_dc_ext *ext,
win->stride_uv = flip_win->attr.stride_uv;
if ((s32)flip_win->attr.pre_syncpt_id >= 0) {
- nvhost_syncpt_wait_timeout(&ext->dc->ndev->host->syncpt,
- flip_win->attr.pre_syncpt_id,
- flip_win->attr.pre_syncpt_val,
- msecs_to_jiffies(500), NULL);
+ nvhost_syncpt_wait_timeout(
+ &nvhost_get_host(ext->dc->ndev)->syncpt,
+ flip_win->attr.pre_syncpt_id,
+ flip_win->attr.pre_syncpt_val,
+ msecs_to_jiffies(500), NULL);
}