Lines Matching refs:offset

51 	u8 offset;  member
88 unsigned offset) in vprbrd_gpioa_get() argument
97 if (gpio->gpioa_out & (1 << offset)) in vprbrd_gpioa_get()
98 return gpio->gpioa_val & (1 << offset); in vprbrd_gpioa_get()
104 gamsg->offset = offset; in vprbrd_gpioa_get()
139 unsigned offset, int value) in vprbrd_gpioa_set() argument
147 if (gpio->gpioa_out & (1 << offset)) { in vprbrd_gpioa_set()
149 gpio->gpioa_val |= (1 << offset); in vprbrd_gpioa_set()
151 gpio->gpioa_val &= ~(1 << offset); in vprbrd_gpioa_set()
157 gamsg->offset = offset; in vprbrd_gpioa_set()
181 unsigned offset) in vprbrd_gpioa_direction_input() argument
189 gpio->gpioa_out &= ~(1 << offset); in vprbrd_gpioa_direction_input()
195 gamsg->offset = offset; in vprbrd_gpioa_direction_input()
219 unsigned offset, int value) in vprbrd_gpioa_direction_output() argument
227 gpio->gpioa_out |= (1 << offset); in vprbrd_gpioa_direction_output()
229 gpio->gpioa_val |= (1 << offset); in vprbrd_gpioa_direction_output()
231 gpio->gpioa_val &= ~(1 << offset); in vprbrd_gpioa_direction_output()
237 gamsg->offset = offset; in vprbrd_gpioa_direction_output()
264 static int vprbrd_gpiob_setdir(struct vprbrd *vb, unsigned offset, in vprbrd_gpiob_setdir() argument
271 gbmsg->val = cpu_to_be16(dir << offset); in vprbrd_gpiob_setdir()
272 gbmsg->mask = cpu_to_be16(0x0001 << offset); in vprbrd_gpiob_setdir()
286 unsigned offset) in vprbrd_gpiob_get() argument
296 if (gpio->gpiob_out & (1 << offset)) in vprbrd_gpiob_get()
297 return gpio->gpiob_val & (1 << offset); in vprbrd_gpiob_get()
315 return (gpio->gpiob_val >> offset) & 0x1; in vprbrd_gpiob_get()
319 unsigned offset, int value) in vprbrd_gpiob_set() argument
327 if (gpio->gpiob_out & (1 << offset)) { in vprbrd_gpiob_set()
329 gpio->gpiob_val |= (1 << offset); in vprbrd_gpiob_set()
331 gpio->gpiob_val &= ~(1 << offset); in vprbrd_gpiob_set()
336 gbmsg->val = cpu_to_be16(value << offset); in vprbrd_gpiob_set()
337 gbmsg->mask = cpu_to_be16(0x0001 << offset); in vprbrd_gpiob_set()
353 unsigned offset) in vprbrd_gpiob_direction_input() argument
360 gpio->gpiob_out &= ~(1 << offset); in vprbrd_gpiob_direction_input()
364 ret = vprbrd_gpiob_setdir(vb, offset, 0); in vprbrd_gpiob_direction_input()
375 unsigned offset, int value) in vprbrd_gpiob_direction_output() argument
382 gpio->gpiob_out |= (1 << offset); in vprbrd_gpiob_direction_output()
386 ret = vprbrd_gpiob_setdir(vb, offset, 1); in vprbrd_gpiob_direction_output()
392 vprbrd_gpiob_set(chip, offset, value); in vprbrd_gpiob_direction_output()