diff mbox series

[v2,6/7] firmware: google: framebuffer: Add to module device table

Message ID 20240112131857.900734-7-nfraprado@collabora.com (mailing list archive)
State Superseded
Headers show
Series Allow coreboot modules to autoload and enable cbmem in the arm64 defconfig | expand

Commit Message

NĂ­colas F. R. A. Prado Jan. 12, 2024, 1:18 p.m. UTC
Create an id table and add it to the module device table to allow the
framebuffer driver to be automatically loaded when a matching device is
found.

Suggested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>

---

Changes in v2:
- Added this commit

 drivers/firmware/google/framebuffer-coreboot.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/firmware/google/framebuffer-coreboot.c b/drivers/firmware/google/framebuffer-coreboot.c
index 5c84bbebfef8..b33e9c6f97d7 100644
--- a/drivers/firmware/google/framebuffer-coreboot.c
+++ b/drivers/firmware/google/framebuffer-coreboot.c
@@ -13,6 +13,7 @@ 
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_data/simplefb.h>
 #include <linux/platform_device.h>
 
@@ -80,6 +81,12 @@  static void framebuffer_remove(struct coreboot_device *dev)
 	platform_device_unregister(pdev);
 }
 
+static const struct coreboot_device_id framebuffer_ids[] = {
+	{ .tag = CB_TAG_FRAMEBUFFER },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(coreboot, framebuffer_ids);
+
 static struct coreboot_driver framebuffer_driver = {
 	.probe = framebuffer_probe,
 	.remove = framebuffer_remove,