Lines Matching refs:offset
59 static unsigned char da9052_gpio_port_odd(unsigned offset) in da9052_gpio_port_odd() argument
61 return offset % 2; in da9052_gpio_port_odd()
64 static int da9052_gpio_get(struct gpio_chip *gc, unsigned offset) in da9052_gpio_get() argument
71 DA9052_GPIO_0_1_REG + (offset >> 1)); in da9052_gpio_get()
75 if (da9052_gpio_port_odd(offset)) { in da9052_gpio_get()
84 if (offset < DA9052_GPIO_MAX_PORTS_PER_REGISTER) in da9052_gpio_get()
92 if (ret & (1 << DA9052_GPIO_SHIFT_COUNT(offset))) in da9052_gpio_get()
97 if (da9052_gpio_port_odd(offset)) in da9052_gpio_get()
106 static void da9052_gpio_set(struct gpio_chip *gc, unsigned offset, int value) in da9052_gpio_set() argument
111 if (da9052_gpio_port_odd(offset)) { in da9052_gpio_set()
112 ret = da9052_reg_update(gpio->da9052, (offset >> 1) + in da9052_gpio_set()
121 ret = da9052_reg_update(gpio->da9052, (offset >> 1) + in da9052_gpio_set()
132 static int da9052_gpio_direction_input(struct gpio_chip *gc, unsigned offset) in da9052_gpio_direction_input() argument
142 if (da9052_gpio_port_odd(offset)) in da9052_gpio_direction_input()
143 ret = da9052_reg_update(gpio->da9052, (offset >> 1) + in da9052_gpio_direction_input()
149 ret = da9052_reg_update(gpio->da9052, (offset >> 1) + in da9052_gpio_direction_input()
158 unsigned offset, int value) in da9052_gpio_direction_output() argument
168 if (da9052_gpio_port_odd(offset)) in da9052_gpio_direction_output()
169 ret = da9052_reg_update(gpio->da9052, (offset >> 1) + in da9052_gpio_direction_output()
175 ret = da9052_reg_update(gpio->da9052, (offset >> 1) + in da9052_gpio_direction_output()
183 static int da9052_gpio_to_irq(struct gpio_chip *gc, u32 offset) in da9052_gpio_to_irq() argument
190 irq = regmap_irq_get_virq(da9052->irq_data, DA9052_IRQ_GPI0 + offset); in da9052_gpio_to_irq()