public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: video: Invoke _PS0 at boot for ACPI video
@ 2023-07-04  7:45 Kai-Heng Feng
  2023-07-04 16:58 ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Kai-Heng Feng @ 2023-07-04  7:45 UTC (permalink / raw)
  To: rafael, lenb; +Cc: Kai-Heng Feng, linux-acpi, linux-kernel

Screen brightness can only be changed once on some HP laptops.

Vendor identified the root cause as Linux doesn't invoke _PS0 at boot
for all ACPI devices:
    Scope (\_SB.PC00.GFX0)
    {
        Scope (DD1F)
        {
            Method (_PS0, 0, Serialized)  // _PS0: Power State 0
            {
                If (CondRefOf (\_SB.PC00.LPCB.EC0.SSBC))
                {
                    \_SB.PC00.LPCB.EC0.SSBC ()
                }
            }
	    ...
	}
	...
    }

_PS0 doesn't get invoked for all ACPI devices because of commit
7cd8407d53ef ("ACPI / PM: Do not execute _PS0 for devices without _PSC
during initialization").

For now explicitly call _PS0 for ACPI video to workaround the issue.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/acpi/acpi_video.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 62f4364e4460..793259bd18c8 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -2027,6 +2027,8 @@ static int acpi_video_bus_add(struct acpi_device *device)
 	if (error)
 		goto err_put_video;
 
+	acpi_device_fix_up_power_extended(device);
+
 	pr_info("%s [%s] (multi-head: %s  rom: %s  post: %s)\n",
 	       ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device),
 	       video->flags.multihead ? "yes" : "no",
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-17  1:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-04  7:45 [PATCH] ACPI: video: Invoke _PS0 at boot for ACPI video Kai-Heng Feng
2023-07-04 16:58 ` Rafael J. Wysocki
2023-07-05 10:33   ` Hans de Goede
2023-07-06  8:20     ` Kai-Heng Feng
2023-07-10 12:54       ` Hans de Goede
2023-07-17  1:35         ` Kai-Heng Feng
2023-07-06  8:13   ` Kai-Heng Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox