Lines Matching refs:qtty
53 static void do_rw_io(struct goldfish_tty *qtty, in do_rw_io() argument
59 void __iomem *base = qtty->base; in do_rw_io()
61 spin_lock_irqsave(&qtty->lock, irq_flags); in do_rw_io()
73 spin_unlock_irqrestore(&qtty->lock, irq_flags); in do_rw_io()
76 static void goldfish_tty_rw(struct goldfish_tty *qtty, in goldfish_tty_rw() argument
85 if (qtty->version > 0) { in goldfish_tty_rw()
102 dma_handle = dma_map_single(qtty->dev, (void *)addr, in goldfish_tty_rw()
105 if (dma_mapping_error(qtty->dev, dma_handle)) { in goldfish_tty_rw()
106 dev_err(qtty->dev, "tty: DMA mapping error.\n"); in goldfish_tty_rw()
109 do_rw_io(qtty, dma_handle, avail, is_write); in goldfish_tty_rw()
115 dma_unmap_single(qtty->dev, dma_handle, avail, dma_dir); in goldfish_tty_rw()
124 do_rw_io(qtty, addr, count, is_write); in goldfish_tty_rw()
131 struct goldfish_tty *qtty = &goldfish_ttys[line]; in goldfish_tty_do_write() local
134 goldfish_tty_rw(qtty, address, count, 1); in goldfish_tty_do_write()
139 struct goldfish_tty *qtty = dev_id; in goldfish_tty_interrupt() local
140 void __iomem *base = qtty->base; in goldfish_tty_interrupt()
149 count = tty_prepare_flip_string(&qtty->port, &buf, count); in goldfish_tty_interrupt()
152 goldfish_tty_rw(qtty, address, count, 0); in goldfish_tty_interrupt()
154 tty_flip_buffer_push(&qtty->port); in goldfish_tty_interrupt()
160 struct goldfish_tty *qtty = container_of(port, struct goldfish_tty, in goldfish_tty_activate() local
162 writel(GOLDFISH_TTY_CMD_INT_ENABLE, qtty->base + GOLDFISH_TTY_REG_CMD); in goldfish_tty_activate()
168 struct goldfish_tty *qtty = container_of(port, struct goldfish_tty, in goldfish_tty_shutdown() local
170 writel(GOLDFISH_TTY_CMD_INT_DISABLE, qtty->base + GOLDFISH_TTY_REG_CMD); in goldfish_tty_shutdown()
175 struct goldfish_tty *qtty = &goldfish_ttys[tty->index]; in goldfish_tty_open() local
176 return tty_port_open(&qtty->port, tty, filp); in goldfish_tty_open()
203 struct goldfish_tty *qtty = &goldfish_ttys[tty->index]; in goldfish_tty_chars_in_buffer() local
204 void __iomem *base = qtty->base; in goldfish_tty_chars_in_buffer()
296 struct goldfish_tty *qtty; in goldfish_tty_probe() local
345 qtty = &goldfish_ttys[line]; in goldfish_tty_probe()
346 spin_lock_init(&qtty->lock); in goldfish_tty_probe()
347 tty_port_init(&qtty->port); in goldfish_tty_probe()
348 qtty->port.ops = &goldfish_port_ops; in goldfish_tty_probe()
349 qtty->base = base; in goldfish_tty_probe()
350 qtty->irq = irq; in goldfish_tty_probe()
351 qtty->dev = &pdev->dev; in goldfish_tty_probe()
360 qtty->version = readl(base + GOLDFISH_TTY_REG_VERSION); in goldfish_tty_probe()
366 if (qtty->version > 0) { in goldfish_tty_probe()
382 "goldfish_tty", qtty); in goldfish_tty_probe()
388 ttydev = tty_port_register_device(&qtty->port, goldfish_tty_driver, in goldfish_tty_probe()
395 strcpy(qtty->console.name, "ttyGF"); in goldfish_tty_probe()
396 qtty->console.write = goldfish_tty_console_write; in goldfish_tty_probe()
397 qtty->console.device = goldfish_tty_console_device; in goldfish_tty_probe()
398 qtty->console.setup = goldfish_tty_console_setup; in goldfish_tty_probe()
399 qtty->console.flags = CON_PRINTBUFFER; in goldfish_tty_probe()
400 qtty->console.index = line; in goldfish_tty_probe()
401 register_console(&qtty->console); in goldfish_tty_probe()
402 platform_set_drvdata(pdev, qtty); in goldfish_tty_probe()
408 free_irq(irq, qtty); in goldfish_tty_probe()
410 tty_port_destroy(&qtty->port); in goldfish_tty_probe()
423 struct goldfish_tty *qtty = platform_get_drvdata(pdev); in goldfish_tty_remove() local
427 unregister_console(&qtty->console); in goldfish_tty_remove()
428 tty_unregister_device(goldfish_tty_driver, qtty->console.index); in goldfish_tty_remove()
429 iounmap(qtty->base); in goldfish_tty_remove()
430 qtty->base = NULL; in goldfish_tty_remove()
431 free_irq(qtty->irq, qtty); in goldfish_tty_remove()
432 tty_port_destroy(&qtty->port); in goldfish_tty_remove()