diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-11-15 15:35:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-11-15 15:35:35 +0000 |
commit | 5b459701d6699f6792a912e977f810cf2c13b57c (patch) | |
tree | c1842a5a5d7b219b58812ec8268889f0f3e3e653 /sys | |
parent | 950d8807c7563c7b866198602d720d4866dcf0d5 (diff) |
oh, once we are on bus1, we must have a way to get back to bus0... duh
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/macppc/dev/ki2c.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/macppc/dev/ki2c.c b/sys/arch/macppc/dev/ki2c.c index a8d5b57e8e8..24ac4cd0821 100644 --- a/sys/arch/macppc/dev/ki2c.c +++ b/sys/arch/macppc/dev/ki2c.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ki2c.c,v 1.6 2005/11/14 22:29:35 deraadt Exp $ */ +/* $OpenBSD: ki2c.c,v 1.7 2005/11/15 15:35:34 deraadt Exp $ */ /* $NetBSD: ki2c.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */ /*- @@ -173,9 +173,11 @@ ki2c_setmode(sc, mode, bus) KASSERT((mode & ~I2C_MODE) == 0); x = ki2c_readreg(sc, MODE); - x &= ~I2C_MODE; + x &= ~(I2C_MODE); if (bus) x |= I2C_BUS1; + else + x &= ~I2C_BUS1; x |= mode; ki2c_writereg(sc, MODE, x); } @@ -368,7 +370,7 @@ ki2c_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, return (EINVAL); /* We handle the subaddress stuff ourselves. */ - ki2c_setmode(sc, I2C_STDMODE, addr >> 7); + ki2c_setmode(sc, I2C_STDMODE, addr & 0x80); addr &= 0x7f; if (ki2c_write(sc, (addr << 1), 0, cmdbuf, cmdlen) != 0) |