mailbox: mtk-cmdq: Use GCE_CTRL_BY_SW definition instead of number
authorYongqiang Niu <yongqiang.niu@mediatek.com>
Thu, 15 Dec 2022 07:28:03 +0000 (15:28 +0800)
committerJassi Brar <jaswinder.singh@linaro.org>
Mon, 19 Dec 2022 02:40:29 +0000 (20:40 -0600)
Use GCE_CTRL_BY_SW definition instead of number

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/mtk-cmdq-mailbox.c

index 9465f9081515da1d57c2cd178857b75bc761c873..c3cb24f51699a69829e81a1c51bad89ace0c0730 100644 (file)
@@ -38,6 +38,7 @@
 #define CMDQ_THR_PRIORITY              0x40
 
 #define GCE_GCTL_VALUE                 0x48
+#define GCE_CTRL_BY_SW                         GENMASK(2, 0)
 
 #define CMDQ_THR_ACTIVE_SLOT_CYCLES    0x3200
 #define CMDQ_THR_ENABLED               0x1
@@ -129,7 +130,8 @@ static void cmdq_init(struct cmdq *cmdq)
 
        WARN_ON(clk_bulk_enable(cmdq->gce_num, cmdq->clocks));
        if (cmdq->control_by_sw)
-               writel(0x7, cmdq->base + GCE_GCTL_VALUE);
+               writel(GCE_CTRL_BY_SW, cmdq->base + GCE_GCTL_VALUE);
+
        writel(CMDQ_THR_ACTIVE_SLOT_CYCLES, cmdq->base + CMDQ_THR_SLOT_CYCLES);
        for (i = 0; i <= CMDQ_MAX_EVENT; i++)
                writel(i, cmdq->base + CMDQ_SYNC_TOKEN_UPDATE);