Module Name: src
Committed By: macallan
Date: Wed Mar 31 05:09:41 UTC 2010
Modified Files:
src/sys/dev/ic: pcf8584.c
Log Message:
Do as OpenSolaris does and read the status register after each write.
Now this driver works on my Blade 2500.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/pcf8584.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/pcf8584.c
diff -u src/sys/dev/ic/pcf8584.c:1.6 src/sys/dev/ic/pcf8584.c:1.7
--- src/sys/dev/ic/pcf8584.c:1.6 Sun Feb 28 11:47:28 2010
+++ src/sys/dev/ic/pcf8584.c Wed Mar 31 05:09:41 2010
@@ -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 @@
#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 @@
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);
}