aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-sibyte.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/i2c/busses/i2c-sibyte.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/i2c/busses/i2c-sibyte.c')
-rw-r--r--drivers/i2c/busses/i2c-sibyte.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c
new file mode 100644
index 000000000000..e5dd90bdb04a
--- /dev/null
+++ b/drivers/i2c/busses/i2c-sibyte.c
@@ -0,0 +1,71 @@
1/*
2 * Copyright (C) 2004 Steven J. Hill
3 * Copyright (C) 2001,2002,2003 Broadcom Corporation
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
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.
14 *
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20#include <linux/config.h>
21#include <linux/module.h>
22#include <linux/i2c-algo-sibyte.h>
23#include <asm/sibyte/sb1250_regs.h>
24#include <asm/sibyte/sb1250_smbus.h>
25
26static struct i2c_algo_sibyte_data sibyte_board_data[2] = {
27 { NULL, 0, (void *) (KSEG1+A_SMB_BASE(0)) },
28 { NULL, 1, (void *) (KSEG1+A_SMB_BASE(1)) }
29};
30
31static struct i2c_adapter sibyte_board_adapter[2] = {
32 {
33 .owner = THIS_MODULE,
34 .id = I2C_HW_SIBYTE,
35 .class = I2C_CLASS_HWMON,
36 .algo = NULL,
37 .algo_data = &sibyte_board_data[0],
38 .name = "SiByte SMBus 0",
39 },
40 {
41 .owner = THIS_MODULE,
42 .id = I2C_HW_SIBYTE,
43 .class = I2C_CLASS_HWMON,
44 .algo = NULL,
45 .algo_data = &sibyte_board_data[1],
46 .name = "SiByte SMBus 1",
47 },
48};
49
50static int __init i2c_sibyte_init(void)
51{
52 printk("i2c-swarm.o: i2c SMBus adapter module for SiByte board\n");
53 if (i2c_sibyte_add_bus(&sibyte_board_adapter[0], K_SMB_FREQ_100KHZ) < 0)
54 return -ENODEV;
55 if (i2c_sibyte_add_bus(&sibyte_board_adapter[1], K_SMB_FREQ_400KHZ) < 0)
56 return -ENODEV;
57 return 0;
58}
59
60static void __exit i2c_sibyte_exit(void)
61{
62 i2c_sibyte_del_bus(&sibyte_board_adapter[0]);
63 i2c_sibyte_del_bus(&sibyte_board_adapter[1]);
64}
65
66module_init(i2c_sibyte_init);
67module_exit(i2c_sibyte_exit);
68
69MODULE_AUTHOR("Kip Walker <kwalker@broadcom.com>, Steven J. Hill <sjhill@realitydiluted.com>");
70MODULE_DESCRIPTION("SMBus adapter routines for SiByte boards");
71MODULE_LICENSE("GPL");