summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index c1150bac..4c6566a6 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -69,7 +69,7 @@
69/* TODO: Change to e.g. "nvidia-gpu%s" once we have symlinks in place. */ 69/* TODO: Change to e.g. "nvidia-gpu%s" once we have symlinks in place. */
70#define INTERFACE_NAME "nvhost%s-gpu" 70#define INTERFACE_NAME "nvhost%s-gpu"
71 71
72#define GK20A_NUM_CDEVS 5 72#define GK20A_NUM_CDEVS 6
73 73
74#if defined(GK20A_DEBUG) 74#if defined(GK20A_DEBUG)
75u32 gk20a_dbg_mask = GK20A_DEFAULT_DBG_MASK; 75u32 gk20a_dbg_mask = GK20A_DEFAULT_DBG_MASK;
@@ -144,6 +144,16 @@ static const struct file_operations gk20a_prof_ops = {
144#endif 144#endif
145}; 145};
146 146
147static const struct file_operations gk20a_tsg_ops = {
148 .owner = THIS_MODULE,
149 .release = gk20a_tsg_dev_release,
150 .open = gk20a_tsg_dev_open,
151#ifdef CONFIG_COMPAT
152 .compat_ioctl = gk20a_tsg_dev_ioctl,
153#endif
154 .unlocked_ioctl = gk20a_tsg_dev_ioctl,
155};
156
147static inline void sim_writel(struct gk20a *g, u32 r, u32 v) 157static inline void sim_writel(struct gk20a *g, u32 r, u32 v)
148{ 158{
149 writel(v, g->sim.regs+r); 159 writel(v, g->sim.regs+r);
@@ -1061,6 +1071,11 @@ static void gk20a_user_deinit(struct platform_device *dev)
1061 cdev_del(&g->prof.cdev); 1071 cdev_del(&g->prof.cdev);
1062 } 1072 }
1063 1073
1074 if (g->tsg.node) {
1075 device_destroy(g->class, g->tsg.cdev.dev);
1076 cdev_del(&g->tsg.cdev);
1077 }
1078
1064 if (g->cdev_region) 1079 if (g->cdev_region)
1065 unregister_chrdev_region(g->cdev_region, GK20A_NUM_CDEVS); 1080 unregister_chrdev_region(g->cdev_region, GK20A_NUM_CDEVS);
1066 1081
@@ -1120,6 +1135,12 @@ static int gk20a_user_init(struct platform_device *dev)
1120 if (err) 1135 if (err)
1121 goto fail; 1136 goto fail;
1122 1137
1138 err = gk20a_create_device(dev, devno++, "-tsg",
1139 &g->tsg.cdev, &g->tsg.node,
1140 &gk20a_tsg_ops);
1141 if (err)
1142 goto fail;
1143
1123 return 0; 1144 return 0;
1124fail: 1145fail:
1125 gk20a_user_deinit(dev); 1146 gk20a_user_deinit(dev);