MLK-23754-6 remoteproc: imx_rproc: make syscon optional
Make syscon optional, since i.MX8QM/QXP/7ULP not have SRC to control M4. But currently i.MX8QM/QXP/7ULP not added, so still check regmap when start/stop to avoid unhappy things. Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
eb225e1d92
commit
6d3a01497f
|
@ -162,6 +162,9 @@ static int imx_rproc_start(struct rproc *rproc)
|
|||
struct device *dev = priv->dev;
|
||||
int ret;
|
||||
|
||||
if (!priv->regmap)
|
||||
return -ENOTSUPP;
|
||||
|
||||
ret = regmap_update_bits(priv->regmap, dcfg->src_reg,
|
||||
dcfg->src_mask, dcfg->src_start);
|
||||
if (ret)
|
||||
|
@ -177,6 +180,9 @@ static int imx_rproc_stop(struct rproc *rproc)
|
|||
struct device *dev = priv->dev;
|
||||
int ret;
|
||||
|
||||
if (!priv->regmap)
|
||||
return -ENOTSUPP;
|
||||
|
||||
ret = regmap_update_bits(priv->regmap, dcfg->src_reg,
|
||||
dcfg->src_mask, dcfg->src_stop);
|
||||
if (ret)
|
||||
|
@ -323,9 +329,10 @@ static int imx_rproc_probe(struct platform_device *pdev)
|
|||
regmap = syscon_regmap_lookup_by_phandle(np, "syscon");
|
||||
if (IS_ERR(regmap)) {
|
||||
dev_err(dev, "failed to find syscon\n");
|
||||
return PTR_ERR(regmap);
|
||||
regmap = NULL;
|
||||
} else {
|
||||
regmap_attach_dev(dev, regmap, &config);
|
||||
}
|
||||
regmap_attach_dev(dev, regmap, &config);
|
||||
|
||||
/* set some other name then imx */
|
||||
rproc = rproc_alloc(dev, "imx-rproc", &imx_rproc_ops,
|
||||
|
|
Loading…
Reference in New Issue