summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/nvhost_channel.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2011-12-29 16:03:51 +0200
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-01-12 09:56:22 -0800
commit10c8828c7b2bf26ab6ec9feee860fc5cc8eb2ce7 (patch)
tree6e1c0b97ddd63f64eee95c313f46fb49940edc25 /drivers/video/tegra/host/nvhost_channel.c
parent6bc2684e40093d8859b90d96c0d9957e1472c5c9 (diff)
video: tegra: host: Move device data to nvhost_device
Move all device data from nvhost_channeldesc, nvhost_moduledesc and nvhost_module to nvhost_device. nvhost_devices are also assigned into a hierarchy to prepare for implementation of runtime power management. Change-Id: I1e18daae8fe538086cd1f453d316e0f73e9d7d92 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/72844 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Reviewed-on: http://git-master/r/74560 Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/nvhost_channel.c')
-rw-r--r--drivers/video/tegra/host/nvhost_channel.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/video/tegra/host/nvhost_channel.c b/drivers/video/tegra/host/nvhost_channel.c
index 85256016ad70..6d39eba643c4 100644
--- a/drivers/video/tegra/host/nvhost_channel.c
+++ b/drivers/video/tegra/host/nvhost_channel.c
@@ -49,17 +49,13 @@ struct nvhost_channel *nvhost_getchannel(struct nvhost_channel *ch)
int err = 0;
mutex_lock(&ch->reflock);
if (ch->refcount == 0) {
- err = nvhost_module_init(&ch->mod, ch->desc->name,
- &ch->desc->module,
- &ch->dev->mod,
- &ch->dev->pdev->dev);
+ err = nvhost_module_init(ch->dev);
if (!err) {
err = nvhost_cdma_init(&ch->cdma);
if (err)
- nvhost_module_deinit(&ch->dev->pdev->dev,
- &ch->mod);
+ nvhost_module_deinit(ch->dev);
}
- } else if (ch->desc->exclusive) {
+ } else if (ch->dev->exclusive) {
err = -EBUSY;
}
if (!err)
@@ -68,8 +64,8 @@ struct nvhost_channel *nvhost_getchannel(struct nvhost_channel *ch)
mutex_unlock(&ch->reflock);
/* Keep alive modules that needs to be when a channel is open */
- if (!err && ch->desc->keepalive)
- nvhost_module_busy(&ch->mod);
+ if (!err && ch->dev->keepalive)
+ nvhost_module_busy(ch->dev);
return err ? NULL : ch;
}
@@ -86,14 +82,14 @@ void nvhost_putchannel(struct nvhost_channel *ch, struct nvhost_hwctx *ctx)
}
/* Allow keep-alive'd module to be turned off */
- if (ch->desc->keepalive)
- nvhost_module_idle(&ch->mod);
+ if (ch->dev->keepalive)
+ nvhost_module_idle(ch->dev);
mutex_lock(&ch->reflock);
if (ch->refcount == 1) {
channel_cdma_op(ch).stop(&ch->cdma);
nvhost_cdma_deinit(&ch->cdma);
- nvhost_module_deinit(&ch->dev->pdev->dev, &ch->mod);
+ nvhost_module_deinit(ch->dev);
}
ch->refcount--;
mutex_unlock(&ch->reflock);
@@ -107,7 +103,7 @@ int nvhost_channel_suspend(struct nvhost_channel *ch)
BUG_ON(!channel_cdma_op(ch).stop);
if (ch->refcount) {
- ret = nvhost_module_suspend(&ch->mod, false);
+ ret = nvhost_module_suspend(ch->dev, false);
if (!ret)
channel_cdma_op(ch).stop(&ch->cdma);
}