Lines Matching refs:bit

86 static void xgpio_read_ch(struct xgpio_instance *chip, int reg, int bit, unsigned long *a)  in xgpio_read_ch()  argument
88 void __iomem *addr = chip->regs + reg + xgpio_regoffset(chip, bit / 32); in xgpio_read_ch()
91 bitmap_write(a, value, round_down(bit, 32), 32); in xgpio_read_ch()
94 static void xgpio_write_ch(struct xgpio_instance *chip, int reg, int bit, unsigned long *a) in xgpio_write_ch() argument
96 void __iomem *addr = chip->regs + reg + xgpio_regoffset(chip, bit / 32); in xgpio_write_ch()
97 unsigned long value = bitmap_read(a, round_down(bit, 32), 32); in xgpio_write_ch()
105 int bit; in xgpio_read_ch_all() local
107 for (bit = 0; bit <= lastbit ; bit += 32) in xgpio_read_ch_all()
108 xgpio_read_ch(chip, reg, bit, a); in xgpio_read_ch_all()
114 int bit; in xgpio_write_ch_all() local
116 for (bit = 0; bit <= lastbit ; bit += 32) in xgpio_write_ch_all()
117 xgpio_write_ch(chip, reg, bit, a); in xgpio_write_ch_all()
134 unsigned long bit = find_nth_bit(chip->map, 64, gpio); in xgpio_get() local
137 xgpio_read_ch(chip, XGPIO_DATA_OFFSET, bit, state); in xgpio_get()
139 return test_bit(bit, state); in xgpio_get()
155 unsigned long bit = find_nth_bit(chip->map, 64, gpio); in xgpio_set() local
160 __assign_bit(bit, chip->state, val); in xgpio_set()
162 xgpio_write_ch(chip, XGPIO_DATA_OFFSET, bit, chip->state); in xgpio_set()
216 unsigned long bit = find_nth_bit(chip->map, 64, gpio); in xgpio_dir_in() local
221 __set_bit(bit, chip->dir); in xgpio_dir_in()
222 xgpio_write_ch(chip, XGPIO_TRI_OFFSET, bit, chip->dir); in xgpio_dir_in()
245 unsigned long bit = find_nth_bit(chip->map, 64, gpio); in xgpio_dir_out() local
250 __assign_bit(bit, chip->state, val); in xgpio_dir_out()
251 xgpio_write_ch(chip, XGPIO_DATA_OFFSET, bit, chip->state); in xgpio_dir_out()
254 __clear_bit(bit, chip->dir); in xgpio_dir_out()
255 xgpio_write_ch(chip, XGPIO_TRI_OFFSET, bit, chip->dir); in xgpio_dir_out()
377 unsigned long bit = find_nth_bit(chip->map, 64, irq_offset), enable; in xgpio_irq_mask() local
378 u32 mask = BIT(bit / 32), temp; in xgpio_irq_mask()
382 __clear_bit(bit, chip->enable); in xgpio_irq_mask()
384 enable = bitmap_read(chip->enable, round_down(bit, 32), 32); in xgpio_irq_mask()
405 unsigned long bit = find_nth_bit(chip->map, 64, irq_offset), enable; in xgpio_irq_unmask() local
406 u32 mask = BIT(bit / 32), val; in xgpio_irq_unmask()
412 enable = bitmap_read(chip->enable, round_down(bit, 32), 32); in xgpio_irq_unmask()
420 xgpio_read_ch(chip, XGPIO_DATA_OFFSET, bit, chip->last_irq_read); in xgpio_irq_unmask()
428 __set_bit(bit, chip->enable); in xgpio_irq_unmask()
445 unsigned long bit = find_nth_bit(chip->map, 64, irq_offset); in xgpio_set_irq_type() local
455 __set_bit(bit, chip->rising_edge); in xgpio_set_irq_type()
456 __set_bit(bit, chip->falling_edge); in xgpio_set_irq_type()
459 __set_bit(bit, chip->rising_edge); in xgpio_set_irq_type()
460 __clear_bit(bit, chip->falling_edge); in xgpio_set_irq_type()
463 __clear_bit(bit, chip->rising_edge); in xgpio_set_irq_type()
464 __set_bit(bit, chip->falling_edge); in xgpio_set_irq_type()