lkml.org 
[lkml]   [2022]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] ACPI: video: Fix missing native backlight on Chromebooks
Date
Chromebooks don't have backlight in ACPI table, they suppose to use
native backlight in this case. Check presence of the CrOS embedded
controller ACPI device and prefer the native backlight if EC found.

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Fixes: 2600bfa3df99 ("ACPI: video: Add acpi_video_backlight_use_native() helper")
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
---

Changelog:

v2: - Added explanatory comment to the code and added check for the
native backlight presence, like was requested by Hans de Goede.

drivers/acpi/video_detect.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 0d9064a9804c..9cd8797d12bb 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -668,6 +668,11 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
{ },
};

+static bool google_cros_ec_present(void)
+{
+ return acpi_dev_found("GOOG0004");
+}
+
/*
* Determine which type of backlight interface to use on this system,
* First check cmdline, then dmi quirks, then do autodetect.
@@ -730,6 +735,13 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
return acpi_backlight_video;
}

+ /*
+ * Chromebooks that don't have backlight handle in ACPI table
+ * are supposed to use native backlight if it's available.
+ */
+ if (google_cros_ec_present() && native_available)
+ return acpi_backlight_native;
+
/* No ACPI video (old hw), use vendor specific fw methods. */
return acpi_backlight_vendor;
}
--
2.37.3
\
 
 \ /
  Last update: 2022-10-24 19:16    [W:0.051 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site