Lines Matching +full:8 +full:dev
46 #include <dev/gpio/gpiobusvar.h>
47 #include <dev/superio/superio.h>
75 #define NCT_VERBOSE_PRINTF(dev, ...) \ argument
78 device_printf(dev, __VA_ARGS__); \
100 uint8_t pinbits[8];
105 device_t dev; member
131 device_get_nameunit(dev), NULL, MTX_DEF)
165 .npins = 8,
177 .npins = 8,
189 .npins = 8,
201 .npins = 8,
213 .npins = 8,
232 .npins = 8,
244 .npins = 8,
263 .npins = 8,
275 .npins = 8,
294 .npins = 8,
306 .npins = 8,
326 .npins = 8,
338 .npins = 8,
350 .npins = 8,
374 .npins = 8,
387 .npins = 8,
399 .npins = 8,
411 .npins = 8,
415 .grpnum = 8,
423 .npins = 8,
495 .grpnum = 8,
503 .npins = 8,
534 .npins = 8,
546 .npins = 8,
558 .npins = 8,
582 .npins = 8,
594 .npins = 8,
606 .npins = 8,
622 .grpnum = 8,
630 .npins = 8,
649 .npins = 8,
661 .npins = 8,
673 .npins = 8,
685 .npins = 8,
697 .npins = 8,
709 .npins = 8,
721 .npins = 8,
733 .npins = 8,
737 .grpnum = 8,
745 .npins = 8,
773 NCT_VERBOSE_PRINTF(sc->dev, "write %s 0x%x ioport %d\n", in nct_io_set_group()
787 NCT_VERBOSE_PRINTF(sc->dev, "read %s 0x%x ioport %d\n", in nct_io_read()
797 NCT_VERBOSE_PRINTF(sc->dev, "write %s 0x%x ioport %d\n", in nct_io_write()
838 val = superio_ldn_read(sc->dev, gp->data_ldn, ioreg); in nct_read_reg()
839 NCT_VERBOSE_PRINTF(sc->dev, "read %s 0x%x from group GPIO%u ioreg 0x%x\n", in nct_read_reg()
874 superio_ldn_write(sc->dev, gp->data_ldn, ioreg, val); in nct_write_reg()
876 NCT_VERBOSE_PRINTF(sc->dev, "write %s 0x%x to group GPIO%u ioreg 0x%x\n", in nct_write_reg()
991 NCT_VERBOSE_PRINTF(sc->dev, "read %d from input pin %u<GPIO%u%u>\n", in nct_get_pin_reg()
994 NCT_VERBOSE_PRINTF(sc->dev, in nct_get_pin_reg()
1024 NCT_VERBOSE_PRINTF(sc->dev, in nct_read_pin()
1061 outcfg = superio_ldn_read(sc->dev, NCT_PPOD_LDN, reg); in nct_set_pin_opendrain()
1063 superio_ldn_write(sc->dev, 0xf, reg, outcfg); in nct_set_pin_opendrain()
1073 outcfg = superio_ldn_read(sc->dev, NCT_PPOD_LDN, reg); in nct_set_pin_pushpull()
1075 superio_ldn_write(sc->dev, 0xf, reg, outcfg); in nct_set_pin_pushpull()
1085 outcfg = superio_ldn_read(sc->dev, NCT_PPOD_LDN, reg); in nct_pin_is_opendrain()
1090 nct_lookup_device(device_t dev) in nct_lookup_device() argument
1096 devid = superio_devid(dev); in nct_lookup_device()
1097 extid = superio_extid(dev); in nct_lookup_device()
1106 nct_probe(device_t dev) in nct_probe() argument
1111 ldn = superio_get_ldn(dev); in nct_probe()
1113 if (superio_vendor(dev) != SUPERIO_VENDOR_NUVOTON) { in nct_probe()
1114 NCT_VERBOSE_PRINTF(dev, "ldn 0x%x not a Nuvoton device\n", ldn); in nct_probe()
1117 if (superio_get_type(dev) != SUPERIO_DEV_GPIO) { in nct_probe()
1118 NCT_VERBOSE_PRINTF(dev, "ldn 0x%x not a GPIO device\n", ldn); in nct_probe()
1122 nctdevp = nct_lookup_device(dev); in nct_probe()
1124 NCT_VERBOSE_PRINTF(dev, "ldn 0x%x not supported\n", ldn); in nct_probe()
1127 device_set_desc(dev, nctdevp->descr); in nct_probe()
1132 nct_attach(device_t dev) in nct_attach() argument
1140 sc = device_get_softc(dev); in nct_attach()
1141 sc->dev = dev; in nct_attach()
1142 sc->nctdevp = nct_lookup_device(dev); in nct_attach()
1145 (void)resource_int_value(device_get_name(dev), device_get_unit(dev), "flags", &flags); in nct_attach()
1153 * Logical Device 8 which is primarily used for WDT, but also plays in nct_attach()
1157 dev_8 = superio_find_dev(device_get_parent(dev), SUPERIO_DEV_WDT, 8); in nct_attach()
1163 NCT_VERBOSE_PRINTF(dev, "iobase %#x\n", iobase); in nct_attach()
1166 err = bus_set_resource(dev, SYS_RES_IOPORT, sc->iorid, in nct_attach()
1167 iobase, 7); /* FIXME NCT6796D-E have 8 registers according to table 18.3. */ in nct_attach()
1169 sc->iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT, in nct_attach()
1172 device_printf(dev, "can't map i/o space, " in nct_attach()
1176 device_printf(dev, in nct_attach()
1181 NCT_VERBOSE_PRINTF(dev, "iores %p %s channel\n", in nct_attach()
1186 NCT_VERBOSE_PRINTF(dev, in nct_attach()
1190 v = superio_ldn_read(dev, gp->enable_ldn, gp->enable_reg); in nct_attach()
1192 superio_ldn_write(dev, gp->enable_ldn, gp->enable_reg, v); in nct_attach()
1257 NCT_VERBOSE_PRINTF(dev, "%d pins available\n", sc->npins); in nct_attach()
1261 sc->busdev = gpiobus_attach_bus(dev); in nct_attach()
1263 device_printf(dev, "failed to attach to gpiobus\n"); in nct_attach()
1272 nct_detach(device_t dev) in nct_detach() argument
1276 sc = device_get_softc(dev); in nct_detach()
1277 gpiobus_detach_bus(dev); in nct_detach()
1280 bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->iores); in nct_detach()
1288 nct_gpio_get_bus(device_t dev) in nct_gpio_get_bus() argument
1292 sc = device_get_softc(dev); in nct_gpio_get_bus()
1298 nct_gpio_pin_max(device_t dev, int *maxpin) in nct_gpio_pin_max() argument
1302 sc = device_get_softc(dev); in nct_gpio_pin_max()
1308 nct_gpio_pin_set(device_t dev, uint32_t pin_num, uint32_t pin_value) in nct_gpio_pin_set() argument
1312 sc = device_get_softc(dev); in nct_gpio_pin_set()
1329 nct_gpio_pin_get(device_t dev, uint32_t pin_num, uint32_t *pin_value) in nct_gpio_pin_get() argument
1333 sc = device_get_softc(dev); in nct_gpio_pin_get()
1347 nct_gpio_pin_toggle(device_t dev, uint32_t pin_num) in nct_gpio_pin_toggle() argument
1351 sc = device_get_softc(dev); in nct_gpio_pin_toggle()
1373 nct_gpio_pin_getcaps(device_t dev, uint32_t pin_num, uint32_t *caps) in nct_gpio_pin_getcaps() argument
1377 sc = device_get_softc(dev); in nct_gpio_pin_getcaps()
1391 nct_gpio_pin_getflags(device_t dev, uint32_t pin_num, uint32_t *flags) in nct_gpio_pin_getflags() argument
1395 sc = device_get_softc(dev); in nct_gpio_pin_getflags()
1409 nct_gpio_pin_getname(device_t dev, uint32_t pin_num, char *name) in nct_gpio_pin_getname() argument
1413 sc = device_get_softc(dev); in nct_gpio_pin_getname()
1427 nct_gpio_pin_setflags(device_t dev, uint32_t pin_num, uint32_t flags) in nct_gpio_pin_setflags() argument
1432 sc = device_get_softc(dev); in nct_gpio_pin_setflags()