From patchwork Wed Aug 23 10:44:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 13362038 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9238FEE49B0 for ; Wed, 23 Aug 2023 10:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234029AbjHWKpw (ORCPT ); Wed, 23 Aug 2023 06:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234034AbjHWKpU (ORCPT ); Wed, 23 Aug 2023 06:45:20 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DE2E10DC for ; Wed, 23 Aug 2023 03:45:07 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-317716a4622so4834359f8f.1 for ; Wed, 23 Aug 2023 03:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692787505; x=1693392305; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TCd7GbPPAXe7wBQWBz5Iyr/diRlD1CNdqcFal/PKyLw=; b=H6uJQcVzryfjYSV6JMb3V1q9wO1vw54u/N7gmajjhKcL+QVvZk+JDoPdCID4huXbbb /jQw9ZuKB23Y92K08ejwK/u9isaH1da4f6lq/thdnSioSj9tVrNEKiKLUeYYeT8NJTrk BZ7KONeHT/gyBg/frz0JQ8KrBo4Wh5/pWbF0753smrJIpK4x86gHK7z0oiXj34e4WF4b HVTkf25A7JZt/0FaiKffvpRcIqR9dDAXvRTE8BDyXTqNwnQS6F8ESJ+0+c9nKvFF/wyH 9hKkA2BaTmE/8+yNEllRRoBwaVmtQIB3dDG/RoAGJPSbSWHQMiNcXXSkxxSlyPOp+PGi 1qdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692787505; x=1693392305; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TCd7GbPPAXe7wBQWBz5Iyr/diRlD1CNdqcFal/PKyLw=; b=Xn5defSHeSUXzG/37iu/qz+dZ4IgQpaJk/C9AT1b1woOWsCwFhNSE+vVS/+XZzG6Rj oyYDYWH9I3T2YB4vZTsX15EODT/uOdOok1t3BsKkXsWdUagFsMY6KlbqUCqD3DGaPXJJ ohX2k7PfcI9/Xodkpcq68vtKWPuFUFraAmTnlYEzdFjn6CGUTBzY30fut0YHoNq1XWNT zK2aOyMbyQoq5CKfOlejxNZbrXQsGLECMXWJTdgoeiTtrASuJJyh65vWD1J6xaAZD2T/ 57tCFfAgaldQoCIEgZai6bFs/zVVdRUkJ9zmod5CkyCIXq9S81cAgeDpq6W2j7c2SlCH 9oeg== X-Gm-Message-State: AOJu0YyBBu5/FueHfIp/JTiQ536Eud35ylNhsdsk5R9eAfOrcG0deSlh +1u6p9+OijLSkmiCHUS5xp8t5Q== X-Google-Smtp-Source: AGHT+IHFTgzCRaRfXXW9f0M92PiwFPDTi6wBLNXXA+cBYRX14+FSYG4I4TYBx7jMa0brq4Ir0itlvA== X-Received: by 2002:a5d:678d:0:b0:315:a17d:dbc6 with SMTP id v13-20020a5d678d000000b00315a17ddbc6mr9970701wru.14.1692787505788; Wed, 23 Aug 2023 03:45:05 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id n4-20020a5d4204000000b0031c5dda3aedsm6281213wrq.95.2023.08.23.03.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 03:45:05 -0700 (PDT) From: Bryan O'Donoghue To: rfoss@kernel.org, todor.too@gmail.com, bryan.odonoghue@linaro.org, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org, hverkuil-cisco@xs4all.nl, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, andrey.konovalov@linaro.org Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 13/15] media: qcom: camss: Support RDI3 for VFE 17x Date: Wed, 23 Aug 2023 11:44:42 +0100 Message-ID: <20230823104444.1954663-14-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823104444.1954663-1-bryan.odonoghue@linaro.org> References: <20230823104444.1954663-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Some VFEs have four RDIs apiece. Right now the ISR code has a hard-coded value which tops-out at RDI2 meaning only three RDIs can be utilised in practice. Extend out the various routines in camss-vfe-17x.c to support the higher RDI count. Signed-off-by: Bryan O'Donoghue Acked-by: Konrad Dybcio Reviewed-by: Laurent Pinchart --- drivers/media/platform/qcom/camss/camss-vfe-170.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-vfe-170.c b/drivers/media/platform/qcom/camss/camss-vfe-170.c index 8aa921400ded0..c2487a8196db7 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe-170.c +++ b/drivers/media/platform/qcom/camss/camss-vfe-170.c @@ -210,7 +210,8 @@ static void vfe_global_reset(struct vfe_device *vfe) GLOBAL_RESET_CMD_IDLE_CGC | GLOBAL_RESET_CMD_RDI0 | GLOBAL_RESET_CMD_RDI1 | - GLOBAL_RESET_CMD_RDI2; + GLOBAL_RESET_CMD_RDI2 | + GLOBAL_RESET_CMD_RDI3; writel_relaxed(BIT(31), vfe->base + VFE_IRQ_MASK_0); @@ -344,7 +345,7 @@ static void vfe_violation_read(struct vfe_device *vfe) static irqreturn_t vfe_isr(int irq, void *dev) { struct vfe_device *vfe = dev; - u32 status0, status1, vfe_bus_status[3]; + u32 status0, status1, vfe_bus_status[VFE_LINE_NUM_MAX]; int i, wm; status0 = readl_relaxed(vfe->base + VFE_IRQ_STATUS_0); @@ -353,7 +354,7 @@ static irqreturn_t vfe_isr(int irq, void *dev) writel_relaxed(status0, vfe->base + VFE_IRQ_CLEAR_0); writel_relaxed(status1, vfe->base + VFE_IRQ_CLEAR_1); - for (i = VFE_LINE_RDI0; i <= VFE_LINE_RDI2; i++) { + for (i = VFE_LINE_RDI0; i < vfe->line_num; i++) { vfe_bus_status[i] = readl_relaxed(vfe->base + VFE_BUS_IRQ_STATUS(i)); writel_relaxed(vfe_bus_status[i], vfe->base + VFE_BUS_IRQ_CLEAR(i)); } @@ -367,11 +368,11 @@ static irqreturn_t vfe_isr(int irq, void *dev) if (status0 & STATUS_0_RESET_ACK) vfe->isr_ops.reset_ack(vfe); - for (i = VFE_LINE_RDI0; i <= VFE_LINE_RDI2; i++) + for (i = VFE_LINE_RDI0; i < vfe->line_num; i++) if (status0 & STATUS_0_RDI_REG_UPDATE(i)) vfe->isr_ops.reg_update(vfe, i); - for (i = VFE_LINE_RDI0; i <= VFE_LINE_RDI2; i++) + for (i = VFE_LINE_RDI0; i < vfe->line_num; i++) if (status0 & STATUS_1_RDI_SOF(i)) vfe->isr_ops.sof(vfe, i);