Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp75757rdb; Mon, 14 Aug 2023 09:54:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHAL2YLTBWHtefVsLUBUbay4/SZl4XQoFjDdhW0qgz4w8OfkBPgmdtJzBEh2gQzue16HB0 X-Received: by 2002:a17:902:a407:b0:1bc:5197:73c5 with SMTP id p7-20020a170902a40700b001bc519773c5mr10205868plq.54.1692032082725; Mon, 14 Aug 2023 09:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692032082; cv=none; d=google.com; s=arc-20160816; b=AtxkF293PXewF56/aGVzE8Q8ZB8fho6TcSEdW6gm6SCukPgh8vqE3lslJd3uhX36y9 F8Aedm9Z8Zho5CFh3GOf+ummMMG3SNuel31xWHjpp6SJe8jz2/G4Krvjj3Y+pym17r1h iJSyIyil9rvseollO+cPZOHiguwc6vxEPwA6Xdg32zf2vH7fIk2c2ykENYXFe3i2zdiv asViaEwECem7AMKaE2ygeI73RttjcQ7P9p0punCGwnFNBZiboX/qbtoFMUpwx2PSkaED c4EuXayuXTFgzFzvUgVgy2YhKuZmJU7rWIEKm31DoX6LWyQLVOYUMlARadZJxf9D4/c4 fmQg== 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=yWSfC4PTyf3c1S/i4WTl2tNnfkmumB5Ykd84R92bEPk=; fh=zUAAL0oq2+kA0nMRT5WSj9jrme2MlEZTDW5RK2mes1s=; b=k508BMPpDHB7cDYd6tQ883CBacsWJQbK861Ns31vkY8Vuq3k9csvErUbwDdXrZGGIP uEVAC0PJ54mF3BlcNkizzrG7Edv2j7czXmr4of4y+8Z8sGrDaaeDboHiCwV7n5uZoob9 opzFHzKXH+y91CZ2mXIWf3rtkOuTLGwOIerkh2SAERBZzf8JqN8gGXOY4fFejig17c1C ohfm5bsVqjV7c244H5mBQVzYspU7/+92u49/HBKCGqPrWQAWDXbKxKqc8fhWAn3g/G2x QMKXECijvR9v/18D+Gx+YI3nGtabJmIBauxd+b8Iuo9d/CKCKWDWFSXe2HKRT//j4Xc9 SLWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cDDA/x6u"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a170902dad100b001b88ff2efeasi8508369plx.431.2023.08.14.09.54.29; Mon, 14 Aug 2023 09:54:42 -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=@linaro.org header.s=google header.b="cDDA/x6u"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231452AbjHNQ36 (ORCPT + 99 others); Mon, 14 Aug 2023 12:29:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232536AbjHNQ3b (ORCPT ); Mon, 14 Aug 2023 12:29:31 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16DBDE63 for ; Mon, 14 Aug 2023 09:29:29 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b9a2033978so67655161fa.0 for ; Mon, 14 Aug 2023 09:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692030567; x=1692635367; 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=yWSfC4PTyf3c1S/i4WTl2tNnfkmumB5Ykd84R92bEPk=; b=cDDA/x6uAs9Fb/p3fnZNPWdLRpHIQkICXRmvtfXsLYbPEZca3GQOyIdWbd+wKaP+zR GXYTESy+Qrymyvq8hhqNN6c2KnCs0uGhbrjLYDRxo7s6rZVTW7VLLZSaY5+2iesYM6gs ebTMwFkfw8bmn4HleDEp62P+LOjHOEVl3rLStV9VyU0boggl8UZovgllNrHT3xuSdKok rDhgeEfAEcOydaO3skzqsi5vcpX2h0iGp2e4+1+hfy/VQLgJql+i3r+qiwWajascFSJR WL7QreSstUophq3R1rxFu36oP1SWEnNz9+xt1gOvKLORSFe/wr/E3hwOMy8NxVHzUmSL xOMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692030567; x=1692635367; 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=yWSfC4PTyf3c1S/i4WTl2tNnfkmumB5Ykd84R92bEPk=; b=egVaO9S+tnc9rZyWGUDNlrChfkHd/H59QCdp2iORXbYrehTXnsG/QZLd82rjzPYsuQ d+mxmzDvcAH298gPb8iUJSVeiJGdB+t5NgLwG0RmQMHGkn4YV+Fbgsu7SClzFbbYpvqj QQ0lDEKEF8dLEA7n/KiTKM0PiIj3N6Cna8omqjURhNpVxI9gHtqoDEYSphdPS9PtIVJ5 Zvt1BIqf+aywyT+/YK13xtnK2mpYG6k3hRRgLEQCF14yIBx+8Gw7LfkMezYrQC4GHquT X++wCnsD8dl1jjZIrddQqH4zjBjxN2RA0PHpr62GVKhcNgptVvO/sOfHz1Jx4RfDLskH PCOQ== X-Gm-Message-State: AOJu0Yw4TOsANDTlDvc/rF1kgO2/jhk2uv+U8aFRuU/6zy8TMi1kbaix zmEAfofrhOu9KEUYurIoYrEzhQ== X-Received: by 2002:a05:6512:10d4:b0:4fe:746:63d1 with SMTP id k20-20020a05651210d400b004fe074663d1mr7639216lfg.5.1692030567400; Mon, 14 Aug 2023 09:29:27 -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 l14-20020a1c790e000000b003fc16ee2864sm14743475wme.48.2023.08.14.09.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 09:29:26 -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 v1 14/14] media: qcom: camss: Support RDI3 for VFE 17x Date: Mon, 14 Aug 2023 17:29:07 +0100 Message-ID: <20230814162907.3878421-15-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230814162907.3878421-1-bryan.odonoghue@linaro.org> References: <20230814162907.3878421-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 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 --- 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); -- 2.41.0