diff options
Diffstat (limited to 'drivers/video/tegra/host/vi')
-rw-r--r-- | drivers/video/tegra/host/vi/Makefile | 7 | ||||
-rw-r--r-- | drivers/video/tegra/host/vi/vi.c | 82 |
2 files changed, 89 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/vi/Makefile b/drivers/video/tegra/host/vi/Makefile new file mode 100644 index 00000000000..8c130e49814 --- /dev/null +++ b/drivers/video/tegra/host/vi/Makefile | |||
@@ -0,0 +1,7 @@ | |||
1 | GCOV_PROFILE := y | ||
2 | EXTRA_CFLAGS += -Idrivers/video/tegra/host | ||
3 | |||
4 | nvhost-vi-objs = \ | ||
5 | vi.o | ||
6 | |||
7 | obj-$(CONFIG_TEGRA_GRHOST) += nvhost-vi.o | ||
diff --git a/drivers/video/tegra/host/vi/vi.c b/drivers/video/tegra/host/vi/vi.c new file mode 100644 index 00000000000..71d517152ad --- /dev/null +++ b/drivers/video/tegra/host/vi/vi.c | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * drivers/video/tegra/host/vi/vi.c | ||
3 | * | ||
4 | * Tegra Graphics Host VI | ||
5 | * | ||
6 | * Copyright (c) 2012, NVIDIA Corporation. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms and conditions of the GNU General Public License, | ||
10 | * version 2, as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
15 | * more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | #include "dev.h" | ||
22 | #include "bus_client.h" | ||
23 | |||
24 | static int __devinit vi_probe(struct nvhost_device *dev) | ||
25 | { | ||
26 | return nvhost_client_device_init(dev); | ||
27 | } | ||
28 | |||
29 | static int __exit vi_remove(struct nvhost_device *dev) | ||
30 | { | ||
31 | /* Add clean-up */ | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | static int vi_suspend(struct nvhost_device *dev, pm_message_t state) | ||
36 | { | ||
37 | return nvhost_client_device_suspend(dev); | ||
38 | } | ||
39 | |||
40 | static int vi_resume(struct nvhost_device *dev) | ||
41 | { | ||
42 | dev_info(&dev->dev, "resuming\n"); | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | struct nvhost_device *vi_device; | ||
47 | |||
48 | static struct nvhost_driver vi_driver = { | ||
49 | .probe = vi_probe, | ||
50 | .remove = __exit_p(vi_remove), | ||
51 | #ifdef CONFIG_PM | ||
52 | .suspend = vi_suspend, | ||
53 | .resume = vi_resume, | ||
54 | #endif | ||
55 | .driver = { | ||
56 | .owner = THIS_MODULE, | ||
57 | .name = "vi", | ||
58 | } | ||
59 | }; | ||
60 | |||
61 | static int __init vi_init(void) | ||
62 | { | ||
63 | int err; | ||
64 | |||
65 | vi_device = nvhost_get_device("vi"); | ||
66 | if (!vi_device) | ||
67 | return -ENXIO; | ||
68 | |||
69 | err = nvhost_device_register(vi_device); | ||
70 | if (err) | ||
71 | return err; | ||
72 | |||
73 | return nvhost_driver_register(&vi_driver); | ||
74 | } | ||
75 | |||
76 | static void __exit vi_exit(void) | ||
77 | { | ||
78 | nvhost_driver_unregister(&vi_driver); | ||
79 | } | ||
80 | |||
81 | module_init(vi_init); | ||
82 | module_exit(vi_exit); | ||