Lines Matching refs:gpio_index
57 static int mpfs_gpio_direction_input(struct gpio_chip *gc, unsigned int gpio_index) in mpfs_gpio_direction_input() argument
61 regmap_update_bits(mpfs_gpio->regs, MPFS_GPIO_CTRL(gpio_index), in mpfs_gpio_direction_input()
67 static int mpfs_gpio_direction_output(struct gpio_chip *gc, unsigned int gpio_index, int value) in mpfs_gpio_direction_output() argument
71 regmap_update_bits(mpfs_gpio->regs, MPFS_GPIO_CTRL(gpio_index), in mpfs_gpio_direction_output()
73 regmap_update_bits(mpfs_gpio->regs, mpfs_gpio->offsets->outp, BIT(gpio_index), in mpfs_gpio_direction_output()
74 value << gpio_index); in mpfs_gpio_direction_output()
80 unsigned int gpio_index) in mpfs_gpio_get_direction() argument
85 regmap_read(mpfs_gpio->regs, MPFS_GPIO_CTRL(gpio_index), &gpio_cfg); in mpfs_gpio_get_direction()
92 static int mpfs_gpio_get(struct gpio_chip *gc, unsigned int gpio_index) in mpfs_gpio_get() argument
96 if (mpfs_gpio_get_direction(gc, gpio_index) == GPIO_LINE_DIRECTION_OUT) in mpfs_gpio_get()
97 return regmap_test_bits(mpfs_gpio->regs, mpfs_gpio->offsets->outp, BIT(gpio_index)); in mpfs_gpio_get()
99 return regmap_test_bits(mpfs_gpio->regs, mpfs_gpio->offsets->inp, BIT(gpio_index)); in mpfs_gpio_get()
102 static void mpfs_gpio_set(struct gpio_chip *gc, unsigned int gpio_index, int value) in mpfs_gpio_set() argument
106 mpfs_gpio_get(gc, gpio_index); in mpfs_gpio_set()
108 regmap_update_bits(mpfs_gpio->regs, mpfs_gpio->offsets->outp, BIT(gpio_index), in mpfs_gpio_set()
109 value << gpio_index); in mpfs_gpio_set()
111 mpfs_gpio_get(gc, gpio_index); in mpfs_gpio_set()