2 * Copyright (c) 2003-2005 Advanced Micro Devices, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * The full GNU General Public License is included in this distribution in the
24 * Cimarron module initalization
25 * Jordan Crouse (jordan.crouse@amd.com)
28 #include <linux/kernel.h>
29 #include <linux/init.h>
30 #include <linux/module.h>
31 #include <linux/pci.h>
32 #include <linux/pci_ids.h>
36 #include "build_num.h"
39 MODULE_AUTHOR("Advanced Micro Devices, Inc.");
40 MODULE_DESCRIPTION("AMD Geode LX Graphics Abstraction Layer");
41 MODULE_LICENSE("GPL");
44 #define CIM_MOD_DRIVER_NAME "cimarron"
46 int cim_init_dev(void);
47 void cim_exit_dev(void);
49 int cim_init_memory(void);
50 void cim_exit_memory(void);
51 /* We do this because there really isn't any way to verify that the
52 KFB or V4L2 is going to be loaded before Cimarron is. We force
53 the issue by asking the other entities to call cim_mod_init()
54 and we set a flag indicating that we have already been set up
57 static int cim_init_flag
= 0;
60 cim_mod_probe(struct pci_dev
*pcidev
, const struct pci_device_id
*pciid
) {
62 ret
= pci_enable_device(pcidev
);
64 ret
= cim_init_memory();
76 cim_mod_remove(struct pci_dev
*dev
) {
82 pci_device_id cim_mod_id_table
[] __devinitdata
= {
83 {PCI_VENDOR_ID_AMD
, PCI_DEVICE_ID_AMD_LX_VIDEO
, \
84 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0, 0},
88 MODULE_DEVICE_TABLE(pci
, cim_mod_id_table
);
91 pci_driver cim_mod_driver
= {
92 name
: CIM_MOD_DRIVER_NAME
,
93 id_table
: cim_mod_id_table
,
95 remove
: cim_mod_remove
102 if( cim_init_flag
!= 0 ) return 0;
103 printk(KERN_INFO
"%s\n", AMD_VERSION
);
104 ret
= pci_register_driver(&cim_mod_driver
);
105 if( ret
== 0 ) cim_init_flag
= 1;
113 printk(KERN_INFO CIM_MOD_DRIVER_NAME
" unloading\n");
114 pci_unregister_driver(&cim_mod_driver
);
119 module_init(cim_mod_init
);
122 module_exit(cim_mod_exit
);