[PATCH v3, 7/8] soc: mediatek: mmsys: Use function call for setting mmsys ovl mout register
Chun-Kuang Hu
chunkuang.hu at kernel.org
Mon Dec 28 11:38:05 EST 2020
Hi, Yongqiang:
Yongqiang Niu <yongqiang.niu at mediatek.com> 於 2020年12月28日 週一 下午4:38寫道:
>
> Use function call for setting mmsys ovl mout register
>
> Signed-off-by: Yongqiang Niu <yongqiang.niu at mediatek.com>
> ---
> drivers/soc/mediatek/mmsys/mtk-mmsys.c | 20 ++++++++++++++++++++
> include/linux/soc/mediatek/mtk-mmsys.h | 3 +++
> 2 files changed, 23 insertions(+)
>
> diff --git a/drivers/soc/mediatek/mmsys/mtk-mmsys.c b/drivers/soc/mediatek/mmsys/mtk-mmsys.c
> index dae665b..ea36a11 100644
> --- a/drivers/soc/mediatek/mmsys/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mmsys/mtk-mmsys.c
> @@ -74,6 +74,17 @@ void mtk_mmsys_ddp_connect(struct device *dev,
> reg = readl_relaxed(mmsys->regs + addr) | value;
> writel_relaxed(reg, mmsys->regs + addr);
> }
> +
> + if (!funcs->ovl_mout_en)
> + return;
> +
> + if (funcs->ovl_mout_en) {
> + value = funcs->ovl_mout_en(cur, next, &addr);
> + if (value) {
> + reg = readl_relaxed(mmsys->regs + addr) | value;
> + writel_relaxed(reg, mmsys->regs + addr);
> + }
> + }
mtk_mmsys_ddp_mout_en() could write register inside it rather than
return value and write register in mtk_mmsys_ddp_connect(). So you
could do ovl_mout_en() in mtk_mmsys_ddp_mout_en().
Regards,
Chun-Kuang.
> }
> EXPORT_SYMBOL_GPL(mtk_mmsys_ddp_connect);
>
> @@ -99,6 +110,15 @@ void mtk_mmsys_ddp_disconnect(struct device *dev,
> reg = readl_relaxed(mmsys->regs + addr) & ~value;
> writel_relaxed(reg, mmsys->regs + addr);
> }
> +
> + if (!funcs->ovl_mout_en)
> + return;
> +
> + value = funcs->ovl_mout_en(cur, next, &addr);
> + if (value) {
> + reg = readl_relaxed(mmsys->regs + addr) & ~value;
> + writel_relaxed(reg, mmsys->regs + addr);
> + }
> }
> EXPORT_SYMBOL_GPL(mtk_mmsys_ddp_disconnect);
>
> diff --git a/include/linux/soc/mediatek/mtk-mmsys.h b/include/linux/soc/mediatek/mtk-mmsys.h
> index aa4f60e..220203d 100644
> --- a/include/linux/soc/mediatek/mtk-mmsys.h
> +++ b/include/linux/soc/mediatek/mtk-mmsys.h
> @@ -49,6 +49,9 @@ struct mtk_mmsys_conn_funcs {
> u32 (*mout_en)(enum mtk_ddp_comp_id cur,
> enum mtk_ddp_comp_id next,
> unsigned int *addr);
> + u32 (*ovl_mout_en)(enum mtk_ddp_comp_id cur,
> + enum mtk_ddp_comp_id next,
> + unsigned int *addr);
> u32 (*sel_in)(enum mtk_ddp_comp_id cur,
> enum mtk_ddp_comp_id next,
> unsigned int *addr);
> --
> 1.8.1.1.dirty
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
More information about the Linux-mediatek
mailing list