summaryrefslogtreecommitdiff
path: root/include/linux/platform_data/cros_usbpd_notify.h
diff options
context:
space:
mode:
authorJon Flatley <jflat@chromium.org>2020-01-24 15:18:32 -0800
committerBenson Leung <bleung@chromium.org>2020-02-10 10:14:19 -0800
commitec2daf6e33f9f9113ba085b6ff88592907b6f1ce (patch)
treec4da6c2eeff46545c25d541228f4fb56c81d9c57 /include/linux/platform_data/cros_usbpd_notify.h
parentbb6d3fb354c5ee8d6bde2d576eb7220ea09862b9 (diff)
platform: chrome: Add cros-usbpd-notify driver
ChromiumOS uses ACPI device with HID "GOOG0003" for power delivery related events. The existing cros-usbpd-charger driver relies on these events without ever actually receiving them on ACPI platforms. This is because in the ChromeOS kernel trees, the GOOG0003 device is owned by an ACPI driver that offers firmware updates to USB-C chargers. Introduce a new platform driver under cros-ec, the ChromeOS embedded controller, that handles these PD events and dispatches them appropriately over a notifier chain to all drivers that use them. On platforms that don't have the ACPI device defined, the driver gets instantiated for ECs which support the EC_FEATURE_USB_PD feature bit, and the notification events will get delivered using the MKBP event handling mechanism. Co-Developed-by: Prashant Malani <pmalani@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Benson Leung <bleung@chromium.org> Signed-off-by: Jon Flatley <jflat@chromium.org> Signed-off-by: Prashant Malani <pmalani@chromium.org> Acked-By: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Benson Leung <bleung@chromium.org>
Diffstat (limited to 'include/linux/platform_data/cros_usbpd_notify.h')
-rw-r--r--include/linux/platform_data/cros_usbpd_notify.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/platform_data/cros_usbpd_notify.h b/include/linux/platform_data/cros_usbpd_notify.h
new file mode 100644
index 000000000000..4f2791722b6d
--- /dev/null
+++ b/include/linux/platform_data/cros_usbpd_notify.h
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * ChromeOS EC Power Delivery Notifier Driver
+ *
+ * Copyright 2020 Google LLC
+ */
+
+#ifndef __LINUX_PLATFORM_DATA_CROS_USBPD_NOTIFY_H
+#define __LINUX_PLATFORM_DATA_CROS_USBPD_NOTIFY_H
+
+#include <linux/notifier.h>
+
+int cros_usbpd_register_notify(struct notifier_block *nb);
+
+void cros_usbpd_unregister_notify(struct notifier_block *nb);
+
+#endif /* __LINUX_PLATFORM_DATA_CROS_USBPD_NOTIFY_H */