Lines Matching +full:64 +full:bit

31 #define XGPIO_GIER_IE		BIT(31)
62 DECLARE_BITMAP(map, 64);
63 DECLARE_BITMAP(state, 64);
64 DECLARE_BITMAP(last_irq_read, 64);
65 DECLARE_BITMAP(dir, 64);
68 DECLARE_BITMAP(enable, 64);
69 DECLARE_BITMAP(rising_edge, 64);
70 DECLARE_BITMAP(falling_edge, 64);
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()
104 unsigned long lastbit = find_nth_bit(chip->map, 64, chip->gc.ngpio - 1); in xgpio_read_ch_all()
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()
113 unsigned long lastbit = find_nth_bit(chip->map, 64, chip->gc.ngpio - 1); in xgpio_write_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
135 DECLARE_BITMAP(state, 64); in xgpio_get()
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()
181 DECLARE_BITMAP(hw_mask, 64); in xgpio_set_multiple()
182 DECLARE_BITMAP(hw_bits, 64); in xgpio_set_multiple()
183 DECLARE_BITMAP(state, 64); in xgpio_set_multiple()
187 bitmap_scatter(hw_mask, mask, chip->map, 64); in xgpio_set_multiple()
188 bitmap_scatter(hw_bits, bits, chip->map, 64); in xgpio_set_multiple()
192 bitmap_replace(state, chip->state, hw_bits, hw_mask, 64); in xgpio_set_multiple()
196 bitmap_copy(chip->state, state, 64); in xgpio_set_multiple()
216 unsigned long bit = find_nth_bit(chip->map, 64, gpio); in xgpio_dir_in() local
220 /* Set the GPIO bit in shadow register and set direction as input */ in xgpio_dir_in()
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()
253 /* Clear the GPIO bit in shadow register and set direction as output */ 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()
483 DECLARE_BITMAP(rising, 64); in xgpio_irqhandler()
484 DECLARE_BITMAP(falling, 64); in xgpio_irqhandler()
485 DECLARE_BITMAP(hw, 64); in xgpio_irqhandler()
486 DECLARE_BITMAP(sw, 64); in xgpio_irqhandler()
499 bitmap_complement(rising, chip->last_irq_read, 64); in xgpio_irqhandler()
500 bitmap_and(rising, rising, hw, 64); in xgpio_irqhandler()
501 bitmap_and(rising, rising, chip->enable, 64); in xgpio_irqhandler()
502 bitmap_and(rising, rising, chip->rising_edge, 64); in xgpio_irqhandler()
504 bitmap_complement(falling, hw, 64); in xgpio_irqhandler()
505 bitmap_and(falling, falling, chip->last_irq_read, 64); in xgpio_irqhandler()
506 bitmap_and(falling, falling, chip->enable, 64); in xgpio_irqhandler()
507 bitmap_and(falling, falling, chip->falling_edge, 64); in xgpio_irqhandler()
509 bitmap_copy(chip->last_irq_read, hw, 64); in xgpio_irqhandler()
510 bitmap_or(hw, rising, falling, 64); in xgpio_irqhandler()
514 dev_dbg(gc->parent, "IRQ rising %*pb falling %*pb\n", 64, rising, 64, falling); in xgpio_irqhandler()
516 bitmap_gather(sw, hw, chip->map, 64); in xgpio_irqhandler()
517 for_each_set_bit(irq_offset, sw, 64) in xgpio_irqhandler()
571 bitmap_from_arr32(chip->state, state, 64); in xgpio_probe()
577 bitmap_from_arr32(chip->dir, dir, 64); in xgpio_probe()
602 chip->gc.ngpio = bitmap_weight(chip->map, 64); in xgpio_probe()