diff mbox series

[1/2] drm/privacy_screen_x86: Add entry for ChromeOS privacy-screen

Message ID 20211210201144.1975655-1-rajatja@google.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/privacy_screen_x86: Add entry for ChromeOS privacy-screen | expand

Commit Message

Rajat Jain Dec. 10, 2021, 8:11 p.m. UTC
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@google.com>
---
This patch is rebased on top of linux-next/master

 drivers/gpu/drm/drm_privacy_screen_x86.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_privacy_screen_x86.c b/drivers/gpu/drm/drm_privacy_screen_x86.c
index a2cafb294ca6..3728870a98e7 100644
--- a/drivers/gpu/drm/drm_privacy_screen_x86.c
+++ b/drivers/gpu/drm/drm_privacy_screen_x86.c
@@ -45,6 +45,17 @@  static bool __init detect_thinkpad_privacy_screen(void)
 
 	return (output & 0x10000) ? true : false;
 }
+#elif IS_ENABLED(CONFIG_CHROMEOS_PRIVACY_SCREEN)
+
+static bool __init detect_chromeos_privacy_screen(void)
+{
+	if (!acpi_dev_present("GOOG0010", NULL, -1))
+		return false;
+
+	pr_info("%s: Need to wait for ChromeOS privacy-screen", __func__);
+	return true;
+
+}
 #endif
 
 static const struct arch_init_data arch_init_data[] __initconst = {
@@ -57,6 +68,15 @@  static const struct arch_init_data arch_init_data[] __initconst = {
 		},
 		.detect = detect_thinkpad_privacy_screen,
 	},
+#elif IS_ENABLED(CONFIG_CHROMEOS_PRIVACY_SCREEN)
+	{
+		.lookup = {
+			.dev_id = NULL,
+			.con_id = NULL,
+			.provider = "privacy_screen-GOOG0010:00",
+		},
+		.detect = detect_chromeos_privacy_screen,
+	},
 #endif
 };