int register_pinmux(struct pinmux_info *pip) { struct gpio_chip *chip = &pip->chip; pr_info("sh pinmux: %s handling gpio %d -> %d\n", pip->name, pip->first_gpio, pip->last_gpio); setup_data_regs(pip); chip->request = sh_gpio_request; chip->free = sh_gpio_free; chip->direction_input = sh_gpio_direction_input; chip->get = sh_gpio_get; chip->direction_output = sh_gpio_direction_output; chip->set = sh_gpio_set; WARN_ON(pip->first_gpio != 0); /* needs testing */ chip->label = pip->name; chip->owner = THIS_MODULE; chip->base = pip->first_gpio; chip->ngpio = (pip->last_gpio - pip->first_gpio) + 1; return gpiochip_add(chip); }
int register_pinmux(struct pinmux_info *pip) { struct gpio_chip *chip = &pip->chip; int ret; pr_info("%s handling gpio %d -> %d\n", pip->name, pip->first_gpio, pip->last_gpio); ret = pfc_ioremap(pip); if (ret < 0) return ret; setup_data_regs(pip); chip->request = sh_gpio_request; chip->free = sh_gpio_free; chip->direction_input = sh_gpio_direction_input; chip->get = sh_gpio_get; chip->direction_output = sh_gpio_direction_output; chip->set = sh_gpio_set; chip->to_irq = sh_gpio_to_irq; WARN_ON(pip->first_gpio != 0); /* */ chip->label = pip->name; chip->owner = THIS_MODULE; chip->base = pip->first_gpio; chip->ngpio = (pip->last_gpio - pip->first_gpio) + 1; ret = gpiochip_add(chip); if (ret < 0) pfc_iounmap(pip); return ret; }
int register_pinmux(struct pinmux_info *pip) { if (pip != NULL) { gpioc = pip; debug("%s deregistering\n", pip->name); setup_data_regs(gpioc); } return 0; }