]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/gpu/drm/vivante/vivante_drv.c
ENGR00240988: drm: vivante: remove reclaim_buffers callback
[karo-tx-linux.git] / drivers / gpu / drm / vivante / vivante_drv.c
1 /****************************************************************************
2 *
3 *    Copyright (C) 2005 - 2013 by Vivante Corp.
4 *
5 *    This program is free software; you can redistribute it and/or modify
6 *    it under the terms of the GNU General Public License as published by
7 *    the Free Software Foundation; either version 2 of the license, or
8 *    (at your option) any later version.
9 *
10 *    This program is distributed in the hope that it will be useful,
11 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *    GNU General Public License for more details.
14 *
15 *    You should have received a copy of the GNU General Public License
16 *    along with this program; if not write to the Free Software
17 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 *****************************************************************************/
20
21
22 /* vivante_drv.c -- vivante driver -*- linux-c -*-
23  *
24  *
25  * Permission is hereby granted, free of charge, to any person obtaining a
26  * copy of this software and associated documentation files (the "Software"),
27  * to deal in the Software without restriction, including without limitation
28  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
29  * and/or sell copies of the Software, and to permit persons to whom the
30  * Software is furnished to do so, subject to the following conditions:
31  *
32  * The above copyright notice and this permission notice (including the next
33  * paragraph) shall be included in all copies or substantial portions of the
34  * Software.
35  *
36  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
39  * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
40  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
41  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
42  * DEALINGS IN THE SOFTWARE.
43  *
44  * Authors:
45  *    Rickard E. (Rik) Faith <faith@valinux.com>
46  *    Daryll Strauss <daryll@valinux.com>
47  *    Gareth Hughes <gareth@valinux.com>
48  */
49
50 #include <linux/version.h>
51 #include <linux/module.h>
52
53 #include "drmP.h"
54 #include "vivante_drv.h"
55
56 #include "drm_pciids.h"
57
58 static char platformdevicename[] = "Vivante GCCore";
59 static struct platform_device *pplatformdev;
60
61 static const struct file_operations viv_driver_fops = {
62         .owner = THIS_MODULE,
63         .open = drm_open,
64         .release = drm_release,
65         .unlocked_ioctl = drm_ioctl,
66         .mmap = drm_mmap,
67         .poll = drm_poll,
68         .fasync = drm_fasync,
69         .llseek = noop_llseek,
70 };
71
72 static struct drm_driver driver = {
73         .driver_features = DRIVER_USE_MTRR,
74         .fops = &viv_driver_fops,
75         .name = DRIVER_NAME,
76         .desc = DRIVER_DESC,
77         .date = DRIVER_DATE,
78         .major = DRIVER_MAJOR,
79         .minor = DRIVER_MINOR,
80         .patchlevel = DRIVER_PATCHLEVEL,
81 };
82
83 static int __init vivante_init(void)
84 {
85         int retcode;
86
87         pplatformdev = platform_device_register_simple(platformdevicename,
88                         -1, NULL, 0);
89         if (pplatformdev == NULL)
90                 printk(KERN_ERR"Platform device is null\n");
91
92         retcode = drm_platform_init(&driver, pplatformdev);
93
94         return retcode;
95 }
96
97 static void __exit vivante_exit(void)
98 {
99         if (pplatformdev) {
100                 drm_platform_exit(&driver, pplatformdev);
101                 platform_device_unregister(pplatformdev);
102                 pplatformdev = NULL;
103         }
104 }
105
106 module_init(vivante_init);
107 module_exit(vivante_exit);
108
109 MODULE_AUTHOR(DRIVER_AUTHOR);
110 MODULE_DESCRIPTION(DRIVER_DESC);
111 MODULE_LICENSE("GPL and additional rights");