NetBSD-Bugs archive

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

kern/43275: gpioiic driver does not return all pins states



>Number:         43275
>Category:       kern
>Synopsis:       gpioiic driver does not return all pins states
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 07 11:15:00 +0000 2010
>Originator:     Maxim Weber
>Release:        5.0.2 (6.0)
>Organization:
SOHARD Embedded Systems GmbH
>Environment:
>Description:
The function gpioiic_bb_read_bits() does not return all pins states as result 
I2C attached to gpioiic* will not work.
>How-To-Repeat:
gpioiic.c,v 1.2 2009/12/06 22:33:44
>Fix:
Here code snipped that fix the problem:

u_int32_t
gpioiic_bb_read_bits(void *cookie)
{
        struct gpioiic_softc *sc = cookie;
        u_int32_t bits_state = 0;

        if (GPIO_PIN_HIGH == gpio_pin_read(sc->sc_gpio, &sc->sc_map, 
GPIOIIC_PIN_SDA))
                bits_state |= GPIOIIC_SDA;

        if (GPIO_PIN_HIGH == gpio_pin_read(sc->sc_gpio, &sc->sc_map, 
GPIOIIC_PIN_SCL))
                bits_state |= GPIOIIC_SCL;

        return bits_state;
}



Home | Main Index | Thread Index | Old Index