for (i = 0; i < GSCGPIO_NPINS; i++)
for (i = 0; i < PCAGPIO_NPINS; i++)
pcagpio_attach(struct device *parent, struct device *self, void *aux){	struct pcagpio_softc *sc = (struct pcagpio_softc *)self;	struct i2c_attach_args *ia = aux;	struct gpiobus_attach_args gba;	u_int8_t cmd, data;	int outputs = 0, i;	sc->sc_tag = ia->ia_tag;	sc->sc_addr = ia->ia_addr;	cmd = PCA9554_CONFIG;	if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,	    sc->sc_addr, &cmd, sizeof cmd, &data, sizeof data, 0)) {		printf(": failed to initialize\n");		return;	}	sc->sc_control = data;	cmd = PCA9554_POLARITY;	if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,	    sc->sc_addr, &cmd, sizeof cmd, &data, sizeof data, 0)) {		printf(": failed to initialize\n");		return;	}	sc->sc_polarity = data;	cmd = PCA9554_OUT;	if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,	    sc->sc_addr, &cmd, sizeof cmd, &data, sizeof data, 0)) {		printf(": failed to initialize\n");		return;	}	/* Initialize sensor data. */	for (i = 0; i < GSCGPIO_NPINS; i++)		strlcpy(sc->sc_sensor[i].device, sc->sc_dev.dv_xname,		    sizeof(sc->sc_sensor[i].device));	for (i = 0; i < GSCGPIO_NPINS; i++) {		sc->sc_sensor[i].type = SENSOR_INTEGER;		if ((sc->sc_control & (1 << i)) == 0) {			snprintf(sc->sc_sensor[i].desc,			    sizeof(sc->sc_sensor[i].desc), "out%d", i);			outputs++;		} else			snprintf(sc->sc_sensor[i].desc,			    sizeof(sc->sc_sensor[i].desc), "in%d", i);	}	if (sensor_task_register(sc, pcagpio_refresh, 5)) {		printf(", unable to register update task\n");		return;	}#if 0	for (i = 0; i < GSCGPIO_NPINS; i++)		SENSOR_ADD(&sc->sc_sensor[i]);#endif	printf(": %d inputs %d outputs\n", 8 - outputs, outputs);	for (i = 0; i < GSCGPIO_NPINS; i++) {		sc->sc_gpio_pins[i].pin_num = i;		sc->sc_gpio_pins[i].pin_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT;		if ((sc->sc_control & (1 << i)) == 0) {			sc->sc_gpio_pins[i].pin_flags = GPIO_PIN_OUTPUT;			sc->sc_gpio_pins[i].pin_state =			    data & (1 << i) ? GPIO_PIN_HIGH : GPIO_PIN_LOW;		}	}	/* Create controller tag */	sc->sc_gpio_gc.gp_cookie = sc;	sc->sc_gpio_gc.gp_pin_read = pcagpio_gpio_pin_read;	sc->sc_gpio_gc.gp_pin_write = pcagpio_gpio_pin_write;	sc->sc_gpio_gc.gp_pin_ctl = pcagpio_gpio_pin_ctl;	gba.gba_name = "gpio";	gba.gba_gc = &sc->sc_gpio_gc;	gba.gba_pins = sc->sc_gpio_pins;	gba.gba_npins = GSCGPIO_NPINS;	config_found(&sc->sc_dev, &gba, gpiobus_print);}