Lines Matching +full:uart +full:- +full:routing

1 // SPDX-License-Identifier: GPL-2.0+
65 /* routing selector for AST25xx */
287 /* routing selector for AST26xx */
499 regmap_read(uart_routing->map, sel->reg, &val); in aspeed_uart_routing_show()
500 val = (val >> sel->shift) & sel->mask; in aspeed_uart_routing_show()
503 for (pos = 0; sel->options[pos] != NULL; ++pos) { in aspeed_uart_routing_show()
505 len += sysfs_emit_at(buf, len, "[%s] ", sel->options[pos]); in aspeed_uart_routing_show()
507 len += sysfs_emit_at(buf, len, "%s ", sel->options[pos]); in aspeed_uart_routing_show()
526 val = __sysfs_match_string(sel->options, -1, buf); in aspeed_uart_routing_store()
529 return -EINVAL; in aspeed_uart_routing_store()
532 regmap_update_bits(uart_routing->map, sel->reg, in aspeed_uart_routing_store()
533 (sel->mask << sel->shift), in aspeed_uart_routing_store()
534 (val & sel->mask) << sel->shift); in aspeed_uart_routing_store()
542 struct device *dev = &pdev->dev; in aspeed_uart_routing_probe()
545 uart_routing = devm_kzalloc(&pdev->dev, sizeof(*uart_routing), GFP_KERNEL); in aspeed_uart_routing_probe()
547 return -ENOMEM; in aspeed_uart_routing_probe()
549 uart_routing->map = syscon_node_to_regmap(dev->parent->of_node); in aspeed_uart_routing_probe()
550 if (IS_ERR(uart_routing->map)) { in aspeed_uart_routing_probe()
552 return PTR_ERR(uart_routing->map); in aspeed_uart_routing_probe()
555 uart_routing->attr_grp = of_device_get_match_data(dev); in aspeed_uart_routing_probe()
557 rc = sysfs_create_group(&dev->kobj, uart_routing->attr_grp); in aspeed_uart_routing_probe()
570 struct device *dev = &pdev->dev; in aspeed_uart_routing_remove()
573 sysfs_remove_group(&dev->kobj, uart_routing->attr_grp); in aspeed_uart_routing_remove()
577 { .compatible = "aspeed,ast2400-uart-routing",
579 { .compatible = "aspeed,ast2500-uart-routing",
581 { .compatible = "aspeed,ast2600-uart-routing",
588 .name = "aspeed-uart-routing",
598 MODULE_AUTHOR("Chia-Wei Wang <chiawei_wang@aspeedtech.com>");
600 MODULE_DESCRIPTION("Driver to configure Aspeed UART routing");