Lines Matching refs:qtty

53 static void do_rw_io(struct goldfish_tty *qtty, unsigned long address,  in do_rw_io()  argument
57 void __iomem *base = qtty->base; in do_rw_io()
59 spin_lock_irqsave(&qtty->lock, irq_flags); in do_rw_io()
71 spin_unlock_irqrestore(&qtty->lock, irq_flags); in do_rw_io()
74 static void goldfish_tty_rw(struct goldfish_tty *qtty, unsigned long addr, in goldfish_tty_rw() argument
81 if (qtty->version > 0) { in goldfish_tty_rw()
98 dma_handle = dma_map_single(qtty->dev, (void *)addr, in goldfish_tty_rw()
101 if (dma_mapping_error(qtty->dev, dma_handle)) { in goldfish_tty_rw()
102 dev_err(qtty->dev, "tty: DMA mapping error.\n"); in goldfish_tty_rw()
105 do_rw_io(qtty, dma_handle, avail, is_write); in goldfish_tty_rw()
111 dma_unmap_single(qtty->dev, dma_handle, avail, dma_dir); in goldfish_tty_rw()
120 do_rw_io(qtty, addr, count, is_write); in goldfish_tty_rw()
126 struct goldfish_tty *qtty = &goldfish_ttys[line]; in goldfish_tty_do_write() local
128 goldfish_tty_rw(qtty, (unsigned long)buf, count, true); in goldfish_tty_do_write()
133 struct goldfish_tty *qtty = dev_id; in goldfish_tty_interrupt() local
134 void __iomem *base = qtty->base; in goldfish_tty_interrupt()
142 count = tty_prepare_flip_string(&qtty->port, &buf, count); in goldfish_tty_interrupt()
144 goldfish_tty_rw(qtty, (unsigned long)buf, count, false); in goldfish_tty_interrupt()
146 tty_flip_buffer_push(&qtty->port); in goldfish_tty_interrupt()
152 struct goldfish_tty *qtty = container_of(port, struct goldfish_tty, in goldfish_tty_activate() local
154 gf_iowrite32(GOLDFISH_TTY_CMD_INT_ENABLE, qtty->base + GOLDFISH_TTY_REG_CMD); in goldfish_tty_activate()
160 struct goldfish_tty *qtty = container_of(port, struct goldfish_tty, in goldfish_tty_shutdown() local
162 gf_iowrite32(GOLDFISH_TTY_CMD_INT_DISABLE, qtty->base + GOLDFISH_TTY_REG_CMD); in goldfish_tty_shutdown()
167 struct goldfish_tty *qtty = &goldfish_ttys[tty->index]; in goldfish_tty_open() local
168 return tty_port_open(&qtty->port, tty, filp); in goldfish_tty_open()
195 struct goldfish_tty *qtty = &goldfish_ttys[tty->index]; in goldfish_tty_chars_in_buffer() local
196 void __iomem *base = qtty->base; in goldfish_tty_chars_in_buffer()
288 struct goldfish_tty *qtty; in goldfish_tty_probe() local
335 qtty = &goldfish_ttys[line]; in goldfish_tty_probe()
336 spin_lock_init(&qtty->lock); in goldfish_tty_probe()
337 tty_port_init(&qtty->port); in goldfish_tty_probe()
338 qtty->port.ops = &goldfish_port_ops; in goldfish_tty_probe()
339 qtty->base = base; in goldfish_tty_probe()
340 qtty->irq = irq; in goldfish_tty_probe()
341 qtty->dev = &pdev->dev; in goldfish_tty_probe()
350 qtty->version = gf_ioread32(base + GOLDFISH_TTY_REG_VERSION); in goldfish_tty_probe()
356 if (qtty->version > 0) { in goldfish_tty_probe()
372 "goldfish_tty", qtty); in goldfish_tty_probe()
378 ttydev = tty_port_register_device(&qtty->port, goldfish_tty_driver, in goldfish_tty_probe()
385 strcpy(qtty->console.name, "ttyGF"); in goldfish_tty_probe()
386 qtty->console.write = goldfish_tty_console_write; in goldfish_tty_probe()
387 qtty->console.device = goldfish_tty_console_device; in goldfish_tty_probe()
388 qtty->console.setup = goldfish_tty_console_setup; in goldfish_tty_probe()
389 qtty->console.flags = CON_PRINTBUFFER; in goldfish_tty_probe()
390 qtty->console.index = line; in goldfish_tty_probe()
391 register_console(&qtty->console); in goldfish_tty_probe()
392 platform_set_drvdata(pdev, qtty); in goldfish_tty_probe()
398 free_irq(irq, qtty); in goldfish_tty_probe()
400 tty_port_destroy(&qtty->port); in goldfish_tty_probe()
413 struct goldfish_tty *qtty = platform_get_drvdata(pdev); in goldfish_tty_remove() local
417 unregister_console(&qtty->console); in goldfish_tty_remove()
418 tty_unregister_device(goldfish_tty_driver, qtty->console.index); in goldfish_tty_remove()
419 iounmap(qtty->base); in goldfish_tty_remove()
420 qtty->base = NULL; in goldfish_tty_remove()
421 free_irq(qtty->irq, qtty); in goldfish_tty_remove()
422 tty_port_destroy(&qtty->port); in goldfish_tty_remove()