Lines Matching defs:offset
48 static unsigned char da9052_gpio_port_odd(unsigned offset)
50 return offset % 2;
53 static int da9052_gpio_get(struct gpio_chip *gc, unsigned offset)
60 DA9052_GPIO_0_1_REG + (offset >> 1));
64 if (da9052_gpio_port_odd(offset)) {
73 if (offset < DA9052_GPIO_MAX_PORTS_PER_REGISTER)
81 return !!(ret & (1 << DA9052_GPIO_SHIFT_COUNT(offset)));
83 if (da9052_gpio_port_odd(offset))
92 static void da9052_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
97 if (da9052_gpio_port_odd(offset)) {
98 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
107 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
118 static int da9052_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
128 if (da9052_gpio_port_odd(offset))
129 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
135 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
144 unsigned offset, int value)
154 if (da9052_gpio_port_odd(offset))
155 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
161 ret = da9052_reg_update(gpio->da9052, (offset >> 1) +
169 static int da9052_gpio_to_irq(struct gpio_chip *gc, u32 offset)
176 irq = regmap_irq_get_virq(da9052->irq_data, DA9052_IRQ_GPI0 + offset);