Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Do as OpenSolaris does and read the status regist...



details:   https://anonhg.NetBSD.org/src/rev/92654c018af6
branches:  trunk
changeset: 753502:92654c018af6
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed Mar 31 05:09:41 2010 +0000

description:
Do as OpenSolaris does and read the status register after each write.
Now this driver works on my Blade 2500.

diffstat:

 sys/dev/ic/pcf8584.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 12d5dd1ad9a0 -r 92654c018af6 sys/dev/ic/pcf8584.c
--- a/sys/dev/ic/pcf8584.c      Wed Mar 31 04:17:23 2010 +0000
+++ b/sys/dev/ic/pcf8584.c      Wed Mar 31 05:09:41 2010 +0000
@@ -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);
 }



Home | Main Index | Thread Index | Old Index