aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2011-11-10 08:18:09 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-15 18:50:30 -0500
commitb82e324b3c46a554595c12b45465d1943a57326c (patch)
treedd74e36cd1d04948ee76dcfbdb9894190e689a40 /drivers/tty/serial
parent66ef27c3fd0e91038029054c862c9439be5137c1 (diff)
serial, mfd: don't hardcode the console
Add support to specify which HSU port to use as an early console. This can be selected by passing "earlyprintk=hsu<n>" on the kernel command line. By default port 0 is still used. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/mfd.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c
index 286c386d9c46..565f3fe3dd77 100644
--- a/drivers/tty/serial/mfd.c
+++ b/drivers/tty/serial/mfd.c
@@ -1156,7 +1156,6 @@ serial_hsu_console_setup(struct console *co, char *options)
1156 int bits = 8; 1156 int bits = 8;
1157 int parity = 'n'; 1157 int parity = 'n';
1158 int flow = 'n'; 1158 int flow = 'n';
1159 int ret;
1160 1159
1161 if (co->index == -1 || co->index >= serial_hsu_reg.nr) 1160 if (co->index == -1 || co->index >= serial_hsu_reg.nr)
1162 co->index = 0; 1161 co->index = 0;
@@ -1167,9 +1166,7 @@ serial_hsu_console_setup(struct console *co, char *options)
1167 if (options) 1166 if (options)
1168 uart_parse_options(options, &baud, &parity, &bits, &flow); 1167 uart_parse_options(options, &baud, &parity, &bits, &flow);
1169 1168
1170 ret = uart_set_options(&up->port, co, baud, parity, bits, flow); 1169 return uart_set_options(&up->port, co, baud, parity, bits, flow);
1171
1172 return ret;
1173} 1170}
1174 1171
1175static struct console serial_hsu_console = { 1172static struct console serial_hsu_console = {
@@ -1178,9 +1175,13 @@ static struct console serial_hsu_console = {
1178 .device = uart_console_device, 1175 .device = uart_console_device,
1179 .setup = serial_hsu_console_setup, 1176 .setup = serial_hsu_console_setup,
1180 .flags = CON_PRINTBUFFER, 1177 .flags = CON_PRINTBUFFER,
1181 .index = 2, 1178 .index = -1,
1182 .data = &serial_hsu_reg, 1179 .data = &serial_hsu_reg,
1183}; 1180};
1181
1182#define SERIAL_HSU_CONSOLE (&serial_hsu_console)
1183#else
1184#define SERIAL_HSU_CONSOLE NULL
1184#endif 1185#endif
1185 1186
1186struct uart_ops serial_hsu_pops = { 1187struct uart_ops serial_hsu_pops = {
@@ -1210,6 +1211,7 @@ static struct uart_driver serial_hsu_reg = {
1210 .major = TTY_MAJOR, 1211 .major = TTY_MAJOR,
1211 .minor = 128, 1212 .minor = 128,
1212 .nr = 3, 1213 .nr = 3,
1214 .cons = SERIAL_HSU_CONSOLE,
1213}; 1215};
1214 1216
1215#ifdef CONFIG_PM 1217#ifdef CONFIG_PM
@@ -1344,12 +1346,6 @@ static int serial_hsu_probe(struct pci_dev *pdev,
1344 } 1346 }
1345 uart_add_one_port(&serial_hsu_reg, &uport->port); 1347 uart_add_one_port(&serial_hsu_reg, &uport->port);
1346 1348
1347#ifdef CONFIG_SERIAL_MFD_HSU_CONSOLE
1348 if (index == 2) {
1349 register_console(&serial_hsu_console);
1350 uport->port.cons = &serial_hsu_console;
1351 }
1352#endif
1353 pci_set_drvdata(pdev, uport); 1349 pci_set_drvdata(pdev, uport);
1354 } 1350 }
1355 1351