Commit 4b48921a authored by Bjorn Andersson's avatar Bjorn Andersson
Browse files

remoteproc: qcom: Use common SMD edge handler



Call the common SMD edge handler to instantiate subdevices to bring
associated SMD edges up and down as the remoteproc is started and
stopped.

Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent b90fcfcb
......@@ -76,6 +76,7 @@ config QCOM_ADSP_PIL
depends on OF && ARCH_QCOM
depends on REMOTEPROC
depends on QCOM_SMEM
depends on QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n)
select MFD_SYSCON
select QCOM_MDT_LOADER
select QCOM_RPROC_COMMON
......@@ -92,6 +93,7 @@ config QCOM_Q6V5_PIL
depends on OF && ARCH_QCOM
depends on QCOM_SMEM
depends on REMOTEPROC
depends on QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n)
select MFD_SYSCON
select QCOM_RPROC_COMMON
select QCOM_SCM
......
......@@ -70,6 +70,8 @@ struct qcom_adsp {
phys_addr_t mem_reloc;
void *mem_region;
size_t mem_size;
struct qcom_rproc_subdev smd_subdev;
};
static int adsp_load(struct rproc *rproc, const struct firmware *fw)
......@@ -404,6 +406,8 @@ static int adsp_probe(struct platform_device *pdev)
goto free_rproc;
}
qcom_add_smd_subdev(rproc, &adsp->smd_subdev);
ret = rproc_add(rproc);
if (ret)
goto free_rproc;
......@@ -422,6 +426,8 @@ static int adsp_remove(struct platform_device *pdev)
qcom_smem_state_put(adsp->state);
rproc_del(adsp->rproc);
qcom_remove_smd_subdev(adsp->rproc, &adsp->smd_subdev);
rproc_free(adsp->rproc);
return 0;
......
......@@ -151,6 +151,8 @@ struct q6v5 {
phys_addr_t mpss_reloc;
void *mpss_region;
size_t mpss_size;
struct qcom_rproc_subdev smd_subdev;
};
static int q6v5_regulator_init(struct device *dev, struct reg_info *regs,
......@@ -1035,6 +1037,8 @@ static int q6v5_probe(struct platform_device *pdev)
goto free_rproc;
}
qcom_add_smd_subdev(rproc, &qproc->smd_subdev);
ret = rproc_add(rproc);
if (ret)
goto free_rproc;
......@@ -1052,6 +1056,8 @@ static int q6v5_remove(struct platform_device *pdev)
struct q6v5 *qproc = platform_get_drvdata(pdev);
rproc_del(qproc->rproc);
qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
rproc_free(qproc->rproc);
return 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment