From 1e140df0496541c473e5d40b0da5d2d626b2e343 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Mon, 24 Jul 2017 22:56:43 -0700 Subject: remoteproc: qcom: Add support for SSR notifications This adds the remoteproc part of subsystem restart, which is responsible for emitting notifications to other processors in the system about a dying remoteproc instance. These notifications are propagated to the various communication systems in the various remote processors to shut down communication links that was left in a dangling state as the remoteproc was stopped (or crashed). Signed-off-by: Bjorn Andersson --- drivers/remoteproc/qcom_adsp_pil.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/remoteproc/qcom_adsp_pil.c') diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers/remoteproc/qcom_adsp_pil.c index 49fe2f807e1d..a41d399766fd 100644 --- a/drivers/remoteproc/qcom_adsp_pil.c +++ b/drivers/remoteproc/qcom_adsp_pil.c @@ -38,6 +38,7 @@ struct adsp_data { const char *firmware_name; int pas_id; bool has_aggre2_clk; + const char *ssr_name; }; struct qcom_adsp { @@ -72,6 +73,7 @@ struct qcom_adsp { size_t mem_size; struct qcom_rproc_subdev smd_subdev; + struct qcom_rproc_ssr ssr_subdev; }; static int adsp_load(struct rproc *rproc, const struct firmware *fw) @@ -402,6 +404,7 @@ static int adsp_probe(struct platform_device *pdev) } qcom_add_smd_subdev(rproc, &adsp->smd_subdev); + qcom_add_ssr_subdev(rproc, &adsp->ssr_subdev, desc->ssr_name); ret = rproc_add(rproc); if (ret) @@ -423,6 +426,7 @@ static int adsp_remove(struct platform_device *pdev) rproc_del(adsp->rproc); qcom_remove_smd_subdev(adsp->rproc, &adsp->smd_subdev); + qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev); rproc_free(adsp->rproc); return 0; @@ -433,6 +437,7 @@ static const struct adsp_data adsp_resource_init = { .firmware_name = "adsp.mdt", .pas_id = 1, .has_aggre2_clk = false, + .ssr_name = "lpass", }; static const struct adsp_data slpi_resource_init = { @@ -440,6 +445,7 @@ static const struct adsp_data slpi_resource_init = { .firmware_name = "slpi.mdt", .pas_id = 12, .has_aggre2_clk = true, + .ssr_name = "dsps", }; static const struct of_device_id adsp_of_match[] = { -- cgit v1.2.3 From c76929b3c695305c1055d7e7c935d35b5fd275be Mon Sep 17 00:00:00 2001 From: Himanshu Jha Date: Tue, 29 Aug 2017 19:13:18 +0530 Subject: remoteproc: qcom: Use PTR_ERR_OR_ZERO Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Signed-off-by: Himanshu Jha Signed-off-by: Bjorn Andersson --- drivers/remoteproc/qcom_adsp_pil.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/remoteproc/qcom_adsp_pil.c') diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers/remoteproc/qcom_adsp_pil.c index a41d399766fd..d01a8daf948a 100644 --- a/drivers/remoteproc/qcom_adsp_pil.c +++ b/drivers/remoteproc/qcom_adsp_pil.c @@ -268,10 +268,7 @@ static int adsp_init_regulator(struct qcom_adsp *adsp) regulator_set_load(adsp->cx_supply, 100000); adsp->px_supply = devm_regulator_get(adsp->dev, "px"); - if (IS_ERR(adsp->px_supply)) - return PTR_ERR(adsp->px_supply); - - return 0; + return PTR_ERR_OR_ZERO(adsp->px_supply); } static int adsp_request_irq(struct qcom_adsp *adsp, -- cgit v1.2.3