mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
TTY/Serial patches for 4.9-rc1
Here is the big TTY and Serial patch set for 4.9-rc1. It also includes some drivers/dma/ changes, as those were needed by some serial drivers, and they were all acked by the DMA maintainer. Also in here is the long-suffering ACPI SPCR patchset, which was passed around from maintainer to maintainer like a hot-potato. Seems I was the sucker^Wlucky one. All of those patches have been acked by the various subsystem maintainers as well. All of this has been in linux-next with no reported issues. Signed-off-by: Greg Kroah-Hartman <[email protected]> -----BEGIN PGP SIGNATURE----- iFYEABECABYFAlfyNjEPHGdyZWdAa3JvYWguY29tAAoJEDFH1A3bLfspwIcAn2uN qCD8xQJ0Cs61hD1nUzhNygG8AJ94I4zz/fPGpyh/CtJfLQwtUdLhNA== =Rken -----END PGP SIGNATURE----- Merge tag 'tty-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty and serial updates from Greg KH: "Here is the big tty and serial patch set for 4.9-rc1. It also includes some drivers/dma/ changes, as those were needed by some serial drivers, and they were all acked by the DMA maintainer. Also in here is the long-suffering ACPI SPCR patchset, which was passed around from maintainer to maintainer like a hot-potato. Seems I was the sucker^Wlucky one. All of those patches have been acked by the various subsystem maintainers as well. All of this has been in linux-next with no reported issues" * tag 'tty-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (111 commits) Revert "serial: pl011: add console matching function" MAINTAINERS: update entry for atmel_serial driver serial: pl011: add console matching function ARM64: ACPI: enable ACPI_SPCR_TABLE ACPI: parse SPCR and enable matching console of/serial: move earlycon early_param handling to serial Revert "drivers/tty: Explicitly pass current to show_stack" tty: amba-pl011: Don't complain on -EPROBE_DEFER when no irq nios2: dts: 10m50: Add tx-threshold parameter serial: 8250: Set Altera 16550 TX FIFO Threshold serial: 8250: of: Load TX FIFO Threshold from DT Documentation: dt: serial: Add TX FIFO threshold parameter drivers/tty: Explicitly pass current to show_stack serial: imx: Fix DCD reading serial: stm32: mark symbols static where possible serial: xuartps: Add some register initialisation to cdns_early_console_setup() serial: xuartps: Removed unwanted checks while reading the error conditions serial: xuartps: Rewrite the interrupt handling logic serial: stm32: use mapbase instead of membase for DMA tty/serial: atmel: fix fractional baud rate computation ...
This commit is contained in:
commit
e6dce825fb
69 changed files with 2610 additions and 1269 deletions
|
|
@ -77,6 +77,9 @@ config ACPI_DEBUGGER_USER
|
|||
|
||||
endif
|
||||
|
||||
config ACPI_SPCR_TABLE
|
||||
bool
|
||||
|
||||
config ACPI_SLEEP
|
||||
bool
|
||||
depends on SUSPEND || HIBERNATION
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ obj-$(CONFIG_ACPI_EC_DEBUGFS) += ec_sys.o
|
|||
obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o
|
||||
obj-$(CONFIG_ACPI_BGRT) += bgrt.o
|
||||
obj-$(CONFIG_ACPI_CPPC_LIB) += cppc_acpi.o
|
||||
obj-$(CONFIG_ACPI_SPCR_TABLE) += spcr.o
|
||||
obj-$(CONFIG_ACPI_DEBUGGER_USER) += acpi_dbg.o
|
||||
|
||||
# processor has its own "processor." module_param namespace
|
||||
|
|
|
|||
111
drivers/acpi/spcr.c
Normal file
111
drivers/acpi/spcr.c
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
* Copyright (c) 2012, Intel Corporation
|
||||
* Copyright (c) 2015, Red Hat, Inc.
|
||||
* Copyright (c) 2015, 2016 Linaro Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "ACPI: SPCR: " fmt
|
||||
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/serial_core.h>
|
||||
|
||||
/**
|
||||
* parse_spcr() - parse ACPI SPCR table and add preferred console
|
||||
*
|
||||
* @earlycon: set up earlycon for the console specified by the table
|
||||
*
|
||||
* For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be
|
||||
* defined to parse ACPI SPCR table. As a result of the parsing preferred
|
||||
* console is registered and if @earlycon is true, earlycon is set up.
|
||||
*
|
||||
* When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called
|
||||
* from arch inintialization code as soon as the DT/ACPI decision is made.
|
||||
*
|
||||
*/
|
||||
int __init parse_spcr(bool earlycon)
|
||||
{
|
||||
static char opts[64];
|
||||
struct acpi_table_spcr *table;
|
||||
acpi_size table_size;
|
||||
acpi_status status;
|
||||
char *uart;
|
||||
char *iotype;
|
||||
int baud_rate;
|
||||
int err;
|
||||
|
||||
if (acpi_disabled)
|
||||
return -ENODEV;
|
||||
|
||||
status = acpi_get_table_with_size(ACPI_SIG_SPCR, 0,
|
||||
(struct acpi_table_header **)&table,
|
||||
&table_size);
|
||||
|
||||
if (ACPI_FAILURE(status))
|
||||
return -ENOENT;
|
||||
|
||||
if (table->header.revision < 2) {
|
||||
err = -ENOENT;
|
||||
pr_err("wrong table version\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
iotype = table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY ?
|
||||
"mmio" : "io";
|
||||
|
||||
switch (table->interface_type) {
|
||||
case ACPI_DBG2_ARM_SBSA_32BIT:
|
||||
iotype = "mmio32";
|
||||
/* fall through */
|
||||
case ACPI_DBG2_ARM_PL011:
|
||||
case ACPI_DBG2_ARM_SBSA_GENERIC:
|
||||
case ACPI_DBG2_BCM2835:
|
||||
uart = "pl011";
|
||||
break;
|
||||
case ACPI_DBG2_16550_COMPATIBLE:
|
||||
case ACPI_DBG2_16550_SUBSET:
|
||||
uart = "uart";
|
||||
break;
|
||||
default:
|
||||
err = -ENOENT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
switch (table->baud_rate) {
|
||||
case 3:
|
||||
baud_rate = 9600;
|
||||
break;
|
||||
case 4:
|
||||
baud_rate = 19200;
|
||||
break;
|
||||
case 6:
|
||||
baud_rate = 57600;
|
||||
break;
|
||||
case 7:
|
||||
baud_rate = 115200;
|
||||
break;
|
||||
default:
|
||||
err = -ENOENT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
|
||||
table->serial_port.address, baud_rate);
|
||||
|
||||
pr_info("console: %s\n", opts);
|
||||
|
||||
if (earlycon)
|
||||
setup_earlycon(opts);
|
||||
|
||||
err = add_preferred_console(uart, 0, opts + strlen(uart) + 1);
|
||||
|
||||
done:
|
||||
early_acpi_os_unmap_memory((void __iomem *)table, table_size);
|
||||
return err;
|
||||
}
|
||||
Loading…
Reference in a new issue