summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeng Kan <fkan@apm.com>2014-12-05 17:45:57 -0800
committerSasha Levin <sasha.levin@oracle.com>2015-06-28 13:39:20 -0400
commit7e01b1bacfe148f0d51fc9bc7bfa76ebe2e194dc (patch)
tree29eb81aded3e01a2d7396449265b1947148f45d4
parent780841321b71d5fc13167260a482ac98ebccd200 (diff)
serial: 8250: add support for ACPI-probed serial port for X-Gene platform
[ Upstream commit 5e1aeea52f6a0763e79473b1767401fda88eb7e1 ] Enable APM X-Gene SoC serial port functionality when using ACPI table to initialize serial port. Signed-off-by: Feng Kan <fkan@apm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r--drivers/tty/serial/8250/8250_dw.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index a69e31e3410f..4327efeb94f7 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -316,10 +316,20 @@ static int dw8250_probe_of(struct uart_port *p,
static int dw8250_probe_acpi(struct uart_8250_port *up,
struct dw8250_data *data)
{
+ const struct acpi_device_id *id;
struct uart_port *p = &up->port;
dw8250_setup_port(up);
+ id = acpi_match_device(p->dev->driver->acpi_match_table, p->dev);
+ if (!id)
+ return -ENODEV;
+
+ if (!p->uartclk)
+ if (device_property_read_u32(p->dev, "clock-frequency",
+ &p->uartclk))
+ return -EINVAL;
+
p->iotype = UPIO_MEM32;
p->serial_in = dw8250_serial_in32;
p->serial_out = dw8250_serial_out32;
@@ -542,6 +552,7 @@ static const struct acpi_device_id dw8250_acpi_match[] = {
{ "INT3435", 0 },
{ "80860F0A", 0 },
{ "8086228A", 0 },
+ { "APMC0D08", 0},
{ },
};
MODULE_DEVICE_TABLE(acpi, dw8250_acpi_match);