remoteproc: qcom_q6v5_pas: Create platform device for BAM-DMUX

Some Qualcomm SoCs using the generic PAS remoteproc driver (e.g.
Shikra) implement the BAM-DMUX protocol on the modem remoteproc to
expose network data channels. The hardware/firmware resources
required by the BAM-DMUX driver are described in an extra device
tree node below the modem remoteproc, with the compatible
"qcom,bam-dmux".

qcom_q6v5_mss.c already creates a platform device for this node
(commit 59983c74fc ("remoteproc: qcom_q6v5_mss: Create platform
device for BAM-DMUX")), but qcom_q6v5_pas.c has no equivalent logic,
so the bam-dmux node never probes on SoCs handled by this driver.

Mirror the qcom_q6v5_mss.c approach: create a platform device
specifically for the "qcom,bam-dmux" child node on probe, and
destroy it on remove. of_get_compatible_child() returns NULL when
the node is absent, and of_platform_device_create()/of_node_put()
are NULL-safe, so this is a no-op for the many PAS-based SoCs that
have no bam-dmux child.

Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260711-qcom-q6v5-pas-bam-dmux-v1-1-1e9231143b79@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
Vishnu Santhosh 2026-07-11 09:34:18 +05:30 committed by Bjorn Andersson
parent 0ec167625b
commit e1de7da254

View File

@ -16,6 +16,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
@ -117,6 +118,7 @@ struct qcom_pas {
struct qcom_rproc_pdm pdm_subdev;
struct qcom_rproc_ssr ssr_subdev;
struct qcom_sysmon *sysmon;
struct platform_device *bam_dmux;
struct qcom_pas_context *pas_ctx;
struct qcom_pas_context *dtb_pas_ctx;
@ -801,6 +803,7 @@ static int qcom_pas_probe(struct platform_device *pdev)
const struct qcom_pas_data *desc;
struct qcom_pas *pas;
struct rproc *rproc;
struct device_node *node;
const char *fw_name, *dtb_fw_name = NULL;
const struct rproc_ops *ops = &qcom_pas_ops;
int ret;
@ -926,6 +929,10 @@ static int qcom_pas_probe(struct platform_device *pdev)
if (ret)
goto remove_ssr_sysmon;
node = of_get_compatible_child(pdev->dev.of_node, "qcom,bam-dmux");
pas->bam_dmux = of_platform_device_create(node, NULL, &pdev->dev);
of_node_put(node);
return 0;
remove_ssr_sysmon:
@ -950,6 +957,9 @@ static void qcom_pas_remove(struct platform_device *pdev)
{
struct qcom_pas *pas = platform_get_drvdata(pdev);
if (pas->bam_dmux)
of_platform_device_destroy(&pas->bam_dmux->dev, NULL);
rproc_del(pas->rproc);
qcom_q6v5_deinit(&pas->q6v5);