head/sys/arm/xilinx/zy7_gpio.c
/* Get a specific pin's name. */
Get a specific pin's name.
Get a specific pin ' s name .
static int
zy7_gpio_pin_getname(device_t dev, uint32_t pin, char *name)
{
	if (!VALID_PIN(pin))
		return (EINVAL);
	if (pin < NUM_MIO_PINS) {
		snprintf(name, GPIOMAXNAME, "MIO_%d", pin);
		name[GPIOMAXNAME - 1] = '\0';
	} else {
		snprintf(name, GPIOMAXNAME, "EMIO_%d", pin - EMIO_PIN);
		name[GPIOMAXNAME - 1] = '\0';
	}
	return (0);
}
static int zy7_gpio_pin_getname ( device_t dev , uint32_t pin , char * name ) { if ( ! VALID_PIN ( pin ) ) return ( EINVAL ) ; if ( pin < NUM_MIO_PINS ) { snprintf ( name , GPIOMAXNAME , " " , pin ) ; name [ GPIOMAXNAME - 1 ] = ' \0 ' ; } else { snprintf ( name , GPIOMAXNAME , " " , pin - EMIO_PIN ) ; name [ GPIOMAXNAME - 1 ] = ' \0 ' ; } return ( 0 ) ; }
Get a specific pin's name.
Get a specific pin ' s name .