From patchwork Mon Sep 25 15:47:04 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: 13398064 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 1B1E8CE7A9B for ; Mon, 25 Sep 2023 15:47:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233102AbjIYPrz (ORCPT ); Mon, 25 Sep 2023 11:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233074AbjIYPrh (ORCPT ); Mon, 25 Sep 2023 11:47:37 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B8FE120 for ; Mon, 25 Sep 2023 08:47:28 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4050bd2e33aso70704445e9.2 for ; Mon, 25 Sep 2023 08:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695656846; x=1696261646; darn=vger.kernel.org; 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=3XAtVUAyBOvnRtU7QZlyMg2OvJJmAGTuY+WdBD311GM=; b=S4hVx2sg6CupCNOx2qU7m93mxgYGuycrwGF4RdfeS3PfCKN3/fYUZTRLd3O8ISaoir 6Mzo7pnZj/VHQH0SYSvsp3ePdn+aJ/DthJ0aK6gSyB622+ezndn5WnRqn0/nVl3zn8kh kL1D123DlCtzdZJ3dwQ760VMASOhkWvX8wJZWOoVx5CT+bk6c3Pkcfh83shyjYh7rEeO zLb0SR1WmW9w6b2IYqNPLijne8nUu8HaayGkIUr8j3JKwjjxAlvcFFEdP5YDjZjNTIGt nIonMwDMNyZD7FJyyK6TYGRZkTeOh8R9Orb8cCTDOXEOpG/134JbYyJi1LJHr/MaVRD5 0Yww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695656846; x=1696261646; 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=3XAtVUAyBOvnRtU7QZlyMg2OvJJmAGTuY+WdBD311GM=; b=ONoKSFehd3TCUapcC5RJHEsHpDpwidFGCL28Zca8xOB35wA03UFSPB6kThbSLCTDG/ 4aiMOyGAfy3Cdnt9FZGlxGSrjbg8eT76rLJXMbe7Aovp4WTeiZR8BNub4dydkBWJ5+of NAW4HeLV9F9y1wBcejrqr4R2NyiTtcm7cv1U4DfLGL0APMkdNGFBpmE/cEAbkT6I9tHt LSdgG2KvWtBlLHcuIg5ZLWRUquxZZIoVolxlr/chmA5csQuY6onU3DF+aCvNCQg9pjKi xfm7T9ltnOVlchM4Xk4DRHNRdEt5CHLNfTF5sXAwcXuAVcC1uP3wBmU2cbzTKsvDDNHh eUYQ== X-Gm-Message-State: AOJu0YzuG5CTDOv+A16E/KrTof8kQ5oO62sa0sqBKjZOxVxNuKpQbHSu LsTBTgVsjG0e2qu+nGPJZSV/iQxgu1Rea0/wqtA= X-Google-Smtp-Source: AGHT+IGIsB4mLYETZvmkEyZcLWQPGapkBfLeHfY3+rXnsGeMiVp+S19QaagA0CKyurcmaGBgvdGfAQ== X-Received: by 2002:adf:e4c9:0:b0:322:db93:41ab with SMTP id v9-20020adfe4c9000000b00322db9341abmr6252935wrm.0.1695656846518; Mon, 25 Sep 2023 08:47:26 -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 d4-20020adffd84000000b0031f34a395e7sm12077536wrr.45.2023.09.25.08.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 08:47:26 -0700 (PDT) From: Bryan O'Donoghue To: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, rfoss@kernel.org, todor.too@gmail.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org, sakari.ailus@linux.intel.com, andrey.konovalov@linaro.org Cc: linux-kernel@vger.kernel.org, Bryan O'Donoghue Subject: [RESEND PATCH v6 14/17] media: qcom: camss: Support RDI3 for VFE 17x Date: Mon, 25 Sep 2023 16:47:04 +0100 Message-ID: <20230925154707.837542-15-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230925154707.837542-1-bryan.odonoghue@linaro.org> References: <20230925154707.837542-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 2ba7160b3bd1e..a5aa799501861 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe-170.c +++ b/drivers/media/platform/qcom/camss/camss-vfe-170.c @@ -209,7 +209,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); @@ -343,7 +344,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); @@ -352,7 +353,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)); } @@ -366,11 +367,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);