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()
179 DECLARE_BITMAP(hw_mask, 64); in xgpio_set_multiple()
180 DECLARE_BITMAP(hw_bits, 64); in xgpio_set_multiple()
181 DECLARE_BITMAP(state, 64); in xgpio_set_multiple()
185 bitmap_scatter(hw_mask, mask, chip->map, 64); in xgpio_set_multiple()
186 bitmap_scatter(hw_bits, bits, chip->map, 64); in xgpio_set_multiple()
190 bitmap_replace(state, chip->state, hw_bits, hw_mask, 64); in xgpio_set_multiple()
194 bitmap_copy(chip->state, state, 64); in xgpio_set_multiple()
212 unsigned long bit = find_nth_bit(chip->map, 64, gpio); in xgpio_dir_in() local
216 /* Set the GPIO bit in shadow register and set direction as input */ in xgpio_dir_in()
217 __set_bit(bit, chip->dir); in xgpio_dir_in()
218 xgpio_write_ch(chip, XGPIO_TRI_OFFSET, bit, chip->dir); in xgpio_dir_in()
241 unsigned long bit = find_nth_bit(chip->map, 64, gpio); in xgpio_dir_out() local
246 __assign_bit(bit, chip->state, val); in xgpio_dir_out()
247 xgpio_write_ch(chip, XGPIO_DATA_OFFSET, bit, chip->state); in xgpio_dir_out()
249 /* Clear the GPIO bit in shadow register and set direction as output */ in xgpio_dir_out()
250 __clear_bit(bit, chip->dir); in xgpio_dir_out()
251 xgpio_write_ch(chip, XGPIO_TRI_OFFSET, bit, chip->dir); in xgpio_dir_out()
373 unsigned long bit = find_nth_bit(chip->map, 64, irq_offset), enable; in xgpio_irq_mask() local
374 u32 mask = BIT(bit / 32), temp; in xgpio_irq_mask()
378 __clear_bit(bit, chip->enable); in xgpio_irq_mask()
380 enable = bitmap_read(chip->enable, round_down(bit, 32), 32); in xgpio_irq_mask()
401 unsigned long bit = find_nth_bit(chip->map, 64, irq_offset), enable; in xgpio_irq_unmask() local
402 u32 mask = BIT(bit / 32), val; in xgpio_irq_unmask()
408 enable = bitmap_read(chip->enable, round_down(bit, 32), 32); in xgpio_irq_unmask()
416 xgpio_read_ch(chip, XGPIO_DATA_OFFSET, bit, chip->last_irq_read); in xgpio_irq_unmask()
424 __set_bit(bit, chip->enable); in xgpio_irq_unmask()
441 unsigned long bit = find_nth_bit(chip->map, 64, irq_offset); in xgpio_set_irq_type() local
451 __set_bit(bit, chip->rising_edge); in xgpio_set_irq_type()
452 __set_bit(bit, chip->falling_edge); in xgpio_set_irq_type()
455 __set_bit(bit, chip->rising_edge); in xgpio_set_irq_type()
456 __clear_bit(bit, chip->falling_edge); in xgpio_set_irq_type()
459 __clear_bit(bit, chip->rising_edge); in xgpio_set_irq_type()
460 __set_bit(bit, chip->falling_edge); in xgpio_set_irq_type()
479 DECLARE_BITMAP(rising, 64); in xgpio_irqhandler()
480 DECLARE_BITMAP(falling, 64); in xgpio_irqhandler()
481 DECLARE_BITMAP(hw, 64); in xgpio_irqhandler()
482 DECLARE_BITMAP(sw, 64); in xgpio_irqhandler()
495 bitmap_complement(rising, chip->last_irq_read, 64); in xgpio_irqhandler()
496 bitmap_and(rising, rising, hw, 64); in xgpio_irqhandler()
497 bitmap_and(rising, rising, chip->enable, 64); in xgpio_irqhandler()
498 bitmap_and(rising, rising, chip->rising_edge, 64); in xgpio_irqhandler()
500 bitmap_complement(falling, hw, 64); in xgpio_irqhandler()
501 bitmap_and(falling, falling, chip->last_irq_read, 64); in xgpio_irqhandler()
502 bitmap_and(falling, falling, chip->enable, 64); in xgpio_irqhandler()
503 bitmap_and(falling, falling, chip->falling_edge, 64); in xgpio_irqhandler()
505 bitmap_copy(chip->last_irq_read, hw, 64); in xgpio_irqhandler()
506 bitmap_or(hw, rising, falling, 64); in xgpio_irqhandler()
510 dev_dbg(gc->parent, "IRQ rising %*pb falling %*pb\n", 64, rising, 64, falling); in xgpio_irqhandler()
512 bitmap_gather(sw, hw, chip->map, 64); in xgpio_irqhandler()
513 for_each_set_bit(irq_offset, sw, 64) in xgpio_irqhandler()
567 bitmap_from_arr32(chip->state, state, 64); in xgpio_probe()
573 bitmap_from_arr32(chip->dir, dir, 64); in xgpio_probe()
598 chip->gc.ngpio = bitmap_weight(chip->map, 64); in xgpio_probe()