Lines Matching defs:offset
22 #define DA9055_PORT_SHIFT(offset) (4 * (offset % 2))
33 static int da9055_gpio_get(struct gpio_chip *gc, unsigned offset)
40 ret = da9055_reg_read(gpio->da9055, (offset >> 1) + DA9055_REG_GPIO0_1);
44 gpio_direction = ret & (DA9055_PORT_MASK) << DA9055_PORT_SHIFT(offset);
45 gpio_direction >>= DA9055_PORT_SHIFT(offset);
58 return ret & (1 << offset);
62 static void da9055_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
68 1 << offset,
69 value << offset);
72 static int da9055_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
78 << DA9055_PORT_SHIFT(offset);
80 return da9055_reg_update(gpio->da9055, (offset >> 1) +
83 DA9055_PORT_SHIFT(offset),
88 unsigned offset, int value)
95 << DA9055_PORT_SHIFT(offset);
97 ret = da9055_reg_update(gpio->da9055, (offset >> 1) +
100 DA9055_PORT_SHIFT(offset),
105 da9055_gpio_set(gc, offset, value);
110 static int da9055_gpio_to_irq(struct gpio_chip *gc, u32 offset)
116 DA9055_IRQ_GPI0 + offset);