aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2016-11-03 22:37:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-19 14:18:06 -0500
commit0e38a0b7acbb8d046c7312ae8cb1e98951934226 (patch)
treef0bd58e47a4f1c31a30abba6867288f73957c9b4
parentb4a69e3877ca10318a7a12296524e92a79a6eea3 (diff)
remoteproc: qcom_wcnss: Fix circular module dependency
commit 6de1a507c46bf22ed97043495b9ab96e4d5c213b upstream. The tie between the main WCNSS driver and the IRIS driver causes a circular dependency between the two modules. Neither part makes sense to have on their own so lets merge them into one module. For the sake of picking up the clock and regulator resources described in the iris of_node we need an associated struct device. But, to keep the size of the patch down we continue to represent the IRIS part as its own platform_driver, within the same module, rather than setting up a dummy device. Fixes: aed361adca9f ("remoteproc: qcom: Introduce WCNSS peripheral image loader") Reported-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/remoteproc/Kconfig5
-rw-r--r--drivers/remoteproc/Makefile5
-rw-r--r--drivers/remoteproc/qcom_wcnss.c25
-rw-r--r--drivers/remoteproc/qcom_wcnss.h2
-rw-r--r--drivers/remoteproc/qcom_wcnss_iris.c8
5 files changed, 29 insertions, 16 deletions
diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
index f396bfef5d42..5fcbefcb8636 100644
--- a/drivers/remoteproc/Kconfig
+++ b/drivers/remoteproc/Kconfig
@@ -91,17 +91,12 @@ config QCOM_Q6V5_PIL
91 Say y here to support the Qualcomm Peripherial Image Loader for the 91 Say y here to support the Qualcomm Peripherial Image Loader for the
92 Hexagon V5 based remote processors. 92 Hexagon V5 based remote processors.
93 93
94config QCOM_WCNSS_IRIS
95 tristate
96 depends on OF && ARCH_QCOM
97
98config QCOM_WCNSS_PIL 94config QCOM_WCNSS_PIL
99 tristate "Qualcomm WCNSS Peripheral Image Loader" 95 tristate "Qualcomm WCNSS Peripheral Image Loader"
100 depends on OF && ARCH_QCOM 96 depends on OF && ARCH_QCOM
101 depends on QCOM_SMEM 97 depends on QCOM_SMEM
102 select QCOM_MDT_LOADER 98 select QCOM_MDT_LOADER
103 select QCOM_SCM 99 select QCOM_SCM
104 select QCOM_WCNSS_IRIS
105 select REMOTEPROC 100 select REMOTEPROC
106 help 101 help
107 Say y here to support the Peripheral Image Loader for the Qualcomm 102 Say y here to support the Peripheral Image Loader for the Qualcomm
diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile
index 6dfb62ed643f..034b6f3563a7 100644
--- a/drivers/remoteproc/Makefile
+++ b/drivers/remoteproc/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_WKUP_M3_RPROC) += wkup_m3_rproc.o
13obj-$(CONFIG_DA8XX_REMOTEPROC) += da8xx_remoteproc.o 13obj-$(CONFIG_DA8XX_REMOTEPROC) += da8xx_remoteproc.o
14obj-$(CONFIG_QCOM_MDT_LOADER) += qcom_mdt_loader.o 14obj-$(CONFIG_QCOM_MDT_LOADER) += qcom_mdt_loader.o
15obj-$(CONFIG_QCOM_Q6V5_PIL) += qcom_q6v5_pil.o 15obj-$(CONFIG_QCOM_Q6V5_PIL) += qcom_q6v5_pil.o
16obj-$(CONFIG_QCOM_WCNSS_IRIS) += qcom_wcnss_iris.o 16obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o
17obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss.o 17qcom_wcnss_pil-y += qcom_wcnss.o
18qcom_wcnss_pil-y += qcom_wcnss_iris.o
18obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o 19obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o
diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index f5cedeaafba1..323b629474a6 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -143,7 +143,6 @@ void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss,
143 143
144 mutex_unlock(&wcnss->iris_lock); 144 mutex_unlock(&wcnss->iris_lock);
145} 145}
146EXPORT_SYMBOL_GPL(qcom_wcnss_assign_iris);
147 146
148static int wcnss_load(struct rproc *rproc, const struct firmware *fw) 147static int wcnss_load(struct rproc *rproc, const struct firmware *fw)
149{ 148{
@@ -619,6 +618,28 @@ static struct platform_driver wcnss_driver = {
619 }, 618 },
620}; 619};
621 620
622module_platform_driver(wcnss_driver); 621static int __init wcnss_init(void)
622{
623 int ret;
624
625 ret = platform_driver_register(&wcnss_driver);
626 if (ret)
627 return ret;
628
629 ret = platform_driver_register(&qcom_iris_driver);
630 if (ret)
631 platform_driver_unregister(&wcnss_driver);
632
633 return ret;
634}
635module_init(wcnss_init);
636
637static void __exit wcnss_exit(void)
638{
639 platform_driver_unregister(&qcom_iris_driver);
640 platform_driver_unregister(&wcnss_driver);
641}
642module_exit(wcnss_exit);
643
623MODULE_DESCRIPTION("Qualcomm Peripherial Image Loader for Wireless Subsystem"); 644MODULE_DESCRIPTION("Qualcomm Peripherial Image Loader for Wireless Subsystem");
624MODULE_LICENSE("GPL v2"); 645MODULE_LICENSE("GPL v2");
diff --git a/drivers/remoteproc/qcom_wcnss.h b/drivers/remoteproc/qcom_wcnss.h
index 9dc4a9fe41e1..25fb7f62a457 100644
--- a/drivers/remoteproc/qcom_wcnss.h
+++ b/drivers/remoteproc/qcom_wcnss.h
@@ -4,6 +4,8 @@
4struct qcom_iris; 4struct qcom_iris;
5struct qcom_wcnss; 5struct qcom_wcnss;
6 6
7extern struct platform_driver qcom_iris_driver;
8
7struct wcnss_vreg_info { 9struct wcnss_vreg_info {
8 const char * const name; 10 const char * const name;
9 int min_voltage; 11 int min_voltage;
diff --git a/drivers/remoteproc/qcom_wcnss_iris.c b/drivers/remoteproc/qcom_wcnss_iris.c
index f0ca24a8dd0b..05d6e175411a 100644
--- a/drivers/remoteproc/qcom_wcnss_iris.c
+++ b/drivers/remoteproc/qcom_wcnss_iris.c
@@ -94,14 +94,12 @@ disable_regulators:
94 94
95 return ret; 95 return ret;
96} 96}
97EXPORT_SYMBOL_GPL(qcom_iris_enable);
98 97
99void qcom_iris_disable(struct qcom_iris *iris) 98void qcom_iris_disable(struct qcom_iris *iris)
100{ 99{
101 clk_disable_unprepare(iris->xo_clk); 100 clk_disable_unprepare(iris->xo_clk);
102 regulator_bulk_disable(iris->num_vregs, iris->vregs); 101 regulator_bulk_disable(iris->num_vregs, iris->vregs);
103} 102}
104EXPORT_SYMBOL_GPL(qcom_iris_disable);
105 103
106static int qcom_iris_probe(struct platform_device *pdev) 104static int qcom_iris_probe(struct platform_device *pdev)
107{ 105{
@@ -174,7 +172,7 @@ static const struct of_device_id iris_of_match[] = {
174 {} 172 {}
175}; 173};
176 174
177static struct platform_driver wcnss_driver = { 175struct platform_driver qcom_iris_driver = {
178 .probe = qcom_iris_probe, 176 .probe = qcom_iris_probe,
179 .remove = qcom_iris_remove, 177 .remove = qcom_iris_remove,
180 .driver = { 178 .driver = {
@@ -182,7 +180,3 @@ static struct platform_driver wcnss_driver = {
182 .of_match_table = iris_of_match, 180 .of_match_table = iris_of_match,
183 }, 181 },
184}; 182};
185
186module_platform_driver(wcnss_driver);
187MODULE_DESCRIPTION("Qualcomm Wireless Subsystem Iris driver");
188MODULE_LICENSE("GPL v2");