From patchwork Thu Aug 17 14:38:12 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: 715289 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 A16D1C3DA54 for ; Thu, 17 Aug 2023 14:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352099AbjHQOiw (ORCPT ); Thu, 17 Aug 2023 10:38:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352071AbjHQOie (ORCPT ); Thu, 17 Aug 2023 10:38:34 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D01E2D78 for ; Thu, 17 Aug 2023 07:38:33 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-317c3ac7339so6623274f8f.0 for ; Thu, 17 Aug 2023 07:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692283112; x=1692887912; 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=xQgdm1ieG7ejUuCAzYH86hBVhP5DKRPn3C37IJ6agLx6jv6nNGoto40WUikUn4vP/3 91MS++FvJ+DpX5BUo9zZSgzkl38mmM6UO4KKz8xSggz+yQ1p1CMAKktAvBYOoAveleJ4 cyNFKcnA62mY2llCOt6ziKPjZ51TWx6m8+lDkcxsgcqb70uszWnezu0m1lXZjEdFC0Dn MDW6CVftEUOC631gIgfBAIidlD4Qqe0vzP3YLv6tswR7N2DugsEv96CoVLWEx8HtDtev rTO8cdrLa2cM5fLIrBeSyPR6WfuRNDS5STqT1RQAVHLVWJ994kv9JNhHgBt9ckmJCWt6 e9qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692283112; x=1692887912; 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=VX1ciJdWHlrDQgUTMuM7HH6+JlPst0r/X+VrM79FIJziqIOAJs+KC8z4fizkOHUuW1 KV78Hil5rpVTnUp5K/xrAORPE6syAJwUU59eBHR2tqWT3hb/5k6eH8ycg98Z53HvGoaj cAjWPjfIk9E0NbwjnoMSrKF+9LXQ+e0tnV+sWdNCXdYmP6mYcuzYsTyRoeMyMTNLCPCh C6mPwgdB0LlRdeRuatxkGk1eRt2rg4gbahDObW36wvZ2xOACmCN9TXXxYtr69Yttmonb ZvoWxYKF4g/YedRloqAdioidITdNqTIkgFBv80Vbdweu6xVSum3TInN/cbLF4jLop8Mo L8zg== X-Gm-Message-State: AOJu0YxQvxO1tsrFU5rN2fxgPlJdMlELeoC/Zp2G5MfMxJ+swsgfG3fO M7rwx+KHzXKknTbei98gRnyjYQ== X-Google-Smtp-Source: AGHT+IGQ83NdZ9/MPpjbzIi8wgd9fe6IGxXL7qSRJFxS/Ghkot6I/NG/mOLCSChxMByz5qmsiwrJVA== X-Received: by 2002:adf:f543:0:b0:319:8333:a2cb with SMTP id j3-20020adff543000000b003198333a2cbmr5310674wrp.13.1692283111938; Thu, 17 Aug 2023 07:38:31 -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 i8-20020a5d4388000000b0030647449730sm25218232wrq.74.2023.08.17.07.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 07:38:31 -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 v2 13/13] media: qcom: camss: Support RDI3 for VFE 17x Date: Thu, 17 Aug 2023 15:38:12 +0100 Message-ID: <20230817143812.677554-14-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230817143812.677554-1-bryan.odonoghue@linaro.org> References: <20230817143812.677554-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 --- 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);