aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Stone <ahs3@redhat.com>2015-02-25 17:46:16 -0700
committerGraeme Gregory <graeme.gregory@linaro.org>2015-07-07 14:36:04 +0100
commit2dbe59cd5e65e9edf7aa85403a860c5c7ac625d3 (patch)
tree39fbd3f29bf79a04c1d32c7b45f9ecd11ad3fb54
parent8781f27a67b3c8ec0fba46549bd65bbc94c9d154 (diff)
downloadleg-kernel-2dbe59cd5e65e9edf7aa85403a860c5c7ac625d3.tar.gz
ACPI: serial: allow for OF or ACPI SPCR configuration of the console
Signed-off-by: Jon Masters <jcm@redhat.com> Signed-off-by: Torez Smith <torez@redhat.com>
-rw-r--r--drivers/tty/serial/serial_core.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 7ae1592f7ec9..ddd160918b8d 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -34,6 +34,7 @@
#include <linux/serial_core.h>
#include <linux/delay.h>
#include <linux/mutex.h>
+#include <linux/acpi.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
@@ -2704,8 +2705,20 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport)
spin_lock_init(&uport->lock);
lockdep_set_class(&uport->lock, &port_lock_key);
}
- if (uport->cons && uport->dev)
- of_console_check(uport->dev->of_node, uport->cons->name, uport->line);
+
+ /*
+ * Support both open FW and ACPI access to console definitions.
+ * Both of_console_check() and acpi_spcr_console_check() will
+ * call add_preferred_console() if a console definition is found.
+ */
+ if (uport->cons && uport->dev) {
+ if (acpi_disabled)
+ of_console_check(uport->dev->of_node, uport->cons->name,
+ uport->line);
+ else
+ acpi_spcr_console_check(ACPI_COMPANION(uport->dev),
+ uport->cons->name, uport->line);
+ }
uart_configure_port(drv, state, uport);