Lines Matching full:mid
25 /* Intel MID Specific registers */
52 static int pnw_setup(struct mid8250 *mid, struct uart_port *p) in pnw_setup() argument
58 mid->dma_index = 0; in pnw_setup()
61 mid->dma_index = 1; in pnw_setup()
64 mid->dma_index = 2; in pnw_setup()
70 mid->dma_dev = pci_get_slot(pdev->bus, in pnw_setup()
75 static void pnw_exit(struct mid8250 *mid) in pnw_exit() argument
77 pci_dev_put(mid->dma_dev); in pnw_exit()
82 struct mid8250 *mid = p->private_data; in tng_handle_irq() local
89 chip = pci_get_drvdata(mid->dma_dev); in tng_handle_irq()
92 err = hsu_dma_get_status(chip, mid->dma_index * 2 + 1, &status); in tng_handle_irq()
97 ret |= hsu_dma_do_irq(chip, mid->dma_index * 2 + 1, status); in tng_handle_irq()
100 err = hsu_dma_get_status(chip, mid->dma_index * 2, &status); in tng_handle_irq()
104 ret |= hsu_dma_do_irq(chip, mid->dma_index * 2, status); in tng_handle_irq()
111 static int tng_setup(struct mid8250 *mid, struct uart_port *p) in tng_setup() argument
124 mid->dma_index = index; in tng_setup()
125 mid->dma_dev = pci_get_slot(pdev->bus, PCI_DEVFN(5, 0)); in tng_setup()
131 static void tng_exit(struct mid8250 *mid) in tng_exit() argument
133 pci_dev_put(mid->dma_dev); in tng_exit()
138 struct mid8250 *mid = p->private_data; in dnv_handle_irq() local
146 err = hsu_dma_get_status(&mid->dma_chip, 1, &status); in dnv_handle_irq()
151 ret |= hsu_dma_do_irq(&mid->dma_chip, 1, status); in dnv_handle_irq()
154 err = hsu_dma_get_status(&mid->dma_chip, 0, &status); in dnv_handle_irq()
158 ret |= hsu_dma_do_irq(&mid->dma_chip, 0, status); in dnv_handle_irq()
167 static int dnv_setup(struct mid8250 *mid, struct uart_port *p) in dnv_setup() argument
169 struct hsu_dma_chip *chip = &mid->dma_chip; in dnv_setup()
184 chip->length = pci_resource_len(pdev, mid->board->bar); in dnv_setup()
192 mid->dma_dev = pdev; in dnv_setup()
198 static void dnv_exit(struct mid8250 *mid) in dnv_exit() argument
200 if (!mid->dma_dev) in dnv_exit()
202 hsu_dma_remove(&mid->dma_chip); in dnv_exit()
211 struct mid8250 *mid = p->private_data; in mid8250_set_termios() local
220 if (mid->board->freq < fuart) { in mid8250_set_termios()
222 if (mid->board->freq > baud) in mid8250_set_termios()
223 ps = mid->board->freq / baud; /* baud rate too high */ in mid8250_set_termios()
229 fuart *= rounddown_pow_of_two(mid->board->freq / fuart); in mid8250_set_termios()
232 rational_best_approximation(fuart, mid->board->freq, w, w, &mul, &div); in mid8250_set_termios()
253 static int mid8250_dma_setup(struct mid8250 *mid, struct uart_8250_port *port) in mid8250_dma_setup() argument
255 struct uart_8250_dma *dma = &mid->dma; in mid8250_dma_setup()
260 if (!mid->dma_dev) in mid8250_dma_setup()
271 rx_param->chan_id = mid->dma_index * 2 + 1; in mid8250_dma_setup()
272 tx_param->chan_id = mid->dma_index * 2; in mid8250_dma_setup()
277 rx_param->dma_dev = &mid->dma_dev->dev; in mid8250_dma_setup()
278 tx_param->dma_dev = &mid->dma_dev->dev; in mid8250_dma_setup()
291 struct mid8250 *mid; in mid8250_probe() local
298 mid = devm_kzalloc(&pdev->dev, sizeof(*mid), GFP_KERNEL); in mid8250_probe()
299 if (!mid) in mid8250_probe()
302 mid->board = (struct mid8250_board *)id->driver_data; in mid8250_probe()
308 uart.port.private_data = mid; in mid8250_probe()
311 uart.port.uartclk = mid->board->base_baud * 16; in mid8250_probe()
315 uart.port.mapbase = pci_resource_start(pdev, mid->board->bar); in mid8250_probe()
316 uart.port.membase = pcim_iomap(pdev, mid->board->bar, 0); in mid8250_probe()
320 ret = mid->board->setup(mid, &uart.port); in mid8250_probe()
324 ret = mid8250_dma_setup(mid, &uart); in mid8250_probe()
332 mid->line = ret; in mid8250_probe()
334 pci_set_drvdata(pdev, mid); in mid8250_probe()
338 mid->board->exit(mid); in mid8250_probe()
344 struct mid8250 *mid = pci_get_drvdata(pdev); in mid8250_remove() local
346 serial8250_unregister_port(mid->line); in mid8250_remove()
348 mid->board->exit(mid); in mid8250_remove()
397 MODULE_DESCRIPTION("Intel MID UART driver");