video: tegra: host: Register devices in SoC files
[linux-2.6.git] / drivers / video / tegra / host / gr2d / gr2d.c
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 <linux/export.h>
22
23 #include "dev.h"
24 #include "bus_client.h"
25
26 static int __devinit gr2d_probe(struct nvhost_device *dev,
27         struct nvhost_device_id *id_table)
28 {
29         return nvhost_client_device_init(dev);
30 }
31
32 static int __exit gr2d_remove(struct nvhost_device *dev)
33 {
34         /* Add clean-up */
35         return 0;
36 }
37
38 static int gr2d_suspend(struct nvhost_device *dev, pm_message_t state)
39 {
40         return nvhost_client_device_suspend(dev);
41 }
42
43 static int gr2d_resume(struct nvhost_device *dev)
44 {
45         dev_info(&dev->dev, "resuming\n");
46         return 0;
47 }
48
49 static struct nvhost_driver gr2d_driver = {
50         .probe = gr2d_probe,
51         .remove = __exit_p(gr2d_remove),
52 #ifdef CONFIG_PM
53         .suspend = gr2d_suspend,
54         .resume = gr2d_resume,
55 #endif
56         .driver = {
57                 .owner = THIS_MODULE,
58                 .name = "gr2d",
59         }
60 };
61
62 static int __init gr2d_init(void)
63 {
64         return nvhost_driver_register(&gr2d_driver);
65 }
66
67 static void __exit gr2d_exit(void)
68 {
69         nvhost_driver_unregister(&gr2d_driver);
70 }
71
72 module_init(gr2d_init);
73 module_exit(gr2d_exit);