summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Wilczynski <m.wilczynski@samsung.com>2024-08-22 09:42:17 +0200
committerMichal Wilczynski <m.wilczynski@samsung.com>2024-08-22 13:53:40 +0200
commit9e8d2a5afe95d900aad1f6cbf62f7aad7fc583ea (patch)
tree0a1a28afd508dc4441090d27dd95e3f499fd5109
parentbd58ea7ee669b5113fd7f8a8667b952e6fcea3fe (diff)
downloadlinux-riscv-9e8d2a5afe95d900aad1f6cbf62f7aad7fc583ea.tar.gz
linux-riscv-9e8d2a5afe95d900aad1f6cbf62f7aad7fc583ea.tar.bz2
linux-riscv-9e8d2a5afe95d900aad1f6cbf62f7aad7fc583ea.zip
pinctrl: single: Add hack to prevent gpio driver failure
The pinctrl driver must finish before the gpio probe starts. This is because as for now, the k1-x gpio driver doesn't handle deferred probe correctly. It can be fixed by registering pinctrl-single in postcore_initcall. This way the pinctrl will always finish before gpio starts. Ported from [1]. [1] - https://github.com/BPI-SINOVOIP/pi-linux.git Change-Id: Ib748db78932829c0eaaf074e51a9603b7708c1d5 Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
-rw-r--r--drivers/pinctrl/pinctrl-single.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 461a7c02d4a3..fd542eadf82b 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1993,7 +1993,22 @@ static struct platform_driver pcs_driver = {
#endif
};
+
+#ifdef CONFIG_ARCH_SPACEMIT
+static int __init pcs_driver_init(void)
+{
+ return platform_driver_register(&pcs_driver);
+}
+postcore_initcall(pcs_driver_init);
+
+static void __exit pcs_driver_exit(void)
+{
+ platform_driver_unregister(&pcs_driver);
+}
+module_exit(pcs_driver_exit);
+#else
module_platform_driver(pcs_driver);
+#endif
MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
MODULE_DESCRIPTION("One-register-per-pin type device tree based pinctrl driver");