summaryrefslogtreecommitdiff
path: root/drivers/reset/reset-socfpga.c
diff options
context:
space:
mode:
authorPaweł Anikiel <pan@semihalf.com>2021-09-20 14:41:41 +0200
committerPhilipp Zabel <p.zabel@pengutronix.de>2021-10-05 12:23:16 +0200
commit3ad60b4b3570937f3278509fe6797a5093ce53f8 (patch)
treed6a15cc3e8570183337bbc94e1300a9d66391649 /drivers/reset/reset-socfpga.c
parentc045ceb5a145d2a9a4bf33cbc55185ddf99f60ab (diff)
reset: socfpga: add empty driver allowing consumers to probe
The early reset driver doesn't ever probe, which causes consuming devices to be unable to probe. Add an empty driver to set this device as available, allowing consumers to probe. Signed-off-by: Paweł Anikiel <pan@semihalf.com> Link: https://lore.kernel.org/r/20210920124141.1166544-4-pan@semihalf.com Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/reset/reset-socfpga.c')
-rw-r--r--drivers/reset/reset-socfpga.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c
index 2a72f861f798..8c6492e5693c 100644
--- a/drivers/reset/reset-socfpga.c
+++ b/drivers/reset/reset-socfpga.c
@@ -92,3 +92,29 @@ void __init socfpga_reset_init(void)
for_each_matching_node(np, socfpga_early_reset_dt_ids)
a10_reset_init(np);
}
+
+/*
+ * The early driver is problematic, because it doesn't register
+ * itself as a driver. This causes certain device links to prevent
+ * consumer devices from probing. The hacky solution is to register
+ * an empty driver, whose only job is to attach itself to the reset
+ * manager and call probe.
+ */
+static const struct of_device_id socfpga_reset_dt_ids[] = {
+ { .compatible = "altr,rst-mgr", },
+ { /* sentinel */ },
+};
+
+static int reset_simple_probe(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static struct platform_driver reset_socfpga_driver = {
+ .probe = reset_simple_probe,
+ .driver = {
+ .name = "socfpga-reset",
+ .of_match_table = socfpga_reset_dt_ids,
+ },
+};
+builtin_platform_driver(reset_socfpga_driver);