| // SPDX-License-Identifier: GPL-2.0-or-later |
| * Registration of Cobalt UART platform device. |
| * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
| #include <linux/ioport.h> |
| #include <linux/platform_device.h> |
| #include <linux/serial_8250.h> |
| static struct resource cobalt_uart_resource[] __initdata = { |
| static struct plat_serial8250_port cobalt_serial8250_port[] = { |
| .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
| static __init int cobalt_uart_add(void) |
| struct platform_device *pdev; |
| * Cobalt Qube1 has no UART. |
| if (cobalt_board_id == COBALT_BRD_ID_QUBE1) |
| pdev = platform_device_alloc("serial8250", -1); |
| pdev->id = PLAT8250_DEV_PLATFORM; |
| pdev->dev.platform_data = cobalt_serial8250_port; |
| retval = platform_device_add_resources(pdev, cobalt_uart_resource, ARRAY_SIZE(cobalt_uart_resource)); |
| retval = platform_device_add(pdev); |
| platform_device_put(pdev); |
| device_initcall(cobalt_uart_add); |