Lines Matching refs:offset

68 static int pl061_direction_input(struct gpio_chip *gc, unsigned offset)
74 if (offset >= gc->ngpio)
79 gpiodir &= ~(1 << offset);
86 static int pl061_direction_output(struct gpio_chip *gc, unsigned offset,
93 if (offset >= gc->ngpio)
97 writeb(!!value << offset, chip->base + (1 << (offset + 2)));
99 gpiodir |= 1 << offset;
106 writeb(!!value << offset, chip->base + (1 << (offset + 2)));
112 static int pl061_get_value(struct gpio_chip *gc, unsigned offset)
116 return !!readb(chip->base + (1 << (offset + 2)));
119 static void pl061_set_value(struct gpio_chip *gc, unsigned offset, int value)
123 writeb(!!value << offset, chip->base + (1 << (offset + 2)));
126 static int pl061_to_irq(struct gpio_chip *gc, unsigned offset)
133 return chip->irq_base + offset;
140 int offset = d->irq - chip->irq_base;
144 if (offset < 0 || offset >= PL061_GPIO_NR)
153 gpiois |= 1 << offset;
155 gpioiev |= 1 << offset;
157 gpioiev &= ~(1 << offset);
159 gpiois &= ~(1 << offset);
164 gpioibe |= 1 << offset;
166 gpioibe &= ~(1 << offset);
168 gpioiev |= 1 << offset;
170 gpioiev &= ~(1 << offset);
184 int offset;
193 for_each_set_bit(offset, &pending, PL061_GPIO_NR)
194 generic_handle_irq(pl061_to_irq(&chip->gc, offset));
315 int offset;
324 for (offset = 0; offset < PL061_GPIO_NR; offset++) {
325 if (chip->csave_regs.gpio_dir & (1 << offset))
327 pl061_get_value(&chip->gc, offset) << offset;
336 int offset;
338 for (offset = 0; offset < PL061_GPIO_NR; offset++) {
339 if (chip->csave_regs.gpio_dir & (1 << offset))
340 pl061_direction_output(&chip->gc, offset,
342 (1 << offset));
344 pl061_direction_input(&chip->gc, offset);