aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/spcr.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-09 12:44:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-09 12:44:25 -0500
commit54ce685cae30c106f062d714c11e644ab1b93b51 (patch)
tree40869cc4a3aabfb6d9ef1cb4f68835cca2e8558c /drivers/acpi/spcr.c
parenta051c14b8db35cb269e9d91e11fc3573b6f7475d (diff)
parentd4abd46b7e7279a61a1aa76d1d1b16a990178e75 (diff)
Merge tag 'acpi-part2-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more ACPI updates from Rafael Wysocki: "These are mostly fixes and cleanups, a few new quirks, a couple of updates related to the handling of ACPI tables and ACPICA copyrights refreshment. Specifics: - Update the ACPICA kernel code to upstream revision 20180105 including: * Assorted fixes (Jung-uk Kim) * Support for X32 ABI compilation (Anuj Mittal) * Update of ACPICA copyrights to 2018 (Bob Moore) - Prepare for future modifications to avoid executing the _STA control method too early (Hans de Goede) - Make the processor performance control library code ignore _PPC notifications if they cannot be handled and fix up the C1 idle state definition when it is used as a fallback state (Chen Yu, Yazen Ghannam) - Make it possible to use the SPCR table on x86 and to replace the original IORT table with a new one from initrd (Prarit Bhargava, Shunyong Yang) - Add battery-related quirks for Asus UX360UA and UX410UAK and add quirks for table parsing on Dell XPS 9570 and Precision M5530 (Kai Heng Feng) - Address static checker warnings in the CPPC code (Gustavo Silva) - Avoid printing a raw pointer to the kernel log in the smart battery driver (Greg Kroah-Hartman)" * tag 'acpi-part2-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: sbshc: remove raw pointer from printk() message ACPI: SPCR: Make SPCR available to x86 ACPI / CPPC: Use 64-bit arithmetic instead of 32-bit ACPI / tables: Add IORT to injectable table list ACPI / bus: Parse tables as term_list for Dell XPS 9570 and Precision M5530 ACPICA: Update version to 20180105 ACPICA: All acpica: Update copyrights to 2018 ACPI / processor: Set default C1 idle state description ACPI / battery: Add quirk for Asus UX360UA and UX410UAK ACPI: processor_perflib: Do not send _PPC change notification if not ready ACPI / scan: Use acpi_bus_get_status() to initialize ACPI_TYPE_DEVICE devs ACPI / bus: Do not call _STA on battery devices with unmet dependencies PCI: acpiphp_ibm: prepare for acpi_get_object_info() no longer returning status ACPI: export acpi_bus_get_status_handle() ACPICA: Add a missing pair of parentheses ACPICA: Prefer ACPI_TO_POINTER() over ACPI_ADD_PTR() ACPICA: Avoid NULL pointer arithmetic ACPICA: Linux: add support for X32 ABI compilation ACPI / video: Use true for boolean value
Diffstat (limited to 'drivers/acpi/spcr.c')
-rw-r--r--drivers/acpi/spcr.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
index 324b35bfe781..89e97d21a89c 100644
--- a/drivers/acpi/spcr.c
+++ b/drivers/acpi/spcr.c
@@ -21,7 +21,7 @@
21 * occasionally getting stuck as 1. To avoid the potential for a hang, check 21 * occasionally getting stuck as 1. To avoid the potential for a hang, check
22 * TXFE == 0 instead of BUSY == 1. This may not be suitable for all UART 22 * TXFE == 0 instead of BUSY == 1. This may not be suitable for all UART
23 * implementations, so only do so if an affected platform is detected in 23 * implementations, so only do so if an affected platform is detected in
24 * parse_spcr(). 24 * acpi_parse_spcr().
25 */ 25 */
26bool qdf2400_e44_present; 26bool qdf2400_e44_present;
27EXPORT_SYMBOL(qdf2400_e44_present); 27EXPORT_SYMBOL(qdf2400_e44_present);
@@ -74,19 +74,21 @@ static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb)
74} 74}
75 75
76/** 76/**
77 * parse_spcr() - parse ACPI SPCR table and add preferred console 77 * acpi_parse_spcr() - parse ACPI SPCR table and add preferred console
78 * 78 *
79 * @earlycon: set up earlycon for the console specified by the table 79 * @enable_earlycon: set up earlycon for the console specified by the table
80 * @enable_console: setup the console specified by the table.
80 * 81 *
81 * For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be 82 * For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be
82 * defined to parse ACPI SPCR table. As a result of the parsing preferred 83 * defined to parse ACPI SPCR table. As a result of the parsing preferred
83 * console is registered and if @earlycon is true, earlycon is set up. 84 * console is registered and if @enable_earlycon is true, earlycon is set up.
85 * If @enable_console is true the system console is also configured.
84 * 86 *
85 * When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called 87 * When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called
86 * from arch initialization code as soon as the DT/ACPI decision is made. 88 * from arch initialization code as soon as the DT/ACPI decision is made.
87 * 89 *
88 */ 90 */
89int __init parse_spcr(bool earlycon) 91int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
90{ 92{
91 static char opts[64]; 93 static char opts[64];
92 struct acpi_table_spcr *table; 94 struct acpi_table_spcr *table;
@@ -105,11 +107,8 @@ int __init parse_spcr(bool earlycon)
105 if (ACPI_FAILURE(status)) 107 if (ACPI_FAILURE(status))
106 return -ENOENT; 108 return -ENOENT;
107 109
108 if (table->header.revision < 2) { 110 if (table->header.revision < 2)
109 err = -ENOENT; 111 pr_info("SPCR table version %d\n", table->header.revision);
110 pr_err("wrong table version\n");
111 goto done;
112 }
113 112
114 if (table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 113 if (table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
115 switch (ACPI_ACCESS_BIT_WIDTH(( 114 switch (ACPI_ACCESS_BIT_WIDTH((
@@ -185,7 +184,7 @@ int __init parse_spcr(bool earlycon)
185 */ 184 */
186 if (qdf2400_erratum_44_present(&table->header)) { 185 if (qdf2400_erratum_44_present(&table->header)) {
187 qdf2400_e44_present = true; 186 qdf2400_e44_present = true;
188 if (earlycon) 187 if (enable_earlycon)
189 uart = "qdf2400_e44"; 188 uart = "qdf2400_e44";
190 } 189 }
191 190
@@ -205,11 +204,13 @@ int __init parse_spcr(bool earlycon)
205 204
206 pr_info("console: %s\n", opts); 205 pr_info("console: %s\n", opts);
207 206
208 if (earlycon) 207 if (enable_earlycon)
209 setup_earlycon(opts); 208 setup_earlycon(opts);
210 209
211 err = add_preferred_console(uart, 0, opts + strlen(uart) + 1); 210 if (enable_console)
212 211 err = add_preferred_console(uart, 0, opts + strlen(uart) + 1);
212 else
213 err = 0;
213done: 214done:
214 acpi_put_table((struct acpi_table_header *)table); 215 acpi_put_table((struct acpi_table_header *)table);
215 return err; 216 return err;