Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22466787rwd; Fri, 30 Jun 2023 08:20:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlFXqljI6zypE7ONP3woX2pAJrHxFvykU4C9yJISp+66/gLijAXzqJkX6Xuj/AC4ekpOZj2Y X-Received: by 2002:a92:d486:0:b0:345:787a:cb1c with SMTP id p6-20020a92d486000000b00345787acb1cmr2608642ilg.6.1688138423368; Fri, 30 Jun 2023 08:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688138423; cv=none; d=google.com; s=arc-20160816; b=d2BAdW+zy1Wj3X18WlocdsVwsU1w2yDZRerHSNlBfqDJBQw9maBLpLSJQPA6pY6D4X F3Mg+7XEKrV9R5h7ZHrsWHKFRruSUjJf3NDxSBzoWnGY8IXKbYOBGYWPq/vnG8zZit3I 6fUUC6a3f6YdtFcPbazh0g5rExrzGPZMzNvwBAeHZg7IUyrghnnLzLaY6zjZNhPv2Qyp Xdf1I/prLc6riUOfQPxMIUzlPatNUq5LYBHJC+QdaYt9saJeTkemLnv81SAYToHnEkAb nrtrkQpCuMGrBhL6RZvKa8cRaCwEuQGCWPsKBvdyI/Z6c1G7a9ppvSCX64jBEm5tBRdU 8Frw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1+XVo35c/ZyJRbiQxxrwhdpa1/f9xKODn5in0OBXxmQ=; fh=R0OJjkFT/i5ZtFHa8S4L8qyxQFw51OrDWN8v9iwpgUc=; b=I3m1V/PMCx9GedRpeQ0h0V5lJhtWnscN/lo3p9r1wIRF1vV/1vZwFxH5r+IrnViykD vcGeCYs/m8dOXhRvdBRa7J7Y9wM5Gvxuf/7QXj+Q00K3WbCouprV+FsmraJVAn4IdanD KgrcQQ0pO4ha/zR+PUnNxUI6U9fEQn+zLE9p9ZH8w25vxwQtEQXQ4s8HOU4mBJlGhr9s XMLFQwxwdM+99yS9qKZRZ1DMZhngDAlhq7Ir4MGexDmhGWdRzBOii1V7qDKeVKag+TRu AOIvX/x29zn4T+hKJCETfh+wyRM7UzMTRHFljYQJFfvJ4gcnIRTlxbyK7ctvVsKuPpEH OXdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="d/aAyYSm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t184-20020a6381c1000000b0053ef815daebsi13313828pgd.253.2023.06.30.08.20.11; Fri, 30 Jun 2023 08:20:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="d/aAyYSm"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232984AbjF3PPi (ORCPT + 99 others); Fri, 30 Jun 2023 11:15:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232762AbjF3PPE (ORCPT ); Fri, 30 Jun 2023 11:15:04 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9D5D35A6; Fri, 30 Jun 2023 08:15:02 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 3DF3E6606E97; Fri, 30 Jun 2023 16:14:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688138101; bh=tcKN7V8jMwtJgXP8lIYDvUvaVxlTOIgSGTz9xCOpjsE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d/aAyYSmIBa5KAv+QEzgrw1/k4ttW/5EKTk8U3srrHGpLEBI0R3HuOhFpa9sE0skj j6vJ2sKO9t9B2gXTTn1w0U58UMIdTPR76ATQgVaGFiHD2aMeL7vQ8Eu4tKdFugmJNE AxKr7tSCDMQSGh3zE61Eh3gw9ow+K6skcdPLSmwvd2HI/+0xOKJzs4FUW9EM6AdEcf hdYWe3tvOnLAnlJfO3wMfl7KkqiEcRnZG3VHn6aN+2DHC8zW/tghjLa6CLSec/FxEn akRfYWRNZKJTZSklrd+Bs4wdfKIcwx/q8rfH1mSy2Pup+D4TiCgmYOPUi56sDPbaeI 1M5gNEtdQ4L5g== From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= To: Matthias Brugger , Hans Verkuil Cc: AngeloGioacchino Del Regno , kernel@collabora.com, =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , Andrew-CT Chen , Mauro Carvalho Chehab , Tiffany Lin , Yunfei Dong , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v5 4/7] media: mediatek: vcodec: Define address for VDEC_HW_ACTIVE Date: Fri, 30 Jun 2023 11:14:10 -0400 Message-ID: <20230630151436.155586-5-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230630151436.155586-1-nfraprado@collabora.com> References: <20230630151436.155586-1-nfraprado@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- (no changes since v4) Changes in v4: - Made use of BIT() macro for mask Changes in v3: - Added this commit drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 4 ++-- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 4 ++-- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c index d41f2121b94f..83780d29a9cf 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -50,8 +50,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; diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c index e1cb2f8dca33..41aa66c7295b 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c @@ -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; diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h index 36faa8d9d681..ff250e3be78e 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h @@ -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 -- 2.41.0