FreeBSD/sys/powerpc/mpc85xx/mpc85xx_gpio.c
/* Get a specific pin's input value. */
Get a specific pin's input value.
Get a specific pin ' s input value .
static int
mpc85xx_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *value)
{
	struct mpc85xx_gpio_softc *sc = device_get_softc(dev);
	if (!VALID_PIN(pin))
		return (EINVAL);
	*value = (bus_read_4(sc->in_res, 0) >> (31 - pin)) & 1;
	return (0);
}
static int mpc85xx_gpio_pin_get ( device_t dev , uint32_t pin , unsigned int * value ) { struct mpc85xx_gpio_softc * sc = device_get_softc ( dev ) ; if ( ! VALID_PIN ( pin ) ) return ( EINVAL ) ; * value = ( bus_read_4 ( sc -> in_res , 0 ) >> ( 31 - pin ) ) & 1 ; return ( 0 ) ; }
Get a specific pin's input value.
Get a specific pin ' s input value .