Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp390081rdb; Mon, 22 Jan 2024 07:22:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGqV0pMsprYgAmMpiCVnlRe9rvyLeW7b9GqZW3W7z3gwrwryC93XQXtcHxGq8j1uE7c7zcW X-Received: by 2002:a17:90a:8902:b0:28e:2294:78ba with SMTP id u2-20020a17090a890200b0028e229478bamr1437441pjn.93.1705936951563; Mon, 22 Jan 2024 07:22:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705936951; cv=pass; d=google.com; s=arc-20160816; b=oZJn/kjHfic79BPShxR21rFiXX8ohO0qIrDVeMQ3x318cgcBGy8256nAlASyuqyWZ5 PaTj8qoW0DxsZujPKlrrhqSJ0k83IqUC4/z3XwQ7vgRlSG7uwFLoC4atY8VXYhVSgq8S 1t3lqnnAkEB0mkw3T/8/jeLeDj+QHCJmzgwV8ALzdVeO+uaFgp3xgV7r328N23xHtZ6V G8SrIz10INdSvLl1p7Sj7EK2EghMZnNddsIUS3iNdg+TFbkfn/Yg/2bCVVn4/FJ+DCT7 rqoW4zrQl52UArQtS//i6TOqLQwxJ714bYi96F/VcG6rYXDNAYdp8qG/EFd4BlQ1mnqo mhAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eSbynV/pKGYUlCxLM6+Ph03sXmsJxVzY0nAtkjP+3VA=; fh=MSL/7hYF60PaScCJvqqoGkUWoZtElvzu/oEB/jqaobA=; b=hjDMf/hEfdoBAhBJqM7n+R82P124TRqOAehofcsKGa+KojbqFuFehVsmyz6q/sIu84 e9QrOVP9IUEzKUsd/+u8NzJ8dBiM/otgmNtfR8l/KXyCMLxZro60O4m7dGmw6/qNWX/p JMLboiu3ODqDRPgwlAPomUkbYR2r9BAiM75zolfPizyElpXZvtj8CB57PoCKgAALFZ6S 4JPyUvXCAanOHkNQWehpgWQIw0msYHSXWcGygc+T4jsfXwN8MJdZepSFL4Uljcii3UQy LTJali0BMyUP9Hlac+tjhDL0pkFFUDVxobduO1UYXSQHKS4F5pxUZVSg5znSE2sGCHzV ZNIQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CBJ4Yfe1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33256-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33256-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id nu14-20020a17090b1b0e00b00290be1473d9si482115pjb.3.2024.01.22.07.22.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 07:22:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33256-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CBJ4Yfe1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33256-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33256-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 028122895F6 for ; Mon, 22 Jan 2024 15:14:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EFFA537F0; Mon, 22 Jan 2024 14:58:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CBJ4Yfe1" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61764524DD; Mon, 22 Jan 2024 14:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935505; cv=none; b=Fo6GesMThKwEwCHJuAqTWztL3sS2lp0DnKghNya7cT2gBiJlsE7dY8TSK/1bctcyVByWUb7NHQsj1PtI4Wkp9MkLKMNwgsxDpnCrxttpSfcmsl0k/Aq83PJ8/l7Q0cQolcv6ffTCQqK++U27ZST3gVvJ4FrgGNXvtKR+4cY93zo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935505; c=relaxed/simple; bh=e4S5oxyAI1Ym/DoprimOTsdp+Rj2lpWX0FiR3QL2cfk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rwnksO86xRcEFyWUHzROQhEpRyi0witBXoWeC6wDc2XqmG1uegMEwz6yfff/RuLcnlSD7Rs5hS77sjMZg0gLgjT2uDynebwPkws7XuZceBjMuIpw2ZWGqO2eXwiq+wCQ1tzXl4PJx9kd0uHwkiI2B3bAmOzP6+5X2YkMaAjvugk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CBJ4Yfe1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1CFFC433A6; Mon, 22 Jan 2024 14:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935505; bh=e4S5oxyAI1Ym/DoprimOTsdp+Rj2lpWX0FiR3QL2cfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CBJ4Yfe1PArpKlKO9QiS50bl9C5Ez+290oILJhCWoB87/Z9dhBOBusfSxg0JmxC43 PiMpx7rmawk4mydrdELY6O8txFTXmOLbStlsyNq0PydpacCtkLEdRL8ogO24nrLQud BmOiDgM/VcWQXbP+CX3CCk6f2Oz8Cuwzv3cGb5vpuj7AGXUpZYNDu9hl/mZ7UNyoT7 IM6snDVoOHdsfyQaTVvJ4gVyxzsk5yG7M2BuXs/cggITOBmKh4zfUXqLEFl9muzcFN 6o1wOEofhDYA6AOsY1xaWtJrLEmcSfQf6Ng9yfBot7UGoe1BRr2H8GJFXzgTwUmvw4 tFbj/XNZP9Qug== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tomi Valkeinen , Adam Ford , Laurent Pinchart , Mauro Carvalho Chehab , Sasha Levin , dafna@fastmail.com, heiko@sntech.de, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 6.7 37/88] media: rkisp1: Store IRQ lines Date: Mon, 22 Jan 2024 09:51:10 -0500 Message-ID: <20240122145608.990137-37-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 Content-Transfer-Encoding: 8bit From: Tomi Valkeinen [ Upstream commit 0753874617de883c6d4da903142f334f76a75d70 ] Store the IRQ lines used by the driver for easy access. These are needed in future patches which fix IRQ race issues. Link: https://lore.kernel.org/r/20231207-rkisp-irq-fix-v3-3-358a2c871a3c@ideasonboard.com Tested-by: Adam Ford #imx8mp-beacon Signed-off-by: Tomi Valkeinen Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- .../platform/rockchip/rkisp1/rkisp1-common.h | 11 ++++++++++- .../media/platform/rockchip/rkisp1/rkisp1-dev.c | 17 +++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h index 1e7cea1bea5e..2d7f06281c39 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h @@ -61,6 +61,14 @@ struct dentry; RKISP1_CIF_ISP_EXP_END | \ RKISP1_CIF_ISP_HIST_MEASURE_RDY) +/* IRQ lines */ +enum rkisp1_irq_line { + RKISP1_IRQ_ISP = 0, + RKISP1_IRQ_MI, + RKISP1_IRQ_MIPI, + RKISP1_NUM_IRQS, +}; + /* enum for the resizer pads */ enum rkisp1_rsz_pad { RKISP1_RSZ_PAD_SINK, @@ -423,7 +431,6 @@ struct rkisp1_debug { * struct rkisp1_device - ISP platform device * * @base_addr: base register address - * @irq: the irq number * @dev: a pointer to the struct device * @clk_size: number of clocks * @clks: array of clocks @@ -441,6 +448,7 @@ struct rkisp1_debug { * @stream_lock: serializes {start/stop}_streaming callbacks between the capture devices. * @debug: debug params to be exposed on debugfs * @info: version-specific ISP information + * @irqs: IRQ line numbers */ struct rkisp1_device { void __iomem *base_addr; @@ -461,6 +469,7 @@ struct rkisp1_device { struct mutex stream_lock; /* serialize {start/stop}_streaming cb between capture devices */ struct rkisp1_debug debug; const struct rkisp1_info *info; + int irqs[RKISP1_NUM_IRQS]; }; /* diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c index 22b2ae0e89c4..c3fa40976140 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c @@ -114,6 +114,7 @@ struct rkisp1_isr_data { const char *name; irqreturn_t (*isr)(int irq, void *ctx); + u32 line_mask; }; /* ---------------------------------------------------------------------------- @@ -471,9 +472,9 @@ static const char * const px30_isp_clks[] = { }; static const struct rkisp1_isr_data px30_isp_isrs[] = { - { "isp", rkisp1_isp_isr }, - { "mi", rkisp1_capture_isr }, - { "mipi", rkisp1_csi_isr }, + { "isp", rkisp1_isp_isr, BIT(RKISP1_IRQ_ISP) }, + { "mi", rkisp1_capture_isr, BIT(RKISP1_IRQ_MI) }, + { "mipi", rkisp1_csi_isr, BIT(RKISP1_IRQ_MIPI) }, }; static const struct rkisp1_info px30_isp_info = { @@ -492,7 +493,7 @@ static const char * const rk3399_isp_clks[] = { }; static const struct rkisp1_isr_data rk3399_isp_isrs[] = { - { NULL, rkisp1_isr }, + { NULL, rkisp1_isr, BIT(RKISP1_IRQ_ISP) | BIT(RKISP1_IRQ_MI) | BIT(RKISP1_IRQ_MIPI) }, }; static const struct rkisp1_info rk3399_isp_info = { @@ -543,6 +544,9 @@ static int rkisp1_probe(struct platform_device *pdev) if (IS_ERR(rkisp1->base_addr)) return PTR_ERR(rkisp1->base_addr); + for (unsigned int il = 0; il < ARRAY_SIZE(rkisp1->irqs); ++il) + rkisp1->irqs[il] = -1; + for (i = 0; i < info->isr_size; i++) { irq = info->isrs[i].name ? platform_get_irq_byname(pdev, info->isrs[i].name) @@ -550,6 +554,11 @@ static int rkisp1_probe(struct platform_device *pdev) if (irq < 0) return irq; + for (unsigned int il = 0; il < ARRAY_SIZE(rkisp1->irqs); ++il) { + if (info->isrs[i].line_mask & BIT(il)) + rkisp1->irqs[il] = irq; + } + ret = devm_request_irq(dev, irq, info->isrs[i].isr, 0, dev_driver_string(dev), dev); if (ret) { -- 2.43.0