remoteproc: qcom_wcnss: Fix circular module dependency

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: aed361adca ("remoteproc: qcom: Introduce WCNSS peripheral image loader")
Reported-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Bjorn Andersson 2016-11-03 19:37:25 -07:00
parent cda8529346
commit 6de1a507c4
5 changed files with 29 additions and 16 deletions

View File

@ -91,17 +91,12 @@ config QCOM_Q6V5_PIL
Say y here to support the Qualcomm Peripherial Image Loader for the Say y here to support the Qualcomm Peripherial Image Loader for the
Hexagon V5 based remote processors. Hexagon V5 based remote processors.
config QCOM_WCNSS_IRIS
tristate
depends on OF && ARCH_QCOM
config QCOM_WCNSS_PIL config QCOM_WCNSS_PIL
tristate "Qualcomm WCNSS Peripheral Image Loader" tristate "Qualcomm WCNSS Peripheral Image Loader"
depends on OF && ARCH_QCOM depends on OF && ARCH_QCOM
depends on QCOM_SMEM depends on QCOM_SMEM
select QCOM_MDT_LOADER select QCOM_MDT_LOADER
select QCOM_SCM select QCOM_SCM
select QCOM_WCNSS_IRIS
select REMOTEPROC select REMOTEPROC
help help
Say y here to support the Peripheral Image Loader for the Qualcomm Say y here to support the Peripheral Image Loader for the Qualcomm

View File

@ -14,6 +14,7 @@ obj-$(CONFIG_WKUP_M3_RPROC) += wkup_m3_rproc.o
obj-$(CONFIG_DA8XX_REMOTEPROC) += da8xx_remoteproc.o obj-$(CONFIG_DA8XX_REMOTEPROC) += da8xx_remoteproc.o
obj-$(CONFIG_QCOM_MDT_LOADER) += qcom_mdt_loader.o obj-$(CONFIG_QCOM_MDT_LOADER) += qcom_mdt_loader.o
obj-$(CONFIG_QCOM_Q6V5_PIL) += qcom_q6v5_pil.o obj-$(CONFIG_QCOM_Q6V5_PIL) += qcom_q6v5_pil.o
obj-$(CONFIG_QCOM_WCNSS_IRIS) += qcom_wcnss_iris.o obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o
obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss.o qcom_wcnss_pil-y += qcom_wcnss.o
qcom_wcnss_pil-y += qcom_wcnss_iris.o
obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o

View File

@ -148,7 +148,6 @@ void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss,
mutex_unlock(&wcnss->iris_lock); mutex_unlock(&wcnss->iris_lock);
} }
EXPORT_SYMBOL_GPL(qcom_wcnss_assign_iris);
static int wcnss_load(struct rproc *rproc, const struct firmware *fw) static int wcnss_load(struct rproc *rproc, const struct firmware *fw)
{ {
@ -647,6 +646,28 @@ static struct platform_driver wcnss_driver = {
}, },
}; };
module_platform_driver(wcnss_driver); static int __init wcnss_init(void)
{
int ret;
ret = platform_driver_register(&wcnss_driver);
if (ret)
return ret;
ret = platform_driver_register(&qcom_iris_driver);
if (ret)
platform_driver_unregister(&wcnss_driver);
return ret;
}
module_init(wcnss_init);
static void __exit wcnss_exit(void)
{
platform_driver_unregister(&qcom_iris_driver);
platform_driver_unregister(&wcnss_driver);
}
module_exit(wcnss_exit);
MODULE_DESCRIPTION("Qualcomm Peripherial Image Loader for Wireless Subsystem"); MODULE_DESCRIPTION("Qualcomm Peripherial Image Loader for Wireless Subsystem");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");

View File

@ -4,6 +4,8 @@
struct qcom_iris; struct qcom_iris;
struct qcom_wcnss; struct qcom_wcnss;
extern struct platform_driver qcom_iris_driver;
struct wcnss_vreg_info { struct wcnss_vreg_info {
const char * const name; const char * const name;
int min_voltage; int min_voltage;

View File

@ -94,14 +94,12 @@ disable_regulators:
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(qcom_iris_enable);
void qcom_iris_disable(struct qcom_iris *iris) void qcom_iris_disable(struct qcom_iris *iris)
{ {
clk_disable_unprepare(iris->xo_clk); clk_disable_unprepare(iris->xo_clk);
regulator_bulk_disable(iris->num_vregs, iris->vregs); regulator_bulk_disable(iris->num_vregs, iris->vregs);
} }
EXPORT_SYMBOL_GPL(qcom_iris_disable);
static int qcom_iris_probe(struct platform_device *pdev) static int qcom_iris_probe(struct platform_device *pdev)
{ {
@ -175,7 +173,7 @@ static const struct of_device_id iris_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, iris_of_match); MODULE_DEVICE_TABLE(of, iris_of_match);
static struct platform_driver wcnss_driver = { struct platform_driver qcom_iris_driver = {
.probe = qcom_iris_probe, .probe = qcom_iris_probe,
.remove = qcom_iris_remove, .remove = qcom_iris_remove,
.driver = { .driver = {
@ -183,7 +181,3 @@ static struct platform_driver wcnss_driver = {
.of_match_table = iris_of_match, .of_match_table = iris_of_match,
}, },
}; };
module_platform_driver(wcnss_driver);
MODULE_DESCRIPTION("Qualcomm Wireless Subsystem Iris driver");
MODULE_LICENSE("GPL v2");