Lines Matching refs:sio
93 struct f7188x_sio *sio; member
292 struct f7188x_sio *sio = bank->data->sio; in f7188x_gpio_get_direction() local
295 err = superio_enter(sio->addr); in f7188x_gpio_get_direction()
298 superio_select(sio->addr, sio->device); in f7188x_gpio_get_direction()
300 dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); in f7188x_gpio_get_direction()
302 superio_exit(sio->addr); in f7188x_gpio_get_direction()
304 if (f7188x_gpio_dir_invert(sio->type)) in f7188x_gpio_get_direction()
317 struct f7188x_sio *sio = bank->data->sio; in f7188x_gpio_direction_in() local
320 err = superio_enter(sio->addr); in f7188x_gpio_direction_in()
323 superio_select(sio->addr, sio->device); in f7188x_gpio_direction_in()
325 dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); in f7188x_gpio_direction_in()
327 if (f7188x_gpio_dir_invert(sio->type)) in f7188x_gpio_direction_in()
331 superio_outb(sio->addr, f7188x_gpio_dir(bank->regbase), dir); in f7188x_gpio_direction_in()
333 superio_exit(sio->addr); in f7188x_gpio_direction_in()
342 struct f7188x_sio *sio = bank->data->sio; in f7188x_gpio_get() local
345 err = superio_enter(sio->addr); in f7188x_gpio_get()
348 superio_select(sio->addr, sio->device); in f7188x_gpio_get()
350 dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); in f7188x_gpio_get()
352 if (f7188x_gpio_data_single(sio->type) || dir) in f7188x_gpio_get()
353 data = superio_inb(sio->addr, f7188x_gpio_data_out(bank->regbase)); in f7188x_gpio_get()
355 data = superio_inb(sio->addr, f7188x_gpio_data_in(bank->regbase)); in f7188x_gpio_get()
357 superio_exit(sio->addr); in f7188x_gpio_get()
367 struct f7188x_sio *sio = bank->data->sio; in f7188x_gpio_direction_out() local
370 err = superio_enter(sio->addr); in f7188x_gpio_direction_out()
373 superio_select(sio->addr, sio->device); in f7188x_gpio_direction_out()
375 data_out = superio_inb(sio->addr, f7188x_gpio_data_out(bank->regbase)); in f7188x_gpio_direction_out()
380 superio_outb(sio->addr, f7188x_gpio_data_out(bank->regbase), data_out); in f7188x_gpio_direction_out()
382 dir = superio_inb(sio->addr, f7188x_gpio_dir(bank->regbase)); in f7188x_gpio_direction_out()
383 if (f7188x_gpio_dir_invert(sio->type)) in f7188x_gpio_direction_out()
387 superio_outb(sio->addr, f7188x_gpio_dir(bank->regbase), dir); in f7188x_gpio_direction_out()
389 superio_exit(sio->addr); in f7188x_gpio_direction_out()
398 struct f7188x_sio *sio = bank->data->sio; in f7188x_gpio_set() local
401 err = superio_enter(sio->addr); in f7188x_gpio_set()
404 superio_select(sio->addr, sio->device); in f7188x_gpio_set()
406 data_out = superio_inb(sio->addr, f7188x_gpio_data_out(bank->regbase)); in f7188x_gpio_set()
411 superio_outb(sio->addr, f7188x_gpio_data_out(bank->regbase), data_out); in f7188x_gpio_set()
413 superio_exit(sio->addr); in f7188x_gpio_set()
422 struct f7188x_sio *sio = bank->data->sio; in f7188x_gpio_set_config() local
429 err = superio_enter(sio->addr); in f7188x_gpio_set_config()
432 superio_select(sio->addr, sio->device); in f7188x_gpio_set_config()
434 data = superio_inb(sio->addr, f7188x_gpio_out_mode(bank->regbase)); in f7188x_gpio_set_config()
439 superio_outb(sio->addr, f7188x_gpio_out_mode(bank->regbase), data); in f7188x_gpio_set_config()
441 superio_exit(sio->addr); in f7188x_gpio_set_config()
453 struct f7188x_sio *sio = dev_get_platdata(&pdev->dev); in f7188x_gpio_probe() local
460 switch (sio->type) { in f7188x_gpio_probe()
500 data->sio = sio; in f7188x_gpio_probe()
523 static int __init f7188x_find(int addr, struct f7188x_sio *sio) in f7188x_find() argument
535 sio->device = SIO_LD_GPIO_FINTEK; in f7188x_find()
539 sio->type = f71869; in f7188x_find()
542 sio->type = f71869a; in f7188x_find()
545 sio->type = f71882fg; in f7188x_find()
548 sio->type = f71889a; in f7188x_find()
551 sio->type = f71889f; in f7188x_find()
554 sio->type = f81866; in f7188x_find()
557 sio->type = f81804; in f7188x_find()
560 sio->type = f81865; in f7188x_find()
563 sio->device = SIO_LD_GPIO_NUVOTON; in f7188x_find()
564 sio->type = nct6126d; in f7188x_find()
572 if (sio->type != nct6126d) { in f7188x_find()
580 sio->addr = addr; in f7188x_find()
583 pr_info("Found %s at %#x\n", f7188x_names[sio->type], (unsigned int)addr); in f7188x_find()
584 if (sio->type != nct6126d) in f7188x_find()
595 f7188x_gpio_device_add(const struct f7188x_sio *sio) in f7188x_gpio_device_add() argument
604 sio, sizeof(*sio)); in f7188x_gpio_device_add()
640 struct f7188x_sio sio; in f7188x_gpio_init() local
642 if (f7188x_find(0x2e, &sio) && in f7188x_gpio_init()
643 f7188x_find(0x4e, &sio)) in f7188x_gpio_init()
648 err = f7188x_gpio_device_add(&sio); in f7188x_gpio_init()