Lines Matching refs:offset
27 #define DA9055_PORT_SHIFT(offset) (4 * (offset % 2)) argument
43 static int da9055_gpio_get(struct gpio_chip *gc, unsigned offset) in da9055_gpio_get() argument
50 ret = da9055_reg_read(gpio->da9055, (offset >> 1) + DA9055_REG_GPIO0_1); in da9055_gpio_get()
54 gpio_direction = ret & (DA9055_PORT_MASK) << DA9055_PORT_SHIFT(offset); in da9055_gpio_get()
55 gpio_direction >>= DA9055_PORT_SHIFT(offset); in da9055_gpio_get()
68 return ret & (1 << offset); in da9055_gpio_get()
72 static void da9055_gpio_set(struct gpio_chip *gc, unsigned offset, int value) in da9055_gpio_set() argument
78 1 << offset, in da9055_gpio_set()
79 value << offset); in da9055_gpio_set()
82 static int da9055_gpio_direction_input(struct gpio_chip *gc, unsigned offset) in da9055_gpio_direction_input() argument
88 << DA9055_PORT_SHIFT(offset); in da9055_gpio_direction_input()
90 return da9055_reg_update(gpio->da9055, (offset >> 1) + in da9055_gpio_direction_input()
93 DA9055_PORT_SHIFT(offset), in da9055_gpio_direction_input()
98 unsigned offset, int value) in da9055_gpio_direction_output() argument
105 << DA9055_PORT_SHIFT(offset); in da9055_gpio_direction_output()
107 ret = da9055_reg_update(gpio->da9055, (offset >> 1) + in da9055_gpio_direction_output()
110 DA9055_PORT_SHIFT(offset), in da9055_gpio_direction_output()
115 da9055_gpio_set(gc, offset, value); in da9055_gpio_direction_output()
120 static int da9055_gpio_to_irq(struct gpio_chip *gc, u32 offset) in da9055_gpio_to_irq() argument
126 DA9055_IRQ_GPI0 + offset); in da9055_gpio_to_irq()