提交 8e3f4d96 编写于 作者: S Srinivasa Rao Mandadapu 提交者: Zheng Zengkai

ASoC: qcom: Fix typo error in HDMI regmap config callbacks

stable inclusion
from stable-5.10.20
commit 9ac3137995154e30b1bf86d9661d11a6762dc969
bugzilla: 50608

--------------------------------

[ Upstream commit e681b1a6 ]

Had a typo in lpass platform driver that resulted in crash
during suspend/resume with an HDMI dongle connected.

The regmap read/write/volatile regesters validation callbacks in lpass-cpu
were using MI2S rdma_channels count instead of hdmi_rdma_channels.

This typo error causing to read registers from the regmap beyond the length
of the mapping created by ioremap().

This fix avoids the need for reducing number hdmi_rdma_channels,
which is done in
commit 7dfe20ee ("ASoC: qcom: Fix number of HDMI RDMA channels on sc7180").
So reverting the same.

Fixes: 7cb37b7b ("ASoC: qcom: Add support for lpass hdmi driver")
Signed-off-by: NSrinivasa Rao Mandadapu <srivasam@codeaurora.org>
Link: https://lore.kernel.org/r/20210202062727.22469-1-srivasam@codeaurora.orgReviewed-by: NStephen Boyd <swboyd@chromium.org>
Tested-by: NStephen Boyd <swboyd@chromium.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 b198e8f9
...@@ -594,7 +594,7 @@ static bool lpass_hdmi_regmap_writeable(struct device *dev, unsigned int reg) ...@@ -594,7 +594,7 @@ static bool lpass_hdmi_regmap_writeable(struct device *dev, unsigned int reg)
return true; return true;
} }
for (i = 0; i < v->rdma_channels; ++i) { for (i = 0; i < v->hdmi_rdma_channels; ++i) {
if (reg == LPAIF_HDMI_RDMACTL_REG(v, i)) if (reg == LPAIF_HDMI_RDMACTL_REG(v, i))
return true; return true;
if (reg == LPAIF_HDMI_RDMABASE_REG(v, i)) if (reg == LPAIF_HDMI_RDMABASE_REG(v, i))
...@@ -640,7 +640,7 @@ static bool lpass_hdmi_regmap_readable(struct device *dev, unsigned int reg) ...@@ -640,7 +640,7 @@ static bool lpass_hdmi_regmap_readable(struct device *dev, unsigned int reg)
if (reg == LPASS_HDMITX_APP_IRQSTAT_REG(v)) if (reg == LPASS_HDMITX_APP_IRQSTAT_REG(v))
return true; return true;
for (i = 0; i < v->rdma_channels; ++i) { for (i = 0; i < v->hdmi_rdma_channels; ++i) {
if (reg == LPAIF_HDMI_RDMACTL_REG(v, i)) if (reg == LPAIF_HDMI_RDMACTL_REG(v, i))
return true; return true;
if (reg == LPAIF_HDMI_RDMABASE_REG(v, i)) if (reg == LPAIF_HDMI_RDMABASE_REG(v, i))
...@@ -667,7 +667,7 @@ static bool lpass_hdmi_regmap_volatile(struct device *dev, unsigned int reg) ...@@ -667,7 +667,7 @@ static bool lpass_hdmi_regmap_volatile(struct device *dev, unsigned int reg)
if (reg == LPASS_HDMI_TX_LEGACY_ADDR(v)) if (reg == LPASS_HDMI_TX_LEGACY_ADDR(v))
return true; return true;
for (i = 0; i < v->rdma_channels; ++i) { for (i = 0; i < v->hdmi_rdma_channels; ++i) {
if (reg == LPAIF_HDMI_RDMACURR_REG(v, i)) if (reg == LPAIF_HDMI_RDMACURR_REG(v, i))
return true; return true;
} }
...@@ -817,7 +817,7 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev) ...@@ -817,7 +817,7 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
} }
lpass_hdmi_regmap_config.max_register = LPAIF_HDMI_RDMAPER_REG(variant, lpass_hdmi_regmap_config.max_register = LPAIF_HDMI_RDMAPER_REG(variant,
variant->hdmi_rdma_channels); variant->hdmi_rdma_channels - 1);
drvdata->hdmiif_map = devm_regmap_init_mmio(dev, drvdata->hdmiif, drvdata->hdmiif_map = devm_regmap_init_mmio(dev, drvdata->hdmiif,
&lpass_hdmi_regmap_config); &lpass_hdmi_regmap_config);
if (IS_ERR(drvdata->hdmiif_map)) { if (IS_ERR(drvdata->hdmiif_map)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册