summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra/host')
-rw-r--r--drivers/video/tegra/host/dev.c146
-rw-r--r--drivers/video/tegra/host/dev.h3
-rw-r--r--drivers/video/tegra/host/host1x/host1x_cdma.c28
-rw-r--r--drivers/video/tegra/host/host1x/host1x_syncpt.c11
-rw-r--r--drivers/video/tegra/host/nvhost_acm.c10
-rw-r--r--drivers/video/tegra/host/nvhost_channel.c2
-rw-r--r--drivers/video/tegra/host/nvhost_syncpt.c6
7 files changed, 131 insertions, 75 deletions
diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c
index 2b11929dab3c..fa8c6176fcbc 100644
--- a/drivers/video/tegra/host/dev.c
+++ b/drivers/video/tegra/host/dev.c
@@ -28,7 +28,6 @@
#include <linux/spinlock.h>
#include <linux/fs.h>
#include <linux/cdev.h>
-#include <linux/platform_device.h>
#include <linux/uaccess.h>
#include <linux/file.h>
#include <linux/clk.h>
@@ -43,15 +42,16 @@
#include <mach/nvmap.h>
#include <mach/gpufuse.h>
#include <mach/hardware.h>
+#include <mach/iomap.h>
#include "debug.h"
#include "nvhost_job.h"
#include "t20/t20.h"
#include "t30/t30.h"
-#define DRIVER_NAME "tegra_grhost"
-#define IFACE_NAME "nvhost"
-#define TRACE_MAX_LENGTH 128U
+#define DRIVER_NAME "host1x"
+#define IFACE_NAME "nvhost"
+#define TRACE_MAX_LENGTH 128U
static int nvhost_major = NVHOST_MAJOR;
static int nvhost_minor;
@@ -788,7 +788,7 @@ static int __devinit nvhost_user_init(struct nvhost_master *host)
host->nvhost_class = class_create(THIS_MODULE, IFACE_NAME);
if (IS_ERR(host->nvhost_class)) {
err = PTR_ERR(host->nvhost_class);
- dev_err(&host->pdev->dev, "failed to create class\n");
+ dev_err(&host->dev->dev, "failed to create class\n");
goto fail;
}
@@ -796,7 +796,7 @@ static int __devinit nvhost_user_init(struct nvhost_master *host)
host->nb_channels + 1, IFACE_NAME);
nvhost_major = MAJOR(devno);
if (err < 0) {
- dev_err(&host->pdev->dev, "failed to reserve chrdev region\n");
+ dev_err(&host->dev->dev, "failed to reserve chrdev region\n");
goto fail;
}
@@ -809,14 +809,14 @@ static int __devinit nvhost_user_init(struct nvhost_master *host)
devno = MKDEV(nvhost_major, nvhost_minor + i);
err = cdev_add(&ch->cdev, devno, 1);
if (err < 0) {
- dev_err(&host->pdev->dev, "failed to add chan %i cdev\n", i);
+ dev_err(&host->dev->dev, "failed to add chan %i cdev\n", i);
goto fail;
}
ch->node = device_create(host->nvhost_class, NULL, devno, NULL,
IFACE_NAME "-%s", ch->dev->name);
if (IS_ERR(ch->node)) {
err = PTR_ERR(ch->node);
- dev_err(&host->pdev->dev, "failed to create chan %i device\n", i);
+ dev_err(&host->dev->dev, "failed to create chan %i device\n", i);
goto fail;
}
}
@@ -831,7 +831,7 @@ static int __devinit nvhost_user_init(struct nvhost_master *host)
IFACE_NAME "-ctrl");
if (IS_ERR(host->ctrl)) {
err = PTR_ERR(host->ctrl);
- dev_err(&host->pdev->dev, "failed to create ctrl device\n");
+ dev_err(&host->dev->dev, "failed to create ctrl device\n");
goto fail;
}
@@ -909,27 +909,72 @@ static int __devinit nvhost_init_chip_support(struct nvhost_master *host)
return 0;
}
-struct nvhost_device hostdev = {
- .name = "host1x",
+static struct resource tegra_grhost_resources[] = {
+ {
+ .start = TEGRA_HOST1X_BASE,
+ .end = TEGRA_HOST1X_BASE + TEGRA_HOST1X_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = TEGRA_DISPLAY_BASE,
+ .end = TEGRA_DISPLAY_BASE + TEGRA_DISPLAY_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = TEGRA_DISPLAY2_BASE,
+ .end = TEGRA_DISPLAY2_BASE + TEGRA_DISPLAY2_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = TEGRA_VI_BASE,
+ .end = TEGRA_VI_BASE + TEGRA_VI_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = TEGRA_ISP_BASE,
+ .end = TEGRA_ISP_BASE + TEGRA_ISP_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = TEGRA_MPE_BASE,
+ .end = TEGRA_MPE_BASE + TEGRA_MPE_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = INT_SYNCPT_THRESH_BASE,
+ .end = INT_SYNCPT_THRESH_BASE + INT_SYNCPT_THRESH_NR - 1,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
+ .start = INT_HOST1X_MPCORE_GENERAL,
+ .end = INT_HOST1X_MPCORE_GENERAL,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+struct nvhost_device tegra_grhost_device = {
+ .name = DRIVER_NAME,
.id = -1,
+ .resource = tegra_grhost_resources,
+ .num_resources = ARRAY_SIZE(tegra_grhost_resources),
.finalize_poweron = power_on_host,
.prepare_poweroff = power_off_host,
.clocks = {{"host1x", UINT_MAX}, {} },
NVHOST_MODULE_NO_POWERGATE_IDS,
};
-static int __devinit nvhost_probe(struct platform_device *pdev)
+static int __devinit nvhost_probe(struct nvhost_device *dev)
{
struct nvhost_master *host;
struct resource *regs, *intr0, *intr1;
int i, err;
- regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- intr0 = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- intr1 = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
+ regs = nvhost_get_resource(dev, IORESOURCE_MEM, 0);
+ intr0 = nvhost_get_resource(dev, IORESOURCE_IRQ, 0);
+ intr1 = nvhost_get_resource(dev, IORESOURCE_IRQ, 1);
if (!regs || !intr0 || !intr1) {
- dev_err(&pdev->dev, "missing required platform resources\n");
+ dev_err(&dev->dev, "missing required platform resources\n");
return -ENXIO;
}
@@ -937,42 +982,41 @@ static int __devinit nvhost_probe(struct platform_device *pdev)
if (!host)
return -ENOMEM;
- host->pdev = pdev;
-
host->nvmap = nvmap_create_client(nvmap_dev, "nvhost");
if (!host->nvmap) {
- dev_err(&pdev->dev, "unable to create nvmap client\n");
+ dev_err(&dev->dev, "unable to create nvmap client\n");
err = -EIO;
goto fail;
}
host->reg_mem = request_mem_region(regs->start,
- resource_size(regs), pdev->name);
+ resource_size(regs), dev->name);
if (!host->reg_mem) {
- dev_err(&pdev->dev, "failed to get host register memory\n");
+ dev_err(&dev->dev, "failed to get host register memory\n");
err = -ENXIO;
goto fail;
}
+
host->aperture = ioremap(regs->start, resource_size(regs));
if (!host->aperture) {
- dev_err(&pdev->dev, "failed to remap host registers\n");
+ dev_err(&dev->dev, "failed to remap host registers\n");
err = -ENXIO;
goto fail;
}
err = nvhost_init_chip_support(host);
if (err) {
- dev_err(&pdev->dev, "failed to init chip support\n");
+ dev_err(&dev->dev, "failed to init chip support\n");
goto fail;
}
/* Register host1x device as bus master */
- nvhost_device_register(&hostdev);
- host->dev = &hostdev;
- nvhost_bus_add_host(host);
+ host->dev = dev;
/* Give pointer to host1x via driver */
- nvhost_set_drvdata(&hostdev, host);
+ nvhost_set_drvdata(dev, host);
+
+ nvhost_bus_add_host(host);
BUG_ON(!host_channel_op(host).init);
for (i = 0; i < host->nb_channels; i++) {
@@ -990,7 +1034,7 @@ static int __devinit nvhost_probe(struct platform_device *pdev)
if (err)
goto fail;
- err = nvhost_module_init(&hostdev);
+ err = nvhost_module_init(&tegra_grhost_device);
if (err)
goto fail;
@@ -999,15 +1043,15 @@ static int __devinit nvhost_probe(struct platform_device *pdev)
nvhost_module_init(ch->dev);
}
- platform_set_drvdata(pdev, host);
-
- clk_enable(host->dev->clk[0]);
+ for (i = 0; i < host->dev->num_clks; i++)
+ clk_enable(host->dev->clk[i]);
nvhost_syncpt_reset(&host->syncpt);
- clk_disable(host->dev->clk[0]);
+ for (i = 0; i < host->dev->num_clks; i++)
+ clk_disable(host->dev->clk[0]);
nvhost_debug_init(host);
- dev_info(&pdev->dev, "initialized\n");
+ dev_info(&dev->dev, "initialized\n");
return 0;
fail:
@@ -1018,18 +1062,18 @@ fail:
return err;
}
-static int __exit nvhost_remove(struct platform_device *pdev)
+static int __exit nvhost_remove(struct nvhost_device *dev)
{
- struct nvhost_master *host = platform_get_drvdata(pdev);
+ struct nvhost_master *host = nvhost_get_drvdata(dev);
nvhost_remove_chip_support(host);
return 0;
}
-static int nvhost_suspend(struct platform_device *pdev, pm_message_t state)
+static int nvhost_suspend(struct nvhost_device *dev, pm_message_t state)
{
- struct nvhost_master *host = platform_get_drvdata(pdev);
+ struct nvhost_master *host = nvhost_get_drvdata(dev);
int i, ret;
- dev_info(&pdev->dev, "suspending\n");
+ dev_info(&dev->dev, "suspending\n");
for (i = 0; i < host->nb_channels; i++) {
ret = nvhost_channel_suspend(&host->channels[i]);
@@ -1038,17 +1082,18 @@ static int nvhost_suspend(struct platform_device *pdev, pm_message_t state)
}
ret = nvhost_module_suspend(host->dev, true);
- dev_info(&pdev->dev, "suspend status: %d\n", ret);
+ dev_info(&dev->dev, "suspend status: %d\n", ret);
return ret;
}
-static int nvhost_resume(struct platform_device *pdev)
+static int nvhost_resume(struct nvhost_device *dev)
{
- dev_info(&pdev->dev, "resuming\n");
+ dev_info(&dev->dev, "resuming\n");
return 0;
}
-static struct platform_driver nvhost_driver = {
+static struct nvhost_driver nvhost_driver = {
+ .probe = nvhost_probe,
.remove = __exit_p(nvhost_remove),
.suspend = nvhost_suspend,
.resume = nvhost_resume,
@@ -1060,16 +1105,27 @@ static struct platform_driver nvhost_driver = {
static int __init nvhost_mod_init(void)
{
+ int err;
+
register_sets = tegra_gpu_register_sets();
- return platform_driver_probe(&nvhost_driver, nvhost_probe);
+
+ err = nvhost_device_register(&tegra_grhost_device);
+ if (err)
+ return err;
+
+ return nvhost_driver_register(&nvhost_driver);
}
static void __exit nvhost_mod_exit(void)
{
- platform_driver_unregister(&nvhost_driver);
+ nvhost_driver_unregister(&nvhost_driver);
}
-module_init(nvhost_mod_init);
+/* host1x master device needs nvmap to be instantiated first.
+ * nvmap is instantiated via fs_initcall.
+ * Hence instantiate host1x master device using rootfs_initcall
+ * which is one level after fs_initcall. */
+rootfs_initcall(nvhost_mod_init);
module_exit(nvhost_mod_exit);
module_param_call(register_sets, NULL, param_get_uint, &register_sets, 0444);
diff --git a/drivers/video/tegra/host/dev.h b/drivers/video/tegra/host/dev.h
index 67d78aabfa6a..cface049166e 100644
--- a/drivers/video/tegra/host/dev.h
+++ b/drivers/video/tegra/host/dev.h
@@ -3,7 +3,7 @@
*
* Tegra Graphics Host Driver Entrypoint
*
- * Copyright (c) 2010-2011, NVIDIA Corporation.
+ * Copyright (c) 2010-2012, NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,7 +36,6 @@ struct nvhost_master {
void __iomem *aperture;
void __iomem *sync_aperture;
struct resource *reg_mem;
- struct platform_device *pdev;
struct class *nvhost_class;
struct cdev cdev;
struct device *ctrl;
diff --git a/drivers/video/tegra/host/host1x/host1x_cdma.c b/drivers/video/tegra/host/host1x/host1x_cdma.c
index 1006fbd90f88..76d3d49d4159 100644
--- a/drivers/video/tegra/host/host1x/host1x_cdma.c
+++ b/drivers/video/tegra/host/host1x/host1x_cdma.c
@@ -226,7 +226,7 @@ static int cdma_timeout_init(struct nvhost_cdma *cdma,
goto fail;
}
- dev_dbg(&dev->pdev->dev, "%s: SYNCPT_INCR buffer at 0x%x\n",
+ dev_dbg(&dev->dev->dev, "%s: SYNCPT_INCR buffer at 0x%x\n",
__func__, sb->phys);
sb->words_per_incr = (syncpt_id == NVSYNCPT_3D) ? 5 : 3;
@@ -318,7 +318,7 @@ static void cdma_timeout_cpu_incr(struct nvhost_cdma *cdma, u32 getptr,
u32 *p = (u32 *)((u32)pb->mapped + getidx);
*(p++) = NVHOST_OPCODE_NOOP;
*(p++) = NVHOST_OPCODE_NOOP;
- dev_dbg(&dev->pdev->dev, "%s: NOP at 0x%x\n",
+ dev_dbg(&dev->dev->dev, "%s: NOP at 0x%x\n",
__func__, pb->phys + getidx);
getidx = (getidx + 8) & (PUSH_BUFFER_SIZE - 1);
}
@@ -353,7 +353,7 @@ static void cdma_timeout_pb_incr(struct nvhost_cdma *cdma, u32 getptr,
getidx += (hwctx->save_slots * 8);
getidx &= (PUSH_BUFFER_SIZE - 1);
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(&dev->dev->dev,
"%s: exec CTXSAVE of prev ctx (slots %d, incrs %d)\n",
__func__, nr_slots, syncpt_incrs);
}
@@ -369,7 +369,7 @@ static void cdma_timeout_pb_incr(struct nvhost_cdma *cdma, u32 getptr,
*(p++) = nvhost_opcode_gather(count);
*(p++) = sb->phys;
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(&dev->dev->dev,
"%s: GATHER at 0x%x, from 0x%x, dcount = %d\n",
__func__,
pb->phys + getidx, sb->phys,
@@ -385,7 +385,7 @@ static void cdma_timeout_pb_incr(struct nvhost_cdma *cdma, u32 getptr,
p = (u32 *)((u32)pb->mapped + getidx);
*(p++) = NVHOST_OPCODE_NOOP;
*(p++) = NVHOST_OPCODE_NOOP;
- dev_dbg(&dev->pdev->dev, "%s: NOP at 0x%x\n",
+ dev_dbg(&dev->dev->dev, "%s: NOP at 0x%x\n",
__func__, pb->phys + getidx);
getidx = (getidx + 8) & (PUSH_BUFFER_SIZE - 1);
}
@@ -452,7 +452,7 @@ static void cdma_timeout_restart(struct nvhost_cdma *cdma, u32 getptr)
writel(host1x_channel_dmactrl(true, true, true),
chan_regs + HOST1X_CHANNEL_DMACTRL);
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(&dev->dev->dev,
"%s: DMA GET 0x%x, PUT HW 0x%x / shadow 0x%x\n",
__func__,
readl(chan_regs + HOST1X_CHANNEL_DMAGET),
@@ -529,14 +529,14 @@ void cdma_timeout_teardown_begin(struct nvhost_cdma *cdma)
BUG_ON(cdma->torndown);
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(&dev->dev->dev,
"begin channel teardown (channel id %d)\n", ch->chid);
cmdproc_stop = readl(dev->sync_aperture + HOST1X_SYNC_CMDPROC_STOP);
cmdproc_stop |= BIT(ch->chid);
writel(cmdproc_stop, dev->sync_aperture + HOST1X_SYNC_CMDPROC_STOP);
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(&dev->dev->dev,
"%s: DMA GET 0x%x, PUT HW 0x%x / shadow 0x%x\n",
__func__,
readl(ch->aperture + HOST1X_CHANNEL_DMAGET),
@@ -561,7 +561,7 @@ void cdma_timeout_teardown_end(struct nvhost_cdma *cdma, u32 getptr)
BUG_ON(!cdma->torndown || cdma->running);
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(&dev->dev->dev,
"end channel teardown (id %d, DMAGET restart = 0x%x)\n",
ch->chid, getptr);
@@ -598,7 +598,7 @@ static void cdma_timeout_handler(struct work_struct *work)
mutex_lock(&cdma->lock);
if (!cdma->timeout.clientid) {
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(&dev->dev->dev,
"cdma_timeout: expired, but has no clientid\n");
mutex_unlock(&cdma->lock);
return;
@@ -609,7 +609,7 @@ static void cdma_timeout_handler(struct work_struct *work)
cmdproc_stop = prev_cmdproc | BIT(ch->chid);
writel(cmdproc_stop, dev->sync_aperture + HOST1X_SYNC_CMDPROC_STOP);
- dev_dbg(&dev->pdev->dev, "cdma_timeout: cmdproc was 0x%x is 0x%x\n",
+ dev_dbg(&dev->dev->dev, "cdma_timeout: cmdproc was 0x%x is 0x%x\n",
prev_cmdproc, cmdproc_stop);
syncpt_val = nvhost_syncpt_update_min(&dev->syncpt,
@@ -617,7 +617,7 @@ static void cdma_timeout_handler(struct work_struct *work)
/* has buffer actually completed? */
if ((s32)(syncpt_val - cdma->timeout.syncpt_val) >= 0) {
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(&dev->dev->dev,
"cdma_timeout: expired, but buffer had completed\n");
/* restore */
cmdproc_stop = prev_cmdproc & ~(BIT(ch->chid));
@@ -627,7 +627,7 @@ static void cdma_timeout_handler(struct work_struct *work)
return;
}
- dev_warn(&dev->pdev->dev,
+ dev_warn(&dev->dev->dev,
"%s: timeout: %d (%s) ctx 0x%p, HW thresh %d, done %d\n",
__func__,
cdma->timeout.syncpt_id,
@@ -638,7 +638,7 @@ static void cdma_timeout_handler(struct work_struct *work)
/* stop HW, resetting channel/module */
cdma_op(cdma).timeout_teardown_begin(cdma);
- nvhost_cdma_update_sync_queue(cdma, sp, &dev->pdev->dev);
+ nvhost_cdma_update_sync_queue(cdma, sp, &dev->dev->dev);
mutex_unlock(&cdma->lock);
}
diff --git a/drivers/video/tegra/host/host1x/host1x_syncpt.c b/drivers/video/tegra/host/host1x/host1x_syncpt.c
index d2fe006ec85a..1cb0db5b428c 100644
--- a/drivers/video/tegra/host/host1x/host1x_syncpt.c
+++ b/drivers/video/tegra/host/host1x/host1x_syncpt.c
@@ -73,10 +73,11 @@ static u32 t20_syncpt_update_min(struct nvhost_syncpt *sp, u32 id)
} while ((u32)atomic_cmpxchg(&sp->min_val[id], old, live) != old);
if (!nvhost_syncpt_check_max(sp, id, live))
- dev_err(&syncpt_to_dev(sp)->pdev->dev,
+ dev_err(&syncpt_to_dev(sp)->dev->dev,
"%s failed: id=%u\n",
__func__,
id);
+
return live;
}
@@ -89,7 +90,7 @@ static void t20_syncpt_cpu_incr(struct nvhost_syncpt *sp, u32 id)
struct nvhost_master *dev = syncpt_to_dev(sp);
BUG_ON(!nvhost_module_powered(dev->dev));
if (!client_managed(id) && nvhost_syncpt_min_eq_max(sp, id)) {
- dev_err(&syncpt_to_dev(sp)->pdev->dev,
+ dev_err(&syncpt_to_dev(sp)->dev->dev,
"Trying to increment syncpoint id %d beyond max\n",
id);
nvhost_debug_dump(syncpt_to_dev(sp));
@@ -146,7 +147,7 @@ static int t20_syncpt_wait_check(struct nvhost_syncpt *sp,
* syncpt with a matching threshold value of 0, so
* is guaranteed to be popped by the host HW.
*/
- dev_dbg(&syncpt_to_dev(sp)->pdev->dev,
+ dev_dbg(&syncpt_to_dev(sp)->dev->dev,
"drop WAIT id %d (%s) thresh 0x%x, syncpt 0x%x\n",
wait->syncpt_id,
syncpt_op(sp).name(sp, wait->syncpt_id),
@@ -200,7 +201,7 @@ static void t20_syncpt_debug(struct nvhost_syncpt *sp)
u32 min = nvhost_syncpt_update_min(sp, i);
if (!max && !min)
continue;
- dev_info(&syncpt_to_dev(sp)->pdev->dev,
+ dev_info(&syncpt_to_dev(sp)->dev->dev,
"id %d (%s) min %d max %d\n",
i, syncpt_op(sp).name(sp, i),
min, max);
@@ -212,7 +213,7 @@ static void t20_syncpt_debug(struct nvhost_syncpt *sp)
t20_syncpt_read_wait_base(sp, i);
base_val = sp->base_val[i];
if (base_val)
- dev_info(&syncpt_to_dev(sp)->pdev->dev,
+ dev_info(&syncpt_to_dev(sp)->dev->dev,
"waitbase id %d val %d\n",
i, base_val);
diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c
index a2386a257c8f..496e38b962a2 100644
--- a/drivers/video/tegra/host/nvhost_acm.c
+++ b/drivers/video/tegra/host/nvhost_acm.c
@@ -400,23 +400,23 @@ static void debug_not_idle(struct nvhost_master *host)
struct nvhost_device *dev = host->channels[i].dev;
mutex_lock(&dev->lock);
if (dev->name)
- dev_warn(&host->pdev->dev,
- "tegra_grhost: %s: refcnt %d\n",
- dev->name, dev->refcount);
+ dev_warn(&host->dev->dev,
+ "tegra_grhost: %s: refcnt %d\n", dev->name,
+ dev->refcount);
mutex_unlock(&dev->lock);
}
for (i = 0; i < host->syncpt.nb_mlocks; i++) {
int c = atomic_read(&host->syncpt.lock_counts[i]);
if (c) {
- dev_warn(&host->pdev->dev,
+ dev_warn(&host->dev->dev,
"tegra_grhost: lock id %d: refcnt %d\n",
i, c);
lock_released = false;
}
}
if (lock_released)
- dev_dbg(&host->pdev->dev, "tegra_grhost: all locks released\n");
+ dev_dbg(&host->dev->dev, "tegra_grhost: all locks released\n");
}
int nvhost_module_suspend(struct nvhost_device *dev, bool system_suspend)
diff --git a/drivers/video/tegra/host/nvhost_channel.c b/drivers/video/tegra/host/nvhost_channel.c
index c7b0c82b3e45..51bdcb73f1af 100644
--- a/drivers/video/tegra/host/nvhost_channel.c
+++ b/drivers/video/tegra/host/nvhost_channel.c
@@ -54,7 +54,7 @@ int nvhost_channel_init(struct nvhost_channel *ch,
/* Map IO memory related to nvhost_device */
if (ndev->moduleid != NVHOST_MODULE_NONE) {
/* First one is host1x - skip that */
- r = platform_get_resource(dev->pdev,
+ r = nvhost_get_resource(dev->dev,
IORESOURCE_MEM, ndev->moduleid + 1);
if (!r)
goto fail;
diff --git a/drivers/video/tegra/host/nvhost_syncpt.c b/drivers/video/tegra/host/nvhost_syncpt.c
index 7172698e06ca..1686d94fb571 100644
--- a/drivers/video/tegra/host/nvhost_syncpt.c
+++ b/drivers/video/tegra/host/nvhost_syncpt.c
@@ -136,7 +136,7 @@ int nvhost_syncpt_wait_timeout(struct nvhost_syncpt *sp, u32 id,
BUG_ON(!syncpt_op(sp).update_min);
if (!nvhost_syncpt_check_max(sp, id, thresh)) {
- dev_warn(&syncpt_to_dev(sp)->pdev->dev,
+ dev_warn(&syncpt_to_dev(sp)->dev->dev,
"wait %d (%s) for (%d) wouldn't be met (max %d)\n",
id, syncpt_op(sp).name(sp, id), thresh,
nvhost_syncpt_read_max(sp, id));
@@ -208,14 +208,14 @@ int nvhost_syncpt_wait_timeout(struct nvhost_syncpt *sp, u32 id,
timeout -= check;
}
if (timeout) {
- dev_warn(&syncpt_to_dev(sp)->pdev->dev,
+ dev_warn(&syncpt_to_dev(sp)->dev->dev,
"%s: syncpoint id %d (%s) stuck waiting %d, timeout=%d\n",
current->comm, id, syncpt_op(sp).name(sp, id),
thresh, timeout);
syncpt_op(sp).debug(sp);
if (check_count > MAX_STUCK_CHECK_COUNT) {
if (low_timeout) {
- dev_warn(&syncpt_to_dev(sp)->pdev->dev,
+ dev_warn(&syncpt_to_dev(sp)->dev->dev,
"is timeout %d too low?\n",
low_timeout);
}