Skip to content

Commit 3ad60b4

Browse files
Paweł AnikielpH5
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Zabel <[email protected]>
1 parent c045ceb commit 3ad60b4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

drivers/reset/reset-socfpga.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,29 @@ void __init socfpga_reset_init(void)
9292
for_each_matching_node(np, socfpga_early_reset_dt_ids)
9393
a10_reset_init(np);
9494
}
95+
96+
/*
97+
* The early driver is problematic, because it doesn't register
98+
* itself as a driver. This causes certain device links to prevent
99+
* consumer devices from probing. The hacky solution is to register
100+
* an empty driver, whose only job is to attach itself to the reset
101+
* manager and call probe.
102+
*/
103+
static const struct of_device_id socfpga_reset_dt_ids[] = {
104+
{ .compatible = "altr,rst-mgr", },
105+
{ /* sentinel */ },
106+
};
107+
108+
static int reset_simple_probe(struct platform_device *pdev)
109+
{
110+
return 0;
111+
}
112+
113+
static struct platform_driver reset_socfpga_driver = {
114+
.probe = reset_simple_probe,
115+
.driver = {
116+
.name = "socfpga-reset",
117+
.of_match_table = socfpga_reset_dt_ids,
118+
},
119+
};
120+
builtin_platform_driver(reset_socfpga_driver);

0 commit comments

Comments
 (0)