diff options
Diffstat (limited to 'drivers/video/tegra/host/gr2d/gr2d.c')
-rw-r--r-- | drivers/video/tegra/host/gr2d/gr2d.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/gr2d/gr2d.c b/drivers/video/tegra/host/gr2d/gr2d.c new file mode 100644 index 00000000000..f88eb72e0a4 --- /dev/null +++ b/drivers/video/tegra/host/gr2d/gr2d.c | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * drivers/video/tegra/host/gr2d/gr2d.c | ||
3 | * | ||
4 | * Tegra Graphics 2D | ||
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 gr2d_probe(struct nvhost_device *dev) | ||
25 | { | ||
26 | return nvhost_client_device_init(dev); | ||
27 | } | ||
28 | |||
29 | static int __exit gr2d_remove(struct nvhost_device *dev) | ||
30 | { | ||
31 | /* Add clean-up */ | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | static int gr2d_suspend(struct nvhost_device *dev, pm_message_t state) | ||
36 | { | ||
37 | return nvhost_client_device_suspend(dev); | ||
38 | } | ||
39 | |||
40 | static int gr2d_resume(struct nvhost_device *dev) | ||
41 | { | ||
42 | dev_info(&dev->dev, "resuming\n"); | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | struct nvhost_device *gr2d_device; | ||
47 | |||
48 | static struct nvhost_driver gr2d_driver = { | ||
49 | .probe = gr2d_probe, | ||
50 | .remove = __exit_p(gr2d_remove), | ||
51 | #ifdef CONFIG_PM | ||
52 | .suspend = gr2d_suspend, | ||
53 | .resume = gr2d_resume, | ||
54 | #endif | ||
55 | .driver = { | ||
56 | .owner = THIS_MODULE, | ||
57 | .name = "gr2d", | ||
58 | } | ||
59 | }; | ||
60 | |||
61 | static int __init gr2d_init(void) | ||
62 | { | ||
63 | int err; | ||
64 | |||
65 | gr2d_device = nvhost_get_device("gr2d"); | ||
66 | if (!gr2d_device) | ||
67 | return -ENXIO; | ||
68 | |||
69 | err = nvhost_device_register(gr2d_device); | ||
70 | if (err) | ||
71 | return err; | ||
72 | |||
73 | return nvhost_driver_register(&gr2d_driver); | ||
74 | } | ||
75 | |||
76 | static void __exit gr2d_exit(void) | ||
77 | { | ||
78 | nvhost_driver_unregister(&gr2d_driver); | ||
79 | } | ||
80 | |||
81 | module_init(gr2d_init); | ||
82 | module_exit(gr2d_exit); | ||