[PATCH v14 09/12] soc: mediatek: add mtk-mutex support for mt8195 vdosys0
Jason-JH Lin
jason-jh.lin at mediatek.com
Tue Jan 25 20:43:18 PST 2022
Hi CK,
Thanks for the reviews.
On Mon, 2022-01-24 at 17:13 +0800, CK Hu wrote:
> Hi, Jason:
>
> On Fri, 2022-01-07 at 18:14 +0800, jason-jh.lin wrote:
> > Add mtk-mutex support for mt8195 vdosys0.
> >
> > Signed-off-by: jason-jh.lin <jason-jh.lin at mediatek.com>
> > Acked-by: AngeloGioacchino Del Regno <
> > angelogioacchino.delregno at collabora.com>
> > ---
> > This patch is base on [1]
> > [1] Add mmsys and mutex support for MDP
> > -
> >
https://patchwork.kernel.org/project/linux-mediatek/cover/20220104091712.25670-1-moudy.ho@mediatek.com/
> > ---
> > drivers/soc/mediatek/mtk-mutex.c | 95
> > +++++++++++++++++++++++++++++++-
> > 1 file changed, 92 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/soc/mediatek/mtk-mutex.c
> > b/drivers/soc/mediatek/mtk-mutex.c
> > index 615c42260a50..89daab7e6863 100644
> > --- a/drivers/soc/mediatek/mtk-mutex.c
> > +++ b/drivers/soc/mediatek/mtk-mutex.c
> > @@ -21,6 +21,9 @@
> > #define MT8183_MUTEX0_MOD0 0x30
> > #define MT8183_MUTEX0_SOF0 0x2c
[snip]
> >
> > +static const unsigned int mt8195_mutex_sof[DDP_MUTEX_SOF_MAX] = {
> > + [MUTEX_SOF_SINGLE_MODE] = MUTEX_SOF_SINGLE_MODE,
> > + [MUTEX_SOF_DSI0] = MT8195_MUTEX_SOF_DSI0 |
> > MT8195_MUTEX_EOF_DSI0,
> > + [MUTEX_SOF_DSI1] = MT8195_MUTEX_SOF_DSI1 |
> > MT8195_MUTEX_EOF_DSI1,
> > + [MUTEX_SOF_DPI0] = MT8195_MUTEX_SOF_DPI0 |
> > MT8195_MUTEX_EOF_DPI0,
> > + [MUTEX_SOF_DPI1] = MT8195_MUTEX_SOF_DPI1 |
> > MT8195_MUTEX_EOF_DPI1,
> > + [MUTEX_SOF_DP_INTF0] =
> > + MT8195_MUTEX_SOF_DP_INTF0 | MT8195_MUTEX_EOF_DP_INTF0,
>
> Why add EOF? Add comment for this.
>
> Regards,
> CK
>
OK, I' ll add this comment:
/*
* To support refresh mode(video mode), DISP_REG_MUTEX_SOF should
* select the EOF source and configure the EOF plus timing from the
* module that provides the timing signal.
* So that MUTEX can not only send a STREAM_DONE event to GCE
* but also detect the error at end of frame(EAEOF) when EOF signal
* arrives.
*/
Regards,
Jason-JH.Lin
> > + [MUTEX_SOF_DP_INTF1] =
> > + MT8195_MUTEX_SOF_DP_INTF1 | MT8195_MUTEX_EOF_DP_INTF1,
> > +};
> > +
> > static const struct mtk_mutex_data mt2701_mutex_driver_data = {
> > .mutex_mod = mt2701_mutex_mod,
> > .mutex_sof = mt2712_mutex_sof,
> > @@ -355,6 +431,13 @@ static const struct mtk_mutex_data
> > mt8192_mutex_driver_data = {
> > .mutex_sof_reg = MT8183_MUTEX0_SOF0,
> > };
> >
> > +static const struct mtk_mutex_data mt8195_mutex_driver_data = {
> > + .mutex_mod = mt8195_mutex_mod,
> > + .mutex_sof = mt8195_mutex_sof,
> > + .mutex_mod_reg = MT8195_DISP_MUTEX0_MOD0,
> > + .mutex_sof_reg = MT8195_DISP_MUTEX0_SOF,
> > +};
> > +
> > struct mtk_mutex *mtk_mutex_get(struct device *dev)
> > {
> > struct mtk_mutex_ctx *mtx = dev_get_drvdata(dev);
> > @@ -442,6 +525,9 @@ void mtk_mutex_add_comp(struct mtk_mutex
> > *mutex,
> > case DDP_COMPONENT_DPI1:
> > sof_id = MUTEX_SOF_DPI1;
> > break;
> > + case DDP_COMPONENT_DP_INTF0:
> > + sof_id = MUTEX_SOF_DP_INTF0;
> > + break;
> > default:
> > if (mtx->data->mutex_mod[id] < 32) {
> > offset = DISP_REG_MUTEX_MOD(mtx->data-
> > > mutex_mod_reg,
> >
> > @@ -481,6 +567,7 @@ void mtk_mutex_remove_comp(struct mtk_mutex
> > *mutex,
> > case DDP_COMPONENT_DSI3:
> > case DDP_COMPONENT_DPI0:
> > case DDP_COMPONENT_DPI1:
> > + case DDP_COMPONENT_DP_INTF0:
> > writel_relaxed(MUTEX_SOF_SINGLE_MODE,
> > mtx->regs +
> > DISP_REG_MUTEX_SOF(mtx->data-
> > > mutex_sof_reg,
> >
> > @@ -678,6 +765,8 @@ static const struct of_device_id
> > mutex_driver_dt_match[] = {
> > .data = &mt8183_mutex_driver_data},
> > { .compatible = "mediatek,mt8192-disp-mutex",
> > .data = &mt8192_mutex_driver_data},
> > + { .compatible = "mediatek,mt8195-disp-mutex",
> > + .data = &mt8195_mutex_driver_data},
> > {},
> > };
> > MODULE_DEVICE_TABLE(of, mutex_driver_dt_match);
>
>
--
Jason-JH Lin <jason-jh.lin at mediatek.com>
More information about the linux-arm-kernel
mailing list