Lines Matching defs:offset
49 static unsigned char da9052_gpio_port_odd(unsigned offset)
51 return offset % 2;
54 static int da9052_gpio_get(struct gpio_chip *gc, unsigned offset)
61 DA9052_GPIO_0_1_REG + (offset >> 1));
65 if (da9052_gpio_port_odd(offset)) {
74 if (offset < DA9052_GPIO_MAX_PORTS_PER_REGISTER)
82 return !!(ret & (1 << DA9052_GPIO_SHIFT_COUNT(offset)));
84 if (da9052_gpio_port_odd(offset))
93 static void da9052_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
98 if (da9052_gpio_port_odd(offset)) {
99 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
108 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
119 static int da9052_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
129 if (da9052_gpio_port_odd(offset))
130 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
136 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
145 unsigned offset, int value)
155 if (da9052_gpio_port_odd(offset))
156 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
162 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
170 static int da9052_gpio_to_irq(struct gpio_chip *gc, u32 offset)
177 irq = regmap_irq_get_virq(da9052->irq_data, DA9052_IRQ_GPI0 + offset);