From 446c85af665cf6d911c4821ac9507c8ba0cc7e75 Mon Sep 17 00:00:00 2001 From: Ammar Faizi Date: Fri, 23 Dec 2022 21:24:18 +0700 Subject: [PATCH 1/5] ACPI: Silence missing prototype warnings Compiling with clang-16: drivers/acpi/acpi_lpit.c:142:6: error: no previous prototype \ for function 'acpi_init_lpit' [-Werror,-Wmissing-prototypes] drivers/acpi/ioapic.c:212:6: error: no previous prototype \ for function 'pci_ioapic_remove' [-Werror,-Wmissing-prototypes] drivers/acpi/ioapic.c:229:5: error: no previous prototype \ for function 'acpi_ioapic_remove' [-Werror,-Wmissing-prototypes] Include "internal.h" to silence them. Signed-off-by: Ammar Faizi Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_lpit.c | 1 + drivers/acpi/ioapic.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c index 50540d4d4948e..3843d2576d3fa 100644 --- a/drivers/acpi/acpi_lpit.c +++ b/drivers/acpi/acpi_lpit.c @@ -10,6 +10,7 @@ #include #include #include +#include "internal.h" struct lpit_residency_info { struct acpi_generic_address gaddr; diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c index a690c7b186232..6677955b4a8e3 100644 --- a/drivers/acpi/ioapic.c +++ b/drivers/acpi/ioapic.c @@ -24,6 +24,7 @@ #include #include #include +#include "internal.h" struct acpi_pci_ioapic { acpi_handle root_handle; From faffb0831ad683a33e3b0f2e70eb2957874a71bb Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Thu, 26 Jan 2023 22:39:39 -0800 Subject: [PATCH 2/5] Documentation: firmware-guide/ACPI: correct spelling Correct spelling problems for Documentation/firmware-guide/ as reported by codespell. Signed-off-by: Randy Dunlap Signed-off-by: Rafael J. Wysocki --- Documentation/firmware-guide/acpi/acpi-lid.rst | 2 +- Documentation/firmware-guide/acpi/namespace.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/firmware-guide/acpi/acpi-lid.rst b/Documentation/firmware-guide/acpi/acpi-lid.rst index 71b9af13a048f..03cbad6c67307 100644 --- a/Documentation/firmware-guide/acpi/acpi-lid.rst +++ b/Documentation/firmware-guide/acpi/acpi-lid.rst @@ -34,7 +34,7 @@ state upon the last _LID evaluation. There won't be difference when the _LID control method is evaluated during the runtime, the problem is its initial returning value. When the AML tables implement this control method with cached value, the initial returning value is likely not reliable. -There are platforms always retun "closed" as initial lid state. +There are platforms always return "closed" as initial lid state. Restrictions of the lid state change notifications ================================================== diff --git a/Documentation/firmware-guide/acpi/namespace.rst b/Documentation/firmware-guide/acpi/namespace.rst index 6193582a2204d..4ef963679a3d0 100644 --- a/Documentation/firmware-guide/acpi/namespace.rst +++ b/Documentation/firmware-guide/acpi/namespace.rst @@ -31,7 +31,7 @@ Description Table). The XSDT always points to the FADT (Fixed ACPI Description Table) using its first entry, the data within the FADT includes various fixed-length entries that describe fixed ACPI features of the hardware. The FADT contains a pointer to the DSDT -(Differentiated System Descripition Table). The XSDT also contains +(Differentiated System Description Table). The XSDT also contains entries pointing to possibly multiple SSDTs (Secondary System Description Table). From 2d11eae42d52a131f06061015e49dc0f085c5bfc Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 2 Feb 2023 13:44:49 +0100 Subject: [PATCH 3/5] ACPI: video: Fix Lenovo Ideapad Z570 DMI match Multiple Ideapad Z570 variants need acpi_backlight=native to force native use on these pre Windows 8 machines since acpi_video backlight control does not work here. The original DMI quirk matches on a product_name of "102434U" but other variants may have different product_name-s such as e.g. "1024D9U". Move to checking product_version instead as is more or less standard for Lenovo DMI quirks for similar reasons. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki --- drivers/acpi/video_detect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index a8c02608dde45..710ac640267dd 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -434,7 +434,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = { /* Lenovo Ideapad Z570 */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "102434U"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Ideapad Z570"), }, }, { From 3082d7efd76a55f74f263dc01f059f5b5221e8cc Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Mon, 13 Feb 2023 22:40:05 +0200 Subject: [PATCH 4/5] Documentation: firmware-guide: gpio-properties: Clarify Explicit and Implicit Clarify the Explicit and Implicit meanings in the table of Pull Bias. While at it, distinguish pull bias keywords used in ACPI by using bold font in the table of the respective terms. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki --- .../firmware-guide/acpi/gpio-properties.rst | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Documentation/firmware-guide/acpi/gpio-properties.rst b/Documentation/firmware-guide/acpi/gpio-properties.rst index eaec732cc77cf..db0c0b1f37008 100644 --- a/Documentation/firmware-guide/acpi/gpio-properties.rst +++ b/Documentation/firmware-guide/acpi/gpio-properties.rst @@ -67,17 +67,30 @@ state of the output pin which driver should use during its initialization. Linux tries to use common sense here and derives the state from the bias and polarity settings. The table below shows the expectations: -========= ============= ============== -Pull Bias Polarity Requested... -========= ============= ============== -Implicit x AS IS (assumed firmware configured for us) -Explicit x (no _DSD) as Pull Bias (Up == High, Down == Low), - assuming non-active (Polarity = !Pull Bias) -Down Low as low, assuming active -Down High as low, assuming non-active -Up Low as high, assuming non-active -Up High as high, assuming active -========= ============= ============== ++-------------+-------------+-----------------------------------------------+ +| Pull Bias | Polarity | Requested... | ++=============+=============+===============================================+ +| Implicit | ++-------------+-------------+-----------------------------------------------+ +| **Default** | x | AS IS (assumed firmware configured it for us) | ++-------------+-------------+-----------------------------------------------+ +| Explicit | ++-------------+-------------+-----------------------------------------------+ +| **None** | x | AS IS (assumed firmware configured it for us) | +| | | with no Pull Bias | ++-------------+-------------+-----------------------------------------------+ +| **Up** | x (no _DSD) | | +| +-------------+ as high, assuming non-active | +| | Low | | +| +-------------+-----------------------------------------------+ +| | High | as high, assuming active | ++-------------+-------------+-----------------------------------------------+ +| **Down** | x (no _DSD) | | +| +-------------+ as low, assuming non-active | +| | High | | +| +-------------+-----------------------------------------------+ +| | Low | as low, assuming active | ++-------------+-------------+-----------------------------------------------+ That said, for our above example the both GPIOs, since the bias setting is explicit and _DSD is present, will be treated as active with a high From a527b0111798ed7b9f49830989eaabfe537e09ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Tue, 14 Feb 2023 03:23:52 +0000 Subject: [PATCH 5/5] ACPI: make kobj_type structures constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definitions to prevent modification at runtime. Signed-off-by: Thomas Weißschuh Signed-off-by: Rafael J. Wysocki --- drivers/acpi/cppc_acpi.c | 2 +- drivers/acpi/device_sysfs.c | 2 +- drivers/acpi/sysfs.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 0f17b1c32718e..a8f58b32d66f2 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -193,7 +193,7 @@ static struct attribute *cppc_attrs[] = { }; ATTRIBUTE_GROUPS(cppc); -static struct kobj_type cppc_ktype = { +static const struct kobj_type cppc_ktype = { .sysfs_ops = &kobj_sysfs_ops, .default_groups = cppc_groups, }; diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index 120873dad2cc5..c3aa15571f164 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -78,7 +78,7 @@ static void acpi_data_node_release(struct kobject *kobj) complete(&dn->kobj_done); } -static struct kobj_type acpi_data_node_ktype = { +static const struct kobj_type acpi_data_node_ktype = { .sysfs_ops = &acpi_data_node_sysfs_ops, .default_groups = acpi_data_node_default_groups, .release = acpi_data_node_release, diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 7db3b530279bd..7f4ff56c9d426 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -953,7 +953,7 @@ static struct attribute *hotplug_profile_attrs[] = { }; ATTRIBUTE_GROUPS(hotplug_profile); -static struct kobj_type acpi_hotplug_profile_ktype = { +static const struct kobj_type acpi_hotplug_profile_ktype = { .sysfs_ops = &kobj_sysfs_ops, .default_groups = hotplug_profile_groups, };