diff options
| author | macallan <macallan@NetBSD.org> | 2010-03-31 05:09:41 +0000 |
|---|---|---|
| committer | macallan <macallan@NetBSD.org> | 2010-03-31 05:09:41 +0000 |
| commit | 38fe6d628443170d7a8cece47bd23240647672b3 (patch) | |
| tree | e89fbc07f228f9a9307bdeaff017c27c81bf6d0a /sys/dev | |
| parent | a26d6af163707af5de3ffbf7f807603e4e3a911c (diff) | |
Do as OpenSolaris does and read the status register after each write.
Now this driver works on my Blade 2500.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/pcf8584.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ic/pcf8584.c b/sys/dev/ic/pcf8584.c index a42fffdeb44..04c6bc4c02b 100644 --- a/sys/dev/ic/pcf8584.c +++ b/sys/dev/ic/pcf8584.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcf8584.c,v 1.6 2010/02/28 11:47:28 martin Exp $ */ +/* $NetBSD: pcf8584.c,v 1.7 2010/03/31 05:09:41 macallan Exp $ */ /* $OpenBSD: pcf8584.c,v 1.9 2007/10/20 18:46:21 kettenis Exp $ */ /* @@ -167,7 +167,7 @@ pcfiic_i2c_exec(void *arg, i2c_op_t op, i2c_addr_t addr, #if 0 printf("%s: exec op: %d addr: 0x%x cmdlen: %d len: %d flags 0x%x\n", - sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags); + device_xname(sc->sc_dev), op, addr, (int)cmdlen, (int)len, flags); #endif if (cold || sc->sc_poll) @@ -267,7 +267,9 @@ pcfiic_read(struct pcfiic_softc *sc, bus_size_t r) void pcfiic_write(struct pcfiic_softc *sc, bus_size_t r, u_int8_t v) { + volatile uint8_t junk; bus_space_write_1(sc->sc_iot, sc->sc_ioh, sc->sc_regmap[r], v); + junk = bus_space_read_1(sc->sc_iot, sc->sc_ioh, PCF_S1); bus_space_barrier(sc->sc_iot, sc->sc_ioh, sc->sc_regmap[r], 1, BUS_SPACE_BARRIER_WRITE); } |
