Message ID | 20240220-v6-8-topic-rk3568-vicap-v1-6-2680a1fa640b@wolfvision.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-72714-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp293905dyc; Tue, 20 Feb 2024 01:56:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUVV8LS0BRCOhkuxYZz8WsTi31RRVuF5sGJ9oMzFu7sGoC/tB/4XLCtrjROxeXpFLCsDT0Nyq//pTDjSGU9woCBjjMfPw== X-Google-Smtp-Source: AGHT+IEhjOyjM4y11D4t7COmckBAyER5hZ5zUAISXo/OhrMKLZh4SnasHUhQKnf71vOMF5iyo9BA X-Received: by 2002:a05:6358:63a2:b0:17b:c8d:f39c with SMTP id k34-20020a05635863a200b0017b0c8df39cmr16526172rwh.28.1708422961709; Tue, 20 Feb 2024 01:56:01 -0800 (PST) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s135-20020a63778d000000b005d6a0068c1csi863460pgc.95.2024.02.20.01.56.01 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 01:56:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72714-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=mZMDjyeg; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-72714-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72714-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 91B97B20A0A for <ouuuleilei@gmail.com>; Tue, 20 Feb 2024 09:42:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27EE9657BA; Tue, 20 Feb 2024 09:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="mZMDjyeg" Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2128.outbound.protection.outlook.com [40.107.21.128]) (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 C088F634EB; Tue, 20 Feb 2024 09:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.128 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708422013; cv=fail; b=TrbWAllvItf8Fk6cSHCBmAqmnmmEmYBv+BRMuVtyb77NF8+LyZhxbAqEQSAvxv6HOHaUcW5Me503Bkr/tcGZpdDLr26B0izmOVZGfs3I6ANjiNWFKSb76mgkhC1m4goQTvkh4H2c/OocPHJcTOLVsmVVSznbQTGqHe8s+NS49dI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708422013; c=relaxed/simple; bh=WQGjonJHv4SJS+dxX3SFBxVGNyfcDP/0ER7RyY5D3Kw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=g/D+QHoqKDy/FvobpXwv+Kw6G2itW0CBKqiWC/SI8VCsjLX4afxsJPgL9O1WUWaOA8ICQONcm65aKpL9tVgmZRNibL17iOWXXuwwWHw8MU+Yhh7ffZLAUVh6XvTWQDlcPkVYHXVLkva7k6jMuafJjN/u4BMwpyKVAPJz+ssmVTA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net; spf=pass smtp.mailfrom=wolfvision.net; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b=mZMDjyeg; arc=fail smtp.client-ip=40.107.21.128 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wolfvision.net ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KKWe6bFh9cAH+94w+AbuhM3iFkn20rYxgbdw6xqEhW1ItLO1sA7o/c2/0cQCFzjw2NdHDRpIAgOtRX2/vBhL39HkNUxY0wdlHOtmM430geHlwtQmlivcLsuASDrEbWRqP4jWLEu0g8o/zCC+D5ZqK+c5l4XKpdZlfr6y4wDZ9YD10UwHNvUzLCW+V4hG3vkWyaITOnSN7WbEJX+dVpG/L1CSxPJEws71lvYCLdABxQUntT/f0+L6w9AUwz5kddcJcHrXc0d6e9I0jfJoKMI1vskqH1hpPVwxdbTsEvO8rmhUx6OB+GEcIHu+QpQoscSqzH97a58TNFzh7BoMmo5k+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ahXRRa2Auy1r3diPOfLqPhufT0OndywK4ZL0NrIqr/M=; b=ezkkFNgGvwEIExv8PjHIRh9x+JoPlt0d0fMPOlY003DzvKMODbxLY4BDf6eXBWg9vaSeGaP89nIAPh6MzhIr4CoIGe/IW/N8DYO1IFXTLp+cxDGAULHQhI/6zYIYzna/EBab/y3yz3efTjU8As378PzhbkDg57Joss5trRPPNUku1shi0bvrGQQb4O2ItXsCxtfEnJCv7VjsuWlwC8JcsUWAPilNRAeVqglzeB9oKTRt5xLwehj1imbrvC8fpVWftXR9DPgOnbSrAk44edCeOXmeUONizv5hJt4H2bZI0ZhcSR8qWEYtpB8jwE5V+gFGrneJ7MvP5u7KmTLwPIUdsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ahXRRa2Auy1r3diPOfLqPhufT0OndywK4ZL0NrIqr/M=; b=mZMDjyegSuDsL0VxrvHBGksdjzKWRdPliEdfVJZEwSaYd/x0BLd1eJNn51SsCqvOdH7InpmhSCTCIlCKnZL1ssk6HkT+WQIDQqT5up8zXr/WKxpbabA6AInz7S0wyM7IXCkx7d1jk0ZLDKyVMvvJ3LK4n3iqk8zvXrlGKiKAkTY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) by DB9PR08MB6763.eurprd08.prod.outlook.com (2603:10a6:10:2af::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 09:40:08 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::7409:db60:8209:c9f4]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::7409:db60:8209:c9f4%6]) with mapi id 15.20.7270.043; Tue, 20 Feb 2024 09:40:08 +0000 From: Michael Riesch <michael.riesch@wolfvision.net> Date: Tue, 20 Feb 2024 10:39:16 +0100 Subject: [PATCH 06/14] media: rockchip: cif: store endpoint information in private data Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240220-v6-8-topic-rk3568-vicap-v1-6-2680a1fa640b@wolfvision.net> References: <20240220-v6-8-topic-rk3568-vicap-v1-0-2680a1fa640b@wolfvision.net> In-Reply-To: <20240220-v6-8-topic-rk3568-vicap-v1-0-2680a1fa640b@wolfvision.net> To: Mehdi Djait <mehdi.djait.k@gmail.com>, =?utf-8?q?Th=C3=A9o_Lebrun?= <theo.lebrun@bootlin.com>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Heiko Stuebner <heiko@sntech.de>, Sakari Ailus <sakari.ailus@linux.intel.com> Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Michael Riesch <michael.riesch@wolfvision.net> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708421995; l=2185; i=michael.riesch@wolfvision.net; s=20230803; h=from:subject:message-id; bh=WQGjonJHv4SJS+dxX3SFBxVGNyfcDP/0ER7RyY5D3Kw=; b=WXoZn0yvOgKVLCymY/AHQSSrbLy6vL0OWA4pStXSuqLRA7xCxgonAdLk1YFJ6mn8szqHh5Mht eoV/bvgzs2DCcbyK5WhbHufMoN5msIqhi51ISghE87RTdhVwjAl4fsm X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=9ral3sulLe95bLcbaiNXTgUTRiBayRBEFZ5OVIEHp+0= X-ClientProxiedBy: VI1PR04CA0128.eurprd04.prod.outlook.com (2603:10a6:803:f0::26) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|DB9PR08MB6763:EE_ X-MS-Office365-Filtering-Correlation-Id: dbde50d9-4ab0-4f8a-8760-08dc31f7ecef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JyteNDqjePRcLM2tjdJTUYUs9/Bep2k9YU2xeIFa9vG4E7/Q+WRqzYGhTwfNmHrgHXfDXyvIrisi9KgNB6IBlWHZUDd5zIdCueZCN9kacHGlo0YgN8fOAhBsKjcWaiUBgXFAlABe0k7GRW9LiPHjKOiUXZNr86tYFedlbkmGk8w8aooeVMCaJfREwWtT4S/eM6zhoDQDlPntcsiQm5D4H8NK0XfozHYixDsnn3MfKIf+Qmb6plYpj0rOYbEUSBklNELEpL0uxmRqH5cycfaLUd0DsviUlLh+Naf3IABZsf/2sAjzYsH20u1SxjxPxxkjKbsGeRA9fQ94Zv9AWkR7ut+rpJ6yajM6kIknekyGcfL5vsMwv6UsZw572K6e83R7if61nt9mY1tnb5a5iEoQ+uZf1XlyfxA9CuJ8GPToSHvBMEM3AXjwGPmrWRM4g1+cIxapQn4SyXW4KkyirU0Y5y2vj+dGTe2vauWJrK2+h7nAsItG3XNoZEtT0gSRlj1/z9YV9RVgJo9Ai7u6epydgWsCgNSUxg+7UQaP2EWLGe4nvdfG9rlwofkSpy+ZdRlw/wEPO6bsLZ4tK9rgdetEswuRxBNF9ZYsHZttxixYvlIActpgOhFjFrHMdIKdNx+t6+p9o6iXWM9t3nqjvuzZ5Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR08MB9155.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(921011)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?dkOWtNTvjZoslsldB7/YmZRkk2ks?= =?utf-8?q?2a8s3ZqJqeQuvdtVgHQoi0GsXHL+Oy+L+cq8pLsMQ367YfdKNyj9Qu2woM4O7Wyvs?= =?utf-8?q?JKg5mc9yGfxB0ziSfqOnuRvjdSbmRdPBY9zOOuSP/oR3lDuNHS3Cfa6UU6KTSeHgm?= =?utf-8?q?ogbrtlfyHfBOeJRyzPnPPGna8KpIP+Zyeis85Z/YXDKGAQSzIr2c/d2/PnIrjdTqI?= =?utf-8?q?bic9UL7eW1bagp7zffM6csAMzUqaFKlKRiFmMCgqJRoP+T3WSnb9D97G2LXE6CayL?= =?utf-8?q?Hz7szW81pRNZrSKaKeNkheGtOh6sklDkHiyr636T1NORTyfvoJh13i+iOhYrpwHFX?= =?utf-8?q?SqRX5klI/xg80ZEob9fHQsSwPKcA0fONq+ysiVGmGmwLHm2ZXkB1xtdpcocO1Yjna?= =?utf-8?q?BLTNvz0Ne6dc1py2oteymdq5VY1/4Ce6iXCpLFBwuHLnzqSewfnJ5nJehZyan9wNO?= =?utf-8?q?/RAYfptDI3qkg4o+IgCEzyw6Q7sGbR6w/dBLyBu2OEdPWWCIQG80uILjow3UeD15R?= =?utf-8?q?Pj+zGy+OZ9xYucPxCHfGk8hJv1jywgbF9e0AjCviY3KIyDcQQUvMtxpKOgGAYhY24?= =?utf-8?q?9/zy9Va5Aw8Rbhx/L1tan+jJG+WZgZCqpjQOd6NB334oJugNr+Hs/RxzB+HhJ+AUb?= =?utf-8?q?WBlM7FPoXHASqwMUz7c6g9Gvseejt+MlejSu4d1PdLybe/QwPFqfAhU463mdGqX+N?= =?utf-8?q?coIGHVNsnBSUetk3bonJOLWTnUc94cxTBS39IPJyCkTyWjiHXUoznP5+kymgzpfF1?= =?utf-8?q?zpDrYjyLM/auo3PuxkL6Iwu8EHAMALHkV5nab5YyWkpzuBeGlJeVgqmlbiDrbEZIu?= =?utf-8?q?M38VWX0eYFU7dNqgj5bo96Wm+9YD0qVgaAtLAfzL5nD1aDMwPY+9c+dG1HeZhjB0Q?= =?utf-8?q?HEQObsCnjbGaYAkNwHQtvdkFMfaAPD4Z6TKFb7tGHfPzy0GUMAknUgM3o90a3M50J?= =?utf-8?q?rbgBQhNd0n0ExnUjgLKrbqUhVsTvs6AYdDXsL8MWyaEewPKXFquj5/2ZiIYDtwUm1?= =?utf-8?q?mjbWPy0xO8rRc4wjqngYWylSHhZbefJwj+8zF9gCeIpGpn2ExLtqctcO0j/XNe3Gh?= =?utf-8?q?j4ma8lEMWL3bOiImriht7sDwtHfXScfTxtzvp/DgDP6hG7drT3iuk3lFMl2OWESzH?= =?utf-8?q?dymp08LtxSgH6ffWRs5jczfPMo2TWSHSpGU6g3/5Ny7Sgri/eQVDBVRmLaqpv5YyI?= =?utf-8?q?MeMub4EmcVRmITNVSyLyQx38Y20Ns9v/gu1UV8ll378WBY9QHvvNvWzTZVdaSHR8+?= =?utf-8?q?h8tq9HuSpJGg9qEF4SdXuseGr5hhl/SqK38S6e8/q8B6WWmaSd27VxymGczXnrpt9?= =?utf-8?q?ELJFNxqJf1/m6LyMRms/GqHM9sCEia3jjzj3AKtdJ0rDCYASgnXKmb3+Nl3OQCYAH?= =?utf-8?q?elq/dk+nYTRzCh44z0eKa3vF4blh4/T2EKB0vDyg17jLqifqUjho/tB7op5JNYQeC?= =?utf-8?q?cfzKJUFoVWw9W90FHJR+FYmvWK0HlU89dKVL5AFOppRqIro6+TC1wTgvWE0Vtc2A5?= =?utf-8?q?OFa+z9e13tzM0mWLR0jX88AbAD6+J9pNMA=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: dbde50d9-4ab0-4f8a-8760-08dc31f7ecef X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 09:40:08.2511 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ugH9ifatd4iBYxTgqqOVJ5pN4NNtoDbBYLlR9e4oYswyTWhrOodBuPv+G9umUwm7+oTPDbs49Xm7ZcH4xxsQMbIn2U5X/HZxduViKxWfwbI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6763 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791411315614324643 X-GMAIL-MSGID: 1791411315614324643 |
Series |
media: rockchip: cif: add support for rk3568 vicap
|
|
Commit Message
Michael Riesch
Feb. 20, 2024, 9:39 a.m. UTC
The endpoint information such as bus width or flags are required
to set CIF (and on certain variants GRF) registers correctly. Store
the information in the private data of the driver in order to make
it accessible.
Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
drivers/media/platform/rockchip/cif/cif-common.h | 1 +
drivers/media/platform/rockchip/cif/cif-dev.c | 11 +++++------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/rockchip/cif/cif-common.h b/drivers/media/platform/rockchip/cif/cif-common.h index 89ed9dd6f36d..34da800a0504 100644 --- a/drivers/media/platform/rockchip/cif/cif-common.h +++ b/drivers/media/platform/rockchip/cif/cif-common.h @@ -108,6 +108,7 @@ struct cif_device { struct media_device media_dev; struct v4l2_async_notifier notifier; struct v4l2_async_connection asd; + struct v4l2_fwnode_endpoint vep; struct cif_remote remote; struct cif_stream stream; diff --git a/drivers/media/platform/rockchip/cif/cif-dev.c b/drivers/media/platform/rockchip/cif/cif-dev.c index 660e28397916..923831827be4 100644 --- a/drivers/media/platform/rockchip/cif/cif-dev.c +++ b/drivers/media/platform/rockchip/cif/cif-dev.c @@ -79,9 +79,7 @@ static int cif_subdev_notifier(struct cif_device *cif_dev) struct v4l2_async_notifier *ntf = &cif_dev->notifier; struct device *dev = cif_dev->dev; struct v4l2_async_connection *asd; - struct v4l2_fwnode_endpoint vep = { - .bus_type = V4L2_MBUS_UNKNOWN, - }; + struct v4l2_fwnode_endpoint *vep = &cif_dev->vep; struct fwnode_handle *ep; int ret; @@ -92,12 +90,13 @@ static int cif_subdev_notifier(struct cif_device *cif_dev) if (!ep) return -ENODEV; - ret = v4l2_fwnode_endpoint_parse(ep, &vep); + vep->bus_type = V4L2_MBUS_UNKNOWN; + ret = v4l2_fwnode_endpoint_parse(ep, vep); if (ret) goto complete; - if (vep.bus_type != V4L2_MBUS_BT656 && - vep.bus_type != V4L2_MBUS_PARALLEL) { + if (vep->bus_type != V4L2_MBUS_BT656 && + vep->bus_type != V4L2_MBUS_PARALLEL) { v4l2_err(&cif_dev->v4l2_dev, "unsupported bus type\n"); goto complete; }