Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/dev/gpio Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/22337a3c98c3
branches:  netbsd-7
changeset: 799632:22337a3c98c3
user:      riz <riz%NetBSD.org@localhost>
date:      Wed Nov 04 21:08:09 2015 +0000

description:
Pull up following revision(s) (requested by phx in ticket #977):
        sys/dev/gpio/gpioiic.c: revision 1.7
i2c_acquire_bus() should return 0 on success.
Fixed bug in gpioiic_bb_set_bits(), which was introduced with the SDA/SCL-
reverse feature.
Now the driver is confirmed to work. Tested with Raspberry Pi GPIO.

diffstat:

 sys/dev/gpio/gpioiic.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r 6a68080edd0a -r 22337a3c98c3 sys/dev/gpio/gpioiic.c
--- a/sys/dev/gpio/gpioiic.c    Wed Nov 04 21:05:01 2015 +0000
+++ b/sys/dev/gpio/gpioiic.c    Wed Nov 04 21:08:09 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gpioiic.c,v 1.6 2012/10/27 17:18:16 chs Exp $ */
+/* $NetBSD: gpioiic.c,v 1.6.12.1 2015/11/04 21:08:09 riz Exp $ */
 /*     $OpenBSD: gpioiic.c,v 1.8 2008/11/24 12:12:12 mbalmer Exp $     */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gpioiic.c,v 1.6 2012/10/27 17:18:16 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpioiic.c,v 1.6.12.1 2015/11/04 21:08:09 riz Exp $");
 
 /*
  * I2C bus bit-banging through GPIO pins.
@@ -232,10 +232,10 @@
        struct gpioiic_softc *sc = cookie;
 
        if (flags & I2C_F_POLL)
-               return 0;
+               return 1;
 
        rw_enter(&sc->sc_i2c_lock, RW_WRITER);
-       return 1;
+       return 0;
 }
 
 void
@@ -286,8 +286,8 @@
 
        gpio_pin_write(sc->sc_gpio, &sc->sc_map, sc->sc_pin_sda,
            bits & GPIOIIC_SDA ? GPIO_PIN_HIGH : GPIO_PIN_LOW);
-       gpio_pin_write(sc->sc_gpio, &sc->sc_map, GPIOIIC_PIN_SCL,
-           bits & GPIOIIC_SCL ? GPIO_PIN_HIGH : sc->sc_pin_scl);
+       gpio_pin_write(sc->sc_gpio, &sc->sc_map, sc->sc_pin_scl,
+           bits & GPIOIIC_SCL ? GPIO_PIN_HIGH : GPIO_PIN_LOW);
 }
 
 void



Home | Main Index | Thread Index | Old Index