]> git.itanic.dy.fi Git - linux-stable/commitdiff
media: mediatek: vcodec: Define address for VDEC_HW_ACTIVE
authorNícolas F. R. A. Prado <nfraprado@collabora.com>
Fri, 30 Jun 2023 15:14:10 +0000 (11:14 -0400)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 25 Jul 2023 07:44:26 +0000 (09:44 +0200)
The VDEC_HW_ACTIVE bit is located at offset 0, bit 4 of the VDECSYS
iospace. Only the mask was previously defined, with the address being
implicit. Explicitly define the address, and append a '_MASK' suffix to
the mask, to make accesses to this bit clearer.

This commit brings no functional change.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h

index 99e9baaf1774fe5a186e9f6331cab87f3c64a63c..09d836f2d61e628d96aa110b524191d9580c52d5 100644 (file)
@@ -51,8 +51,8 @@ static irqreturn_t mtk_vcodec_dec_irq_handler(int irq, void *priv)
        ctx = mtk_vcodec_get_curr_ctx(dev, MTK_VDEC_CORE);
 
        /* check if HW active or not */
-       cg_status = readl(dev->reg_base[0]);
-       if ((cg_status & VDEC_HW_ACTIVE) != 0) {
+       cg_status = readl(dev->reg_base[0] + VDEC_HW_ACTIVE_ADDR);
+       if ((cg_status & VDEC_HW_ACTIVE_MASK) != 0) {
                mtk_v4l2_err("DEC ISR, VDEC active is not 0x0 (0x%08x)",
                             cg_status);
                return IRQ_HANDLED;
index e1cb2f8dca33075307de2c448faa43c36a77fca7..41aa66c7295b165ffee19a033ca301e32ef99398 100644 (file)
@@ -75,8 +75,8 @@ static irqreturn_t mtk_vdec_hw_irq_handler(int irq, void *priv)
        ctx = mtk_vcodec_get_curr_ctx(dev->main_dev, dev->hw_idx);
 
        /* check if HW active or not */
-       cg_status = readl(dev->reg_base[VDEC_HW_SYS]);
-       if (cg_status & VDEC_HW_ACTIVE) {
+       cg_status = readl(dev->reg_base[VDEC_HW_SYS] + VDEC_HW_ACTIVE_ADDR);
+       if (cg_status & VDEC_HW_ACTIVE_MASK) {
                mtk_v4l2_err("vdec active is not 0x0 (0x%08x)",
                             cg_status);
                return IRQ_HANDLED;
index 36faa8d9d681b90cd0354bc277c9d38c9bd48a37..ff250e3be78e6ba1dc0fc7ea3219244bd89062fe 100644 (file)
@@ -12,7 +12,8 @@
 
 #include "mtk_vcodec_drv.h"
 
-#define VDEC_HW_ACTIVE 0x10
+#define VDEC_HW_ACTIVE_ADDR 0x0
+#define VDEC_HW_ACTIVE_MASK BIT(4)
 #define VDEC_IRQ_CFG 0x11
 #define VDEC_IRQ_CLR 0x10
 #define VDEC_IRQ_CFG_REG 0xa4