Lines Matching full:stmfx
3 * Driver for STMicroelectronics Multi-Function eXpander (STMFX) GPIO expander
10 #include <linux/mfd/stmfx.h>
53 * STMFX pinctrl can have up to 24 pins if STMFX other functions are not used.
85 struct stmfx *stmfx; member
113 ret = regmap_read(pctl->stmfx->map, reg, &value); in stmfx_gpio_get()
124 regmap_write_bits(pctl->stmfx->map, reg + get_reg(offset), in stmfx_gpio_set()
136 ret = regmap_read(pctl->stmfx->map, reg, &val); in stmfx_gpio_get_direction()
138 * On stmfx, gpio pins direction is (0)input, (1)output. in stmfx_gpio_get_direction()
155 return regmap_write_bits(pctl->stmfx->map, reg, mask, 0); in stmfx_gpio_direction_input()
167 return regmap_write_bits(pctl->stmfx->map, reg, mask, mask); in stmfx_gpio_direction_output()
177 ret = regmap_read(pctl->stmfx->map, reg, &pupd); in stmfx_pinconf_get_pupd()
190 return regmap_write_bits(pctl->stmfx->map, reg, mask, pupd ? mask : 0); in stmfx_pinconf_set_pupd()
200 ret = regmap_read(pctl->stmfx->map, reg, &type); in stmfx_pinconf_get_type()
213 return regmap_write_bits(pctl->stmfx->map, reg, mask, type ? mask : 0); in stmfx_pinconf_set_type()
509 regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_EVT, in stmfx_pinctrl_irq_bus_sync_unlock()
511 regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_TYPE, in stmfx_pinctrl_irq_bus_sync_unlock()
513 regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_SRC, in stmfx_pinctrl_irq_bus_sync_unlock()
554 regmap_write_bits(pctl->stmfx->map, in stmfx_pinctrl_irq_toggle_trigger()
560 regmap_write_bits(pctl->stmfx->map, in stmfx_pinctrl_irq_toggle_trigger()
575 ret = regmap_bulk_read(pctl->stmfx->map, STMFX_REG_IRQ_GPI_PENDING, in stmfx_pinctrl_irq_thread_fn()
580 regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_SRC, in stmfx_pinctrl_irq_thread_fn()
591 regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_SRC, in stmfx_pinctrl_irq_thread_fn()
637 return stmfx_function_enable(pctl->stmfx, func); in stmfx_pinctrl_gpio_function_enable()
642 struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent); in stmfx_pinctrl_probe() local
648 pctl = devm_kzalloc(stmfx->dev, sizeof(*pctl), GFP_KERNEL); in stmfx_pinctrl_probe()
655 pctl->stmfx = stmfx; in stmfx_pinctrl_probe()
669 pctl->pctl_desc.name = "stmfx-pinctrl"; in stmfx_pinctrl_probe()
691 pctl->gpio_chip.label = "stmfx-gpio"; in stmfx_pinctrl_probe()
740 struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent); in stmfx_pinctrl_remove() local
743 ret = stmfx_function_disable(stmfx, in stmfx_pinctrl_remove()
757 ret = regmap_bulk_read(pctl->stmfx->map, STMFX_REG_GPIO_STATE, in stmfx_pinctrl_backup_regs()
761 ret = regmap_bulk_read(pctl->stmfx->map, STMFX_REG_GPIO_DIR, in stmfx_pinctrl_backup_regs()
765 ret = regmap_bulk_read(pctl->stmfx->map, STMFX_REG_GPIO_TYPE, in stmfx_pinctrl_backup_regs()
769 ret = regmap_bulk_read(pctl->stmfx->map, STMFX_REG_GPIO_PUPD, in stmfx_pinctrl_backup_regs()
781 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_GPIO_DIR, in stmfx_pinctrl_restore_regs()
785 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_GPIO_TYPE, in stmfx_pinctrl_restore_regs()
789 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_GPIO_PUPD, in stmfx_pinctrl_restore_regs()
793 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_GPO_SET, in stmfx_pinctrl_restore_regs()
797 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_EVT, in stmfx_pinctrl_restore_regs()
801 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_TYPE, in stmfx_pinctrl_restore_regs()
805 ret = regmap_bulk_write(pctl->stmfx->map, STMFX_REG_IRQ_GPI_SRC, in stmfx_pinctrl_restore_regs()
846 { .compatible = "st,stmfx-0300-pinctrl", },
853 .name = "stmfx-pinctrl",
862 MODULE_DESCRIPTION("STMFX pinctrl/GPIO driver");