Lines Matching refs:line
48 unsigned int line;
55 struct msix_entry *msix_entries; /* per line MSI-X */
56 struct thunderx_line *line_entries; /* per line irq info */
63 static unsigned int bit_cfg_reg(unsigned int line)
65 return 8 * line + GPIO_BIT_CFG;
68 static unsigned int intr_reg(unsigned int line)
70 return 8 * line + GPIO_INTR;
74 unsigned int line)
76 u64 bit_cfg = readq(txgpio->register_base + bit_cfg_reg(line));
86 unsigned int line)
88 bool rv = thunderx_gpio_is_gpio_nowarn(txgpio, line);
90 WARN_RATELIMIT(!rv, "Pin %d not available for GPIO\n", line);
95 static int thunderx_gpio_request(struct gpio_chip *chip, unsigned int line)
99 return thunderx_gpio_is_gpio(txgpio, line) ? 0 : -EIO;
102 static int thunderx_gpio_dir_in(struct gpio_chip *chip, unsigned int line)
106 if (!thunderx_gpio_is_gpio(txgpio, line))
110 clear_bit(line, txgpio->invert_mask);
111 clear_bit(line, txgpio->od_mask);
112 writeq(txgpio->line_entries[line].fil_bits,
113 txgpio->register_base + bit_cfg_reg(line));
118 static void thunderx_gpio_set(struct gpio_chip *chip, unsigned int line,
122 int bank = line / 64;
123 int bank_bit = line % 64;
131 static int thunderx_gpio_dir_out(struct gpio_chip *chip, unsigned int line,
135 u64 bit_cfg = txgpio->line_entries[line].fil_bits | GPIO_BIT_CFG_TX_OE;
137 if (!thunderx_gpio_is_gpio(txgpio, line))
142 thunderx_gpio_set(chip, line, value);
144 if (test_bit(line, txgpio->invert_mask))
147 if (test_bit(line, txgpio->od_mask))
150 writeq(bit_cfg, txgpio->register_base + bit_cfg_reg(line));
156 static int thunderx_gpio_get_direction(struct gpio_chip *chip, unsigned int line)
161 if (!thunderx_gpio_is_gpio_nowarn(txgpio, line))
169 bit_cfg = readq(txgpio->register_base + bit_cfg_reg(line));
178 unsigned int line,
184 int bank = line / 64;
185 int bank_bit = line % 64;
190 if (!thunderx_gpio_is_gpio(txgpio, line))
194 orig_invert = test_bit(line, txgpio->invert_mask);
196 orig_od = test_bit(line, txgpio->od_mask);
199 bit_cfg = readq(txgpio->register_base + bit_cfg_reg(line));
207 set_bit(line, txgpio->invert_mask);
209 set_bit(line, txgpio->od_mask);
214 clear_bit(line, txgpio->invert_mask);
216 clear_bit(line, txgpio->od_mask);
233 txgpio->line_entries[line].fil_bits =
237 bit_cfg |= txgpio->line_entries[line].fil_bits;
238 writeq(bit_cfg, txgpio->register_base + bit_cfg_reg(line));
252 ret = thunderx_gpio_dir_out(chip, line, orig_dat ^ new_invert);
257 static int thunderx_gpio_get(struct gpio_chip *chip, unsigned int line)
260 int bank = line / 64;
261 int bank_bit = line % 64;
265 if (test_bit(line, txgpio->invert_mask))
346 set_bit(txline->line, txgpio->invert_mask);
348 clear_bit(txline->line, txgpio->invert_mask);
350 clear_bit(txline->line, txgpio->od_mask);
351 writeq(bit_cfg, txgpio->register_base + bit_cfg_reg(txline->line));
498 txgpio->line_entries[i].line = i;
548 /* Push on irq_data and the domain for each line. */