blob: 00e7f7157b75d98f46ef085f9d311517a546a726 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#include <linux/init.h>
28#include <linux/module.h>
29#include <linux/kernel.h>
30#include <linux/errno.h>
31#include <linux/i2c.h>
32
33static u32 isa_func(struct i2c_adapter *adapter);
34
35/* This is the actual algorithm we define */
36static struct i2c_algorithm isa_algorithm = {
37 .name = "ISA bus algorithm",
38 .id = I2C_ALGO_ISA,
39 .functionality = isa_func,
40};
41
42/* There can only be one... */
43static struct i2c_adapter isa_adapter = {
44 .owner = THIS_MODULE,
45 .class = I2C_CLASS_HWMON,
46 .algo = &isa_algorithm,
47 .name = "ISA main adapter",
48};
49
50/* We can't do a thing... */
51static u32 isa_func(struct i2c_adapter *adapter)
52{
53 return 0;
54}
55
56static int __init i2c_isa_init(void)
57{
58 return i2c_add_adapter(&isa_adapter);
59}
60
61static void __exit i2c_isa_exit(void)
62{
63 i2c_del_adapter(&isa_adapter);
64}
65
66MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>");
67MODULE_DESCRIPTION("ISA bus access through i2c");
68MODULE_LICENSE("GPL");
69
70module_init(i2c_isa_init);
71module_exit(i2c_isa_exit);