Lines Matching refs:ret

109 	int ret;  in stmfx_gpio_get()  local
111 ret = regmap_read(pctl->stmfx->map, reg, &value); in stmfx_gpio_get()
113 return ret ? ret : !!(value & mask); in stmfx_gpio_get()
132 int ret; in stmfx_gpio_get_direction() local
134 ret = regmap_read(pctl->stmfx->map, reg, &val); in stmfx_gpio_get_direction()
138 if (ret) in stmfx_gpio_get_direction()
139 return ret; in stmfx_gpio_get_direction()
173 int ret; in stmfx_pinconf_get_pupd() local
175 ret = regmap_read(pctl->stmfx->map, reg, &pupd); in stmfx_pinconf_get_pupd()
176 if (ret) in stmfx_pinconf_get_pupd()
177 return ret; in stmfx_pinconf_get_pupd()
196 int ret; in stmfx_pinconf_get_type() local
198 ret = regmap_read(pctl->stmfx->map, reg, &type); in stmfx_pinconf_get_type()
199 if (ret) in stmfx_pinconf_get_type()
200 return ret; in stmfx_pinconf_get_type()
221 int ret, dir, type, pupd; in stmfx_pinconf_get() local
269 ret = stmfx_gpio_get(&pctl->gpio_chip, pin); in stmfx_pinconf_get()
270 if (ret < 0) in stmfx_pinconf_get()
271 return ret; in stmfx_pinconf_get()
273 arg = ret; in stmfx_pinconf_get()
291 int i, ret; in stmfx_pinconf_set() local
307 ret = stmfx_pinconf_set_type(pctl, pin, 0); in stmfx_pinconf_set()
308 if (ret) in stmfx_pinconf_set()
309 return ret; in stmfx_pinconf_set()
312 ret = stmfx_pinconf_set_type(pctl, pin, 1); in stmfx_pinconf_set()
313 if (ret) in stmfx_pinconf_set()
314 return ret; in stmfx_pinconf_set()
315 ret = stmfx_pinconf_set_pupd(pctl, pin, 0); in stmfx_pinconf_set()
316 if (ret) in stmfx_pinconf_set()
317 return ret; in stmfx_pinconf_set()
320 ret = stmfx_pinconf_set_type(pctl, pin, 1); in stmfx_pinconf_set()
321 if (ret) in stmfx_pinconf_set()
322 return ret; in stmfx_pinconf_set()
323 ret = stmfx_pinconf_set_pupd(pctl, pin, 1); in stmfx_pinconf_set()
324 if (ret) in stmfx_pinconf_set()
325 return ret; in stmfx_pinconf_set()
328 ret = stmfx_pinconf_set_type(pctl, pin, 1); in stmfx_pinconf_set()
329 if (ret) in stmfx_pinconf_set()
330 return ret; in stmfx_pinconf_set()
333 ret = stmfx_gpio_direction_output(&pctl->gpio_chip, in stmfx_pinconf_set()
335 if (ret) in stmfx_pinconf_set()
336 return ret; in stmfx_pinconf_set()
518 int ret; in stmfx_gpio_irq_request_resources() local
520 ret = stmfx_gpio_direction_input(gpio_chip, data->hwirq); in stmfx_gpio_irq_request_resources()
521 if (ret) in stmfx_gpio_irq_request_resources()
522 return ret; in stmfx_gpio_irq_request_resources()
569 int i, ret; in stmfx_pinctrl_irq_thread_fn() local
571 ret = regmap_bulk_read(pctl->stmfx->map, STMFX_REG_IRQ_GPI_PENDING, in stmfx_pinctrl_irq_thread_fn()
573 if (ret) in stmfx_pinctrl_irq_thread_fn()
622 int irq, ret; in stmfx_pinctrl_probe() local
653 ret = devm_pinctrl_register_and_init(pctl->dev, &pctl->pctl_desc, in stmfx_pinctrl_probe()
655 if (ret) { in stmfx_pinctrl_probe()
657 return ret; in stmfx_pinctrl_probe()
660 ret = pinctrl_enable(pctl->pctl_dev); in stmfx_pinctrl_probe()
661 if (ret) { in stmfx_pinctrl_probe()
663 return ret; in stmfx_pinctrl_probe()
699 ret = devm_gpiochip_add_data(pctl->dev, &pctl->gpio_chip, pctl); in stmfx_pinctrl_probe()
700 if (ret) { in stmfx_pinctrl_probe()
702 return ret; in stmfx_pinctrl_probe()
705 ret = stmfx_pinctrl_gpio_function_enable(pctl); in stmfx_pinctrl_probe()
706 if (ret) in stmfx_pinctrl_probe()
707 return ret; in stmfx_pinctrl_probe()
709 ret = devm_request_threaded_irq(pctl->dev, irq, NULL, in stmfx_pinctrl_probe()
713 if (ret) { in stmfx_pinctrl_probe()
715 return ret; in stmfx_pinctrl_probe()
737 int ret; in stmfx_pinctrl_backup_regs() local
739 ret = regmap_bulk_read(pctl->stmfx->map, STMFX_REG_GPIO_STATE, in stmfx_pinctrl_backup_regs()
741 if (ret) in stmfx_pinctrl_backup_regs()
742 return ret; in stmfx_pinctrl_backup_regs()
743 ret = regmap_bulk_read(pctl->stmfx->map, STMFX_REG_GPIO_DIR, in stmfx_pinctrl_backup_regs()
745 if (ret) in stmfx_pinctrl_backup_regs()
746 return ret; in stmfx_pinctrl_backup_regs()
747 ret = regmap_bulk_read(pctl->stmfx->map, STMFX_REG_GPIO_TYPE, in stmfx_pinctrl_backup_regs()
749 if (ret) in stmfx_pinctrl_backup_regs()
750 return ret; in stmfx_pinctrl_backup_regs()
751 ret = regmap_bulk_read(pctl->stmfx->map, STMFX_REG_GPIO_PUPD, in stmfx_pinctrl_backup_regs()
753 if (ret) in stmfx_pinctrl_backup_regs()
754 return ret; in stmfx_pinctrl_backup_regs()
761 int ret; in stmfx_pinctrl_restore_regs() local
763 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_GPIO_DIR, in stmfx_pinctrl_restore_regs()
765 if (ret) in stmfx_pinctrl_restore_regs()
766 return ret; in stmfx_pinctrl_restore_regs()
767 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_GPIO_TYPE, in stmfx_pinctrl_restore_regs()
769 if (ret) in stmfx_pinctrl_restore_regs()
770 return ret; in stmfx_pinctrl_restore_regs()
771 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_GPIO_PUPD, in stmfx_pinctrl_restore_regs()
773 if (ret) in stmfx_pinctrl_restore_regs()
774 return ret; in stmfx_pinctrl_restore_regs()
775 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_GPO_SET, in stmfx_pinctrl_restore_regs()
777 if (ret) in stmfx_pinctrl_restore_regs()
778 return ret; in stmfx_pinctrl_restore_regs()
779 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_EVT, in stmfx_pinctrl_restore_regs()
781 if (ret) in stmfx_pinctrl_restore_regs()
782 return ret; in stmfx_pinctrl_restore_regs()
783 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_TYPE, in stmfx_pinctrl_restore_regs()
785 if (ret) in stmfx_pinctrl_restore_regs()
786 return ret; in stmfx_pinctrl_restore_regs()
787 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_SRC, in stmfx_pinctrl_restore_regs()
789 if (ret) in stmfx_pinctrl_restore_regs()
790 return ret; in stmfx_pinctrl_restore_regs()
798 int ret; in stmfx_pinctrl_suspend() local
800 ret = stmfx_pinctrl_backup_regs(pctl); in stmfx_pinctrl_suspend()
801 if (ret) { in stmfx_pinctrl_suspend()
803 return ret; in stmfx_pinctrl_suspend()
812 int ret; in stmfx_pinctrl_resume() local
814 ret = stmfx_pinctrl_restore_regs(pctl); in stmfx_pinctrl_resume()
815 if (ret) { in stmfx_pinctrl_resume()
817 return ret; in stmfx_pinctrl_resume()