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()
130 struct goldfish_tty *qtty = &goldfish_ttys[line]; in goldfish_tty_do_write() local
133 goldfish_tty_rw(qtty, address, count, 1); in goldfish_tty_do_write()
138 struct goldfish_tty *qtty = dev_id; in goldfish_tty_interrupt() local
139 void __iomem *base = qtty->base; in goldfish_tty_interrupt()
148 count = tty_prepare_flip_string(&qtty->port, &buf, count); in goldfish_tty_interrupt()
151 goldfish_tty_rw(qtty, address, count, 0); in goldfish_tty_interrupt()
153 tty_flip_buffer_push(&qtty->port); in goldfish_tty_interrupt()
159 struct goldfish_tty *qtty = container_of(port, struct goldfish_tty, in goldfish_tty_activate() local
161 gf_iowrite32(GOLDFISH_TTY_CMD_INT_ENABLE, qtty->base + GOLDFISH_TTY_REG_CMD); in goldfish_tty_activate()
167 struct goldfish_tty *qtty = container_of(port, struct goldfish_tty, in goldfish_tty_shutdown() local
169 gf_iowrite32(GOLDFISH_TTY_CMD_INT_DISABLE, qtty->base + GOLDFISH_TTY_REG_CMD); in goldfish_tty_shutdown()
174 struct goldfish_tty *qtty = &goldfish_ttys[tty->index]; in goldfish_tty_open() local
175 return tty_port_open(&qtty->port, tty, filp); in goldfish_tty_open()
202 struct goldfish_tty *qtty = &goldfish_ttys[tty->index]; in goldfish_tty_chars_in_buffer() local
203 void __iomem *base = qtty->base; in goldfish_tty_chars_in_buffer()
295 struct goldfish_tty *qtty; in goldfish_tty_probe() local
342 qtty = &goldfish_ttys[line]; in goldfish_tty_probe()
343 spin_lock_init(&qtty->lock); in goldfish_tty_probe()
344 tty_port_init(&qtty->port); in goldfish_tty_probe()
345 qtty->port.ops = &goldfish_port_ops; in goldfish_tty_probe()
346 qtty->base = base; in goldfish_tty_probe()
347 qtty->irq = irq; in goldfish_tty_probe()
348 qtty->dev = &pdev->dev; in goldfish_tty_probe()
357 qtty->version = gf_ioread32(base + GOLDFISH_TTY_REG_VERSION); in goldfish_tty_probe()
363 if (qtty->version > 0) { in goldfish_tty_probe()
379 "goldfish_tty", qtty); in goldfish_tty_probe()
385 ttydev = tty_port_register_device(&qtty->port, goldfish_tty_driver, in goldfish_tty_probe()
392 strcpy(qtty->console.name, "ttyGF"); in goldfish_tty_probe()
393 qtty->console.write = goldfish_tty_console_write; in goldfish_tty_probe()
394 qtty->console.device = goldfish_tty_console_device; in goldfish_tty_probe()
395 qtty->console.setup = goldfish_tty_console_setup; in goldfish_tty_probe()
396 qtty->console.flags = CON_PRINTBUFFER; in goldfish_tty_probe()
397 qtty->console.index = line; in goldfish_tty_probe()
398 register_console(&qtty->console); in goldfish_tty_probe()
399 platform_set_drvdata(pdev, qtty); in goldfish_tty_probe()
405 free_irq(irq, qtty); in goldfish_tty_probe()
407 tty_port_destroy(&qtty->port); in goldfish_tty_probe()
420 struct goldfish_tty *qtty = platform_get_drvdata(pdev); in goldfish_tty_remove() local
424 unregister_console(&qtty->console); in goldfish_tty_remove()
425 tty_unregister_device(goldfish_tty_driver, qtty->console.index); in goldfish_tty_remove()
426 iounmap(qtty->base); in goldfish_tty_remove()
427 qtty->base = NULL; in goldfish_tty_remove()
428 free_irq(qtty->irq, qtty); in goldfish_tty_remove()
429 tty_port_destroy(&qtty->port); in goldfish_tty_remove()