From patchwork Tue Dec 17 15:55:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13912187 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 083C9E7717F for ; Tue, 17 Dec 2024 16:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pWkNc8fK9Tfm7JgT59wI/imAn+vxr11dgp2yqbb1eTw=; b=K43ygpt+zl4LY0kyqPfM7UtNoV PT7tka3mBm8Vkv2/alx7z4EbDulth/qKUx4pe+m3smM3QBTMccP9hmY+2O0T+kRd1aLQr0FIqDnhY v2td0hZEGnclDAwoGh+Gy8dYoSUYhclo4+SDbU1bRQfhkBg3W6P7a7brtL/OboYJ7ovb5kRDGbuF8 kFpkVGDe5MRfKb3/yO+SmmlYYFnYIo3pMUSakLgqwWJOVQgo8dXr7MaDqU7vns/874un9Jb/pnuV4 nrPyNouX2COvfjpaQaWrTMEEse8TnUt97pRL9MbUg4Yh3eoYSo9lpRUzhjy/8nULjPa9U/VB3vJR9 dfJQXCEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNaOw-0000000EAh0-3bwc; Tue, 17 Dec 2024 16:26:26 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNZuy-0000000E2po-145s; Tue, 17 Dec 2024 15:55:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Aa0/qdNX1Pav0gqc+mdUJp7vTVJvnIMBXmPpi4zzhNCLAV5ITgWf31/RI+aM5upmqR8ggWXal+JBJlqgMcKpxMOMBlNinnio3HrLUKRfuwLTbyV/DZW2CPCsXEF2X7eD9slooieYTfr/rwiEEuK3UwsKs1+rlgID0av79N+iCofcx+n7w1fLiel1OFb5bkEIQX6zYjHVYar1lR/zDvLQiNK95qV5w6AhZqtgMkpTcpKjbGPYNQRuGaSBhlLBVEkzGD6BMTkFazwujlr04HFxSUURMKLNCVnbPFYwrBSsZo+yqKwVFoFWcfmZR8VS1jC5mwjqwutccoMvjSJpg+Ulzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=pWkNc8fK9Tfm7JgT59wI/imAn+vxr11dgp2yqbb1eTw=; b=i/lpMeaEEQu3VegK4L65em0M0E8eWXBDJvXV6Fdj4nfANykFv7JVxTZ8q3Maqt99Dp+6F3p+vusAcQbZ4PyT/XyEFcL4bXGmMxOJ9AwHpVwKX9NKeuneIkgU6WhHcYvmy4o+6KATaELgwjFxdRfdJ8maATL3XJ4ad6d1ZMT82jyabUKH4IxCW7TAA9s3kS/PLeofn8tlUlaYWDCwrqHtS/aYniPv5Z8WgYJIkJQGPc+CIDBEM4yccRFoox1YNW9bGv5aU6YFUvQklaa4MUeO44n9kV9Se+suaivXuKq2T+2RGjf9q+FUXmpLYnBrzUfRKrauDlnbZmv5xQ3LiERhGQ== 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=pWkNc8fK9Tfm7JgT59wI/imAn+vxr11dgp2yqbb1eTw=; b=IVba4SFzSwHnjClEI0hb8D8QDUQOkcPM0vyrC9nGUu5nlGOOvQSZLlIo7Z3lEDtRhGnGNfN9/CiBfDB5nj5BKb0ROgE72isSmQU+CtyPyi5yVQJINgBPp2bPn18dBwceHOWQhFzjgeoP5DG0MLOJK2DfZDzvEl1MPMb/tRdhT0E= 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 AS8PR08MB10149.eurprd08.prod.outlook.com (2603:10a6:20b:63f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Tue, 17 Dec 2024 15:55:22 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d%5]) with mapi id 15.20.8251.015; Tue, 17 Dec 2024 15:55:22 +0000 From: Michael Riesch Date: Tue, 17 Dec 2024 16:55:13 +0100 Subject: [PATCH v2 1/6] media: dt-bindings: media: video-interfaces: add defines for sampling modes Message-Id: <20241217-v6-8-topic-rk3568-vicap-v2-1-b1d488fcc0d3@wolfvision.net> References: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> In-Reply-To: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> To: Mehdi Djait , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Leb?= =?utf-8?q?run?= , Thomas Petazzoni , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Kever Yang , Nicolas Dufresne , Sebastian Fricke , Alexander Shiyan , Val Packett , Rob Herring , Philipp Zabel , 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.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734450919; l=927; i=michael.riesch@wolfvision.net; s=20240405; h=from:subject:message-id; bh=g3tpAJJnMyFyzkixlbq6j8An04absIUx2MkV/qioC2o=; b=F45ata9Zbkm53oBC7JEJb4kRgJ01vOjjiu+4lgjQhu7gawLvMAUqEaoDMX1Mv+hAQXtvKXmRl cT0Zk1Qj5I3CRXW/mFEMxMUqgZY8VebKIGWwcbZIybRwg44cfQimBSX X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=cSJmgKSH3B6kdCIDCl+IYDW1Pw/Ybc6g9rmnUd/G7Ck= X-ClientProxiedBy: VI1PR08CA0244.eurprd08.prod.outlook.com (2603:10a6:803:dc::17) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|AS8PR08MB10149:EE_ X-MS-Office365-Filtering-Correlation-Id: c6721763-cd48-4b25-897f-08dd1eb336ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?ut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Seqs3OQezOBdfrTtWoHznmTaEkPS8YU?= =?utf-8?q?V7T36Z+oLEhTdozketaSzq0QS0XMUK24ccFtEPexn1j8arqncMtbpgc2fsDTddPK1?= =?utf-8?q?iakVZhbOJzkj1zQiBtvNYiRRe4qfo1x2GrG8uWZDTfwHTitIi8CZw1BJ8Cw6FIRB0?= =?utf-8?q?RoqKNCp1xqpF2IQHSMZpxQ8kvaIzbOKMP+/imSWo1bfXoJSiOXAPuBLc40x1lOa5C?= =?utf-8?q?tMwf7Tagf/DrOK39C13fVNE/3LsJHz8dr47jIdrWyqe849BKu1vH0i8GNQueMtcCL?= =?utf-8?q?E+tb3rCKHlhnl0ZAK0Xp6Q/j+bZOll129BCF09NNxyhDRhG3drN8luZSBH7JIsC1v?= =?utf-8?q?6m/fYyblwLmYXpO6un5j6Al6POs+6VNqM5FK9prqGQujgPcFkF9EeN9SQ/doSRIWB?= =?utf-8?q?2klVHHN1cOHvLxB+TPTyT9vJABZf/XehpWyZRsQpHZRCSJBHF7w0JK+gKEC+qhpNR?= =?utf-8?q?94Q3cQ+/lN/Chz8ZQCj970qcV2tEVVnszGKgrL76rJuWuFbba2/Qd1m6+elSXEm/k?= =?utf-8?q?FD0AQTMLXM1a5b1bLHpD/6HYBWJ+9ThCg=3D=3D?= 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:(13230040)(1800799024)(376014)(7416014)(366016)(52116014)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?8rh1dBDgSUFMit71Y9mCVz/8O5B3?= =?utf-8?q?TbKoKBJuQEdG86sX0gIiPSOR3twpI7Xt9toewn6SmRUmqa97TYAXBs6mZBzb7ug32?= =?utf-8?q?aRkK4YwKbpiQwKKnVRFjOtO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AfCJViI9sPfLkmh5Q?= =?utf-8?q?99j/riMCvV8kEk+5PaPdB6nqJ38p7bZm1HwKKo9sTK/fDsyUx9+PH46tZ1RTvy5FP?= =?utf-8?q?Qdn/NXkHbOyGdjzNgLqnKpQfoPk7egnO1rS3ap21vLpzf5sLHw+MzLkWX0oRH330g?= =?utf-8?q?PLbtZhloCm3SXHVwgMVKtpHRYwk7gH2n/H8Us68Qs9ZVA/bFGVU1SKCb8a4azOwst?= =?utf-8?q?bQf43MX+PD+zCpZfZpDp+AMC/x3PSYTRnNN8Nn/tVMHSzEwkNxZ24ZMhhwh8xrIj1?= =?utf-8?q?R5sm8wenI8LbIp158nvGwGLJnz2YgOGsaE6GHKR9o4irQGd1kJvoUlFiCPCNKG9te?= =?utf-8?q?TRilkxZ2tkS+fyBD84Pl37JF66hAmVwYdc8QjRJsYFwAxZ+yeZtQdaeg6jVw7CUYN?= =?utf-8?q?ppgKVtyqP70st636KrQU5fGUfSK9JxglHRB7wU0JwTMo5rArIgidVkITkDfJ2Gs3g?= =?utf-8?q?QjKpfFyoRnwniW6P/2kqMOxSRLWgWqnqyMWDJtf54NkqOXitSwWjkyWxrDg9c2oOP?= =?utf-8?q?A5c1M6tA/OjtKDjowyEYYzkMDgvY4Rk7ug=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: c6721763-cd48-4b25-897f-08dd1eb336ab X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 15:55:22.2482 (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: 3Z4Swsxy4GbdxxqTpXjhFAHZruMh2MtHuWeQnOxAAdfsjLcDmJCvz3lDyvnDO3Zmmh4wHXnjdKZ/5gVeoMs+O6xKAAFMnB5NiOGrd4LD/RU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10149 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_075528_298388_C198594C X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add defines for the pixel clock sampling modes (rising edge, falling edge, dual edge) for parallel video interfaces. This avoids hardcoded constants in device tree sources. Signed-off-by: Michael Riesch Acked-by: Rob Herring --- include/dt-bindings/media/video-interfaces.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/dt-bindings/media/video-interfaces.h b/include/dt-bindings/media/video-interfaces.h index 68ac4e05e37f..02d8239c2038 100644 --- a/include/dt-bindings/media/video-interfaces.h +++ b/include/dt-bindings/media/video-interfaces.h @@ -13,4 +13,8 @@ #define MEDIA_BUS_TYPE_PARALLEL 5 #define MEDIA_BUS_TYPE_BT656 6 +#define MEDIA_PCLK_SAMPLE_FALLING_EDGE 0 +#define MEDIA_PCLK_SAMPLE_RISING_EDGE 1 +#define MEDIA_PCLK_SAMPLE_DUAL_EDGE 2 + #endif /* __DT_BINDINGS_MEDIA_VIDEO_INTERFACES_H__ */ From patchwork Tue Dec 17 15:55:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13912188 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94B65E77184 for ; Tue, 17 Dec 2024 16:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VikGLePMQ9QRBVE4hbE7LcLpfXFlDftNktO4sp2LOLA=; b=GxgFdyhB9XwXVlPFUFIKmEr37D SLgNxNempOtNLNrUl2dydxyiSHrsWm4PdvgpirUAWqhkvi52wqqsAfI/fbazL+QLtdy1R7XZJupz3 c2c4r8tdVhd2iW4TRawpgqqtRgmExRACr+7GdmuTWgHionN0vo1fMM1jQvuJgE8V0kOA6ooqWnpCj z0fJzShk0SQpbpIvGyQEw2JqmbthGf8lEtwTx7GKVO0sPdKc5NguUGFd1U7WeJFtBHqfFYSVif7sC M9HCliqYLslzl8DU+eAysQeIsbD2ibOL6d2RqcIkNiVn5wG9Bkwn36Mzy7DFFaJx4cH8wqs0FWW4m o0nd+7/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNaQ1-0000000EAzu-4Als; Tue, 17 Dec 2024 16:27:34 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNZuz-0000000E2po-2mP6; Tue, 17 Dec 2024 15:55:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t1rYpOrGu2HsSEUgGDVMyvdhFy7vC7tjRAKgyzgYGvDJDLWy/6r1uVnu5R28Tkh2dcScGGAPdp7L/hNqoImbNOR6/56IqOnBIOv3OSbGq10SYBWkZbxUJprhZVl24prgqsdLjn9bZy0pWNwL70cL+5/MvSHmBQiDYJadJNy+lxN4TD5S4jMFma1f0cEucNltH/ZdB/ih7Wmy49vI6ZcK93OAQgS5sp7vAuz25rfTSFYK8AldR+5ZN5LCZDxH74qYQWtzJ9qktiSSGYIovvSLRuarMcFqgsQ7BqR7m4I5OPgtNKVTnhKWTq8XsKkZK3+C9jPdagrqBgErWeMXvEmNGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=VikGLePMQ9QRBVE4hbE7LcLpfXFlDftNktO4sp2LOLA=; b=vtpekwNjmCBM0YN+4ZeFEmbyIZlZEQ8HhoRD6NJr0WkIlv8uafxvm7ILq8HEC71Bqv1q6ebwkJUkOLODQuvTdi1p7O9EIldHry5+BY6d8lvmki+YxfpBp8pcdyC1cHfsOd6p0LVnZNge1KW3zEj9dVwfRKQj5el/l4EEh2DRUvBvnHjC6DEAG9jDB1KFonwaPJhRpdKIKQEdQMjkfVT6Y92EDcy54IKEBij2quQI7qRIECgB0mE6AR62tRjQneISzO8ET4+HYTPp5FTIOT1WJ7P1/TFTpuhR8q9NYeYEt7dZhqkx2VMuMoFjSTPeEZgzUZDHc7R6Nulkt8cDrT68Ng== 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=VikGLePMQ9QRBVE4hbE7LcLpfXFlDftNktO4sp2LOLA=; b=kit/GAUr6BRsLg406UkmnuWmegfZG8wBaLAyr9TpYxJ4I/R6aHwXu/ynM7+xVgYG8dgGW8E4G07C4cpant3pIY5sSx0NA8Q6/0lC2cSKXOfHgTCwNPEPPnkes2mEo1pCWK1mMfsMb9RDPbnauI/NVcIsL5ktRzaDPEWDPFLmKTA= 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 AS8PR08MB10149.eurprd08.prod.outlook.com (2603:10a6:20b:63f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Tue, 17 Dec 2024 15:55:23 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d%5]) with mapi id 15.20.8251.015; Tue, 17 Dec 2024 15:55:23 +0000 From: Michael Riesch Date: Tue, 17 Dec 2024 16:55:14 +0100 Subject: [PATCH v2 2/6] media: dt-bindings: media: add bindings for rockchip px30 vip Message-Id: <20241217-v6-8-topic-rk3568-vicap-v2-2-b1d488fcc0d3@wolfvision.net> References: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> In-Reply-To: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> To: Mehdi Djait , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Leb?= =?utf-8?q?run?= , Thomas Petazzoni , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Kever Yang , Nicolas Dufresne , Sebastian Fricke , Alexander Shiyan , Val Packett , Rob Herring , Philipp Zabel , 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 , Mehdi Djait X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734450919; l=4393; i=michael.riesch@wolfvision.net; s=20240405; h=from:subject:message-id; bh=RmVu3SsH9qeLCvZmcE7bNMUYIKOSWsz4lkOu6z5dwzw=; b=JtswgMPckHBY4HJLJtx2TFMEoinGD9JpEGJOuzSHogcvQhAOEqlp52WZ1aKX5AyegFj6rbyag EXgIf+TsIqXArxEtDHkT2k9TLZdYFB0ybFwnzAAsTzu7lIxdXZbK/UF X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=cSJmgKSH3B6kdCIDCl+IYDW1Pw/Ybc6g9rmnUd/G7Ck= X-ClientProxiedBy: VI1PR08CA0244.eurprd08.prod.outlook.com (2603:10a6:803:dc::17) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|AS8PR08MB10149:EE_ X-MS-Office365-Filtering-Correlation-Id: 60d6d35d-81ce-454c-1c85-08dd1eb33789 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?L2vtZchltAa0tqAK/XXWUu/WyLc+UJp?= =?utf-8?q?uWUotgZfHICAYSYlS3vJqWUc5TqNnO7UFFzaNZJVKlTWdxNjGYVdeJBcplnvj6s3v?= =?utf-8?q?4uOKrw9RKnXcLi4QHKkAoSZkFwFfGnKaFkwjG408Ks5LRHbCejrTsN9Z0vCSf9S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f-8?q?6Q6YL9fgI2zPmim0tFCGL2q42NSv14xRCRhZOG23CUAEsdvM7jo7xCyq9lwZlFZe8?= =?utf-8?q?tmeYTrCrADdrxFSXRSsxOfrlnauPK9QKtAk1Fa1MA2phg7NLDsb4BZPASHAANkaPb?= =?utf-8?q?l7IFeuuP15ur/cPezXV+zBwh5PM2m5VU9LQuSpzv8ImWIdU7aMC5+fZ9XjNswo6eO?= =?utf-8?q?F0B1XRcDvsP2m4Pa80NU2WJVKmrV2ilkbaffIadHGGDIoGiYJ6NVN/Dc93Pb6MuUd?= =?utf-8?q?/m4GgZMsTwLoRP1mrKp5J+mZNBZIJAHtZmUb6juU43FiqWpyFVTm3O7ShL4BMPTh6?= =?utf-8?q?sOwT03aRLN32nW3YYPzvOcbH/bXaRqFqLw=3D=3D?= 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:(13230040)(1800799024)(376014)(7416014)(366016)(52116014)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?h3cJonKD9rQ88wwHtcMmP/bDgiSo?= =?utf-8?q?2kP05ASzEt86d9letHT0T0n8wrm/2P6O6MLDSvLZtEWqstHNUJTOyvu15a6TEevD9?= =?utf-8?q?rPdlk/6etJM5+pkzX0O1PBwpym/N9Gu6DrrQ3Jlb+69zuAncw4exE6BNfUXMqRjUJ?= =?utf-8?q?sA0WGlmoP8W19zQlzpnCQTRJmbzW7jS7xKrfpW1ohLtY+zrjxP5ygllBuobwC3QGE?= =?utf-8?q?Pcfi3TIpzHEN4FNmLavLi0mp3Pg6wBJP7QT7QXJO+FzM8wwEwq62a0P6OYpvZPuB7?= =?utf-8?q?w/QltGrNHza1dIU926mKEoGnG6n+Cj50vPzy8Zdqf6LEgAF0N46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ytrcDyPQ/E1m?= =?utf-8?q?Te3cznaA2cq4r/3TE6pTnnksOVzb+hDKRS6yR6w5pzi3wX9pfnt5IMauKOGrHR+q4?= =?utf-8?q?++oVd9+2kBvvWCyimklvp4bt64tpvg/9XSxmaK9gzSd6xbfq1Yv1mFlbJjiRb81IM?= =?utf-8?q?jaOoCqzrmBf2qQfZ7iyLLdqexVhMw7B3vLtndLJ6yXknJlIkp8etgAs1AG7jvahAJ?= =?utf-8?q?NHl+sts25pX8oWVjNi8RfIR15ULQM0fMWbsfvLf5fegovVUG3HWAarkFOw6rS5mQ8?= =?utf-8?q?LovEDkfjZDTbfn6FKComir5IQqmxbgEXfQ2wQE/GE3wWnzwc2VSu2YRl34hkiA7B7?= =?utf-8?q?4oTKFtqLXEW/zbidpMDJnTl86YtAaZIMLg=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 60d6d35d-81ce-454c-1c85-08dd1eb33789 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 15:55:23.7020 (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: eba52Tf+ZKVbTy2HF2r+jwPGO4oHXxqwNWtt9VKJJZaK171pPZbIoddTDQqev5tm0KXyk0O1IjovfTfel2MD69cXuBVuA1FjcCivIyTbJBM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10149 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_075529_714552_F519490D X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Mehdi Djait Add documentation for the Rockchip PX30 Video Input Processor (VIP). Signed-off-by: Mehdi Djait [revised description] Signed-off-by: Michael Riesch --- .../bindings/media/rockchip,px30-vip.yaml | 123 +++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 130 insertions(+) diff --git a/Documentation/devicetree/bindings/media/rockchip,px30-vip.yaml b/Documentation/devicetree/bindings/media/rockchip,px30-vip.yaml new file mode 100644 index 000000000000..d34c0974204f --- /dev/null +++ b/Documentation/devicetree/bindings/media/rockchip,px30-vip.yaml @@ -0,0 +1,123 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/rockchip,px30-vip.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip PX30 Video Input Processor (VIP) + +maintainers: + - Mehdi Djait + - Michael Riesch + +description: + The Rockchip PX30 Video Input Processor (VIP) receives the data from a camera + sensor or CCIR656 encoder and transfers it into system main memory by AXI bus. + +properties: + compatible: + const: rockchip,px30-vip + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: ACLK + - description: HCLK + - description: PCLK + + clock-names: + items: + - const: aclk + - const: hclk + - const: pclk + + resets: + items: + - description: AXI + - description: AHB + - description: PCLK IN + + reset-names: + items: + - const: axi + - const: ahb + - const: pclkin + + power-domains: + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: input port on the parallel interface + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + bus-type: + enum: [5, 6] + + required: + - bus-type + + required: + - port@0 + +required: + - compatible + - reg + - interrupts + - clocks + - ports + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + + parent { + #address-cells = <2>; + #size-cells = <2>; + + video-capture@ff490000 { + compatible = "rockchip,px30-vip"; + reg = <0x0 0xff490000 0x0 0x200>; + interrupts = ; + clocks = <&cru ACLK_CIF>, <&cru HCLK_CIF>, <&cru PCLK_CIF>; + clock-names = "aclk", "hclk", "pclk"; + power-domains = <&power PX30_PD_VI>; + resets = <&cru SRST_CIF_A>, <&cru SRST_CIF_H>, <&cru SRST_CIF_PCLKIN>; + reset-names = "axi", "ahb", "pclkin"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + cif_in: endpoint { + remote-endpoint = <&tw9900_out>; + bus-type = ; + }; + }; + }; + }; + }; +... diff --git a/MAINTAINERS b/MAINTAINERS index 1e930c7a58b1..1138c8858bc7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20217,6 +20217,13 @@ S: Maintained F: Documentation/devicetree/bindings/net/can/rockchip,rk3568v2-canfd.yaml F: drivers/net/can/rockchip/ +ROCKCHIP CIF DRIVER +M: Mehdi Djait +M: Michael Riesch +L: linux-media@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/media/rockchip,px30-vip.yaml + ROCKCHIP CRYPTO DRIVERS M: Corentin Labbe L: linux-crypto@vger.kernel.org From patchwork Tue Dec 17 15:55:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13912189 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8A8DE7717F for ; Tue, 17 Dec 2024 16:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SpOxnUuYuiAKpv3UeEc0kDOUPXyoFt/7NcJoHQR217s=; b=wQUYRLgCgYtUlg3qxQr4/K2GhM lyrpceBXQNbSYzOaQ1wTCwEAC38qC9Dmiqptb8lSXqu8UFuhtzXGKduxaHnAXfMaPPmVtSjlcjoHw GKS6T/z3wPZvC4dING+TZAT0w8yS7eZzURSHlDPF/GrKIdN8EmOzlrho93zEnrBMko+W+a1rpollL xoXB6zeK4YD8ODQQINL3mOhsSwprFmlu1IULw5yoLTYXArdHpUmgkmUjRFPS1638/MtKu98N+sSv+ pZMwsAt11d4aU47Th7uAGtyxyqFTrU5MJvM1dLBIXcZGM491ZITd7zOYFbDf6Y4O2eHymk07T1lcd snc1bwiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNaR6-0000000EBFM-12X4; Tue, 17 Dec 2024 16:28:40 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNZv1-0000000E2po-1pCA; Tue, 17 Dec 2024 15:55:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yJZHggbMZTYhGYzrxv7Gji77Rg4acReYat+MgErackxzKZ7yomfGkSq26+AuKBDvBhtRk68Pw7IYv6jgfhmlvgEhFTDy48lCysb9uNJr/mIHJuTNkUG9CNce8pub1E/9qA/nO00xwhxldlna+n7eVTb6AoE0ji7yf/MH/GamJL5h+PnOPX6+BSVztG2cyREKwHHJK9RoBlJunAi5SU8lJOVDJwkkADW+t/2fTG+C20uWIoFWrlij8x/RPQx0EWAnGxJL1uZNe67fqR3nLYIHoAHQbUtQ60ORy7E2evnI7hep4GcTleWpM6g1Xvyxogb62WSfQpVASPkg5LcWBOl6XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=SpOxnUuYuiAKpv3UeEc0kDOUPXyoFt/7NcJoHQR217s=; b=i+WZ5hJFX2Gev7DZY3OXl4RNLZ05yFbf3ALLzCw0O5/Lzexta7eEY3QesThF1hlsYyobPX11ZAlDV1JmvoHgOGj/tZXyKZvhxTZG15ahgRq/gGN08pW5EIeOqnLbTBeLpD2n06sO3ZylKR061rUtLUTJKIHelYEMJ2nJe4Rq3GwfCuTNIU1ASlpksZVRCPGpayDbeKXCDEATUl/+44WrAddGfT3Xb8PKgdzrzY98ifZavst3UfIcuIXXwcH8GSTwX5yy3PuDnTnhnox7QH0TjzqHtpvze9kW3Tpo5j+dshCyCMkBSbphyJzAg2YQtcMMsUW6cRajJDp1QF2dukmaiQ== 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=SpOxnUuYuiAKpv3UeEc0kDOUPXyoFt/7NcJoHQR217s=; b=OIYgQAOnltwtd1uhTH09MsmouBDBWjixetTxdDo4Y/QVaZz/r/dk8IKjIBtgqxP1E806QYEC4D5r0ZmmL7yEq9cksu0my09T1Aqoj3kexZiafmInJHo/gG5FpPafZlYA7zfWdjsuK5Z2a+n4c+lVz57ZKdM/g/fcQg7Z4LYIls0= 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 AS8PR08MB10149.eurprd08.prod.outlook.com (2603:10a6:20b:63f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Tue, 17 Dec 2024 15:55:25 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d%5]) with mapi id 15.20.8251.015; Tue, 17 Dec 2024 15:55:25 +0000 From: Michael Riesch Date: Tue, 17 Dec 2024 16:55:15 +0100 Subject: [PATCH v2 3/6] media: dt-bindings: media: add bindings for rockchip rk3568 vicap Message-Id: <20241217-v6-8-topic-rk3568-vicap-v2-3-b1d488fcc0d3@wolfvision.net> References: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> In-Reply-To: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> To: Mehdi Djait , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Leb?= =?utf-8?q?run?= , Thomas Petazzoni , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Kever Yang , Nicolas Dufresne , Sebastian Fricke , Alexander Shiyan , Val Packett , Rob Herring , Philipp Zabel , 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.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734450919; l=5915; i=michael.riesch@wolfvision.net; s=20240405; h=from:subject:message-id; bh=Va3AH3yoDneGj6VtaQffrOm8FCWBAjJbbRmmYuUD33I=; b=2mUH4BvuS669MmEcjMJQOLwkfrBWbxecZ7IkJ2hCwIpppansZuzkSQI6xEkM/F/c0SrDhz29C sRzQd3cMfkCBQViO7UdwXCLdNtO3AC/95srFmKuTFKKMysdyYnop+U3 X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=cSJmgKSH3B6kdCIDCl+IYDW1Pw/Ybc6g9rmnUd/G7Ck= X-ClientProxiedBy: VI1PR08CA0244.eurprd08.prod.outlook.com (2603:10a6:803:dc::17) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|AS8PR08MB10149:EE_ X-MS-Office365-Filtering-Correlation-Id: c8b2af74-f356-4e3d-62e7-08dd1eb3385e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?SBUvQDDVJf8T2/C2lwEyNN9awb8zNK9?= =?utf-8?q?THSuSkn6ZQ3WrAAt9VtN5cmVYcQrkUz7rkOw2B5n1fjnhCIjB2DIObyBxxMB0jP2a?= =?utf-8?q?V6COd30F5J573xj4ER7KGeSDnEACFKAxc34HGElkW7BCEI+8Ow2JOAT56ycSKceTg?= =?utf-8?q?kym3fFNS8Lhu6BrU4u5WgE6BhZ2440bZbkoW9euF3qrLSf7WAMTswoY7x0pywz/eT?= =?utf-8?q?gzTUOES8wdWb4/JTvwqRNIyB1Hl7pnj+h0kfaxbU69fRNR91x/3f0XfeEYuPxcNgC?= =?utf-8?q?oxJw1UXyVm3sO5fuV3yYQee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kIV/dnnr9W73uu9KG7LWwKgmUHizEtmqmSics6w0thH?= =?utf-8?q?NjJGDtwbYXCXNyvfWj9gcRftEBS2CHL9jTUXBYEI4gHVUEawVU2qtmFnj0toG2kgm?= =?utf-8?q?yaQJlHs2pFKK7QIyWPmeVzcajJ0tNy8JcpvJZYHi7Y2GzZGZWZ9VYOfabUywHrSMh?= =?utf-8?q?+ufBYPGHOE7wENkj0t145ovA70oRVelZCA=3D=3D?= 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:(13230040)(1800799024)(376014)(7416014)(366016)(52116014)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?A68u4eQfWdCfUvjjld61GY2/v+gm?= =?utf-8?q?mbd6I3HGhbN7uNR1/z2D9PCBaycNF45ypBznkeXSPJz5VdofVYOL90/IB9dw0DSix?= =?utf-8?q?UCspmpKeH0dobZi+k5mW7USPaxoUmrvZ4UUE9HcJJxiDFgJEDQrWVA7UvqOYSPc3U?= =?utf-8?q?38YUGAy/SqEXu0iMcsCkpBaS7LFIa0uwPmwtty9Oyv6dA7XOnM/ob0acozH8Bm3+f?= =?utf-8?q?0hd3016rVcdR9MT91JgPn8dT4SO9EIryZaQCwlcIgW3JAl2cCEv+uA3z6hZFuaBec?= =?utf-8?q?YoyAt4E2c0XHRpuFNTvZfv8K/L0zZC/V4wJOa0SkVgPR2lEyXuIAkp9P2o66VGDYy?= =?utf-8?q?4wk1Ls4SRwjZqYYZ85wrUucU9CDus/duQgPgeCekWqfcTY73ycjHmuzzApjhlGkT5?= =?utf-8?q?RPoyZdwP+sY71jxwiUyBg5Xu5mK2DlOLCf5acsV9ZPy5pougs0KJajIbKRty1WcRy?= =?utf-8?q?+s7AMzXnGo652h5Z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YZ624m0mNGbSFxlSUiHOC2KqAP3gVQ6Z4myL?= =?utf-8?q?XeBiMJfjylEtmYvKnXUkAPeqhMH9XXm72iMp3owNDuIJQesw6nft/rSfwfHp1Hgzn?= =?utf-8?q?S/K1OiNx1ZtEmfgH9oFtSD8xYRTNuDMV1nXEGqwwpKvR2g+neEG63HvMT3vmetQWB?= =?utf-8?q?IwEn8bYjokOPzwUXeJ8xGs911oD6spKNew=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: c8b2af74-f356-4e3d-62e7-08dd1eb3385e X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 15:55:25.1188 (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: RNcHUJJDf5RCwtjcqrIAmsXR+FDpxU1+sM0SV18Y+/6YbE5KFRQFYUDOvBaJkw/7eprIuMORKkpQF4rcBgzFA2jP0r2jQx+VbxkUeMdb3GU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10149 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_075531_629451_265293D7 X-CRM114-Status: GOOD ( 12.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add documentation for the Rockchip RK3568 Video Capture (VICAP) unit. Signed-off-by: Michael Riesch --- .../bindings/media/rockchip,rk3568-vicap.yaml | 168 +++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 169 insertions(+) diff --git a/Documentation/devicetree/bindings/media/rockchip,rk3568-vicap.yaml b/Documentation/devicetree/bindings/media/rockchip,rk3568-vicap.yaml new file mode 100644 index 000000000000..ef7b14ca6879 --- /dev/null +++ b/Documentation/devicetree/bindings/media/rockchip,rk3568-vicap.yaml @@ -0,0 +1,168 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/rockchip,rk3568-vicap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip RK3568 Video Capture (VICAP) + +maintainers: + - Michael Riesch + +description: + The Rockchip RK3568 Video Capture (VICAP) block features a digital video + port (DVP, a parallel video interface) and a MIPI CSI-2 port. It receives + the data from camera sensors, video decoders, or other companion ICs and + transfers it into system main memory by AXI bus. + +properties: + compatible: + const: rockchip,rk3568-vicap + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: ACLK + - description: HCLK + - description: DCLK + - description: ICLK + + clock-names: + items: + - const: aclk + - const: hclk + - const: dclk + - const: iclk + + rockchip,cif-clk-delaynum: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 127 + description: + Delay the DVP path clock input to align the sampling phase, only valid + in dual edge sampling mode. + + iommus: + maxItems: 1 + + resets: + items: + - description: ARST + - description: HRST + - description: DRST + - description: PRST + - description: IRST + + reset-names: + items: + - const: arst + - const: hrst + - const: drst + - const: prst + - const: irst + + rockchip,grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to general register file used for video input block control. + + power-domains: + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: input port on the parallel interface + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + bus-type: + enum: [5, 6] + + required: + - bus-type + +required: + - compatible + - reg + - interrupts + - clocks + - ports + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + #include + + parent { + #address-cells = <2>; + #size-cells = <2>; + + vicap: video-capture@fdfe0000 { + compatible = "rockchip,rk3568-vicap"; + reg = <0x0 0xfdfe0000 0x0 0x200>; + interrupts = ; + assigned-clocks = <&cru DCLK_VICAP>; + assigned-clock-rates = <300000000>; + clocks = <&cru ACLK_VICAP>, <&cru HCLK_VICAP>, + <&cru DCLK_VICAP>, <&cru ICLK_VICAP_G>; + clock-names = "aclk", "hclk", "dclk", "iclk"; + iommus = <&vicap_mmu>; + power-domains = <&power RK3568_PD_VI>; + resets = <&cru SRST_A_VICAP>, <&cru SRST_H_VICAP>, + <&cru SRST_D_VICAP>, <&cru SRST_P_VICAP>, + <&cru SRST_I_VICAP>; + reset-names = "arst", "hrst", "drst", "prst", "irst"; + rockchip,grf = <&grf>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + vicap_dvp: port@0 { + reg = <0>; + + vicap_dvp_input: endpoint { + bus-type = ; + bus-width = <16>; + pclk-sample = ; + remote-endpoint = <&it6801_output>; + }; + }; + + vicap_mipi: port@1 { + reg = <1>; + }; + }; + }; + + vicap_mmu: iommu@fdfe0800 { + compatible = "rockchip,rk3568-iommu"; + reg = <0x0 0xfdfe0800 0x0 0x100>; + interrupts = ; + clocks = <&cru ACLK_VICAP>, <&cru HCLK_VICAP>; + clock-names = "aclk", "iface"; + #iommu-cells = <0>; + power-domains = <&power RK3568_PD_VI>; + rockchip,disable-mmu-reset; + }; + }; +... diff --git a/MAINTAINERS b/MAINTAINERS index 1138c8858bc7..8dbeb2927a08 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20223,6 +20223,7 @@ M: Michael Riesch L: linux-media@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/media/rockchip,px30-vip.yaml +F: Documentation/devicetree/bindings/media/rockchip,rk3568-vicap.yaml ROCKCHIP CRYPTO DRIVERS M: Corentin Labbe From patchwork Tue Dec 17 15:55:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13912204 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED156E77184 for ; Tue, 17 Dec 2024 16:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Y6fpvhokqj/zIWrDFINWF1mjOLrkoW4zlkMOKmpP0ms=; b=etnxAEZcwLUsySbJzEFvxhM3Fg OchWqLGDa1ZE6j1jf/icQVYSnWIDh4+fTD/eQ1M3fEE5CqHo/WwV7aNirKs06gnRPN9BwBhu+94KT 516fk5Rp3T2uPjAdwM5gm5LWA2i+dNPrkhfBwjrb0HVIHqvVajth4kXHfPUIff0+iYgepjztWbyCK mZ+mFcorFza8rowfYkvIeP1HTQH5Pdw1c1D30EGGHP6XRyndxRNTJwwCYjXUF3prfOTReFBFGWlwh s94oUVyrNwhzF7kiuY5GDUlvzuJ77P2QR1JRubiv7BflsC7iabMY1i04bvu0j8o9LuL/8GxL4l9fC PVc7PvdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNaSB-0000000EBNX-1bgk; Tue, 17 Dec 2024 16:29:47 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNZv3-0000000E2po-11Ge; Tue, 17 Dec 2024 15:55:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AINRSCszH9PsRR8068CP7dxEUYu3aDcNYeD+qIQiPuTOnxsQma79GffZBLqdHwyDKN71Hf1jpcQbcLdt3hofqHHzq5QCFW4a/K6MhGzWfehvDu0r+jMq4CxHuCJfexs0GFk1bfr5b1QW1MRUVKJ8UBifNpsmTNPRtZsEPgwVEAlZhxJkd8nKDaJSSU1HD+fogwfnJJmhYHUiZdRDAiOepS8/us1WN9i9IzmCXxvsUhifuLRhChUnN2tFgm319Mri1qd+3IkAqKU+Dib9aFMAcYaXr4L2W61Vhji/v9LelvMvWGnxJFIEMxOibOUbSmtWgrPIMEsEXxbJ23U4DsTZIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Y6fpvhokqj/zIWrDFINWF1mjOLrkoW4zlkMOKmpP0ms=; b=vtClt+CBeEX3s2X4p+SiNsgpI5Psab5qbdQUSnuJfdH6zmGraQ6rBCaRIitbgn4IdIUFWamV8S05TqjU/AJN9yDFZl5sdH/b9D7uENGm3Dpp0VQVuG6uKagK8E/N30uyfTAhDv+QfVd9iBVspgacXZnFCAHDmy32ymtDnARmwQkUkyYZVuPD1y3xfSTCPhOBc0tLQ/i+u1zxr21qkcs5Q4r/4g2fSIUaSRB6mOn7qgY/RMPt2HMr6RF84ObN+pCKgxrxd74dwtmlRgalBeYA66jy63AuL03bkPZlBM4ufJq+vWGremQWrq4B43WJyQpQE77JLxPrPer/jq/h8qYFBQ== 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=Y6fpvhokqj/zIWrDFINWF1mjOLrkoW4zlkMOKmpP0ms=; b=bV3Ok52JKgh2KWv67wgTc0YRioSvhui+UJIaejzyyv32mNWk2kr4rGTep0Iu+zpLjmxYl/x1vbpQxHG0BtxYKuvIITL/Lqr5iWwQmqlapC+Z2LUOd2wVzFKFowbYx4VzSM1fxikwO0hs2pLmwJ+tgpqLmyPC6hHUmjq97GzWZwU= 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 AS8PR08MB10149.eurprd08.prod.outlook.com (2603:10a6:20b:63f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Tue, 17 Dec 2024 15:55:26 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d%5]) with mapi id 15.20.8251.015; Tue, 17 Dec 2024 15:55:26 +0000 From: Michael Riesch Date: Tue, 17 Dec 2024 16:55:16 +0100 Subject: [PATCH v2 4/6] media: rockchip: add a driver for the rockchip camera interface (cif) Message-Id: <20241217-v6-8-topic-rk3568-vicap-v2-4-b1d488fcc0d3@wolfvision.net> References: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> In-Reply-To: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> To: Mehdi Djait , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Leb?= =?utf-8?q?run?= , Thomas Petazzoni , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Kever Yang , Nicolas Dufresne , Sebastian Fricke , Alexander Shiyan , Val Packett , Rob Herring , Philipp Zabel , 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 , Mehdi Djait , Gerald Loacker X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734450919; l=69135; i=michael.riesch@wolfvision.net; s=20240405; h=from:subject:message-id; bh=MdFIawxHZwgerBfKJYt+NmYuVtXnNeGr+fXYW67Ba7E=; b=2/Nfa3lMXkqqeTPg8rRP+hHzXEAXBbwIW8pT4S5qnikn4pT5gVzKO/2mYcnGFRB2Tw9IDH+CB qY/MyMlxzPvAdz1cnHdn8vO9gnBrK0mYvegNtCBTGZWxmcNM1Hjd9T6 X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=cSJmgKSH3B6kdCIDCl+IYDW1Pw/Ybc6g9rmnUd/G7Ck= X-ClientProxiedBy: VI1PR08CA0244.eurprd08.prod.outlook.com (2603:10a6:803:dc::17) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|AS8PR08MB10149:EE_ X-MS-Office365-Filtering-Correlation-Id: 5bb0e281-a22c-4bb3-f8fc-08dd1eb33944 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016|52116014|4022899009|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?88zXshJb6LdQPAmDxamZq0FKAOV7xsb?= =?utf-8?q?/irc+8kGIglMtTAGIiBHpZIpDf5yN4U2KcfQMgKMZTdWMwQAbJKgiTcx6AjFrxDFu?= =?utf-8?q?hS+AooSIPXGIkZwCBcYWdN59DMPxvcHh+GqbDbtszilnsMPn95iNx3HqO/g8MX/Xv?= =?utf-8?q?15eaaXOE6+0qJ01VI6u57qLCXccOBnOikQQbapvA1lIrLuDVdohRtAso0UOWS1vtM?= =?utf-8?q?QFZpJyXeOUEMdPEghOVOue7w028w2X7AQYn3a1WYF7kX5R2sHdqS0iP3Z2qfJWkB7?= =?utf-8?q?LyzfOsZspXp8FB3p/eJPwyjLZHGT1BTIMoJJKZ9T/k4COHXu6TdY5K1WswQphGBii?= =?utf-8?q?bOzVBfJF9rJG1VF6j1hlBjj7bCwNpNiXTPWT9THYongkSoA/KEvIJQ7Ey1kxSABVm?= =?utf-8?q?epuNhvFJjTyVbVT9yT3SMolKJbwfKgE81Twz3tp5VSTTlg2E8Vu0lNbUXML+fo1E5?= =?utf-8?q?VsxSpfWGOith01XoTDTRqpfwuKlPw4RTepa+5xfw7svkOR1VU5gm3YPgsGC3pIER8?= =?utf-8?q?XgYs+oUGCa7j660/jvVIRx2QkblOM5ddOEE2ZdgAX9hN+XKUOQGYirc987NesCWFJ?= =?utf-8?q?dsGP+oMw2YcvSjyiQhA0BujUF+VtFlzksLmkiSvkt5HM9gN16ho3eky6khGb081vn?= =?utf-8?q?Q9wvP7/VxBNSYCdI1o7emSehjs2vTyZNunt2SatL+Ndmgs7ScwaSxGebQ/Ku46YDh?= =?utf-8?q?dgL2QDhC8EJsSOIWNfgXLW5aFCYtphhqvafdjHQqmqnDX08YQ5lN+h7uXFlFRHGCW?= =?utf-8?q?Mxpn9qj+EiBnZFyfeLmWwYOtkpXHh17tecQkHZ4GliV+ycdDR1RWumD0pu4Ec1wPK?= =?utf-8?q?PQTKwVXel6KKc+Ztmn+Iq+f9wgiI4apwFsLRA279QD/8m/ojBgkvyHc4DKLBUhnBk?= =?utf-8?q?hbdHYy0Rra+25baqj0+fhimhXC4tyhqKrEv9YO0lmzSUzShQPDjXOq1jGZk5cL9Sj?= =?utf-8?q?YHKNUh7yfsOwX/aIt/ZkIydzrAr156bPviGVuHa4mxYmWy7aaR+0m4QoY068XT/3v?= =?utf-8?q?nAkVosXCPGsj6oQ3b527T863BEjqmGhIEHmTj4g8vQW9kZKct8NzFwGNIYOlwtwYG?= =?utf-8?q?ZN95ooa5APgdtTNxQI5NidZcN66h4RjHqpVh9L8EWhgRhqOz40Yskanclmabn5Fyq?= =?utf-8?q?AehKNotB2V0eu+K7ubhXsEJHB7gNe4PvolW3duAW5RkXIsMrFL6PN+4fScMOVITRJ?= =?utf-8?q?hTnrU/U7P8DMnTjvS8FldzsjR4hieJbxm1ftZGNcpVZ79CAfqA1sBk7Xss3eenNvS?= =?utf-8?q?Gaf3g3Pu3YP+KIkuuw9ch6u06bIuGJ0vyT4aA0Hmt9iuehQ5cb+1Woz7cMiWcNgfq?= =?utf-8?q?958a7HV5NbLDpIXGPJvQWiLBGVEciOMSS84/tL5bbJ9aDKD/udCGJkO+CXceV7vEw?= =?utf-8?q?5n5Re/z0O99udrOi/410FO6inf1M8okZA=3D=3D?= 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:(13230040)(1800799024)(376014)(7416014)(366016)(52116014)(4022899009)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?pyMg1Dl7EVKkWKNq+H54CuDD8dLV?= =?utf-8?q?/CtL0UPBCIqT0TclYOWbSKyGRNKtMVdBDAUe55+3tODP15NSA1oqBiVsCZYfjSnfc?= =?utf-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?utf-8?q?YanY99FEN/NytzlEzCyPru2yz71+sQ0xXDV/mBHUCARs7ELuUqKH/xJGP/u+OVb4E?= =?utf-8?q?+/ihEjd2AHfGW69ySENy/d5U6bO+leja/jbFbl8AIQPruFiFsKKQs6JyYQvqAmPSz?= =?utf-8?q?1seWxEKHi+Sk8omsR+OpfVasm3uvM23ZH38ZcCzzA76bX0R+gXa+6/yaW1nfIuUQs?= =?utf-8?q?svBW2jLPufYTNbO6REnjLlx45zdx64tkywDU98X6jn/dHJcepyF7/Udg9fcVMBfoU?= =?utf-8?q?M7N6U4gK/YBfqb4nkMPS9+pfCQuk8Rq4P8xGSBIqwIhCBwOzfMHQmnTXZb7WOjyEz?= =?utf-8?q?QFD4GPyEhpjVzH8bqMdwWPSXZXVSkaQN27WInJuLrMltf7YIv7A40RTey9RwXnWHE?= =?utf-8?q?/1+TWTkXGG8wqAq4Tvtt/NLzzMcooPOKX4sODhzHNLcVUxoliGyIxzgHgx4g73hve?= =?utf-8?q?wk5jsvr8borzRBtnYmSg5+3Lagkdtr1gL0vP+xYNBUnzcnodtU1dMClYmX4tSLHqI?= =?utf-8?q?Om4C26PHddk/OSsMslhRiX1LkvmtjvbWUK1MDpM4e1Rj3fpTAYFDY4tKeHEXzOjWP?= =?utf-8?q?/BeHX2VEMLaNDveZE3eVImePe6ZXBpv0Sw=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 5bb0e281-a22c-4bb3-f8fc-08dd1eb33944 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 15:55:26.6541 (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: 4uqiD2CTOF8q+BW6x7T979BhpId594+EVMrkgXVenK/LGvgawcNN6Eppy+gG6qqgT6L/tEa17+skXVqWokPdd7YGKLWTVolmZtyNK12R3PU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10149 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_075533_469871_D2F85B6F X-CRM114-Status: GOOD ( 17.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Rockchip Camera Interface (CIF) is featured in many Rockchip SoCs in different variations. For example, the PX30 Video Input Processor (VIP) is able to receive video data via the Digital Video Port (DVP, a parallel data interface and transfer it into system memory using a double-buffering mechanism called ping-pong mode. The RK3568 Video Capture (VICAP) unit, on the other hand, features a DVP and a MIPI CSI-2 receiver that can receive video data independently (both using the ping-pong scheme). The different variants may have additional features, such as scaling and/or cropping. Finally, the RK3588 VICAP unit constitutes an essential piece of the camera interface with one DVP, six MIPI CSI-2 receivers, scale/crop units, and different data path multiplexers (to system memory, to ISP, ...). Add a basic media controller centric V4L2 driver for the Rockchip CIF with - support for the PX30 VIP - support for the RK3568 VICAP DVP - abstraction for the ping-pong scheme to allow for future extensions [PX30 VIP support v1-v5] Co-developed-by: Maxime Chevallier Signed-off-by: Maxime Chevallier [PX30 VIP support v6-v13] Co-developed-by: Mehdi Djait Signed-off-by: Mehdi Djait [added RK3568 VICAP DVP support] [refactored to media controller centric driver, added mplane support] Co-developed-by: Gerald Loacker Signed-off-by: Gerald Loacker Signed-off-by: Michael Riesch --- MAINTAINERS | 1 + drivers/media/platform/rockchip/Kconfig | 1 + drivers/media/platform/rockchip/Makefile | 1 + drivers/media/platform/rockchip/cif/Kconfig | 15 + drivers/media/platform/rockchip/cif/Makefile | 3 + .../media/platform/rockchip/cif/cif-capture-dvp.c | 794 +++++++++++++++++++++ .../media/platform/rockchip/cif/cif-capture-dvp.h | 24 + drivers/media/platform/rockchip/cif/cif-common.h | 163 +++++ drivers/media/platform/rockchip/cif/cif-dev.c | 405 +++++++++++ drivers/media/platform/rockchip/cif/cif-regs.h | 132 ++++ drivers/media/platform/rockchip/cif/cif-stream.c | 676 ++++++++++++++++++ drivers/media/platform/rockchip/cif/cif-stream.h | 24 + 12 files changed, 2239 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8dbeb2927a08..fefa848ea37c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20224,6 +20224,7 @@ L: linux-media@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/media/rockchip,px30-vip.yaml F: Documentation/devicetree/bindings/media/rockchip,rk3568-vicap.yaml +F: drivers/media/platform/rockchip/cif/ ROCKCHIP CRYPTO DRIVERS M: Corentin Labbe diff --git a/drivers/media/platform/rockchip/Kconfig b/drivers/media/platform/rockchip/Kconfig index b41d3960c1b4..f73d68d1d2b6 100644 --- a/drivers/media/platform/rockchip/Kconfig +++ b/drivers/media/platform/rockchip/Kconfig @@ -2,5 +2,6 @@ comment "Rockchip media platform drivers" +source "drivers/media/platform/rockchip/cif/Kconfig" source "drivers/media/platform/rockchip/rga/Kconfig" source "drivers/media/platform/rockchip/rkisp1/Kconfig" diff --git a/drivers/media/platform/rockchip/Makefile b/drivers/media/platform/rockchip/Makefile index 4f782b876ac9..1a7aa1f8e134 100644 --- a/drivers/media/platform/rockchip/Makefile +++ b/drivers/media/platform/rockchip/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-y += cif/ obj-y += rga/ obj-y += rkisp1/ diff --git a/drivers/media/platform/rockchip/cif/Kconfig b/drivers/media/platform/rockchip/cif/Kconfig new file mode 100644 index 000000000000..f53e79a4b42d --- /dev/null +++ b/drivers/media/platform/rockchip/cif/Kconfig @@ -0,0 +1,15 @@ +config VIDEO_ROCKCHIP_CIF + tristate "Rockchip Camera Interface (CIF)" + depends on VIDEO_DEV + depends on ARCH_ROCKCHIP || COMPILE_TEST + depends on V4L_PLATFORM_DRIVERS + depends on PM && COMMON_CLK + select MEDIA_CONTROLLER + select VIDEOBUF2_DMA_CONTIG + select V4L2_FWNODE + select VIDEO_V4L2_SUBDEV_API + help + This is a driver for Rockchip Camera Interface (CIF). It is featured + in many Rockchips SoCs in different variations, such as the PX30 + Video Input Processor (VIP, one Digital Video Port (DVP)) or the + RK3568 Video Capture (VICAP, one DVP, one MIPI CSI-2 receiver) unit. diff --git a/drivers/media/platform/rockchip/cif/Makefile b/drivers/media/platform/rockchip/cif/Makefile new file mode 100644 index 000000000000..1bd0d17ba1c4 --- /dev/null +++ b/drivers/media/platform/rockchip/cif/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_VIDEO_ROCKCHIP_CIF) += rockchip-cif.o +rockchip-cif-objs += cif-dev.o cif-capture-dvp.o cif-stream.o diff --git a/drivers/media/platform/rockchip/cif/cif-capture-dvp.c b/drivers/media/platform/rockchip/cif/cif-capture-dvp.c new file mode 100644 index 000000000000..95ff8a986e01 --- /dev/null +++ b/drivers/media/platform/rockchip/cif/cif-capture-dvp.c @@ -0,0 +1,794 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Rockchip Camera Interface (CIF) Driver + * + * Copyright (C) 2018 Rockchip Electronics Co., Ltd. + * Copyright (C) 2020 Maxime Chevallier + * Copyright (C) 2023 Mehdi Djait + * Copyright (C) 2024 Michael Riesch + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cif-capture-dvp.h" +#include "cif-common.h" +#include "cif-regs.h" +#include "cif-stream.h" + +static struct cif_output_fmt dvp_out_fmts[] = { + { + .fourcc = V4L2_PIX_FMT_NV16, + .dvp_fmt_val = CIF_FORMAT_YUV_OUTPUT_422 | + CIF_FORMAT_UV_STORAGE_ORDER_UVUV, + .cplanes = 2, + }, + { + .fourcc = V4L2_PIX_FMT_NV61, + .dvp_fmt_val = CIF_FORMAT_YUV_OUTPUT_422 | + CIF_FORMAT_UV_STORAGE_ORDER_VUVU, + .cplanes = 2, + }, + { + .fourcc = V4L2_PIX_FMT_NV12, + .dvp_fmt_val = CIF_FORMAT_YUV_OUTPUT_420 | + CIF_FORMAT_UV_STORAGE_ORDER_UVUV, + .cplanes = 2, + }, + { + .fourcc = V4L2_PIX_FMT_NV21, + .dvp_fmt_val = CIF_FORMAT_YUV_OUTPUT_420 | + CIF_FORMAT_UV_STORAGE_ORDER_VUVU, + .cplanes = 2, + }, + { + .fourcc = V4L2_PIX_FMT_RGB24, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_RGB565, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_BGR666, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SRGGB8, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SGRBG8, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SGBRG8, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SBGGR8, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SRGGB10, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SGRBG10, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SGBRG10, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SBGGR10, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SRGGB12, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SGRBG12, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SGBRG12, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SBGGR12, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_SBGGR16, + .cplanes = 1, + }, + { + .fourcc = V4L2_PIX_FMT_Y16, + .cplanes = 1, + }, +}; + +static const struct cif_input_fmt px30_dvp_in_fmts[] = { + { + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YUYV, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YUYV, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YVYU, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YVYU, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_UYVY, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_UYVY, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_VYUY, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_VYUY, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_8, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGBRG8_1X8, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_8, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_8, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SRGGB8_1X8, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_8, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_10, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGBRG10_1X10, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_10, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_10, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SRGGB10_1X10, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_10, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SBGGR12_1X12, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_12, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGBRG12_1X12, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_12, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_12, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SRGGB12_1X12, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_12, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_RGB888_1X24, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_Y8_1X8, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_8, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_Y10_1X10, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_10, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_Y12_1X12, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_12, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + } +}; + +const struct cif_dvp_match_data px30_vip_dvp_match_data = { + .in_fmts = px30_dvp_in_fmts, + .in_fmts_num = ARRAY_SIZE(px30_dvp_in_fmts), + .out_fmts = dvp_out_fmts, + .out_fmts_num = ARRAY_SIZE(dvp_out_fmts), + .has_scaler = true, + .regs = { + [CIF_DVP_CTRL] = 0x00, + [CIF_DVP_INTEN] = 0x04, + [CIF_DVP_INTSTAT] = 0x08, + [CIF_DVP_FOR] = 0x0c, + [CIF_DVP_LINE_NUM_ADDR] = 0x10, + [CIF_DVP_FRM0_ADDR_Y] = 0x14, + [CIF_DVP_FRM0_ADDR_UV] = 0x18, + [CIF_DVP_FRM1_ADDR_Y] = 0x1c, + [CIF_DVP_FRM1_ADDR_UV] = 0x20, + [CIF_DVP_VIR_LINE_WIDTH] = 0x24, + [CIF_DVP_SET_SIZE] = 0x28, + [CIF_DVP_SCL_CTRL] = 0x48, + [CIF_DVP_FRAME_STATUS] = 0x60, + [CIF_DVP_LAST_LINE] = 0x68, + [CIF_DVP_LAST_PIX] = 0x6c, + }, +}; + +static const struct cif_input_fmt rk3568_dvp_in_fmts[] = { + { + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YUYV, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YUYV, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YVYU, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YVYU, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_UYVY, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_UYVY, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_VYUY, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_VYUY, + .fmt_type = CIF_FMT_TYPE_YUV, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_YUYV8_1X16, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YUYV | + CIF_FORMAT_INPUT_MODE_BT1120 | + CIF_FORMAT_BT1120_TRANSMIT_PROGRESS, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_YUYV8_1X16, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YUYV | + CIF_FORMAT_INPUT_MODE_BT1120, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_YVYU8_1X16, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YVYU | + CIF_FORMAT_INPUT_MODE_BT1120 | + CIF_FORMAT_BT1120_TRANSMIT_PROGRESS, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_YVYU8_1X16, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YVYU | + CIF_FORMAT_INPUT_MODE_BT1120, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_UYVY8_1X16, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YUYV | + CIF_FORMAT_INPUT_MODE_BT1120 | + CIF_FORMAT_BT1120_YC_SWAP | + CIF_FORMAT_BT1120_TRANSMIT_PROGRESS, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_UYVY8_1X16, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YUYV | + CIF_FORMAT_BT1120_YC_SWAP | + CIF_FORMAT_INPUT_MODE_BT1120, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_VYUY8_1X16, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YVYU | + CIF_FORMAT_INPUT_MODE_BT1120 | + CIF_FORMAT_BT1120_YC_SWAP | + CIF_FORMAT_BT1120_TRANSMIT_PROGRESS, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_VYUY8_1X16, + .dvp_fmt_val = CIF_FORMAT_YUV_INPUT_422 | + CIF_FORMAT_YUV_INPUT_ORDER_YVYU | + CIF_FORMAT_BT1120_YC_SWAP | + CIF_FORMAT_INPUT_MODE_BT1120, + .field = V4L2_FIELD_INTERLACED, + }, + { + .mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_8, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGBRG8_1X8, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_8, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_8, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SRGGB8_1X8, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_8, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_10, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGBRG10_1X10, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_10, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_10, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SRGGB10_1X10, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_10, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SBGGR12_1X12, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_12, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGBRG12_1X12, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_12, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_12, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_SRGGB12_1X12, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_12, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_RGB888_1X24, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_Y8_1X8, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_8, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_Y10_1X10, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_10, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, + { + .mbus_code = MEDIA_BUS_FMT_Y12_1X12, + .dvp_fmt_val = CIF_FORMAT_INPUT_MODE_RAW | + CIF_FORMAT_RAW_DATA_WIDTH_12, + .fmt_type = CIF_FMT_TYPE_RAW, + .field = V4L2_FIELD_NONE, + }, +}; + +static void rk3568_dvp_grf_setup(struct cif_device *cif_dev) +{ + u32 con1 = RK3568_GRF_WRITE_ENABLE(RK3568_GRF_VI_CON1_CIF_DATAPATH | + RK3568_GRF_VI_CON1_CIF_CLK_DELAYNUM); + + if (!cif_dev->grf) + return; + + con1 |= RK3568_GRF_SET_CLK_DELAYNUM(cif_dev->dvp.cif_clk_delaynum); + + if (cif_dev->dvp.vep.bus.parallel.flags & + V4L2_MBUS_PCLK_SAMPLE_DUALEDGE) + con1 |= RK3568_GRF_VI_CON1_CIF_DATAPATH; + + regmap_write(cif_dev->grf, RK3568_GRF_VI_CON1, con1); +} + +const struct cif_dvp_match_data rk3568_vicap_dvp_match_data = { + .in_fmts = rk3568_dvp_in_fmts, + .in_fmts_num = ARRAY_SIZE(rk3568_dvp_in_fmts), + .out_fmts = dvp_out_fmts, + .out_fmts_num = ARRAY_SIZE(dvp_out_fmts), + .setup = rk3568_dvp_grf_setup, + .has_scaler = false, + .regs = { + [CIF_DVP_CTRL] = 0x00, + [CIF_DVP_INTEN] = 0x04, + [CIF_DVP_INTSTAT] = 0x08, + [CIF_DVP_FOR] = 0x0c, + [CIF_DVP_LINE_NUM_ADDR] = 0x2c, + [CIF_DVP_FRM0_ADDR_Y] = 0x14, + [CIF_DVP_FRM0_ADDR_UV] = 0x18, + [CIF_DVP_FRM1_ADDR_Y] = 0x1c, + [CIF_DVP_FRM1_ADDR_UV] = 0x20, + [CIF_DVP_VIR_LINE_WIDTH] = 0x24, + [CIF_DVP_SET_SIZE] = 0x28, + [CIF_DVP_FRAME_STATUS] = 0x3c, + [CIF_DVP_LAST_LINE] = 0x44, + [CIF_DVP_LAST_PIX] = 0x48, + }, +}; + +static inline unsigned int cif_dvp_get_addr(struct cif_device *cif_device, + unsigned int index) +{ + if (index >= CIF_DVP_REGISTER_MAX) + return CIF_DVP_REGISTER_INVALID; + + return cif_device->match_data->dvp->regs[index]; +} + +static inline void cif_dvp_write(struct cif_device *cif_dev, unsigned int index, + u32 val) +{ + unsigned int addr = cif_dvp_get_addr(cif_dev, index); + + if (addr == CIF_DVP_REGISTER_INVALID) + return; + + writel(val, cif_dev->base_addr + addr); +} + +static inline u32 cif_dvp_read(struct cif_device *cif_dev, unsigned int index) +{ + unsigned int addr = cif_dvp_get_addr(cif_dev, index); + + if (addr == CIF_DVP_REGISTER_INVALID) + return 0; + + return readl(cif_dev->base_addr + addr); +} + +static void cif_dvp_queue_buffer(struct cif_stream *stream, unsigned int index) +{ + struct cif_device *cif_dev = stream->cif_dev; + struct cif_buffer *buffer = stream->buffers[index]; + u32 frm_addr_y, frm_addr_uv; + + frm_addr_y = index ? CIF_DVP_FRM1_ADDR_Y : CIF_DVP_FRM0_ADDR_Y; + frm_addr_uv = index ? CIF_DVP_FRM1_ADDR_UV : CIF_DVP_FRM0_ADDR_UV; + + cif_dvp_write(cif_dev, frm_addr_y, buffer->buff_addr[CIF_PLANE_Y]); + cif_dvp_write(cif_dev, frm_addr_uv, buffer->buff_addr[CIF_PLANE_UV]); +} + +static int cif_dvp_start_streaming(struct cif_stream *stream) +{ + u32 val, fmt_type, xfer_mode = 0; + struct cif_device *cif_dev = stream->cif_dev; + struct v4l2_mbus_config_parallel *parallel; + + fmt_type = stream->active_in_fmt->fmt_type; + + parallel = &cif_dev->dvp.vep.bus.parallel; + if ((parallel->bus_width == 16) && + (parallel->flags & V4L2_MBUS_PCLK_SAMPLE_DUALEDGE)) + xfer_mode |= CIF_FORMAT_BT1120_CLOCK_DOUBLE_EDGES; + + val = stream->active_out_fmt->dvp_fmt_val | + stream->active_in_fmt->dvp_fmt_val | xfer_mode; + cif_dvp_write(cif_dev, CIF_DVP_FOR, val); + + val = stream->pix.width; + if (stream->active_in_fmt->fmt_type == CIF_FMT_TYPE_RAW) + val = stream->pix.width * 2; + + cif_dvp_write(cif_dev, CIF_DVP_VIR_LINE_WIDTH, val); + cif_dvp_write(cif_dev, CIF_DVP_SET_SIZE, + stream->pix.width | (stream->pix.height << 16)); + + cif_dvp_write(cif_dev, CIF_DVP_FRAME_STATUS, CIF_FRAME_STAT_CLS); + cif_dvp_write(cif_dev, CIF_DVP_INTSTAT, CIF_INTSTAT_CLS); + if (cif_dev->match_data->dvp->has_scaler) + cif_dvp_write(cif_dev, CIF_DVP_SCL_CTRL, + (fmt_type == CIF_FMT_TYPE_YUV) ? + CIF_SCL_CTRL_ENABLE_YUV_16BIT_BYPASS : + CIF_SCL_CTRL_ENABLE_RAW_16BIT_BYPASS); + + cif_dvp_write(cif_dev, CIF_DVP_INTEN, + CIF_INTEN_FRAME_END_EN | CIF_INTEN_PST_INF_FRAME_END_EN); + + cif_dvp_write(cif_dev, CIF_DVP_CTRL, + CIF_CTRL_AXI_BURST_16 | CIF_CTRL_MODE_PINGPONG | + CIF_CTRL_ENABLE_CAPTURE); + return 0; +} + +static void cif_dvp_stop_streaming(struct cif_stream *stream) +{ + struct cif_device *cif_dev = stream->cif_dev; + u32 val; + + val = cif_dvp_read(cif_dev, CIF_DVP_CTRL); + cif_dvp_write(cif_dev, CIF_DVP_CTRL, val & (~CIF_CTRL_ENABLE_CAPTURE)); + cif_dvp_write(cif_dev, CIF_DVP_INTEN, 0x0); + cif_dvp_write(cif_dev, CIF_DVP_INTSTAT, 0x3ff); + cif_dvp_write(cif_dev, CIF_DVP_FRAME_STATUS, 0x0); + + stream->stopping = false; +} + +static void cif_dvp_reset_stream(struct cif_device *cif_dev) +{ + u32 ctl = cif_dvp_read(cif_dev, CIF_DVP_CTRL); + + cif_dvp_write(cif_dev, CIF_DVP_CTRL, ctl & (~CIF_CTRL_ENABLE_CAPTURE)); + cif_dvp_write(cif_dev, CIF_DVP_CTRL, ctl | CIF_CTRL_ENABLE_CAPTURE); +} + +irqreturn_t cif_dvp_isr(int irq, void *ctx) +{ + struct device *dev = ctx; + struct cif_device *cif_dev = dev_get_drvdata(dev); + struct cif_stream *stream = &cif_dev->dvp.stream; + unsigned int intstat; + u32 lastline, lastpix, ctl, cif_frmst; + irqreturn_t ret = IRQ_NONE; + + if (!cif_dev->match_data->dvp) + return ret; + + intstat = cif_dvp_read(cif_dev, CIF_DVP_INTSTAT); + cif_frmst = cif_dvp_read(cif_dev, CIF_DVP_FRAME_STATUS); + lastline = + CIF_FETCH_Y_LAST_LINE(cif_dvp_read(cif_dev, CIF_DVP_LAST_LINE)); + lastpix = + CIF_FETCH_Y_LAST_LINE(cif_dvp_read(cif_dev, CIF_DVP_LAST_PIX)); + ctl = cif_dvp_read(cif_dev, CIF_DVP_CTRL); + + /* + * The following IRQs are enabled: + * - PST_INF_FRAME_END: cif FIFO is ready, this is prior to FRAME_END + * - FRAME_END: cif has saved frame to memory + */ + + if (intstat & CIF_INTSTAT_PST_INF_FRAME_END) { + cif_dvp_write(cif_dev, CIF_DVP_INTSTAT, + CIF_INTSTAT_PST_INF_FRAME_END_CLR); + + if (stream->stopping) + /* To stop cif ASAP, before FRAME_END IRQ */ + cif_dvp_write(cif_dev, CIF_DVP_CTRL, + ctl & (~CIF_CTRL_ENABLE_CAPTURE)); + + ret = IRQ_HANDLED; + } + + if (intstat & CIF_INTSTAT_FRAME_END) { + cif_dvp_write(cif_dev, CIF_DVP_INTSTAT, + CIF_INTSTAT_FRAME_END_CLR | + CIF_INTSTAT_LINE_END_CLR); + + if (stream->stopping) { + cif_dvp_stop_streaming(stream); + wake_up(&stream->wq_stopped); + return IRQ_HANDLED; + } + + if (lastline != stream->pix.height) { + v4l2_err(&cif_dev->v4l2_dev, + "bad frame, irq:%#x frmst:%#x size:%dx%d\n", + intstat, cif_frmst, lastpix, lastline); + + cif_dvp_reset_stream(cif_dev); + } + + cif_stream_pingpong(stream); + + ret = IRQ_HANDLED; + } + + return ret; +} + +int cif_dvp_register(struct cif_device *cif_dev) +{ + struct cif_stream *stream = &cif_dev->dvp.stream; + const struct cif_stream_config config = { + .name = CIF_DRIVER_NAME "-dvp", + }; + int ret; + + stream->in_fmts = cif_dev->match_data->dvp->in_fmts; + stream->in_fmts_num = cif_dev->match_data->dvp->in_fmts_num; + stream->out_fmts = cif_dev->match_data->dvp->out_fmts; + stream->out_fmts_num = cif_dev->match_data->dvp->out_fmts_num; + stream->queue_buffer = cif_dvp_queue_buffer; + stream->start_streaming = cif_dvp_start_streaming; + stream->stop_streaming = cif_dvp_stop_streaming; + + if (cif_dev->match_data->dvp->setup) + cif_dev->match_data->dvp->setup(cif_dev); + + ret = cif_stream_register(cif_dev, stream, &config); + if (ret) + return ret; + + return 0; +} + +void cif_dvp_unregister(struct cif_device *cif_dev) +{ + struct cif_stream *stream = &cif_dev->dvp.stream; + + cif_stream_unregister(stream); +} diff --git a/drivers/media/platform/rockchip/cif/cif-capture-dvp.h b/drivers/media/platform/rockchip/cif/cif-capture-dvp.h new file mode 100644 index 000000000000..48dd1b7185dc --- /dev/null +++ b/drivers/media/platform/rockchip/cif/cif-capture-dvp.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Rockchip Camera Interface (CIF) Driver + * + * Copyright (C) 2018 Rockchip Electronics Co., Ltd. + * Copyright (C) 2023 Mehdi Djait + * Copyright (C) 2024 Michael Riesch + */ + +#ifndef _CIF_CAPTURE_DVP_H +#define _CIF_CAPTURE_DVP_H + +#include "cif-common.h" + +extern const struct cif_dvp_match_data px30_vip_dvp_match_data; +extern const struct cif_dvp_match_data rk3568_vicap_dvp_match_data; + +int cif_dvp_register(struct cif_device *dev); + +void cif_dvp_unregister(struct cif_device *dev); + +irqreturn_t cif_dvp_isr(int irq, void *ctx); + +#endif diff --git a/drivers/media/platform/rockchip/cif/cif-common.h b/drivers/media/platform/rockchip/cif/cif-common.h new file mode 100644 index 000000000000..c90b705d6bb4 --- /dev/null +++ b/drivers/media/platform/rockchip/cif/cif-common.h @@ -0,0 +1,163 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Rockchip Camera Interface (CIF) Driver + * + * Copyright (C) 2018 Rockchip Electronics Co., Ltd. + * Copyright (C) 2023 Mehdi Djait + * Copyright (C) 2024 Michael Riesch + */ + +#ifndef _CIF_COMMON_H +#define _CIF_COMMON_H + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "cif-regs.h" + +#define CIF_DRIVER_NAME "rockchip-cif" +#define CIF_DEFAULT_WIDTH 640 +#define CIF_DEFAULT_HEIGHT 480 +#define CIF_CLKS_MAX 4 + +enum cif_fmt_type { + CIF_FMT_TYPE_YUV = 0, + CIF_FMT_TYPE_RAW, +}; + +enum cif_plane_index { + CIF_PLANE_Y = 0, + CIF_PLANE_UV = 1, +}; + +struct cif_input_fmt { + u32 mbus_code; + + enum cif_fmt_type fmt_type; + enum v4l2_field field; + + union { + u32 dvp_fmt_val; + }; +}; + +struct cif_output_fmt { + u32 fourcc; + u32 mbus_code; + u8 cplanes; + + union { + u32 dvp_fmt_val; + }; +}; + +struct cif_buffer { + struct vb2_v4l2_buffer vb; + struct list_head queue; + dma_addr_t buff_addr[VIDEO_MAX_PLANES]; + bool is_dummy; +}; + +struct cif_dummy_buffer { + struct cif_buffer buffer; + void *vaddr; + u32 size; +}; + +struct cif_stream; + +struct cif_remote { + struct v4l2_async_connection async_conn; + struct v4l2_subdev *sd; + struct cif_stream *stream; + int source_pad; +}; + +struct cif_stream { + struct cif_device *cif_dev; + struct cif_remote *remote; + + /* in ping-pong mode, two buffers can be provided to the HW */ + struct cif_buffer *buffers[2]; + int frame_idx; + int frame_phase; + + /* in case of no available buffer, HW can write to the dummy buffer */ + struct cif_dummy_buffer dummy; + + bool stopping; + wait_queue_head_t wq_stopped; + + /* queue of available buffers plus spinlock that protects it */ + spinlock_t driver_queue_lock; + struct list_head driver_queue; + + /* Lock used by the V4L core. */ + struct mutex vlock; + struct video_device vdev; + struct vb2_queue buf_queue; + struct media_pad pad; + struct media_pipeline pipeline; + + struct v4l2_pix_format_mplane pix; + const struct cif_input_fmt *active_in_fmt; + const struct cif_output_fmt *active_out_fmt; + + const struct cif_input_fmt *in_fmts; + unsigned int in_fmts_num; + const struct cif_output_fmt *out_fmts; + unsigned int out_fmts_num; + + void (*queue_buffer)(struct cif_stream *stream, unsigned int index); + int (*start_streaming)(struct cif_stream *stream); + void (*stop_streaming)(struct cif_stream *stream); +}; + +struct cif_dvp { + struct cif_stream stream; + struct v4l2_fwnode_endpoint vep; + u32 cif_clk_delaynum; +}; + +struct cif_dvp_match_data { + const struct cif_input_fmt *in_fmts; + unsigned int in_fmts_num; + const struct cif_output_fmt *out_fmts; + unsigned int out_fmts_num; + void (*setup)(struct cif_device *cif_dev); + bool has_scaler; + unsigned int regs[CIF_DVP_REGISTER_MAX]; +}; + +struct cif_match_data { + const char *const *clks; + unsigned int clks_num; + const struct cif_dvp_match_data *dvp; +}; + +struct cif_device { + struct device *dev; + + struct clk_bulk_data clks[CIF_CLKS_MAX]; + unsigned int clks_num; + struct regmap *grf; + struct reset_control *cif_rst; + int irq; + void __iomem *base_addr; + + const struct cif_match_data *match_data; + struct cif_dvp dvp; + + struct media_device media_dev; + struct v4l2_device v4l2_dev; + struct v4l2_async_notifier notifier; +}; + +#endif diff --git a/drivers/media/platform/rockchip/cif/cif-dev.c b/drivers/media/platform/rockchip/cif/cif-dev.c new file mode 100644 index 000000000000..c3aafcf740f1 --- /dev/null +++ b/drivers/media/platform/rockchip/cif/cif-dev.c @@ -0,0 +1,405 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Rockchip Camera Interface (CIF) Driver + * + * Copyright (C) 2018 Rockchip Electronics Co., Ltd. + * Copyright (C) 2020 Maxime Chevallier + * Copyright (C) 2023 Mehdi Djait + * Copyright (C) 2024 Michael Riesch + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "cif-capture-dvp.h" +#include "cif-common.h" + +const char *const px30_vip_clks[] = { + "aclk", + "hclk", + "pclk", +}; + +static const struct cif_match_data px30_vip_match_data = { + .clks = px30_vip_clks, + .clks_num = ARRAY_SIZE(px30_vip_clks), + .dvp = &px30_vip_dvp_match_data, +}; + +const char *const rk3568_vicap_clks[] = { + "aclk", + "hclk", + "dclk", + "iclk", +}; + +static const struct cif_match_data rk3568_vicap_match_data = { + .clks = rk3568_vicap_clks, + .clks_num = ARRAY_SIZE(rk3568_vicap_clks), + .dvp = &rk3568_vicap_dvp_match_data, +}; + +static const struct of_device_id cif_plat_of_match[] = { + { + .compatible = "rockchip,px30-vip", + .data = &px30_vip_match_data, + }, + { + .compatible = "rockchip,rk3568-vicap", + .data = &rk3568_vicap_match_data, + }, + {}, +}; + +static void cif_notify(struct v4l2_subdev *sd, unsigned int notification, + void *arg) +{ + struct v4l2_device *v4l2_dev = sd->v4l2_dev; + struct cif_device *cif = + container_of(v4l2_dev, struct cif_device, v4l2_dev); + struct video_device *vdev = NULL; + + if ((cif->dvp.stream.remote) && (cif->dvp.stream.remote->sd == sd)) + vdev = &cif->dvp.stream.vdev; + + if (!vdev) + return; + + switch (notification) { + case V4L2_DEVICE_NOTIFY_EVENT: + v4l2_event_queue(vdev, arg); + break; + default: + break; + } +} + +static int cif_subdev_notifier_bound(struct v4l2_async_notifier *notifier, + struct v4l2_subdev *sd, + struct v4l2_async_connection *asd) +{ + struct cif_device *cif_dev = + container_of(notifier, struct cif_device, notifier); + struct cif_remote *remote = + container_of(asd, struct cif_remote, async_conn); + int source_pad; + int ret; + + source_pad = media_entity_get_fwnode_pad(&sd->entity, sd->fwnode, + MEDIA_PAD_FL_SOURCE); + if (source_pad < 0) { + dev_err(cif_dev->dev, "failed to find source pad for %s\n", + sd->name); + return source_pad; + } + + remote->sd = sd; + remote->source_pad = source_pad; + + ret = media_create_pad_link(&sd->entity, source_pad, + &remote->stream->vdev.entity, 0, + MEDIA_LNK_FL_ENABLED); + if (ret) { + dev_err(cif_dev->dev, "failed to link source pad of %s\n", + sd->name); + return ret; + } + + return 0; +} + +static int cif_subdev_notifier_complete(struct v4l2_async_notifier *notifier) +{ + struct cif_device *cif_dev = + container_of(notifier, struct cif_device, notifier); + + return v4l2_device_register_subdev_nodes(&cif_dev->v4l2_dev); +} + +static const struct v4l2_async_notifier_operations cif_subdev_notifier_ops = { + .bound = cif_subdev_notifier_bound, + .complete = cif_subdev_notifier_complete, +}; + +static int cif_subdev_notifier_register(struct cif_device *cif_dev, int index) +{ + struct v4l2_async_notifier *ntf = &cif_dev->notifier; + struct v4l2_fwnode_endpoint *vep; + struct cif_remote *remote; + struct device *dev = cif_dev->dev; + struct fwnode_handle *ep; + int ret; + + ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(dev), index, 0, + FWNODE_GRAPH_ENDPOINT_NEXT); + if (!ep) + return -ENODEV; + + if (index == 0) { + vep = &cif_dev->dvp.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) { + v4l2_err(&cif_dev->v4l2_dev, "unsupported bus type\n"); + goto complete; + } + + remote = v4l2_async_nf_add_fwnode_remote(ntf, ep, + struct cif_remote); + if (IS_ERR(remote)) { + ret = PTR_ERR(remote); + goto complete; + } + + cif_dev->dvp.stream.remote = remote; + remote->stream = &cif_dev->dvp.stream; + } else { + ret = -ENODEV; + goto complete; + } + +complete: + fwnode_handle_put(ep); + + return ret; +} + +static void cif_subdev_notifier_unregister(struct cif_device *cif_dev, + int index) +{ +} + +static int cif_entities_register(struct cif_device *cif_dev) +{ + struct v4l2_async_notifier *ntf = &cif_dev->notifier; + struct device *dev = cif_dev->dev; + int ret; + + v4l2_async_nf_init(ntf, &cif_dev->v4l2_dev); + ntf->ops = &cif_subdev_notifier_ops; + + if (cif_dev->match_data->dvp) { + ret = cif_subdev_notifier_register(cif_dev, 0); + if (ret) { + dev_err(dev, + "failed to register notifier for dvp: %d\n", + ret); + goto err; + } + + ret = cif_dvp_register(cif_dev); + if (ret) { + dev_err(dev, "failed to register dvp: %d\n", ret); + goto err_dvp_notifier_unregister; + } + } + + ret = v4l2_async_nf_register(ntf); + if (ret) + goto err_notifier_cleanup; + + return 0; + +err_notifier_cleanup: + if (cif_dev->match_data->dvp) + cif_dvp_unregister(cif_dev); +err_dvp_notifier_unregister: + if (cif_dev->match_data->dvp) + cif_subdev_notifier_unregister(cif_dev, 0); + v4l2_async_nf_cleanup(ntf); +err: + return ret; +} + +static void cif_entities_unregister(struct cif_device *cif_dev) +{ + v4l2_async_nf_unregister(&cif_dev->notifier); + v4l2_async_nf_cleanup(&cif_dev->notifier); + + if (cif_dev->match_data->dvp) { + cif_subdev_notifier_unregister(cif_dev, 0); + cif_dvp_unregister(cif_dev); + } +} + +static irqreturn_t cif_isr(int irq, void *ctx) +{ + irqreturn_t ret = IRQ_NONE; + + if (cif_dvp_isr(irq, ctx) == IRQ_HANDLED) + ret = IRQ_HANDLED; + + return ret; +} + +static int cif_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct cif_device *cif_dev; + u32 cif_clk_delaynum = 0; + int ret, irq, i; + + cif_dev = devm_kzalloc(dev, sizeof(*cif_dev), GFP_KERNEL); + if (!cif_dev) + return -ENOMEM; + + cif_dev->match_data = of_device_get_match_data(dev); + if (!cif_dev->match_data) + return -ENODEV; + + dev_set_drvdata(dev, cif_dev); + cif_dev->dev = dev; + + cif_dev->base_addr = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(cif_dev->base_addr)) + return PTR_ERR(cif_dev->base_addr); + + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; + + ret = devm_request_irq(dev, irq, cif_isr, IRQF_SHARED, + dev_driver_string(dev), dev); + if (ret) + return dev_err_probe(dev, ret, "failed to request irq\n"); + cif_dev->irq = irq; + + cif_dev->clks_num = cif_dev->match_data->clks_num; + for (i = 0; (i < cif_dev->clks_num) && (i < CIF_CLKS_MAX); i++) + cif_dev->clks[i].id = cif_dev->match_data->clks[i]; + ret = devm_clk_bulk_get(dev, cif_dev->clks_num, cif_dev->clks); + if (ret) + return dev_err_probe(dev, ret, "failed to get clocks\n"); + + cif_dev->cif_rst = devm_reset_control_array_get_exclusive(dev); + if (IS_ERR(cif_dev->cif_rst)) + return PTR_ERR(cif_dev->cif_rst); + + cif_dev->grf = + syscon_regmap_lookup_by_phandle(dev->of_node, "rockchip,grf"); + if (IS_ERR(cif_dev->grf)) + cif_dev->grf = NULL; + + if (cif_dev->match_data->dvp) { + of_property_read_u32(dev->of_node, "rockchip,cif-clk-delaynum", + &cif_clk_delaynum); + cif_dev->dvp.cif_clk_delaynum = cif_clk_delaynum; + } + + pm_runtime_enable(&pdev->dev); + + cif_dev->media_dev.dev = dev; + strscpy(cif_dev->media_dev.model, CIF_DRIVER_NAME, + sizeof(cif_dev->media_dev.model)); + media_device_init(&cif_dev->media_dev); + + cif_dev->v4l2_dev.mdev = &cif_dev->media_dev; + cif_dev->v4l2_dev.notify = cif_notify; + strscpy(cif_dev->v4l2_dev.name, CIF_DRIVER_NAME, + sizeof(cif_dev->v4l2_dev.name)); + + ret = v4l2_device_register(dev, &cif_dev->v4l2_dev); + if (ret) + goto err_media_dev_cleanup; + + ret = media_device_register(&cif_dev->media_dev); + if (ret < 0) { + dev_err(dev, "failed to register media device: %d\n", ret); + goto err_v4l2_dev_unregister; + } + + ret = cif_entities_register(cif_dev); + if (ret) { + dev_err(dev, "failed to register media entities: %d\n", ret); + goto err_media_dev_unregister; + } + + return 0; + +err_media_dev_unregister: + media_device_unregister(&cif_dev->media_dev); +err_v4l2_dev_unregister: + v4l2_device_unregister(&cif_dev->v4l2_dev); +err_media_dev_cleanup: + media_device_cleanup(&cif_dev->media_dev); + pm_runtime_disable(&pdev->dev); + return ret; +} + +static void cif_remove(struct platform_device *pdev) +{ + struct cif_device *cif_dev = platform_get_drvdata(pdev); + + cif_entities_unregister(cif_dev); + media_device_unregister(&cif_dev->media_dev); + v4l2_device_unregister(&cif_dev->v4l2_dev); + media_device_cleanup(&cif_dev->media_dev); + pm_runtime_disable(&pdev->dev); +} + +static int cif_runtime_suspend(struct device *dev) +{ + struct cif_device *cif_dev = dev_get_drvdata(dev); + + /* + * Reset CIF (CRU, DMA, FIFOs) to allow a clean resume. + * Since this resets the IOMMU too, we cannot issue this reset when + * resuming. + */ + reset_control_assert(cif_dev->cif_rst); + udelay(5); + reset_control_deassert(cif_dev->cif_rst); + + clk_bulk_disable_unprepare(cif_dev->clks_num, cif_dev->clks); + + return 0; +} + +static int cif_runtime_resume(struct device *dev) +{ + struct cif_device *cif_dev = dev_get_drvdata(dev); + int ret; + + ret = clk_bulk_prepare_enable(cif_dev->clks_num, cif_dev->clks); + if (ret) { + dev_err(dev, "failed to enable clocks\n"); + return ret; + } + + return 0; +} + +static const struct dev_pm_ops cif_plat_pm_ops = { + .runtime_suspend = cif_runtime_suspend, + .runtime_resume = cif_runtime_resume, +}; + +static struct platform_driver cif_plat_drv = { + .driver = { + .name = CIF_DRIVER_NAME, + .of_match_table = cif_plat_of_match, + .pm = &cif_plat_pm_ops, + }, + .probe = cif_probe, + .remove_new = cif_remove, +}; +module_platform_driver(cif_plat_drv); + +MODULE_DESCRIPTION("Rockchip Camera Interface (CIF) platform driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/media/platform/rockchip/cif/cif-regs.h b/drivers/media/platform/rockchip/cif/cif-regs.h new file mode 100644 index 000000000000..eb32998ae056 --- /dev/null +++ b/drivers/media/platform/rockchip/cif/cif-regs.h @@ -0,0 +1,132 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Rockchip Camera Interface (CIF) Driver + * + * Copyright (C) 2018 Rockchip Electronics Co., Ltd. + * Copyright (C) 2023 Mehdi Djait + * Copyright (C) 2024 Michael Riesch + */ + +#ifndef _CIF_REGS_H +#define _CIF_REGS_H + +enum cif_dvp_register { + CIF_DVP_CTRL, + CIF_DVP_INTEN, + CIF_DVP_INTSTAT, + CIF_DVP_FOR, + CIF_DVP_LINE_NUM_ADDR, + CIF_DVP_FRM0_ADDR_Y, + CIF_DVP_FRM0_ADDR_UV, + CIF_DVP_FRM1_ADDR_Y, + CIF_DVP_FRM1_ADDR_UV, + CIF_DVP_VIR_LINE_WIDTH, + CIF_DVP_SET_SIZE, + CIF_DVP_SCL_CTRL, + CIF_DVP_FRAME_STATUS, + CIF_DVP_LAST_LINE, + CIF_DVP_LAST_PIX, + CIF_DVP_REGISTER_MAX, + CIF_DVP_REGISTER_INVALID, +}; + +#define CIF_FETCH_Y_LAST_LINE(VAL) ((VAL) & 0x1fff) + +#define CIF_CTRL_ENABLE_CAPTURE BIT(0) +#define CIF_CTRL_MODE_PINGPONG BIT(1) +#define CIF_CTRL_MODE_LINELOOP BIT(2) +#define CIF_CTRL_AXI_BURST_16 (0xf << 12) + +#define CIF_INTEN_FRAME_END_EN BIT(0) +#define CIF_INTEN_LINE_ERR_EN BIT(2) +#define CIF_INTEN_BUS_ERR_EN BIT(6) +#define CIF_INTEN_SCL_ERR_EN BIT(7) +#define CIF_INTEN_PST_INF_FRAME_END_EN BIT(9) + +#define CIF_INTSTAT_CLS 0x3ff +#define CIF_INTSTAT_FRAME_END BIT(0) +#define CIF_INTSTAT_LINE_END BIT(1) +#define CIF_INTSTAT_LINE_ERR BIT(2) +#define CIF_INTSTAT_PIX_ERR BIT(3) +#define CIF_INTSTAT_DFIFO_OF BIT(5) +#define CIF_INTSTAT_BUS_ERR BIT(6) +#define CIF_INTSTAT_PRE_INF_FRAME_END BIT(8) +#define CIF_INTSTAT_PST_INF_FRAME_END BIT(9) +#define CIF_INTSTAT_FRAME_END_CLR BIT(0) +#define CIF_INTSTAT_LINE_END_CLR BIT(1) +#define CIF_INTSTAT_LINE_ERR_CLR BIT(2) +#define CIF_INTSTAT_PST_INF_FRAME_END_CLR BIT(9) +#define CIF_INTSTAT_ERR 0xfc + +#define CIF_FRAME_STAT_CLS 0x00 +#define CIF_FRAME_FRM0_STAT_CLS 0x20 + +#define CIF_FORMAT_VSY_HIGH_ACTIVE BIT(0) +#define CIF_FORMAT_HSY_LOW_ACTIVE BIT(1) + +#define CIF_FORMAT_INPUT_MODE_YUV (0x00 << 2) +#define CIF_FORMAT_INPUT_MODE_PAL (0x02 << 2) +#define CIF_FORMAT_INPUT_MODE_NTSC (0x03 << 2) +#define CIF_FORMAT_INPUT_MODE_BT1120 (0x07 << 2) +#define CIF_FORMAT_INPUT_MODE_RAW (0x04 << 2) +#define CIF_FORMAT_INPUT_MODE_JPEG (0x05 << 2) +#define CIF_FORMAT_INPUT_MODE_MIPI (0x06 << 2) + +#define CIF_FORMAT_YUV_INPUT_ORDER_UYVY (0x00 << 5) +#define CIF_FORMAT_YUV_INPUT_ORDER_YVYU (0x01 << 5) +#define CIF_FORMAT_YUV_INPUT_ORDER_VYUY (0x02 << 5) +#define CIF_FORMAT_YUV_INPUT_ORDER_YUYV (0x03 << 5) +#define CIF_FORMAT_YUV_INPUT_422 (0x00 << 7) +#define CIF_FORMAT_YUV_INPUT_420 BIT(7) + +#define CIF_FORMAT_INPUT_420_ORDER_ODD BIT(8) + +#define CIF_FORMAT_CCIR_INPUT_ORDER_EVEN BIT(9) + +#define CIF_FORMAT_RAW_DATA_WIDTH_8 (0x00 << 11) +#define CIF_FORMAT_RAW_DATA_WIDTH_10 (0x01 << 11) +#define CIF_FORMAT_RAW_DATA_WIDTH_12 (0x02 << 11) + +#define CIF_FORMAT_YUV_OUTPUT_422 (0x00 << 16) +#define CIF_FORMAT_YUV_OUTPUT_420 BIT(16) + +#define CIF_FORMAT_OUTPUT_420_ORDER_EVEN (0x00 << 17) +#define CIF_FORMAT_OUTPUT_420_ORDER_ODD BIT(17) + +#define CIF_FORMAT_RAWD_DATA_LITTLE_ENDIAN (0x00 << 18) +#define CIF_FORMAT_RAWD_DATA_BIG_ENDIAN BIT(18) + +#define CIF_FORMAT_UV_STORAGE_ORDER_UVUV (0x00 << 19) +#define CIF_FORMAT_UV_STORAGE_ORDER_VUVU BIT(19) + +#define CIF_FORMAT_BT1120_CLOCK_SINGLE_EDGES (0x00 << 24) +#define CIF_FORMAT_BT1120_CLOCK_DOUBLE_EDGES BIT(24) +#define CIF_FORMAT_BT1120_TRANSMIT_INTERFACE (0x00 << 25) +#define CIF_FORMAT_BT1120_TRANSMIT_PROGRESS BIT(25) +#define CIF_FORMAT_BT1120_YC_SWAP BIT(26) + +#define CIF_SCL_CTRL_ENABLE_SCL_DOWN BIT(0) +#define CIF_SCL_CTRL_ENABLE_SCL_UP BIT(1) +#define CIF_SCL_CTRL_ENABLE_YUV_16BIT_BYPASS BIT(4) +#define CIF_SCL_CTRL_ENABLE_RAW_16BIT_BYPASS BIT(5) +#define CIF_SCL_CTRL_ENABLE_32BIT_BYPASS BIT(6) +#define CIF_SCL_CTRL_DISABLE_32BIT_BYPASS (0x00 << 6) + +#define CIF_INTSTAT_F0_READY BIT(0) +#define CIF_INTSTAT_F1_READY BIT(1) + +#define CIF_CROP_Y_SHIFT 16 +#define CIF_CROP_X_SHIFT 0 + +/* GRF register offsets */ +#define RK3568_GRF_VI_CON0 0x340 +#define RK3568_GRF_VI_CON1 0x344 +#define RK3568_GRF_VI_STATUS0 0x348 + +#define RK3568_GRF_VI_CON1_CIF_DATAPATH BIT(9) +#define RK3568_GRF_VI_CON1_CIF_CLK_DELAYNUM 0x7f +#define RK3568_GRF_SET_CLK_DELAYNUM(x) ((x) & 0x7f) + +#define RK3568_GRF_WRITE_ENABLE(x) ((x) << 16) + +#endif diff --git a/drivers/media/platform/rockchip/cif/cif-stream.c b/drivers/media/platform/rockchip/cif/cif-stream.c new file mode 100644 index 000000000000..a56ec3ac675c --- /dev/null +++ b/drivers/media/platform/rockchip/cif/cif-stream.c @@ -0,0 +1,676 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Rockchip Camera Interface (CIF) Driver + * + * Copyright (C) 2024 Michael Riesch + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cif-common.h" +#include "cif-stream.h" + +#define CIF_REQ_BUFS_MIN 8 +#define CIF_MIN_WIDTH 64 +#define CIF_MIN_HEIGHT 64 +#define CIF_MAX_WIDTH 8192 +#define CIF_MAX_HEIGHT 8192 + +static inline struct cif_buffer *to_cif_buffer(struct vb2_v4l2_buffer *vb) +{ + return container_of(vb, struct cif_buffer, vb); +} + +static inline struct cif_stream *to_cif_stream(struct video_device *vdev) +{ + return container_of(vdev, struct cif_stream, vdev); +} + +static const struct cif_output_fmt * +cif_stream_find_output_fmt(struct cif_stream *stream, u32 pixelfmt) +{ + const struct cif_output_fmt *fmt; + unsigned int i; + + for (i = 0; i < stream->out_fmts_num; i++) { + fmt = &stream->out_fmts[i]; + if (fmt->fourcc == pixelfmt) + return fmt; + } + + return NULL; +} + +static struct cif_buffer *cif_stream_pop_buffer(struct cif_stream *stream) +{ + struct cif_buffer *buffer = NULL; + unsigned long lock_flags; + + spin_lock_irqsave(&stream->driver_queue_lock, lock_flags); + + if (list_empty(&stream->driver_queue)) + goto err_empty; + + buffer = list_first_entry(&stream->driver_queue, struct cif_buffer, + queue); + list_del(&buffer->queue); + +err_empty: + spin_unlock_irqrestore(&stream->driver_queue_lock, lock_flags); + return buffer; +} + +static void cif_stream_push_buffer(struct cif_stream *stream, + struct cif_buffer *buffer) +{ + unsigned long lock_flags; + + spin_lock_irqsave(&stream->driver_queue_lock, lock_flags); + list_add_tail(&buffer->queue, &stream->driver_queue); + spin_unlock_irqrestore(&stream->driver_queue_lock, lock_flags); +} + +static inline void cif_stream_return_buffer(struct cif_stream *stream, + struct cif_buffer *buffer, + enum vb2_buffer_state state) +{ + struct vb2_v4l2_buffer *vb = &buffer->vb; + + vb2_buffer_done(&vb->vb2_buf, state); +} + +static void cif_stream_complete_buffer(struct cif_stream *stream, + struct cif_buffer *buffer) +{ + struct vb2_v4l2_buffer *vb = &buffer->vb; + + vb->vb2_buf.timestamp = ktime_get_ns(); + vb->sequence = stream->frame_idx; + vb2_buffer_done(&vb->vb2_buf, VB2_BUF_STATE_DONE); + stream->frame_idx++; +} + +void cif_stream_pingpong(struct cif_stream *stream) +{ + struct cif_buffer *buffer; + + if (!stream->buffers[stream->frame_phase]->is_dummy) + cif_stream_complete_buffer( + stream, stream->buffers[stream->frame_phase]); + + buffer = cif_stream_pop_buffer(stream); + if (buffer) { + stream->buffers[stream->frame_phase] = buffer; + stream->buffers[stream->frame_phase]->is_dummy = false; + } else { + stream->buffers[stream->frame_phase] = &stream->dummy.buffer; + stream->buffers[stream->frame_phase]->is_dummy = true; + dev_warn(stream->cif_dev->dev, + "no buffer available, frame will be dropped\n"); + } + + if (stream->queue_buffer) + stream->queue_buffer(stream, stream->frame_phase); + + stream->frame_phase = 1 - stream->frame_phase; +} + +static int cif_stream_init_buffers(struct cif_stream *stream) +{ + const struct cif_output_fmt *fmt = stream->active_out_fmt; + struct v4l2_pix_format_mplane *pix = &stream->pix; + int i; + + stream->buffers[0] = cif_stream_pop_buffer(stream); + if (!stream->buffers[0]) + goto err_buff_0; + + stream->buffers[1] = cif_stream_pop_buffer(stream); + if (!stream->buffers[1]) + goto err_buff_1; + + if (stream->queue_buffer) { + stream->queue_buffer(stream, 0); + stream->queue_buffer(stream, 1); + } + + stream->dummy.size = fmt->cplanes * pix->plane_fmt[0].sizeimage; + stream->dummy.vaddr = + dma_alloc_attrs(stream->cif_dev->dev, stream->dummy.size, + &stream->dummy.buffer.buff_addr[0], GFP_KERNEL, + DMA_ATTR_NO_KERNEL_MAPPING); + if (!stream->dummy.vaddr) + goto err_dummy; + + for (i = 1; i < fmt->cplanes; i++) + stream->dummy.buffer.buff_addr[i] = + stream->dummy.buffer.buff_addr[i - 1] + + pix->plane_fmt[i - 1].bytesperline * pix->height; + + return 0; + +err_dummy: + cif_stream_return_buffer(stream, stream->buffers[1], + VB2_BUF_STATE_QUEUED); + stream->buffers[1] = NULL; + +err_buff_1: + cif_stream_return_buffer(stream, stream->buffers[0], + VB2_BUF_STATE_QUEUED); + stream->buffers[0] = NULL; +err_buff_0: + return -EINVAL; +} + +static void cif_stream_return_all_buffers(struct cif_stream *stream, + enum vb2_buffer_state state) +{ + struct cif_buffer *buffer; + + dma_free_attrs(stream->cif_dev->dev, stream->dummy.size, + stream->dummy.vaddr, stream->dummy.buffer.buff_addr[0], + DMA_ATTR_NO_KERNEL_MAPPING); + + if (stream->buffers[0]) { + cif_stream_return_buffer(stream, stream->buffers[0], state); + stream->buffers[0] = NULL; + } + + if (stream->buffers[1]) { + cif_stream_return_buffer(stream, stream->buffers[1], state); + stream->buffers[1] = NULL; + } + + while ((buffer = cif_stream_pop_buffer(stream))) + cif_stream_return_buffer(stream, buffer, state); +} + +static int cif_stream_setup_queue(struct vb2_queue *queue, + unsigned int *num_buffers, + unsigned int *num_planes, + unsigned int sizes[], + struct device *alloc_devs[]) +{ + struct cif_stream *stream = queue->drv_priv; + struct v4l2_pix_format_mplane *pix = &stream->pix; + unsigned int i; + + if (*num_planes) { + if (*num_planes != pix->num_planes) + return -EINVAL; + + for (i = 0; i < pix->num_planes; i++) + if (sizes[i] < pix->plane_fmt[i].sizeimage) + return -EINVAL; + } else { + *num_planes = pix->num_planes; + for (i = 0; i < pix->num_planes; i++) + sizes[i] = pix->plane_fmt[i].sizeimage; + } + + return 0; +} + +static int cif_stream_prepare_buffer(struct vb2_buffer *vb) +{ + struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); + struct cif_buffer *buffer = to_cif_buffer(vbuf); + struct cif_stream *stream = vb->vb2_queue->drv_priv; + const struct cif_output_fmt *fmt = stream->active_out_fmt; + struct v4l2_pix_format_mplane *pix = &stream->pix; + unsigned int i; + + memset(buffer->buff_addr, 0, sizeof(buffer->buff_addr)); + for (i = 0; i < pix->num_planes; i++) + buffer->buff_addr[i] = vb2_dma_contig_plane_dma_addr(vb, i); + + /* apply fallback for non-mplane formats, if required */ + if (pix->num_planes == 1) { + for (i = 1; i < fmt->cplanes; i++) + buffer->buff_addr[i] = + buffer->buff_addr[i - 1] + + pix->plane_fmt[i - 1].bytesperline * + pix->height; + } + + for (i = 0; i < pix->num_planes; i++) { + unsigned long size = pix->plane_fmt[i].sizeimage; + + if (vb2_plane_size(vb, i) < size) { + dev_err(stream->cif_dev->dev, + "user buffer too small (%ld < %ld)\n", + vb2_plane_size(vb, i), size); + return -EINVAL; + } + + vb2_set_plane_payload(vb, i, size); + } + + return 0; +} + +static void cif_stream_queue_buffer(struct vb2_buffer *vb) +{ + struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); + struct cif_buffer *buffer = to_cif_buffer(vbuf); + struct cif_stream *stream = vb->vb2_queue->drv_priv; + + cif_stream_push_buffer(stream, buffer); +} + +static int cif_stream_start_streaming(struct vb2_queue *queue, + unsigned int count) +{ + struct cif_stream *stream = queue->drv_priv; + struct cif_device *cif_dev = stream->cif_dev; + struct v4l2_subdev *sd = stream->remote->sd; + int ret; + + stream->frame_idx = 0; + stream->frame_phase = 0; + + ret = video_device_pipeline_start(&stream->vdev, &stream->pipeline); + if (ret) { + dev_err(cif_dev->dev, "failed to start pipeline %d\n", ret); + goto err_out; + } + + ret = pm_runtime_resume_and_get(cif_dev->dev); + if (ret < 0) { + dev_err(cif_dev->dev, "failed to get runtime pm, %d\n", ret); + goto err_pipeline_stop; + } + + ret = cif_stream_init_buffers(stream); + if (ret) + goto err_runtime_put; + + if (stream->start_streaming) { + ret = stream->start_streaming(stream); + if (ret < 0) + goto err_runtime_put; + } + + ret = v4l2_subdev_call(sd, video, s_stream, 1); + if (ret < 0) + goto err_stop_stream; + + return 0; + +err_stop_stream: + if (stream->stop_streaming) + stream->stop_streaming(stream); +err_runtime_put: + pm_runtime_put(cif_dev->dev); +err_pipeline_stop: + video_device_pipeline_stop(&stream->vdev); +err_out: + cif_stream_return_all_buffers(stream, VB2_BUF_STATE_QUEUED); + return ret; +} + +static void cif_stream_stop_streaming(struct vb2_queue *queue) +{ + struct cif_stream *stream = queue->drv_priv; + struct cif_device *cif_dev = stream->cif_dev; + struct v4l2_subdev *sd = stream->remote->sd; + int ret; + + v4l2_subdev_call(sd, video, s_stream, 0); + + stream->stopping = true; + ret = wait_event_timeout(stream->wq_stopped, !stream->stopping, + msecs_to_jiffies(1000)); + + if (!ret && stream->stop_streaming) + stream->stop_streaming(stream); + + pm_runtime_put(cif_dev->dev); + + cif_stream_return_all_buffers(stream, VB2_BUF_STATE_ERROR); + + video_device_pipeline_stop(&stream->vdev); +} + +static const struct vb2_ops cif_stream_vb2_ops = { + .queue_setup = cif_stream_setup_queue, + .buf_prepare = cif_stream_prepare_buffer, + .buf_queue = cif_stream_queue_buffer, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, + .start_streaming = cif_stream_start_streaming, + .stop_streaming = cif_stream_stop_streaming, +}; + +static int cif_stream_try_format(struct file *file, void *fh, + struct v4l2_format *f) +{ + struct cif_stream *stream = video_drvdata(file); + const struct cif_output_fmt *fmt; + struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp; + struct v4l2_subdev *sd = stream->remote->sd; + struct v4l2_subdev_format sd_fmt = { + .which = V4L2_SUBDEV_FORMAT_ACTIVE, + }; + u32 height, width; + int ret; + + fmt = cif_stream_find_output_fmt(stream, pix->pixelformat); + if (!fmt) + fmt = &stream->out_fmts[0]; + + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &sd_fmt); + if (ret < 0) + return ret; + + height = clamp_t(u32, sd_fmt.format.height, CIF_MIN_HEIGHT, + CIF_MAX_HEIGHT); + width = clamp_t(u32, sd_fmt.format.width, CIF_MIN_WIDTH, CIF_MAX_WIDTH); + + pix->field = sd_fmt.format.field; + pix->colorspace = sd_fmt.format.colorspace; + pix->ycbcr_enc = sd_fmt.format.ycbcr_enc; + pix->quantization = sd_fmt.format.quantization; + pix->xfer_func = sd_fmt.format.xfer_func; + + v4l2_fill_pixfmt_mp(pix, fmt->fourcc, width, height); + + return 0; +} + +static int cif_stream_set_format(struct file *file, void *priv, + struct v4l2_format *f) +{ + struct cif_stream *stream = video_drvdata(file); + int ret; + + if (vb2_is_busy(&stream->buf_queue)) + return -EBUSY; + + ret = cif_stream_try_format(file, priv, f); + if (ret) + return ret; + + stream->pix = f->fmt.pix_mp; + stream->active_out_fmt = + cif_stream_find_output_fmt(stream, f->fmt.pix_mp.pixelformat); + + return 0; +} + +static int cif_stream_get_format(struct file *file, void *fh, + struct v4l2_format *f) +{ + struct cif_stream *stream = video_drvdata(file); + + f->fmt.pix_mp = stream->pix; + + return 0; +} + +static int cif_stream_enum_formats(struct file *file, void *priv, + struct v4l2_fmtdesc *f) +{ + struct cif_stream *stream = video_drvdata(file); + + if (f->index >= stream->out_fmts_num) + return -EINVAL; + + f->pixelformat = stream->out_fmts[f->index].fourcc; + + return 0; +} + +static int cif_stream_enum_framesizes(struct file *file, void *fh, + struct v4l2_frmsizeenum *fsize) +{ + struct cif_stream *stream = video_drvdata(file); + struct v4l2_subdev_frame_size_enum fse = { + .index = fsize->index, + .which = V4L2_SUBDEV_FORMAT_ACTIVE, + }; + struct v4l2_subdev *sd = stream->remote->sd; + const struct cif_output_fmt *fmt; + int ret; + + fmt = cif_stream_find_output_fmt(stream, fsize->pixel_format); + if (!fmt) + return -EINVAL; + + fse.code = fmt->mbus_code; + + ret = v4l2_subdev_call(sd, pad, enum_frame_size, NULL, &fse); + if (ret) + return ret; + + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = fse.max_width; + fsize->discrete.height = fse.max_height; + + /* some variants may have a scaler in the path. */ + /* TODO: add support for them */ + + return 0; +} + +static int cif_stream_enum_frameintervals(struct file *file, void *fh, + struct v4l2_frmivalenum *fival) +{ + struct cif_stream *stream = video_drvdata(file); + struct v4l2_subdev *sd = stream->remote->sd; + struct v4l2_subdev_frame_interval_enum fie = { + .index = fival->index, + .width = fival->width, + .height = fival->height, + .which = V4L2_SUBDEV_FORMAT_ACTIVE, + }; + const struct cif_output_fmt *fmt; + int ret; + + fmt = cif_stream_find_output_fmt(stream, fival->pixel_format); + if (!fmt) + return -EINVAL; + + fie.code = fmt->mbus_code; + + ret = v4l2_subdev_call(sd, pad, enum_frame_interval, NULL, &fie); + if (ret) + return ret; + + fival->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fival->discrete = fie.interval; + + return 0; +} + +static int cif_stream_querycap(struct file *file, void *priv, + struct v4l2_capability *cap) +{ + struct cif_stream *stream = video_drvdata(file); + struct device *dev = stream->cif_dev->dev; + + strscpy(cap->driver, dev->driver->name, sizeof(cap->driver)); + strscpy(cap->card, dev->driver->name, sizeof(cap->card)); + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", + dev_name(dev)); + + return 0; +} + +static const struct v4l2_ioctl_ops cif_stream_ioctl_ops = { + .vidioc_reqbufs = vb2_ioctl_reqbufs, + .vidioc_querybuf = vb2_ioctl_querybuf, + .vidioc_create_bufs = vb2_ioctl_create_bufs, + .vidioc_qbuf = vb2_ioctl_qbuf, + .vidioc_expbuf = vb2_ioctl_expbuf, + .vidioc_dqbuf = vb2_ioctl_dqbuf, + .vidioc_prepare_buf = vb2_ioctl_prepare_buf, + .vidioc_streamon = vb2_ioctl_streamon, + .vidioc_streamoff = vb2_ioctl_streamoff, + .vidioc_try_fmt_vid_cap_mplane = cif_stream_try_format, + .vidioc_s_fmt_vid_cap_mplane = cif_stream_set_format, + .vidioc_g_fmt_vid_cap_mplane = cif_stream_get_format, + .vidioc_enum_fmt_vid_cap = cif_stream_enum_formats, + .vidioc_enum_framesizes = cif_stream_enum_framesizes, + .vidioc_enum_frameintervals = cif_stream_enum_frameintervals, + .vidioc_querycap = cif_stream_querycap, + .vidioc_subscribe_event = v4l2_src_change_event_subscribe, + .vidioc_unsubscribe_event = v4l2_event_unsubscribe, +}; + +static int cif_stream_link_validate(struct media_link *link) +{ + struct video_device *vdev = + media_entity_to_video_device(link->sink->entity); + struct v4l2_subdev *sd = + media_entity_to_v4l2_subdev(link->source->entity); + struct cif_stream *stream = to_cif_stream(vdev); + struct v4l2_subdev_format sd_fmt = { + .which = V4L2_SUBDEV_FORMAT_ACTIVE, + .pad = 0, + }; + const struct cif_input_fmt *cif_in_fmt = NULL; + unsigned int i; + int ret; + + ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &sd_fmt); + if (ret < 0) + goto err_out; + + for (i = 0; i < stream->in_fmts_num; i++) { + if (sd_fmt.format.code == stream->in_fmts[i].mbus_code && + sd_fmt.format.field == stream->in_fmts[i].field) { + cif_in_fmt = &stream->in_fmts[i]; + break; + } + } + if (!cif_in_fmt) { + dev_err(stream->cif_dev->dev, + "remote's mbus code not supported\n"); + goto err_out; + } + + if (sd_fmt.format.height != stream->pix.height || + sd_fmt.format.width != stream->pix.width) { + dev_err(stream->cif_dev->dev, + "link '%s':%u -> '%s':%u not valid: %ux%u != %ux%u\n", + link->source->entity->name, link->source->index, + link->sink->entity->name, link->sink->index, + sd_fmt.format.width, sd_fmt.format.height, + stream->pix.width, stream->pix.height); + goto err_out; + } + + stream->active_in_fmt = cif_in_fmt; + return 0; + +err_out: + stream->active_in_fmt = NULL; + return -EPIPE; +} + +static const struct media_entity_operations cif_stream_media_ops = { + .link_validate = cif_stream_link_validate, +}; + +static const struct v4l2_file_operations cif_stream_file_ops = { + .open = v4l2_fh_open, + .release = vb2_fop_release, + .unlocked_ioctl = video_ioctl2, + .poll = vb2_fop_poll, + .mmap = vb2_fop_mmap, +}; + +static int cif_stream_init_vb2_queue(struct vb2_queue *q, + struct cif_stream *stream) +{ + q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + q->io_modes = VB2_MMAP | VB2_DMABUF; + q->drv_priv = stream; + q->ops = &cif_stream_vb2_ops; + q->mem_ops = &vb2_dma_contig_memops; + q->buf_struct_size = sizeof(struct cif_buffer); + q->min_queued_buffers = CIF_REQ_BUFS_MIN; + q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; + q->lock = &stream->vlock; + q->dev = stream->cif_dev->dev; + + return vb2_queue_init(q); +} + +int cif_stream_register(struct cif_device *cif_dev, struct cif_stream *stream, + const struct cif_stream_config *config) +{ + struct v4l2_device *v4l2_dev = &cif_dev->v4l2_dev; + struct video_device *vdev = &stream->vdev; + int ret; + + stream->cif_dev = cif_dev; + + INIT_LIST_HEAD(&stream->driver_queue); + spin_lock_init(&stream->driver_queue_lock); + + init_waitqueue_head(&stream->wq_stopped); + + mutex_init(&stream->vlock); + + vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE_MPLANE | V4L2_CAP_STREAMING | + V4L2_CAP_IO_MC; + vdev->entity.ops = &cif_stream_media_ops; + vdev->fops = &cif_stream_file_ops; + vdev->ioctl_ops = &cif_stream_ioctl_ops; + vdev->lock = &stream->vlock; + vdev->minor = -1; + vdev->release = video_device_release_empty; + vdev->v4l2_dev = v4l2_dev; + vdev->vfl_dir = VFL_DIR_RX; + video_set_drvdata(vdev, stream); + + stream->pad.flags = MEDIA_PAD_FL_SINK; + + cif_stream_init_vb2_queue(&stream->buf_queue, stream); + + vdev->queue = &stream->buf_queue; + if (config->name) + strscpy(vdev->name, config->name, sizeof(vdev->name)); + + ret = media_entity_pads_init(&vdev->entity, 1, &stream->pad); + if (ret < 0) { + dev_err(cif_dev->dev, "failed to initialize media pads: %d\n", + ret); + return ret; + } + + ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1); + if (ret < 0) { + dev_err(cif_dev->dev, "failed to register video device: %d\n", + ret); + goto err_media_entity_cleanup; + } + + v4l2_info(v4l2_dev, "registered %s as /dev/video%d\n", vdev->name, + vdev->num); + + return 0; + +err_media_entity_cleanup: + media_entity_cleanup(&stream->vdev.entity); + return ret; +} + +void cif_stream_unregister(struct cif_stream *stream) +{ + video_unregister_device(&stream->vdev); + media_entity_cleanup(&stream->vdev.entity); +} diff --git a/drivers/media/platform/rockchip/cif/cif-stream.h b/drivers/media/platform/rockchip/cif/cif-stream.h new file mode 100644 index 000000000000..5bfa260eda83 --- /dev/null +++ b/drivers/media/platform/rockchip/cif/cif-stream.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Rockchip Camera Interface (CIF) Driver + * + * Copyright (C) 2024 Michael Riesch + */ + +#ifndef _CIF_STREAM_H +#define _CIF_STREAM_H + +#include "cif-common.h" + +struct cif_stream_config { + const char *name; +}; + +void cif_stream_pingpong(struct cif_stream *stream); + +int cif_stream_register(struct cif_device *cif_dev, struct cif_stream *stream, + const struct cif_stream_config *config); + +void cif_stream_unregister(struct cif_stream *stream); + +#endif From patchwork Tue Dec 17 15:55:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13912205 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F459E77184 for ; Tue, 17 Dec 2024 16:31:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rxCovdfE5jCpFekbbhbq0EQ77/r7AZ8VUAY0zTecDhM=; b=Xo/0IJJ+Lu52jlM9CzOwZxFky7 y4juwRyVOx/QfJQ9S4tii+S8DxzecMRbha4hlNosJDfBcMg2StU6YL5qvTgoKHEhp4sv5k8gRysMg gPvwBcdU23o9tIm+X3IYfq6comGQv+D+efmgXbI67kS14TOh+4DBZz2TbJowyvVxxA1QZXJwRZlVf EWrUWiRl+cxxoNnsfr/yWw909C0GISQEto3JfdYZepSJLsIzP2LYCs+7oJEyDuEGsJVzb+RANJ9ly b3qL39hc2UiI9g1QfU2QDxxTDNLhDzbzg1cesOEYqZmUsSspK9SOTG936gxJ4uAibn4Kr5aJKGnBu PizovvHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNaTF-0000000EBdb-31w3; Tue, 17 Dec 2024 16:30:53 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNZv5-0000000E2po-4BAC; Tue, 17 Dec 2024 15:55:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pfs1g4iQADVuwI5SmhTM86jsR57sq4Eh/jDAoAt9hdDCrzCCyTmmzhlZRHoHJ1Esq4AxnUBQfOI6cTJkFdML72bqb6Uszp8aqvfAsml7BPIblKVftYmsVbBmzdeJYj95txEcKK3iMmzBAp1uxadVR3A1YV2msLxnJ+itFTsdV9g/ndxFgwlH0840nJVFjjg/8Yj6LJeaHBIOTZRepamItlfVZTlRbefmtxzPSZolKcwys2JFrm0XsqWA+H++LpZEu7rdt6wwYr+o5TmBePEub+mpvG9butJU6EcBgmL69arav/IZKgAJAk+fhyZBOzxsDb6juEsGYZua5vJtVum8mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=rxCovdfE5jCpFekbbhbq0EQ77/r7AZ8VUAY0zTecDhM=; b=PYpf1aMznFp/Iw/WEUtEqu6sKpMV0vKCAGirEzbEE+99WzfrDmLL7kd9dW3eyFcjjQHMMxx9bU7ig9KGRT1fLDhAxbfkwnapMJ3Z2JWaJxX21wKNPRLg5zeXdbEqTdTy8Gnsi2PFsyX8LtaKhU9KnvOMB37w/+/Mzru9CT+WgfWGEyX47gNR0RibNHXLa/KQr+JxdLCiI7pjhUIsLHGG9FxBfDERDyrbIBf5ZQ9SDawztpwqAMoJQlKoOm/gmZe3Chg47Z2pfCrwzU96Q/8gykelttEVPSd/QOa30sJf0uWOkhZy+XVV4/6aq+xynhRTmM5ONNU8vArpg/R2j700NA== 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=rxCovdfE5jCpFekbbhbq0EQ77/r7AZ8VUAY0zTecDhM=; b=fuBamtNrH/jIlr8sC5Kdj1wZXc/8NNV4nlU2SPBz3Cny+7sIcseVtpeFxoqpoFrxIGqTiFskvkgl0j+g6L37VkoFGNXNwldVcNumCp3gcTB5aA4c+ivIIyc3OVueCS/ULCpTG7OFLDQ1RGS0GkSlXl/0DpPy4ElWcSwTnt2dl4k= 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 AS8PR08MB10149.eurprd08.prod.outlook.com (2603:10a6:20b:63f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Tue, 17 Dec 2024 15:55:28 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d%5]) with mapi id 15.20.8251.015; Tue, 17 Dec 2024 15:55:28 +0000 From: Michael Riesch Date: Tue, 17 Dec 2024 16:55:17 +0100 Subject: [PATCH v2 5/6] arm64: dts: rockchip: add the vip node to px30 Message-Id: <20241217-v6-8-topic-rk3568-vicap-v2-5-b1d488fcc0d3@wolfvision.net> References: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> In-Reply-To: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> To: Mehdi Djait , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Leb?= =?utf-8?q?run?= , Thomas Petazzoni , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Kever Yang , Nicolas Dufresne , Sebastian Fricke , Alexander Shiyan , Val Packett , Rob Herring , Philipp Zabel , 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 , Mehdi Djait X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734450919; l=1210; i=michael.riesch@wolfvision.net; s=20240405; h=from:subject:message-id; bh=kAZYbwRFBoEiWczEVuI40JvVeuv2U6fJh9wOW1+JivE=; b=NGq8R0LXNFKu+k/eTfnjT+M1pyBEozLczhFkwuqcWUqn5d5EJVFU1IymNULw5xJYtu68Hbt7g 6/o0boxCsJXBqj/SfAuokgy+kdfDRCLeXcGk0Q/F8aZp+YAHkA8ceub X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=cSJmgKSH3B6kdCIDCl+IYDW1Pw/Ybc6g9rmnUd/G7Ck= X-ClientProxiedBy: VI1PR08CA0244.eurprd08.prod.outlook.com (2603:10a6:803:dc::17) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|AS8PR08MB10149:EE_ X-MS-Office365-Filtering-Correlation-Id: a0dcd861-986c-4329-fbdc-08dd1eb33a26 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?5QAkAMZcpsRMG77jUB6t2XB3I/NEGPH?= =?utf-8?q?uCjVMIfMJ42L/WCoR6Ixd77XqMVJqU7qGNNCEzBgToIq6GF/qf2SWHbCJxIf7S5wT?= =?utf-8?q?3l0UYR0C25/N+KnnZVj/QwVkWH3Qd/QFWPvg3YPdOEsjw3qdNXLE3OXf9L4YUamTR?= =?utf-8?q?SdjS4Tlk4m9OSqr4vj3PSLRp6e3IqapLQnnO6zve/8v3n1WHAcaa9OB6uJxKUZ/1A?= =?utf-8?q?xXIduNoDcgc0J6+8NX/9f+WBNLZehPJw4H5Fvmv583SjrG7dTtK3OCDSxeqiqZTlc?= =?utf-8?q?Xi4OkMa6AmPrQyLMPGxUCEkQU+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KJJ9WlLTlL0KzoO8sbJW?= =?utf-8?q?kBenxUx2bvtClyl1G/lAYTymAqAG4RymvB4KyW7dI2i/zKhTTxiazfiWXJUi8f0cM?= =?utf-8?q?GHqJRoDb5CMJ3Zj+bv7TMQAAxe7BEB/3Hn9zqfmfmvdZG4WcvatqFt5OUQ1pfLk10?= =?utf-8?q?owTxOAEIldoQnR6Q00mBIdzRUV9A+ViuKT56NiQUlmf9wv+cdl4olPirOitnL4cGt?= =?utf-8?q?C4/HS0apTd46LIn7WnaAO/8e7JblSxktg=3D=3D?= 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:(13230040)(1800799024)(376014)(7416014)(366016)(52116014)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?uTnFOwA71xAopYBjPTQx8QNvhF/5?= =?utf-8?q?OYLnKeFBKIqkta2cnfWOEPPrN8ywMbYbtzMRh+K3rm0dkcQITTuMdRHS441PS+Lks?= =?utf-8?q?eEtksXqQul2wsSNcn2IwdrOsEClcbOV+Zja8jXKPGLoObIWHCVioQml3KRu13EG1h?= =?utf-8?q?HY6l18528dvktG8Br5nGXnQFK0H/cELyQAdw177XGom4NNjSxo8IY8rJlMLLJcNU9?= =?utf-8?q?P1hpqRnN/Llij++DX+3AW+gnFJ2RMHQVBiF67I7c709/Dbo8SeRLj0mAE1jfv+YEb?= =?utf-8?q?de4KsGzzi4Rh2qfafT0ZCVj3yPkZ0yPEv1GeRhJtnXcQciaF/782UeSzDRwnNe/Yr?= =?utf-8?q?pWjo9vmY4SN+6BgK1VcbEHFi6Nj6cuU1ZxeuV377a13xFPDFufX30AFXqLg0YbAi6?= =?utf-8?q?buKQALn3Ib+xES57V7XpNxIIEUKrU2kwyftU79DBSuV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mj+KIFAwzR8k?= =?utf-8?q?PL14Zj70zUrGEgM7sIqgIcARSD62fEYjN+RIa2T7E4NTvs3E+EO/m1UNonr0ddJSD?= =?utf-8?q?2YU02rfhzElrx+wRl2d+qN1Nps2NdKKGVQ3x0WhM8FvgZevCaklUjlN8/XD4sueV1?= =?utf-8?q?Giyqm6mrtVQ2nk4jpsL9+g+7slbQpZOU1S9Xb9npHSEW3mBYNJ/Ii2nStPWi/1TnW?= =?utf-8?q?DhwoMm3GJvC9x3LJ7J9kst6h+FmVxTEpjw=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: a0dcd861-986c-4329-fbdc-08dd1eb33a26 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 15:55:28.0800 (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: LACTWp2yzfIBwTRS9/xdG2TGc15yWsrvGxjoa7ov6edDiQ7ipIjbNvVBTFyH5W5raI5w0f0mpygiONjfINFGt8M+K7M7SplCnsYf8cZzQfs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10149 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_075536_044441_BB9FDBBC X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Mehdi Djait Add the device tree node for the PX30 Video Input Processor (VIP). Signed-off-by: Mehdi Djait [added cosmetic changes] Signed-off-by: Michael Riesch --- arch/arm64/boot/dts/rockchip/px30.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi index 9137dd76e72c..c2acf5952d08 100644 --- a/arch/arm64/boot/dts/rockchip/px30.dtsi +++ b/arch/arm64/boot/dts/rockchip/px30.dtsi @@ -1282,6 +1282,18 @@ isp_mmu: iommu@ff4a8000 { #iommu-cells = <0>; }; + cif: video-capture@ff490000 { + compatible = "rockchip,px30-vip"; + reg = <0x0 0xff490000 0x0 0x200>; + interrupts = ; + clocks = <&cru ACLK_CIF>, <&cru HCLK_CIF>, <&cru PCLK_CIF>; + clock-names = "aclk", "hclk", "pclk"; + power-domains = <&power PX30_PD_VI>; + resets = <&cru SRST_CIF_A>, <&cru SRST_CIF_H>, <&cru SRST_CIF_PCLKIN>; + reset-names = "axi", "ahb", "pclkin"; + status = "disabled"; + }; + qos_gmac: qos@ff518000 { compatible = "rockchip,px30-qos", "syscon"; reg = <0x0 0xff518000 0x0 0x20>; From patchwork Tue Dec 17 15:55:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13912206 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 544A9E77184 for ; Tue, 17 Dec 2024 16:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nk3b1vxeDZn/wel0Eldbt0PkyheM0Xq6NUrTiMKUNuw=; b=VEDTfNy1G1NxLH4A2UdtknAsiI JxUPJd5PLPbkeI4G3vcUaWacMfLXWSc3l5Lkr80rmyScXbDq284UV3JwTbBBsxZFi/2TLM8FJr6+1 x4e7KlFDL/pGXDysHzWnWDLmDnsPqu0UrWOjh8WO2ak9ewxMF32vg8+45TVTmugGBXvDwAGkr+cQR XFIGg+c111m3IhmjzMCjJsMbhAytDpPFcr4qr1ahthGpCKvDUcm4KGuk2R5aMN8BEIA6oA1QVM5kZ 6eKM3p8zm4Wz63bY985UH9XIw+aFjkfzmnTEG8BGyqO/9HTbpbkKzQnXpPvm/LPDXodNSP4+mHTlo 7+lbo1LA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNaUK-0000000EBsa-31KA; Tue, 17 Dec 2024 16:32:00 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNZv9-0000000E2wr-0r1v; Tue, 17 Dec 2024 15:55:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NmSXdVwRQw5ZATM31yMNrV1ZEK0LDI/uP56HO3GtKwR5TV+zIgq2qbcquEpxWEFmf/Gu0UCmYNE71zJtPcRM5/11+XTx1FHlAQ+sBjAKxhHSQzzR4IYw/2sm/Vua4nYUqZguYcNKJKy8xb/Ie7HJJYCQL2yTIyOXdNJ2gLogsD7g8mI3jU414YWzJAHCT0Zw6IJIDs7b66hoq+TJhIT1Y4iI7ARkotpXyj2zOVga1NB8GR4yoELhancrkNBgTkCTivxxImmKsG0wIXhgdIG3ZtKKQEwji/EU8jzj0LyS/jGBt5apGcNrUx7LyCx2vALQlXofq9emZFSd7mcQm17NPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nk3b1vxeDZn/wel0Eldbt0PkyheM0Xq6NUrTiMKUNuw=; b=L0La9XGVxLOaUksYzNTX8b5YJU2okuYTR64hxwXMHYg1xtURDPqNW79wBvlx9iTVh3Shr+dFgMVrk6/1MWu8JMQRYNEhar4TaK0LdToha8UTfahyA154Cp7Fkjq99i2N3SDFtwX23tidkFR2P9a31JVaGstZoT8B61OdnwJc1Jmz42v8mNbeHFo1RbfQ1Ec3c9jaYjJJypgMNmY8FG4px3t0+TlQODoyNAEy7gs3gTso51Mg3T+l5chuhQmN+ZK8mnhQkirwsb5Bmn/W+vu75IJSEUEY/IOJXjURknLGF4Qw6xGG7+DI3yQLyCS19ujKDC5B8Qg1grlpYsedtF0Pyg== 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=nk3b1vxeDZn/wel0Eldbt0PkyheM0Xq6NUrTiMKUNuw=; b=wKv/ClDEFKb34C0tApzqx96+T5K+jCK5nl20pQuBuI1vZIfQOuyk18ZhSIpBot6YFoNQ5DB9y2hvXVHSGGUVnK+g9OYBxj+7CBKqPz1atDNwgXkRzevBgD+Yhuja34g+kb5NLRhXuQsgjMNeZFIEWLMEOgEmef9XHngFghvqqFA= 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 AS8PR08MB10149.eurprd08.prod.outlook.com (2603:10a6:20b:63f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Tue, 17 Dec 2024 15:55:29 +0000 Received: from DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d]) by DU0PR08MB9155.eurprd08.prod.outlook.com ([fe80::4e72:c5d4:488e:f16d%5]) with mapi id 15.20.8251.015; Tue, 17 Dec 2024 15:55:29 +0000 From: Michael Riesch Date: Tue, 17 Dec 2024 16:55:18 +0100 Subject: [PATCH v2 6/6] arm64: dts: rockchip: add vicap node to rk356x Message-Id: <20241217-v6-8-topic-rk3568-vicap-v2-6-b1d488fcc0d3@wolfvision.net> References: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> In-Reply-To: <20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net> To: Mehdi Djait , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Leb?= =?utf-8?q?run?= , Thomas Petazzoni , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Kever Yang , Nicolas Dufresne , Sebastian Fricke , Alexander Shiyan , Val Packett , Rob Herring , Philipp Zabel , 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.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734450919; l=1988; i=michael.riesch@wolfvision.net; s=20240405; h=from:subject:message-id; bh=Iv8zXQjKTO9MzBU4yq6In+vkOstndZA8TJEpuCCdl3E=; b=EVAgMNiduf1W5NpmeMIcas1x/p175qznzjS81JBdWMP96nFigBHCqR4UcdBSgDckQefzIFR+6 bDl8mgv1Jy6DytRedq+/PcTWgtAUoEYeMaZlpXXB/A/S5/jAyYMg4Ab X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=cSJmgKSH3B6kdCIDCl+IYDW1Pw/Ybc6g9rmnUd/G7Ck= X-ClientProxiedBy: VI1PR08CA0244.eurprd08.prod.outlook.com (2603:10a6:803:dc::17) To DU0PR08MB9155.eurprd08.prod.outlook.com (2603:10a6:10:416::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB9155:EE_|AS8PR08MB10149:EE_ X-MS-Office365-Filtering-Correlation-Id: 32ec1d0f-d077-425c-55d6-08dd1eb33b21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?6AtTRLjNinNjYek5RkfevsFaKhwojFm?= =?utf-8?q?R7lD1z0pHPex0ShmVxeDa6L4cpKq++pPF0JJRdmxKUqRe0F7UzWRJQGJFv0AbOYuq?= =?utf-8?q?hxoeOWoq8lr8HFUc1z4QAkN2NfCjwT6ZvmEXto+n4GAVvoXO9ybe8TbjbQLplbaTy?= =?utf-8?q?Bp27K4uD4RMBsQfE+AFxVg1i+8j5XmmsTKhkskSt71WhtuvHQm17G+4JQqR1Yk7mp?= =?utf-8?q?7G9+rGf+fEIc+bidgd+djeZn1+thRM0B1HXUElewcanP1R8DuEcvwK/2CUJ1A5do2?= =?utf-8?q?wcxZ1U6SnjUpGjxfqBGcidJIG3W/DfArWZjfJoliA2IWc+38ePV/YwUGhY7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f-8?q?HqmWK7qJA+z6kbVT6gi9wIknTXIz8rSvwfNSGIvsJFyf26rOWPUvsP+N3hY/4Q7M5?= =?utf-8?q?cUekLVRVFD8pyZMQgekKsL9P4gKU5WpbSfUVHJaAmXOAUi3H3zmU4+vmmuFImzxIC?= =?utf-8?q?lHXlUL5EHnlmakokyAIHIjoIjXsYkTTSgCZbSDLdARpePFu++1CiVF98ygCS88/U2?= =?utf-8?q?ILYo2y2nEOB?= 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:(13230040)(1800799024)(376014)(7416014)(366016)(52116014)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?q1dtsOIp6lp83ufa0uGT73jAkqqM?= =?utf-8?q?MwTEZxu3JkLLatlzpeG4hOf6a47O1deI02pewTdvG8+ggR4kLWmLl/FTEOoNn16rq?= =?utf-8?q?mNLxsaDmAW0tEkuVm9CYFcR4jWur+DJN4pOa61Tg5G3Xu73mjPsY2yS4Jm/EfT7t1?= =?utf-8?q?UHebBF6+VkC+Kv+FZeeJME8fKRr+Zn7bRih4CakYNx4vxMAMPO+Ds7rUWcwkQ4tU1?= =?utf-8?q?3UWxd0Ok1HFMLd2KrMkYd5NCmpjDD06ttE5qwywb+wX5PnAbVs3eXVrZZxY2sIr2n?= =?utf-8?q?bS0AWsvPszb2ERffAihyOggyBo5UL7Nq4F1Y3rBX2JBMFTqnEiSh9t1FVY14ebFIW?= =?utf-8?q?Vr4jKpohGrFOPzZy0f6ywW9owLHUeLdlZFO+/f6CuhY/13UHkn41fEgvGdEZ30OHV?= =?utf-8?q?Yz83Iu8y++ru1ez4ub20SHYtLyr+0vrj8so5I/kC5+syoOPIVlxgMnL2KNAtlnvqV?= =?utf-8?q?+1cI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YjUS04NiYyLs6t7bVJ4Fgc6SMNEjygI2vmFnG/vZEmd/i8M7sJmlLzLmWOqb4AaTX?= =?utf-8?q?PsH7aRSGnpqcWrPfkJFHjQa/+hybK8zDq7G5cALFMohmY2vwVcuW7tJkeoTQB3r/7?= =?utf-8?q?gsvTz/NydUVN6XrDdHUfNuX8IpwbaLNJlZSHAGfD+UCoFh1s7/4M7LjlnUg2unPtV?= =?utf-8?q?kd238gUL4xYeeoeHhD75TCNMAmL47oEwAg=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 32ec1d0f-d077-425c-55d6-08dd1eb33b21 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB9155.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 15:55:29.7274 (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: pzhQ6VU0kEV1fxjc0AcIRYOS8UhxBltXXtFAuRyCWHCgMcMAEcgkV9ieoOnXw31Af+yGJavaWYd8m9XyLgkgTabLUyZNrczAIuTdQbeu8Ao= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10149 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_075539_236152_69284530 X-CRM114-Status: GOOD ( 10.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add the device tree node for the RK356x Video Capture (VICAP) unit. Signed-off-by: Michael Riesch --- arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi index 62be06f3b863..73ff1ff01e24 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi @@ -553,6 +553,50 @@ gpu: gpu@fde60000 { status = "disabled"; }; + vicap: video-capture@fdfe0000 { + compatible = "rockchip,rk3568-vicap"; + reg = <0x0 0xfdfe0000 0x0 0x200>; + interrupts = ; + assigned-clocks = <&cru DCLK_VICAP>; + assigned-clock-rates = <300000000>; + clocks = <&cru ACLK_VICAP>, <&cru HCLK_VICAP>, + <&cru DCLK_VICAP>, <&cru ICLK_VICAP_G>; + clock-names = "aclk", "hclk", "dclk", "iclk"; + iommus = <&vicap_mmu>; + power-domains = <&power RK3568_PD_VI>; + resets = <&cru SRST_A_VICAP>, <&cru SRST_H_VICAP>, + <&cru SRST_D_VICAP>, <&cru SRST_P_VICAP>, + <&cru SRST_I_VICAP>; + reset-names = "arst", "hrst", "drst", "prst", "irst"; + rockchip,grf = <&grf>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + vicap_dvp: port@0 { + reg = <0>; + }; + + vicap_mipi: port@1 { + reg = <1>; + }; + }; + }; + + vicap_mmu: iommu@fdfe0800 { + compatible = "rockchip,rk3568-iommu"; + reg = <0x0 0xfdfe0800 0x0 0x100>; + interrupts = ; + clocks = <&cru ACLK_VICAP>, <&cru HCLK_VICAP>; + clock-names = "aclk", "iface"; + #iommu-cells = <0>; + power-domains = <&power RK3568_PD_VI>; + rockchip,disable-mmu-reset; + status = "disabled"; + }; + vpu: video-codec@fdea0400 { compatible = "rockchip,rk3568-vpu"; reg = <0x0 0xfdea0000 0x0 0x800>;