Linux-2.6.12-rc2
[linux-flexiantxendom0-natty.git] / drivers / i2c / busses / i2c-isa.c
1 /*
2     i2c-isa.c - Part of lm_sensors, Linux kernel modules for hardware
3             monitoring
4     Copyright (c) 1998, 1999  Frodo Looijaard <frodol@dds.nl> 
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 /* This implements an i2c algorithm/adapter for ISA bus. Not that this is
22    on first sight very useful; almost no functionality is preserved.
23    Except that it makes writing drivers for chips which can be on both
24    the SMBus and the ISA bus very much easier. See lm78.c for an example
25    of this. */
26
27 #include <linux/config.h>
28 #include <linux/init.h>
29 #include <linux/module.h>
30 #include <linux/kernel.h>
31 #include <linux/errno.h>
32 #include <linux/i2c.h>
33
34 static u32 isa_func(struct i2c_adapter *adapter);
35
36 /* This is the actual algorithm we define */
37 static struct i2c_algorithm isa_algorithm = {
38         .name           = "ISA bus algorithm",
39         .id             = I2C_ALGO_ISA,
40         .functionality  = isa_func,
41 };
42
43 /* There can only be one... */
44 static struct i2c_adapter isa_adapter = {
45         .owner          = THIS_MODULE,
46         .class          = I2C_CLASS_HWMON,
47         .algo           = &isa_algorithm,
48         .name           = "ISA main adapter",
49 };
50
51 /* We can't do a thing... */
52 static u32 isa_func(struct i2c_adapter *adapter)
53 {
54         return 0;
55 }
56
57 static int __init i2c_isa_init(void)
58 {
59         return i2c_add_adapter(&isa_adapter);
60 }
61
62 static void __exit i2c_isa_exit(void)
63 {
64         i2c_del_adapter(&isa_adapter);
65 }
66
67 MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>");
68 MODULE_DESCRIPTION("ISA bus access through i2c");
69 MODULE_LICENSE("GPL");
70
71 module_init(i2c_isa_init);
72 module_exit(i2c_isa_exit);