Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1626761rdb; Tue, 20 Feb 2024 01:52:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWq9LEI4XvpC7wLHuKSscW1xmZzgmObhZ1wufwbXX3XbZDqeIkMcV4PP85tcvylpajqEV9Sew3THsFvy7Zr3dkSGlR9qo+abAW0UGkOfg== X-Google-Smtp-Source: AGHT+IHUPxvFZitC5D4VbH4Y5Yu8hmxAbkrTC5icOAMCdj4vXjivCbQ0KQyumaY83AxjfTxg8BPo X-Received: by 2002:ac2:4835:0:b0:512:b24d:d472 with SMTP id 21-20020ac24835000000b00512b24dd472mr3152442lft.64.1708422743531; Tue, 20 Feb 2024 01:52:23 -0800 (PST) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v21-20020a509555000000b005648d81a61csi1309012eda.622.2024.02.20.01.52.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 01:52:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72714-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 22A2B1F2973E for ; Tue, 20 Feb 2024 09:42:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86DE4612FE; Tue, 20 Feb 2024 09:40:14 +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 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 , =?utf-8?q?Th=C3=A9o_Lebrun?= , Thomas Petazzoni , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Sakari Ailus 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 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: List-Subscribe: List-Unsubscribe: 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?B?ZGtPV3ROVHZqWm9zbHNsZEI3L1ltWlJrazJrczJhOHMzWnFKcWVRdXZkdFZn?= =?utf-8?B?SFFvaTBHc1hITCtPeStMK2NxOHBMc01RMzY3WWZkS055ajlRdTJ3b000TzdX?= =?utf-8?B?eXZzSktnNW1jOXlHZnhCMHppU2ZxT251UnZqZFNibVJkUEJZOXpPT3VTUC9v?= =?utf-8?B?UjNsRHVOSFMzQ2ZhNlVVNktUU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ZGNGJs?= =?utf-8?B?aDQvVDJFS0IwdkR5ZzE3akxxaWZxVWpoby90QjdvcDVKTllRZUNjZnpLSlVG?= =?utf-8?B?b1ZXdzlXOTBGSEpSK0ZZbXZXSzBIbFU4OWRLVkw1QUZPcHBScUlybzYrVEMx?= =?utf-8?B?d1RndldFMFZ0YzJBNU9GYSt6OWUxM3R6TTBtV0xSMGpYODhBYkFENitKOXBO?= =?utf-8?B?TUE9PQ==?= 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 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 --- 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; } -- 2.30.2