summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/t114/t114.c
diff options
context:
space:
mode:
authorMayuresh Kulkarni <mkulkarni@nvidia.com>2012-12-21 18:54:07 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 01:29:12 -0700
commit8c0789375dd58a389e05ae5e450c6ff3448aa193 (patch)
tree30af8cbaba39e33709ea0fbf4d9d45911470eea6 /drivers/video/tegra/host/t114/t114.c
parentbfb559e723c1047232611991e565a46e77297578 (diff)
video: tegra: host: re-org #include files
- this commit ensures that nvhost_device_data is populated from single source file (txxx.c) - to do this, change some header files to include the driver specific function pointers and include them in txxx.c. - extern the nvhost_device_data of each device per SOC so that it is accessible from individual driver files when device-tree support is added. this way each driver will match the compatible property and get its platform_data via match->data. no-device-tree path is untouched this is in preparation for adding device tree support bug 1041377 Change-Id: Ie80914cbc8fe41e08f1797ad4fee840261b04999 Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/173024 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/t114/t114.c')
-rw-r--r--drivers/video/tegra/host/t114/t114.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/drivers/video/tegra/host/t114/t114.c b/drivers/video/tegra/host/t114/t114.c
index f8ae4c1e6274..a0ecfcff6a57 100644
--- a/drivers/video/tegra/host/t114/t114.c
+++ b/drivers/video/tegra/host/t114/t114.c
@@ -28,7 +28,10 @@
#include "t20/t20.h"
#include "t30/t30.h"
#include "t114.h"
+#include "gr2d/gr2d_t114.h"
#include "gr3d/gr3d_t114.h"
+#include "gr3d/scale3d_actmon.h"
+#include "gr3d/gr3d_t30.h"
#include "gr3d/scale3d.h"
#include "host1x/host1x02_hardware.h"
#include "msenc/msenc.h"
@@ -98,9 +101,10 @@ static struct host1x_device_info host1x02_info = {
.client_managed = NVSYNCPTS_CLIENT_MANAGED,
};
-static struct nvhost_device_data tegra_host1x02_info = {
+struct nvhost_device_data t11_host1x_info = {
.clocks = { {"host1x", 136000000} },
NVHOST_MODULE_NO_POWERGATE_IDS,
+ .private_data = &host1x02_info,
};
static struct platform_device tegra_host1x02_device = {
@@ -109,11 +113,11 @@ static struct platform_device tegra_host1x02_device = {
.resource = tegra_host1x02_resources,
.num_resources = ARRAY_SIZE(tegra_host1x02_resources),
.dev = {
- .platform_data = &tegra_host1x02_info,
+ .platform_data = &t11_host1x_info,
},
};
-static struct nvhost_device_data tegra_gr3d03_info = {
+struct nvhost_device_data t11_gr3d_info = {
.version = 3,
.index = 1,
.syncpts = {NVSYNCPT_3D},
@@ -128,17 +132,26 @@ static struct nvhost_device_data tegra_gr3d03_info = {
.powergate_delay = 250,
.powerup_reset = true,
.moduleid = NVHOST_MODULE_NONE,
+ .busy = nvhost_scale3d_actmon_notify_busy,
+ .idle = nvhost_scale3d_actmon_notify_idle,
+ .suspend_ndev = nvhost_scale3d_suspend,
+ .init = nvhost_gr3d_t114_init,
+ .deinit = nvhost_gr3d_t114_deinit,
+ .prepare_poweroff = nvhost_gr3d_t114_prepare_power_off,
+ .finalize_poweron = nvhost_gr3d_t114_finalize_power_on,
+ .alloc_hwctx_handler = nvhost_gr3d_t114_ctxhandler_init,
+ .read_reg = nvhost_gr3d_t30_read_reg,
};
static struct platform_device tegra_gr3d03_device = {
- .name = "gr3d03",
+ .name = "gr3d",
.id = -1,
.dev = {
- .platform_data = &tegra_gr3d03_info,
+ .platform_data = &t11_gr3d_info,
},
};
-static struct nvhost_device_data tegra_gr2d03_info = {
+struct nvhost_device_data t11_gr2d_info = {
.version = 2,
.index = 2,
.syncpts = {NVSYNCPT_2D_0, NVSYNCPT_2D_1},
@@ -153,13 +166,14 @@ static struct nvhost_device_data tegra_gr2d03_info = {
.powergate_delay = 100,
.moduleid = NVHOST_MODULE_NONE,
.serialize = true,
+ .finalize_poweron = nvhost_gr2d_t114_finalize_poweron,
};
static struct platform_device tegra_gr2d03_device = {
- .name = "gr2d02",
+ .name = "gr2d",
.id = -1,
.dev = {
- .platform_data = &tegra_gr2d03_info,
+ .platform_data = &t11_gr2d_info,
},
};
@@ -172,7 +186,7 @@ static struct resource isp_resources[] = {
}
};
-static struct nvhost_device_data tegra_isp01_info = {
+struct nvhost_device_data t11_isp_info = {
.index = 3,
.syncpts = {NVSYNCPT_VI_ISP_2, NVSYNCPT_VI_ISP_3,
NVSYNCPT_VI_ISP_4},
@@ -189,7 +203,7 @@ static struct platform_device tegra_isp01_device = {
.resource = isp_resources,
.num_resources = ARRAY_SIZE(isp_resources),
.dev = {
- .platform_data = &tegra_isp01_info,
+ .platform_data = &t11_isp_info,
},
};
@@ -202,7 +216,7 @@ static struct resource vi_resources[] = {
},
};
-static struct nvhost_device_data tegra_vi01_info = {
+struct nvhost_device_data t11_vi_info = {
.index = 4,
.syncpts = {NVSYNCPT_CSI_VI_0, NVSYNCPT_CSI_VI_1,
NVSYNCPT_VI_ISP_0, NVSYNCPT_VI_ISP_1,
@@ -221,7 +235,7 @@ static struct platform_device tegra_vi01_device = {
.num_resources = ARRAY_SIZE(vi_resources),
.id = -1,
.dev = {
- .platform_data = &tegra_vi01_info,
+ .platform_data = &t11_vi_info,
},
};
@@ -234,7 +248,7 @@ static struct resource msenc_resources[] = {
},
};
-static struct nvhost_device_data tegra_msenc02_info = {
+struct nvhost_device_data t11_msenc_info = {
.version = NVHOST_ENCODE_MSENC_VER(2, 0),
.index = 5,
.syncpts = {NVSYNCPT_MSENC},
@@ -255,7 +269,7 @@ static struct platform_device tegra_msenc02_device = {
.resource = msenc_resources,
.num_resources = ARRAY_SIZE(msenc_resources),
.dev = {
- .platform_data = &tegra_msenc02_info,
+ .platform_data = &t11_msenc_info,
},
};
@@ -268,7 +282,7 @@ static struct resource tsec_resources[] = {
},
};
-static struct nvhost_device_data tegra_tsec01_info = {
+struct nvhost_device_data t11_tsec_info = {
.version = NVHOST_ENCODE_TSEC_VER(1, 0),
.index = 7,
.syncpts = {NVSYNCPT_TSEC},
@@ -288,7 +302,7 @@ static struct platform_device tegra_tsec01_device = {
.resource = tsec_resources,
.num_resources = ARRAY_SIZE(tsec_resources),
.dev = {
- .platform_data = &tegra_tsec01_info,
+ .platform_data = &t11_tsec_info,
},
};
@@ -306,10 +320,6 @@ struct platform_device *tegra11_register_host1x_devices(void)
int index = 0;
struct platform_device *pdev;
- struct nvhost_device_data *pdata =
- (struct nvhost_device_data *)tegra_host1x02_device.dev.platform_data;
- pdata->private_data = &host1x02_info;
-
/* register host1x device first */
platform_device_register(&tegra_host1x02_device);
tegra_host1x02_device.dev.parent = NULL;
@@ -318,13 +328,7 @@ struct platform_device *tegra11_register_host1x_devices(void)
for (index = 0; index < ARRAY_SIZE(t11_devices); index++) {
pdev = t11_devices[index];
pdev->dev.parent = &tegra_host1x02_device.dev;
- if (pdev == &tegra_gr3d03_device) {
- const char *real_name = pdev->name;
- pdev->name = "gr3d";
- platform_device_register(pdev);
- pdev->name = real_name;
- } else
- platform_device_register(pdev);
+ platform_device_register(pdev);
}
return &tegra_host1x02_device;