1 /****************************************************************************
3 * Copyright (C) 2005 - 2013 by Vivante Corp.
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.
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.
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.
19 *****************************************************************************/
22 /* vivante_drv.c -- vivante driver -*- linux-c -*-
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:
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
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.
45 * Rickard E. (Rik) Faith <faith@valinux.com>
46 * Daryll Strauss <daryll@valinux.com>
47 * Gareth Hughes <gareth@valinux.com>
50 #include <linux/version.h>
51 #include <linux/module.h>
54 #include "vivante_drv.h"
56 #include "drm_pciids.h"
58 static char platformdevicename[] = "Vivante GCCore";
59 static struct platform_device *pplatformdev;
61 static const struct file_operations viv_driver_fops = {
64 .release = drm_release,
65 .unlocked_ioctl = drm_ioctl,
69 .llseek = noop_llseek,
72 static struct drm_driver driver = {
73 .driver_features = DRIVER_USE_MTRR,
74 .fops = &viv_driver_fops,
78 .major = DRIVER_MAJOR,
79 .minor = DRIVER_MINOR,
80 .patchlevel = DRIVER_PATCHLEVEL,
83 static int __init vivante_init(void)
87 pplatformdev = platform_device_register_simple(platformdevicename,
89 if (pplatformdev == NULL)
90 printk(KERN_ERR"Platform device is null\n");
92 retcode = drm_platform_init(&driver, pplatformdev);
97 static void __exit vivante_exit(void)
100 drm_platform_exit(&driver, pplatformdev);
101 platform_device_unregister(pplatformdev);
106 module_init(vivante_init);
107 module_exit(vivante_exit);
109 MODULE_AUTHOR(DRIVER_AUTHOR);
110 MODULE_DESCRIPTION(DRIVER_DESC);
111 MODULE_LICENSE("GPL and additional rights");