Lines Matching +full:lpc +full:- +full:interrupts

1 // SPDX-License-Identifier: GPL-2.0+
61 * to the host on the Host <-> BMC LPC bus. It could be different on a
67 return readb(vuart->port->port.membase + reg); in aspeed_vuart_readb()
72 writeb(val, vuart->port->port.membase + reg); in aspeed_vuart_writeb()
90 return -EINVAL; in aspeed_vuart_set_lpc_address()
134 return -EINVAL; in aspeed_vuart_set_sirq()
250 struct aspeed_vuart *vuart = uart_8250_port->port.private_data; in aspeed_vuart_startup()
265 struct aspeed_vuart *vuart = uart_8250_port->port.private_data; in aspeed_vuart_shutdown()
278 lockdep_assert_held_once(&up->port.lock); in __aspeed_vuart_set_throttle()
280 up->ier &= ~irqs; in __aspeed_vuart_set_throttle()
282 up->ier |= irqs; in __aspeed_vuart_set_throttle()
283 serial_out(up, UART_IER, up->ier); in __aspeed_vuart_set_throttle()
308 struct uart_8250_port *up = vuart->port; in aspeed_vuart_unthrottle_exp()
310 if (!tty_buffer_space_avail(&up->port.state->port)) { in aspeed_vuart_unthrottle_exp()
311 mod_timer(&vuart->unthrottle_timer, in aspeed_vuart_unthrottle_exp()
316 aspeed_vuart_unthrottle(&up->port); in aspeed_vuart_unthrottle_exp()
320 * Custom interrupt handler to manage finer-grained flow control. Although we
347 space = tty_buffer_space_avail(&port->state->port); in aspeed_vuart_handle_irq()
351 struct aspeed_vuart *vuart = port->private_data; in aspeed_vuart_handle_irq()
354 if (!timer_pending(&vuart->unthrottle_timer)) in aspeed_vuart_handle_irq()
355 mod_timer(&vuart->unthrottle_timer, in aspeed_vuart_handle_irq()
364 if (--count == 0) in aspeed_vuart_handle_irq()
368 tty_flip_buffer_push(&port->state->port); in aspeed_vuart_handle_irq()
390 dev_warn(vuart->dev, in aspeed_vuart_auto_configure_sirq_polarity()
391 "could not get regmap for aspeed,sirq-polarity-sense\n"); in aspeed_vuart_auto_configure_sirq_polarity()
395 dev_warn(vuart->dev, "could not read hw strap table\n"); in aspeed_vuart_auto_configure_sirq_polarity()
410 return -EINVAL; in aspeed_vuart_map_irq_polarity()
417 struct device *dev = &pdev->dev; in aspeed_vuart_probe()
426 np = pdev->dev.of_node; in aspeed_vuart_probe()
428 vuart = devm_kzalloc(&pdev->dev, sizeof(*vuart), GFP_KERNEL); in aspeed_vuart_probe()
430 return -ENOMEM; in aspeed_vuart_probe()
432 vuart->dev = &pdev->dev; in aspeed_vuart_probe()
433 timer_setup(&vuart->unthrottle_timer, aspeed_vuart_unthrottle_exp, 0); in aspeed_vuart_probe()
437 return -EINVAL; in aspeed_vuart_probe()
441 port.port.mapbase = res->start; in aspeed_vuart_probe()
448 port.port.dev = &pdev->dev; in aspeed_vuart_probe()
454 rc = sysfs_create_group(&vuart->dev->kobj, &aspeed_vuart_attr_group); in aspeed_vuart_probe()
466 rc = dev_err_probe(dev, PTR_ERR(vclk), "clk or clock-frequency not defined\n"); in aspeed_vuart_probe()
473 /* If current-speed was set, then try not to change it. */ in aspeed_vuart_probe()
474 if (of_property_read_u32(np, "current-speed", &prop) == 0) in aspeed_vuart_probe()
483 if (of_property_read_bool(np, "auto-flow-control")) in aspeed_vuart_probe()
490 vuart->line = rc; in aspeed_vuart_probe()
491 vuart->port = serial8250_get_port(vuart->line); in aspeed_vuart_probe()
494 np, "aspeed,sirq-polarity-sense", 2, 0, in aspeed_vuart_probe()
497 dev_dbg(&pdev->dev, in aspeed_vuart_probe()
498 "aspeed,sirq-polarity-sense property not found\n"); in aspeed_vuart_probe()
507 rc = of_property_read_u32(np, "aspeed,lpc-io-reg", &prop); in aspeed_vuart_probe()
513 dev_err_probe(dev, rc, "invalid value in aspeed,lpc-io-reg property\n"); in aspeed_vuart_probe()
517 rc = of_property_read_u32_array(np, "aspeed,lpc-interrupts", sirq, 2); in aspeed_vuart_probe()
525 dev_err_probe(dev, rc, "invalid sirq number in aspeed,lpc-interrupts property\n"); in aspeed_vuart_probe()
532 "invalid sirq polarity in aspeed,lpc-interrupts property\n"); in aspeed_vuart_probe()
545 sysfs_remove_group(&vuart->dev->kobj, &aspeed_vuart_attr_group); in aspeed_vuart_probe()
553 del_timer_sync(&vuart->unthrottle_timer); in aspeed_vuart_remove()
555 serial8250_unregister_port(vuart->line); in aspeed_vuart_remove()
556 sysfs_remove_group(&vuart->dev->kobj, &aspeed_vuart_attr_group); in aspeed_vuart_remove()
560 { .compatible = "aspeed,ast2400-vuart" },
561 { .compatible = "aspeed,ast2500-vuart" },
568 .name = "aspeed-vuart",