[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211222001127.3337471-3-rajatja@google.com>
Date: Tue, 21 Dec 2021 16:11:27 -0800
From: Rajat Jain <rajatja@...gle.com>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Hans de Goede <hdegoede@...hat.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Benson Leung <bleung@...omium.org>,
Henrique de Moraes Holschuh <hmh@....eng.br>,
Mark Gross <markgross@...nel.org>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
ibm-acpi-devel@...ts.sourceforge.net,
platform-driver-x86@...r.kernel.org, gwendal@...gle.com,
seanpaul@...gle.com, marcheu@...gle.com, dtor@...gle.com
Cc: Rajat Jain <rajatja@...gle.com>, rajatxjain@...il.com
Subject: [PATCH v4 3/3] drm/privacy_screen_x86: Add entry for ChromeOS privacy-screen
Add a static entry in the x86 table, to detect and wait for
privacy-screen on some ChromeOS platforms.
Please note that this means that if CONFIG_CHROMEOS_PRIVACY_SCREEN is
enabled, and if "GOOG0010" device is found in ACPI, then the i915 probe
shall return EPROBE_DEFER until a platform driver actually registers the
privacy-screen: https://hansdegoede.livejournal.com/25948.html
Signed-off-by: Rajat Jain <rajatja@...gle.com>
---
v4: * Simplify the detect_chromeos_privacy_screen() function
* Don't change the existing print statement
v3: * Remove the pr_info() from detect_chromeos_privacy_screen(), instead
enhance the one already present in drm_privacy_screen_lookup_init()
v2: * Use #if instead of #elif
* Reorder the patches in the series.
* Rebased on drm-tip
drivers/gpu/drm/drm_privacy_screen_x86.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/gpu/drm/drm_privacy_screen_x86.c b/drivers/gpu/drm/drm_privacy_screen_x86.c
index a2cafb294ca6..88802cd7a1ee 100644
--- a/drivers/gpu/drm/drm_privacy_screen_x86.c
+++ b/drivers/gpu/drm/drm_privacy_screen_x86.c
@@ -47,6 +47,13 @@ static bool __init detect_thinkpad_privacy_screen(void)
}
#endif
+#if IS_ENABLED(CONFIG_CHROMEOS_PRIVACY_SCREEN)
+static bool __init detect_chromeos_privacy_screen(void)
+{
+ return acpi_dev_present("GOOG0010", NULL, -1);
+}
+#endif
+
static const struct arch_init_data arch_init_data[] __initconst = {
#if IS_ENABLED(CONFIG_THINKPAD_ACPI)
{
@@ -58,6 +65,16 @@ static const struct arch_init_data arch_init_data[] __initconst = {
.detect = detect_thinkpad_privacy_screen,
},
#endif
+#if IS_ENABLED(CONFIG_CHROMEOS_PRIVACY_SCREEN)
+ {
+ .lookup = {
+ .dev_id = NULL,
+ .con_id = NULL,
+ .provider = "privacy_screen-GOOG0010:00",
+ },
+ .detect = detect_chromeos_privacy_screen,
+ },
+#endif
};
void __init drm_privacy_screen_lookup_init(void)
--
2.34.1.307.g9b7440fafd-goog
Powered by blists - more mailing lists