tdfx_drv.c revision 1.2
1/* $NetBSD: tdfx_drv.c,v 1.2 2018/08/27 04:58:37 riastradh Exp $ */ 2 3/* tdfx_drv.c -- tdfx driver -*- linux-c -*- 4 * Created: Thu Oct 7 10:38:32 1999 by faith@precisioninsight.com 5 * 6 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. 7 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. 8 * All Rights Reserved. 9 * 10 * Permission is hereby granted, free of charge, to any person obtaining a 11 * copy of this software and associated documentation files (the "Software"), 12 * to deal in the Software without restriction, including without limitation 13 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 14 * and/or sell copies of the Software, and to permit persons to whom the 15 * Software is furnished to do so, subject to the following conditions: 16 * 17 * The above copyright notice and this permission notice (including the next 18 * paragraph) shall be included in all copies or substantial portions of the 19 * Software. 20 * 21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 * DEALINGS IN THE SOFTWARE. 28 * 29 * Authors: 30 * Rickard E. (Rik) Faith <faith@valinux.com> 31 * Daryll Strauss <daryll@valinux.com> 32 * Gareth Hughes <gareth@valinux.com> 33 */ 34 35#include <sys/cdefs.h> 36__KERNEL_RCSID(0, "$NetBSD: tdfx_drv.c,v 1.2 2018/08/27 04:58:37 riastradh Exp $"); 37 38#include <linux/module.h> 39 40#include <drm/drmP.h> 41#include "tdfx_drv.h" 42 43#include <drm/drm_pciids.h> 44#include <drm/drm_legacy.h> 45 46static struct pci_device_id pciidlist[] = { 47 tdfx_PCI_IDS 48}; 49 50static const struct file_operations tdfx_driver_fops = { 51 .owner = THIS_MODULE, 52 .open = drm_open, 53 .release = drm_release, 54 .unlocked_ioctl = drm_ioctl, 55 .mmap = drm_legacy_mmap, 56 .poll = drm_poll, 57#ifdef CONFIG_COMPAT 58 .compat_ioctl = drm_compat_ioctl, 59#endif 60 .llseek = noop_llseek, 61}; 62 63static struct drm_driver driver = { 64 .set_busid = drm_pci_set_busid, 65 .fops = &tdfx_driver_fops, 66 .name = DRIVER_NAME, 67 .desc = DRIVER_DESC, 68 .date = DRIVER_DATE, 69 .major = DRIVER_MAJOR, 70 .minor = DRIVER_MINOR, 71 .patchlevel = DRIVER_PATCHLEVEL, 72}; 73 74static struct pci_driver tdfx_pci_driver = { 75 .name = DRIVER_NAME, 76 .id_table = pciidlist, 77}; 78 79static int __init tdfx_init(void) 80{ 81 return drm_pci_init(&driver, &tdfx_pci_driver); 82} 83 84static void __exit tdfx_exit(void) 85{ 86 drm_pci_exit(&driver, &tdfx_pci_driver); 87} 88 89module_init(tdfx_init); 90module_exit(tdfx_exit); 91 92MODULE_AUTHOR(DRIVER_AUTHOR); 93MODULE_DESCRIPTION(DRIVER_DESC); 94MODULE_LICENSE("GPL and additional rights"); 95