From 1f59ab2783aed04f1318b840950801e38b2bebdf Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Wed, 12 Jul 2017 17:45:57 -0700 Subject: ACPI / video: Add force_none quirk for Dell OptiPlex 9020M Dell OptiPlex 9020M is a micro PC desktop that has no built-in LCD panel and its acpi_video does not work. Signed-off-by: Alex Hung Signed-off-by: Rafael J. Wysocki --- drivers/acpi/video_detect.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'drivers/acpi') diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index d179e8d9177d..601e5d372887 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -103,6 +103,12 @@ static int video_detect_force_native(const struct dmi_system_id *d) return 0; } +static int video_detect_force_none(const struct dmi_system_id *d) +{ + acpi_backlight_dmi = acpi_backlight_none; + return 0; +} + static const struct dmi_system_id video_detect_dmi_table[] = { /* On Samsung X360, the BIOS will set a flag (VDRV) if generic * ACPI backlight device is used. This flag will definitively break @@ -313,6 +319,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Precision 7510"), }, }, + { + .callback = video_detect_force_none, + .ident = "Dell OptiPlex 9020M", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020M"), + }, + }, { }, }; -- cgit v1.2.1 From a06f29b2866ce4418154d6cb955e35899c554066 Mon Sep 17 00:00:00 2001 From: Sumeet Pawnikar Date: Sat, 22 Jul 2017 00:14:42 +0530 Subject: ACPI / lpat: Fix typos in comments and kerneldoc style This patch fix the typos in function header of acpi_lpat_raw_to_temp and acpi_lpat_temp_to_raw. Signed-off-by: Sumeet Pawnikar Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_lpat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpi_lpat.c b/drivers/acpi/acpi_lpat.c index c1c4877ca96c..2cd9f738812b 100644 --- a/drivers/acpi/acpi_lpat.c +++ b/drivers/acpi/acpi_lpat.c @@ -25,7 +25,7 @@ * @raw: the raw value, used as a key to get the temerature from the * above mapping table * - * A positive converted temperarure value will be returned on success, + * A positive converted temperature value will be returned on success, * a negative errno will be returned in error cases. */ int acpi_lpat_raw_to_temp(struct acpi_lpat_conversion_table *lpat_table, @@ -55,11 +55,11 @@ EXPORT_SYMBOL_GPL(acpi_lpat_raw_to_temp); * acpi_lpat_temp_to_raw(): Return raw value from temperature through * LPAT conversion table * - * @lpat: the temperature_raw mapping table + * @lpat_table: the temperature_raw mapping table * @temp: the temperature, used as a key to get the raw value from the * above mapping table * - * A positive converted temperature value will be returned on success, + * The raw value will be returned on success, * a negative errno will be returned in error cases. */ int acpi_lpat_temp_to_raw(struct acpi_lpat_conversion_table *lpat_table, -- cgit v1.2.1 From 19dc7134805fdf8977c5b44a95cb5a55f832da35 Mon Sep 17 00:00:00 2001 From: Amitoj Kaur Chawla Date: Tue, 1 Aug 2017 20:28:46 -0400 Subject: ACPI / dock: constify attribute_group structure Functions working with attribute_groups provided by work with const attribute_group. These attribute_group structures do not change at runtime so mark them as const. File size before: text data bss dec hex filename 7902 3528 64 11494 2ce6 drivers/acpi/dock.o File size after: text data bss dec hex filename 7998 3432 64 11494 2ce6 drivers/acpi/dock.o This change was made with the help of Coccinelle. Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Rafael J. Wysocki --- drivers/acpi/dock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 0c00208b423e..2305e1ab978e 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -585,7 +585,7 @@ static struct attribute *dock_attributes[] = { NULL }; -static struct attribute_group dock_attribute_group = { +static const struct attribute_group dock_attribute_group = { .attrs = dock_attributes }; -- cgit v1.2.1 From dee82bc1e653126408f4108cd994d1e96949d064 Mon Sep 17 00:00:00 2001 From: Graeme Gregory Date: Fri, 4 Aug 2017 22:49:43 +0100 Subject: ACPI: SPCR: extend XGENE 8250 workaround to m400 xgene v1/v2 chips are also used on moonshot cartridges that have different table headers to the ones on Mustang. Extend the quirk so it also recognises the Moonshot M400 variant too. Signed-off-by: Graeme Gregory Tested-by: Mark Salter Reviewed-by: Mark Salter Signed-off-by: Rafael J. Wysocki --- drivers/acpi/spcr.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index 98aa8c808a33..2c156941b371 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c @@ -53,17 +53,24 @@ static bool qdf2400_erratum_44_present(struct acpi_table_header *h) */ static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb) { + bool xgene_8250 = false; + if (tb->interface_type != ACPI_DBG2_16550_COMPATIBLE) return false; - if (memcmp(tb->header.oem_id, "APMC0D", ACPI_OEM_ID_SIZE)) + if (memcmp(tb->header.oem_id, "APMC0D", ACPI_OEM_ID_SIZE) && + memcmp(tb->header.oem_id, "HPE ", ACPI_OEM_ID_SIZE)) return false; if (!memcmp(tb->header.oem_table_id, "XGENESPC", ACPI_OEM_TABLE_ID_SIZE) && tb->header.oem_revision == 0) - return true; + xgene_8250 = true; - return false; + if (!memcmp(tb->header.oem_table_id, "ProLiant", + ACPI_OEM_TABLE_ID_SIZE) && tb->header.oem_revision == 1) + xgene_8250 = true; + + return xgene_8250; } /** -- cgit v1.2.1 From 03c3876f2e3b4c79ced7d1d227e5a7fe645ed666 Mon Sep 17 00:00:00 2001 From: Graeme Gregory Date: Fri, 4 Aug 2017 22:49:44 +0100 Subject: ACPI: SPCR: work around clock issue on xgene UART xgene v1/v2 8250 UARTs don't run at the standard clock rate expected by the driver and there is no information on clocking available from the SPCR table. As there has been no progress on relevant vendors updating DBG2/SPCR specifications to fix this work around this using the previous xgene quirk handling to avoid setting a baud rate and therefore using the UART as configured by firmware. Signed-off-by: Graeme Gregory Tested-by: Mark Salter Reviewed-by: Mark Salter Signed-off-by: Rafael J. Wysocki --- drivers/acpi/spcr.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index 2c156941b371..40a56b538b9f 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c @@ -188,11 +188,19 @@ int __init parse_spcr(bool earlycon) uart = "qdf2400_e44"; } - if (xgene_8250_erratum_present(table)) + if (xgene_8250_erratum_present(table)) { iotype = "mmio32"; - snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype, - table->serial_port.address, baud_rate); + /* for xgene v1 and v2 we don't know the clock rate of the + * UART so don't attempt to change to the baud rate state + * in the table because driver cannot calculate the dividers + */ + snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype, + table->serial_port.address); + } else { + snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype, + table->serial_port.address, baud_rate); + } pr_info("console: %s\n", opts); -- cgit v1.2.1 From 82d2b610586763f21f8f6e1f8c163c1f14b94e1c Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Mon, 21 Aug 2017 17:13:07 +0530 Subject: ACPI: make device_attribute const Make these const as they are only passed as an argument to the function device_create_file and device_remove_file and the corresponding arguments are of type const. Done using Coccinelle Signed-off-by: Bhumika Goyal Signed-off-by: Rafael J. Wysocki --- drivers/acpi/battery.c | 2 +- drivers/acpi/sbs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 1cbb88d938e5..13e7b56e33ae 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -620,7 +620,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev, return count; } -static struct device_attribute alarm_attr = { +static const struct device_attribute alarm_attr = { .attr = {.name = "alarm", .mode = 0644}, .show = acpi_battery_alarm_show, .store = acpi_battery_alarm_store, diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index ad0b13ad4bbb..ad6d817f5788 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -476,7 +476,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev, return count; } -static struct device_attribute alarm_attr = { +static const struct device_attribute alarm_attr = { .attr = {.name = "alarm", .mode = 0644}, .show = acpi_battery_alarm_show, .store = acpi_battery_alarm_store, -- cgit v1.2.1