Re: [PATCH 2/2] soc: mediatek: mutex: add mt8186 mutex mod settings for mdp3

AngeloGioacchino Del Regno
2022-07-07T08:52:04Z

Il 05/07/22 14:26, Allen-KH Cheng ha scritto:
> This patch adds mt8186 mutex mod settings for mdp3.
>
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> Signed-off-by: Xiandong Wang <xiandong.wang@mediatek.com>
> ---
> drivers/soc/mediatek/mtk-mutex.c | 23 +++++++++++++++++++++++
> include/linux/soc/mediatek/mtk-mutex.h | 2 ++
> 2 files changed, 25 insertions(+)
>
> diff --git a/drivers/soc/mediatek/mtk-mutex.c b/drivers/soc/mediatek/mtk-mutex.c
> index 2fd8318c3bdc..51fd0186d9b5 100644
> --- a/drivers/soc/mediatek/mtk-mutex.c
> +++ b/drivers/soc/mediatek/mtk-mutex.c
> @@ -91,6 +91,15 @@
> #define MT8183_MUTEX_MOD_MDP_AAL0 23
> #define MT8183_MUTEX_MOD_MDP_CCORR0 24
>
> +#define MT8186_MUTEX_MOD_MDP_RDMA0 0
> +#define MT8186_MUTEX_MOD_MDP_AAL0 2
> +#define MT8186_MUTEX_MOD_MDP_HDR0 4
> +#define MT8186_MUTEX_MOD_MDP_RSZ0 5
> +#define MT8186_MUTEX_MOD_MDP_RSZ1 6
> +#define MT8186_MUTEX_MOD_MDP_WROT0 7
> +#define MT8186_MUTEX_MOD_MDP_TDSHP0 9
> +#define MT8186_MUTEX_MOD_MDP_COLOR0 14
> +
> #define MT8173_MUTEX_MOD_DISP_OVL0 11
> #define MT8173_MUTEX_MOD_DISP_OVL1 12
> #define MT8173_MUTEX_MOD_DISP_RDMA0 13
> @@ -324,6 +333,17 @@ static const unsigned int mt8186_mutex_mod[DDP_COMPONENT_ID_MAX] = {
> [DDP_COMPONENT_RDMA1] = MT8186_MUTEX_MOD_DISP_RDMA1,
> };
>
> +static const unsigned int mt8186_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
> + [MUTEX_MOD_IDX_MDP_RDMA0] = MT8186_MUTEX_MOD_MDP_RDMA0,
> + [MUTEX_MOD_IDX_MDP_RSZ0] = MT8186_MUTEX_MOD_MDP_RSZ0,
> + [MUTEX_MOD_IDX_MDP_RSZ1] = MT8186_MUTEX_MOD_MDP_RSZ1,
> + [MUTEX_MOD_IDX_MDP_TDSHP0] = MT8186_MUTEX_MOD_MDP_TDSHP0,
> + [MUTEX_MOD_IDX_MDP_WROT0] = MT8186_MUTEX_MOD_MDP_WROT0,
> + [MUTEX_MOD_IDX_MDP_HDR0] = MT8186_MUTEX_MOD_MDP_HDR0,
> + [MUTEX_MOD_IDX_MDP_AAL0] = MT8186_MUTEX_MOD_MDP_AAL0,
> + [MUTEX_MOD_IDX_MDP_COLOR0] = MT8186_MUTEX_MOD_MDP_COLOR0,
> +};
> +
> static const unsigned int mt8192_mutex_mod[DDP_COMPONENT_ID_MAX] = {
> [DDP_COMPONENT_AAL0] = MT8192_MUTEX_MOD_DISP_AAL0,
> [DDP_COMPONENT_CCORR] = MT8192_MUTEX_MOD_DISP_CCORR0,
> @@ -463,6 +483,7 @@ static const struct mtk_mutex_data mt8186_mutex_driver_data = {
> .mutex_sof = mt8186_mutex_sof,
> .mutex_mod_reg = MT8183_MUTEX0_MOD0,
> .mutex_sof_reg = MT8183_MUTEX0_SOF0,
> + .mutex_table_mod = mt8186_mutex_table_mod,
> };
>
> static const struct mtk_mutex_data mt8192_mutex_driver_data = {
> @@ -816,6 +837,8 @@ static const struct of_device_id mutex_driver_dt_match[] = {
> .data = &mt8183_mutex_driver_data},
> { .compatible = "mediatek,mt8186-disp-mutex",
> .data = &mt8186_mutex_driver_data},
> + { .compatible = "mediatek,mt8186-mdp3-mutex",

You don't need this entry, as mediatek,mt8186-disp-mutex already uses the same
driver data as this one.

Please drop that.

Everything else looks good.

> + .data = &mt8186_mutex_driver_data},
> { .compatible = "mediatek,mt8192-disp-mutex",
> .data = &mt8192_mutex_driver_data},
> { .compatible = "mediatek,mt8195-disp-mutex",
> diff --git a/include/linux/soc/mediatek/mtk-mutex.h b/include/linux/soc/mediatek/mtk-mutex.h
> index a0f4f51a3b45..b335c2837cd8 100644
> --- a/include/linux/soc/mediatek/mtk-mutex.h
> +++ b/include/linux/soc/mediatek/mtk-mutex.h
> @@ -20,6 +20,8 @@ enum mtk_mutex_mod_index {
> MUTEX_MOD_IDX_MDP_WDMA,
> MUTEX_MOD_IDX_MDP_AAL0,
> MUTEX_MOD_IDX_MDP_CCORR0,
> + MUTEX_MOD_IDX_MDP_HDR0,
> + MUTEX_MOD_IDX_MDP_COLOR0,
>
> MUTEX_MOD_IDX_MAX /* ALWAYS keep at the end */
> };
>