From: kettenis Date: Sun, 1 Aug 2010 18:48:41 +0000 (+0000) Subject: Read status register after all writes to the pcf8584 controller. Alegedly X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a6cacc5311a67b4bdd4df5bd6213de2a4e75c5bc;p=openbsd Read status register after all writes to the pcf8584 controller. Alegedly this is what (Open)Solaris does and it makes the i2c controller on the blade2.5k work. From NetBSD. Tested by sthen@, ok deraadt@ --- diff --git a/sys/dev/ic/pcf8584.c b/sys/dev/ic/pcf8584.c index 949e5eb03d9..b86f6fec432 100644 --- a/sys/dev/ic/pcf8584.c +++ b/sys/dev/ic/pcf8584.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcf8584.c,v 1.10 2010/04/30 15:18:29 kettenis Exp $ */ +/* $OpenBSD: pcf8584.c,v 1.11 2010/08/01 18:48:41 kettenis Exp $ */ /* * Copyright (c) 2006 David Gwynne @@ -275,8 +275,9 @@ void pcfiic_write(struct pcfiic_softc *sc, bus_size_t r, u_int8_t v) { bus_space_write_1(sc->sc_iot, sc->sc_ioh, sc->sc_regmap[r], v); - bus_space_barrier(sc->sc_iot, sc->sc_ioh, sc->sc_regmap[r], 1, - BUS_SPACE_BARRIER_WRITE); + bus_space_barrier(sc->sc_iot, sc->sc_ioh, 0, 4, + BUS_SPACE_BARRIER_WRITE | BUS_SPACE_BARRIER_READ); + bus_space_read_1(sc->sc_iot, sc->sc_ioh, sc->sc_regmap[PCF_S1]); } void