Skip to content
Permalink
Browse files
drm/simpledrm: Bind to OF framebuffers in /chosen
This matches the simplefb behavior; these nodes are not matched by the
standard OF machinery.

Signed-off-by: Hector Martin <marcan@marcan.st>
  • Loading branch information
marcan committed Nov 17, 2021
1 parent c96d6ca commit 9b33c21a89cb394a38274b1e8e8fba65b1cc6ad8
Showing 1 changed file with 17 additions and 0 deletions.
@@ -2,6 +2,7 @@

#include <linux/clk.h>
#include <linux/of_clk.h>
#include <linux/of_platform.h>
#include <linux/platform_data/simplefb.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
@@ -897,5 +898,21 @@ static struct platform_driver simpledrm_platform_driver = {

module_platform_driver(simpledrm_platform_driver);

static int __init simplefb_init(void)
{
struct device_node *np;

if (IS_ENABLED(CONFIG_OF_ADDRESS) && of_chosen) {
for_each_child_of_node(of_chosen, np) {
if (of_device_is_compatible(np, "simple-framebuffer"))
of_platform_device_create(np, NULL, NULL);
}
}

return 0;
}

fs_initcall(simplefb_init);

MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL v2");

0 comments on commit 9b33c21

Please sign in to comment.