Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101314
b: refs/heads/master
c: 392a040
h: refs/heads/master
v: v3
  • Loading branch information
Maciej W. Rozycki authored and Jean Delvare committed Jul 14, 2008
1 parent c256262 commit aa7096a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf898dc5e9dfd1487b28ca0176b68722f05d4d48
refs/heads/master: 392a0408fdc4c9069c32a9a02b0088eae76c4618
1 change: 1 addition & 0 deletions trunk/arch/mips/sibyte/swarm/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
obj-y := setup.o rtc_xicor1241.o rtc_m41t81.o

obj-$(CONFIG_I2C_BOARDINFO) += swarm-i2c.o
obj-$(CONFIG_KGDB) += dbg_io.o
37 changes: 37 additions & 0 deletions trunk/arch/mips/sibyte/swarm/swarm-i2c.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* arch/mips/sibyte/swarm/swarm-i2c.c
*
* Broadcom BCM91250A (SWARM), etc. I2C platform setup.
*
* Copyright (c) 2008 Maciej W. Rozycki
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/

#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>


static struct i2c_board_info swarm_i2c_info1[] __initdata = {
{
I2C_BOARD_INFO("m41t81", 0x68),
},
};

static int __init swarm_i2c_init(void)
{
int err;

err = i2c_register_board_info(1, swarm_i2c_info1,
ARRAY_SIZE(swarm_i2c_info1));
if (err < 0)
printk(KERN_ERR
"swarm-i2c: cannot register board I2C devices\n");
return err;
}

arch_initcall(swarm_i2c_init);
4 changes: 3 additions & 1 deletion trunk/drivers/i2c/busses/i2c-sibyte.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static int __init i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed)
csr_out32(speed, SMB_CSR(adap,R_SMB_FREQ));
csr_out32(0, SMB_CSR(adap,R_SMB_CONTROL));

return i2c_add_adapter(i2c_adap);
return i2c_add_numbered_adapter(i2c_adap);
}


Expand All @@ -159,6 +159,7 @@ static struct i2c_adapter sibyte_board_adapter[2] = {
.class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
.algo = NULL,
.algo_data = &sibyte_board_data[0],
.nr = 0,
.name = "SiByte SMBus 0",
},
{
Expand All @@ -167,6 +168,7 @@ static struct i2c_adapter sibyte_board_adapter[2] = {
.class = I2C_CLASS_HWMON | I2C_CLASS_SPD,
.algo = NULL,
.algo_data = &sibyte_board_data[1],
.nr = 1,
.name = "SiByte SMBus 1",
},
};
Expand Down

0 comments on commit aa7096a

Please sign in to comment.