From patchwork Fri Aug 16 08:09:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13765681 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010071.outbound.protection.outlook.com [52.101.69.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C0C954645 for ; Fri, 16 Aug 2024 08:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723795786; cv=fail; b=otf9q6EKLXcMrXbY/M9iYwQxw3yJqXIHKzOaAfkRDUeX6PP7LKkuQAQF1D9sf2nHK89TFZLR71m7/C2FdWe+ahF0ixt+M9QMYtw014AAeQEMP8UMYGvi9SUrfxQ0DnoI+coTTrBbGj/b6dHuYKztcJVzPyzTEX80mhYLN88s55I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723795786; c=relaxed/simple; bh=uDWb7HNtZ2vkBiOUMPSMCrRhOKC+tasJruVrLr1jcBk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=PiQXhaZSCbVHOVaI1FJ7sCwLtwxCxp/4BiOL3V6U4sT5rKWekgl8/691kFpr+4DkB80No3gHu/jaaNQuCA+8r+FATMOACCTs89/h8NpxCybSbN6/TJ24qs6FVrBjL39CLEcQ5QMe3ZmWrkG91Dgs95O7a/INnkzg4avOh9QQOBQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=aLUtqBfo; arc=fail smtp.client-ip=52.101.69.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="aLUtqBfo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PbeyU4vciAlDrd74+BfDkLqONwIaDi23IGbpCoKvUniWH/I9XB0UPtrb8rams+F9h3ABLODN+vR7osfKRy/Lcy/eauHmvpk7DeZtlq/TDdKMFBuqq/gJaSwDFtT8lZMh354e9VJ8jLHMXCseSGMLdAsZ65sfFjxPUaBpikjFeXtfA02Lbf64iYnHorvkFzAMxgzCMTNBfUauFOKM+3CW17qoc2Brx8HmhWGUGaJ3XPVKG0u52nMG8fCzQahz0AOa6KVYpisqflVkZLnNM6bC8zYaUHMCarXdaODzDFF5VBpx3PHjXhBc4J/tDXmyHXFfSHrH4lhHaWfK9VN9I7pzQQ== 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=cBgvnV0vGzFUX82obLi1whjT8/21qAXVAUeYAGHmp6I=; b=qSf4A+HiLt/58uoz3pgUn9XhhzzzuyfEJKnSBlcSdf06U6MGNBXustjds2JQiDs21AgxYT0Z2erOr9bIoXc0zAgboXMDInPQttlO9RosTsTo2Qv+WfB5BKseYvHIGZeDuvhGgb8svheKbtC2gvtWYF8OPWI9rY4IWYaySpwfB72Ocg3pzi6/SAlD2okXwrUrl+YX7dTq2DeLYOEX8+ZuXa3ZK1OxCP/EU7gefEJzfc8QSjhg1fdE7eZsRK5H+U2F3F0UHWvC7n9zntLnPxQnISPn1lotNEGXzBcVpUyjOjfaMiWlczjsNeY1591zsVeieDrCMvU1lh+eCFcLrQvtQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cBgvnV0vGzFUX82obLi1whjT8/21qAXVAUeYAGHmp6I=; b=aLUtqBfoRAfU+RBNZcnY4xgvUTRDhaOSFrSxNsOiLHb72aGUr6v7qGfBtArZpz0PrUgwPlFEuO3NjATiFlxQn7jtVNmbjePAqWMZD/sFox4jBGRl4Ca4MSFrF90DvNZOp/F/9D5+PTCIbTaFSILePO0x5dTMNBEK+AEfk9jIFHJE7mIfsqUWghjBya8lebtFX6r6U6kGTvxF/u8BcolKLQRBboQcCNztPRMhoPoCZpmB2utrIh8BH/nUfmea2hPU1el9kskWH5LvzSif7bBsMkpmHwWdma4wD4wea5OYVCYX3+pUS3yeHCc572eeQvuWdfdsbMAfvxhyVvggSk2sgg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AS5PR04MB9941.eurprd04.prod.outlook.com (2603:10a6:20b:67c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Fri, 16 Aug 2024 08:09:41 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90%2]) with mapi id 15.20.7875.018; Fri, 16 Aug 2024 08:09:41 +0000 From: Liu Ying To: devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, victor.liu@nxp.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, peng.fan@nxp.com, Conor Dooley Subject: [PATCH v3 RESEND 1/2] dt-bindings: soc: imx93-media-blk-ctrl: Add PDFC subnode to schema and example Date: Fri, 16 Aug 2024 16:09:32 +0800 Message-Id: <20240816080933.440594-2-victor.liu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240816080933.440594-1-victor.liu@nxp.com> References: <20240816080933.440594-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2PR01CA0035.apcprd01.prod.exchangelabs.com (2603:1096:4:192::13) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AS5PR04MB9941:EE_ X-MS-Office365-Filtering-Correlation-Id: fce449b6-d883-4ba4-b5db-08dcbdcac773 X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|7416014|376014|38350700014; X-Microsoft-Antispam-Message-Info: JirXDemJNQQ+vgouMAD2xEaNLW9y/hGrf1lyHLob15PSiO0KdsTH6t9m2evh1TV6hdUN6y4nwCD9n/+01OODN5g4xR5dxySCD4mBX3nNCg87jnfBDrtUGKnl7MT96oSyy3Kya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/xr0QXgL44/jCYwPme0/6PLcTvgqwSnOz/xuVZFI3k3QYGjor2wX/LrnV8mdpaKxljJobjxmJ3o+SLyrzA5zkCwpwh3eHwyPkeGuTdYLcaUVAjT2L71znEu95QpmmkbNmJdvuAsi9MYycISkIF+6gwFvzx12CTyyVbqJqMszytz4DI/luzVWTYAYF99MzYvzrg6PgJlHjE4jc4BizUpOZA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(7416014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XvoxGqyQgY3xTxDqUC9D9ajLqDY8qGjauW1Nbb40lxVxqsVrKWK89iPvojVO0s0nP/CTgPktq9DMbVDrDrndCy5VDF1M5Sgc5kuS1HAqvM0Dfb0dGyH3k28ICeeSTcpwpjqWAwZh/BWW7dj8d2PCwmb75EHDIkfqDWe9u4gs+X02FMg2efQWYiCm2GsCwRIrswzAC3EjyW48hHqjciTUDW3I+ocwYFf6AgN55ezqtasFJYYaMkZj3QbAsuSdF6mB+szhe4GxINWcVvSj4Pm1oXPol719TpKOK/D/2c/YGDizQ9qRNpxdSnRmPVB081rbacrjPCaAgoPep8n2A2fNbEv4ysY4cN0Lvf8xmGZ7UUBk4HtK3FBchpseunRN23FV9j0ArC+T6eWPC91OMBILcYrrfwjCU+RgVzLlEr/dy9YwqhqhIlVShB1SZHBEH13jBH+Jlmxfg29NRB7f6nTKHdNhptTrrO+fSMhBPw571T0LeAN8C8+f8YUoIq8urUgeGCzQo4JTF+ePMoF5GHREE84xlwGhZCxI6vOVUH8lSvwe3jsY5mJaTWvchqhGxhVro0cOiVvUQLTta06JNHwjJZ/ZLSLjjAJ93iBWU/OD1GNTfVF+NsniHGAee7xTID4feQZI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prd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 08:09:40.9597 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: O0+IPYVQpC5qHMxmLepl+6iua7TAI2BKVFTkjbrwK9WUdTTE3JazVmA0fm12GIkOGC2Yj2+FBB7XPAS3kjOP/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9941 i.MX93 SoC mediamix blk-ctrl contains one DISPLAY_MUX register which configures parallel display format by using the "PARALLEL_DISP_FORMAT" field. Document the Parallel Display Format Configuration(PDFC) subnode and add the subnode to example. Signed-off-by: Liu Ying Reviewed-by: Conor Dooley --- v2->v3: * Newly introduced to replace the standalone dt-binding in v1 and v2. (Rob) * Resend with Conor's R-b tag and with the patch rebased upon v6.11-rc1. .../soc/imx/fsl,imx93-media-blk-ctrl.yaml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml index b3554e7f9e76..3f550c30d93d 100644 --- a/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx93-media-blk-ctrl.yaml @@ -24,6 +24,12 @@ properties: reg: maxItems: 1 + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + '#power-domain-cells': const: 1 @@ -46,9 +52,43 @@ properties: - const: csi - const: dsi + bridge@60: + type: object + additionalProperties: false + + properties: + compatible: + const: nxp,imx93-pdfc + + reg: + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Input port node to receive pixel data. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Output port node to downstream pixel data receivers. + + required: + - port@0 + - port@1 + + required: + - compatible + - reg + - ports + required: - compatible - reg + - '#address-cells' + - '#size-cells' - power-domains - clocks - clock-names @@ -76,5 +116,33 @@ examples: <&clk IMX93_CLK_MIPI_DSI_GATE>; clock-names = "apb", "axi", "nic", "disp", "cam", "pxp", "lcdif", "isi", "csi", "dsi"; + #address-cells = <1>; + #size-cells = <1>; #power-domain-cells = <1>; + + bridge@60 { + compatible = "nxp,imx93-pdfc"; + reg = <0x60 0x4>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + pdfc_from_lcdif: endpoint { + remote-endpoint = <&lcdif_to_pdfc>; + }; + }; + + port@1 { + reg = <1>; + + pdfc_to_panel: endpoint { + remote-endpoint = <&panel_from_pdfc>; + }; + }; + }; + }; }; From patchwork Fri Aug 16 08:09:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13765682 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012022.outbound.protection.outlook.com [52.101.66.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A78C4137775 for ; Fri, 16 Aug 2024 08:09:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.22 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723795792; cv=fail; b=DtaPvXCiW0MvFJmZOrekusZBzbWlEgtC0Yh9claNn64Npz+Dz20IDWqnzkp9xQKuEboghpWcLgfJEluLNRM/PUjJTR3c4Er+NihxC+FrzgX0987M1bRQTQHeW21+SZ90gH/Hq5G8edm8BvG/3Wwd4zd8XmrKZH/auxY958TUZEc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723795792; c=relaxed/simple; bh=SDuYuT0vn+Y26xB6YQ5ISw3zuZA13U4S4QV5f21lBJc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=cyYgcO4j25a6iBq1jlTTcl875d/VUdrjWPS0uq6C6YckaOxuL44wXiyNwNdu69+o66KHhemIJ2YoCFdA0YnnFHIFH/7d0MQSkuPui3FicKyo/ASVJPc0rs3FpUGZ15F65uJj/mjfC/5CIwvP5G3NT5KI0nBj10UacypbECPdZGQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=cLsfMsTc; arc=fail smtp.client-ip=52.101.66.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="cLsfMsTc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xxlSC908290oJ/9uOTObd/yen2CHogJExLjbt30cg5ib9BnNWgB59Y6eOCpygFhYAvaz8cVEX0Qu6SAGuIDlwiBVO1f9ak+fq5oapSpyXv/F/d5sm/Nqs5v6GJ8v2M18gPMY5gbULldKyA3DQtk6ffmhJQHYYaiOprJJoZetrk7Vb6+bLu2zxQJUvwF6VXOcf/HIO0NraymIek+MEkBgBDTnX/PRnrETfmMFZvdFtvigXNj8law0jdmCZnlYGoCtjDCZQ8PlzBdLAqdaGZ9Bpugy+mcrrI4WVGF965fRRolY4akmc4KlIGza67D0OFxnQxCEpmlq25xzk2YOrI9vGA== 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=SASibpNd9cI06mVGfQKiplrHGCETLJd/7QBCcWPgQJQ=; b=e5kGS75uZ+ZwpspysuBZ0xYhLADxrAiyutsG7/w8AHkt7pE9m4SeyB58V5fmLpcOPOaJB/FblUHmo4W1n0r+t12l7pw3I8HRuA66kq1Jy2wc43K0wGbKbloKFXpUXffOVzBDImFKdUO+5XBbR891eR3BqIVax1qYdHD+C43eC1EbRJptQilcd68WvnUb5KYwDooTE70yqDg/n5qBoQ+J0UJknPTy0IPk0CPY6Dk55cRMjStTohRdLR7QNbLn7dkTV9R+q0VUvWt88gQ2kPcnSM+jjNcE6zFmsI/gKio/ZL0yq/FjNOF5cjyVuoIwfe0hdaAKaRU//q1I8C6VrQshVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SASibpNd9cI06mVGfQKiplrHGCETLJd/7QBCcWPgQJQ=; b=cLsfMsTcKsPv4SsegxtyQESUwzO5hcI2FDKaVznW6pzsYt+wnFMQ6WiN9U39LIabkm8ORcpK88HvOt4dQYIbKIu408/x2xKxoyKUDEoUqeNs1x2MrrF3mToXjRhsf1Q/99OhtVdNFBhT6DmizfQvfj3lljeQecqblyX52a/qVBm8FccKJtZf7cLxlk98MROa2hOEmIudL6zyDxvyQKRJTE6jXcNX1KSWhv0UUf1Q9Rur8lHq8+bp+iLZXEQ6cgubtUG/lsIvQcTa7H874LDftHKEiQAKj51knQW3pzvvr5I7sdVI+d+9/3BbbsWV7feOICCa+cQgRWfIsIZwkYvvEw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AS5PR04MB9941.eurprd04.prod.outlook.com (2603:10a6:20b:67c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Fri, 16 Aug 2024 08:09:47 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90%2]) with mapi id 15.20.7875.018; Fri, 16 Aug 2024 08:09:47 +0000 From: Liu Ying To: devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, victor.liu@nxp.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, peng.fan@nxp.com Subject: [PATCH v3 RESEND 2/2] drm/bridge: imx: Add i.MX93 parallel display format configuration support Date: Fri, 16 Aug 2024 16:09:33 +0800 Message-Id: <20240816080933.440594-3-victor.liu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240816080933.440594-1-victor.liu@nxp.com> References: <20240816080933.440594-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2PR01CA0035.apcprd01.prod.exchangelabs.com (2603:1096:4:192::13) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AS5PR04MB9941:EE_ X-MS-Office365-Filtering-Correlation-Id: 6156556e-f651-4cd9-3b9f-08dcbdcacb8f X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|7416014|376014|38350700014; X-Microsoft-Antispam-Message-Info: vRndcO3nfavVzCNkrocbWKSalL7LosPkemG+gIIkl78SZH6Ls/6TOjaZhcnd6REp4hsOx24O4mRh0raCPAXTQdax1L9zMx7eUrnjRQews7puygFacsqTVnV44P/0XjLFn0/33qqwUXl6nNdpOuwERnOdPPzgYFn90dRDFdiiUKVXWgycYIZbBuTaW2HSsIKxvM83MjGNzV5c/ERL9TTIgwF1xvQx+KVEcidTq3JoXuSGQmdIW00pI4mtzY/ZXJOMYs2EBs0Nm7L9Eets+MtkV9dklCisQ3+D8Zg2O5r8XMiEI4loqdYYG1sViZF/bX9n12Pb2u3gBUwYh6N3aquuOQQloSgG7p44jPvL96BNzLftsjiwm7728na8pkFPCCABOT8UeY515yEjDoBSvSgZMYSbshfeS2JK82e+qPUdNSjAVma1P3ErskdfNq2P/YLUrDGsjh0ylJU2xK/WvW9NbjEf/tLQXwfWHD+3e0WN+4cZfO16FsxyYa38suhAis+N8YfNPNhDjoKUFbmEvF9cR+Dfl0bLL2VaYEC8A2qPrEbpTnfiGnZmIcPeNN+P2Yo5sdFc+KwdpcTYmS2hrbECJkEgbvPg0IfZgyJqYZ7wkFxygi88nIU12LobvJIiU41xHdhBM88TVS8Rfg9TG452IEkArntOMSAzgU1OS/MJacmkXj6+3YH0t6DfX6sqJv6rikT9IY12VoS8UMrIPrZtt2vn0eL1xH0EuloiJPXzpAB51kvqJfBd8d0kmEZATcgb+R1WykoRYgQ4QNDJA0znI0tvIAycH0V49My9h9MBwkPdIVxFDyPW4a7C8flm6ZVY7aaTxZNp2DGDBwBXQPY1mqqaW8piO/y33j7bqEjq51G+7iFMdO65c69wy7VlBjJps3uc1uHUHROdiK8e9vJyXZWMz+6RzMq1m4hisdAEoxtJ6UfuCJXLXpAWyO7Ao8Nxvf1kDnkbOfB3u+zDCK+0aMQODp3hN/chON1PNSsNy0gsi2xwggvhwZT+WvjLTCq5toL2yWGNk0k65nUQraAzsdRdy9iNY68AWTYAPMDkw+NkJRx7IJa3ibtMX/6+Kq7mwpFsOTm0F9fZbaIYkcS2y8wPp6iwvb3sjv47X/rZFpbfk9LT+8t2hHi2cFhoCzX0OPb5zpmI+KUkvy6HIAvkLfXwXnpKoyzi+/b6aV+Wt5O05aG7II1yaW3XCTJdXSqq7+L5pA5QesDTtq5tCYtJi61ua++Ipiz1aMFoidvbUWJQcarsx50GzgaKNX4l+2G1Kcd76zr/cbbPmzjD3lhy1nVEEY7Ov8ee4TDhfmf87YgMSOEYlmDGbqMmWFBoyK1kIZGqDh6P0dS9tUsntPvbNUTKxL5i5Eao5cQG1xLVwSU/t3woLXoLZczrLqAzfn8ARsCkPvFAbFNqpIWABm2nVw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(7416014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZgTIAqOrFLnO4byxxAwdzwM5x5zcuNHJhEfLYXJXpcdmQ8bNCbGnESohhoBIJV3b3H2yWzpJk0/5zzfMJQkwceDstRXhQBGCk1BL/akj7/hq5vqGiy74Z0GXYwswdE6SDC+UIDVFV9+qhLS9yzQypBydHf3KOMMFiy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zz5PhZlblRei6iLLa4iq+rMuNFoCAyz6gVLDKbWpwSk6WHySiv/f3Vtb3V6u9/Dkn7+Ok4bTVc5kYjFbofFVfBdov0542/9Lz9Fr5BnF2afbMkjy1pxTPt+iDwbuBkzuPck9KY30xiqXLYhE7hoD3rdbpbBFxrRn7t35xEEZlASI9CuOsueGSpL8/woLukpBPF/E/nKiShlPxZAJomx4SvqToTdhnvtHN0ozPt1TpmE2eKR3z/98VOv3cozbBkebWRGsA2ZAqYpcYRp0ZlBf5lS+6cLWpQz2TaXf3JPw+QSg952Mc6cD5eKLaD0Pm/8DbPZM7EGSP+R20LrcpW5x94c6Js/BX4p2l X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6156556e-f651-4cd9-3b9f-08dcbdcacb8f X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 08:09:47.7548 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /SC24KZibEo2q6Es1NI4ZBiV++9/tw1//KBMoi7LtoxaTfLovZ4RhBoFWfGpDGGJw6UfLy8D9GFauD//JYGaeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9941 NXP i.MX93 mediamix blk-ctrl contains one DISPLAY_MUX register which configures parallel display format by using the "PARALLEL_DISP_FORMAT" field. Add a DRM bridge driver to support the display format configuration. Signed-off-by: Liu Ying --- v2->v3: * No change. * Resend with the patch rebased upon v6.11-rc1. v1->v2: * Set *num_input_fmts to zero in case imx93_pdfc_bridge_atomic_get_input_bus_fmts() returns NULL. * Replace .remove callback with .remove_new callback in imx93_pdfc_bridge_driver. drivers/gpu/drm/bridge/imx/Kconfig | 8 + drivers/gpu/drm/bridge/imx/Makefile | 1 + drivers/gpu/drm/bridge/imx/imx93-pdfc.c | 209 ++++++++++++++++++++++++ 3 files changed, 218 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx93-pdfc.c diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index 8dd89efa8ea7..088241575857 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -78,4 +78,12 @@ config DRM_IMX93_MIPI_DSI Choose this to enable MIPI DSI controller found in Freescale i.MX93 processor. +config DRM_IMX93_PARALLEL_DISP_FMT_CONFIG + tristate "NXP i.MX93 parallel display format configuration" + depends on OF + select DRM_KMS_HELPER + help + Choose this to enable parallel display format configuration + found in NXP i.MX93 processor. + endif # ARCH_MXC || COMPILE_TEST diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile index edb0a7b71b30..8d3499fb7fba 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_DRM_IMX8QXP_PIXEL_COMBINER) += imx8qxp-pixel-combiner.o obj-$(CONFIG_DRM_IMX8QXP_PIXEL_LINK) += imx8qxp-pixel-link.o obj-$(CONFIG_DRM_IMX8QXP_PIXEL_LINK_TO_DPI) += imx8qxp-pxl2dpi.o obj-$(CONFIG_DRM_IMX93_MIPI_DSI) += imx93-mipi-dsi.o +obj-$(CONFIG_DRM_IMX93_PARALLEL_DISP_FMT_CONFIG) += imx93-pdfc.o diff --git a/drivers/gpu/drm/bridge/imx/imx93-pdfc.c b/drivers/gpu/drm/bridge/imx/imx93-pdfc.c new file mode 100644 index 000000000000..61e01b503be5 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx93-pdfc.c @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2022,2023 NXP + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define DRIVER_NAME "imx93_pdfc" + +#define DISPLAY_MUX 0x60 +#define PARALLEL_DISP_FORMAT 0x700 + +enum imx93_pdfc_format { + RGB888_TO_RGB888 = 0x0, + RGB888_TO_RGB666 = 0x1 << 8, + RGB565_TO_RGB565 = 0x2 << 8, +}; + +struct imx93_pdfc { + struct drm_bridge bridge; + struct drm_bridge *next_bridge; + struct device *dev; + struct regmap *regmap; + u32 format; +}; + +static int imx93_pdfc_bridge_attach(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct imx93_pdfc *pdfc = bridge->driver_private; + + return drm_bridge_attach(bridge->encoder, pdfc->next_bridge, bridge, flags); +} + +static void +imx93_pdfc_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct imx93_pdfc *pdfc = bridge->driver_private; + + regmap_update_bits(pdfc->regmap, DISPLAY_MUX, PARALLEL_DISP_FORMAT, + pdfc->format); +} + +static const u32 imx93_pdfc_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB888_1X24, + MEDIA_BUS_FMT_RGB666_1X18, + MEDIA_BUS_FMT_RGB565_1X16, + MEDIA_BUS_FMT_FIXED +}; + +static bool imx93_pdfc_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx93_pdfc_bus_output_fmts); i++) { + if (imx93_pdfc_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx93_pdfc_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + u32 *input_fmts; + + *num_input_fmts = 0; + + if (!imx93_pdfc_bus_output_fmt_supported(output_fmt)) + return NULL; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_RGB888_1X24: + case MEDIA_BUS_FMT_RGB565_1X16: + input_fmts[0] = output_fmt; + break; + case MEDIA_BUS_FMT_RGB666_1X18: + case MEDIA_BUS_FMT_FIXED: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + break; + } + + *num_input_fmts = 1; + + return input_fmts; +} + +static int imx93_pdfc_bridge_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct imx93_pdfc *pdfc = bridge->driver_private; + + switch (bridge_state->output_bus_cfg.format) { + case MEDIA_BUS_FMT_RGB888_1X24: + pdfc->format = RGB888_TO_RGB888; + break; + case MEDIA_BUS_FMT_RGB666_1X18: + pdfc->format = RGB888_TO_RGB666; + break; + case MEDIA_BUS_FMT_RGB565_1X16: + pdfc->format = RGB565_TO_RGB565; + break; + default: + DRM_DEV_DEBUG_DRIVER(pdfc->dev, "Unsupported output bus format: 0x%x\n", + bridge_state->output_bus_cfg.format); + return -EINVAL; + } + + return 0; +} + +static const struct drm_bridge_funcs imx93_pdfc_bridge_funcs = { + .attach = imx93_pdfc_bridge_attach, + .atomic_enable = imx93_pdfc_bridge_atomic_enable, + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_get_input_bus_fmts = imx93_pdfc_bridge_atomic_get_input_bus_fmts, + .atomic_check = imx93_pdfc_bridge_atomic_check, + .atomic_reset = drm_atomic_helper_bridge_reset, +}; + +static int imx93_pdfc_bridge_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct imx93_pdfc *pdfc; + int ret; + + pdfc = devm_kzalloc(dev, sizeof(*pdfc), GFP_KERNEL); + if (!pdfc) + return -ENOMEM; + + pdfc->regmap = syscon_node_to_regmap(dev->of_node->parent); + if (IS_ERR(pdfc->regmap)) { + ret = PTR_ERR(pdfc->regmap); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get regmap: %d\n", ret); + return ret; + } + + pdfc->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); + if (IS_ERR(pdfc->next_bridge)) { + ret = PTR_ERR(pdfc->next_bridge); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get next bridge: %d\n", ret); + return ret; + } + + platform_set_drvdata(pdev, pdfc); + + pdfc->dev = dev; + pdfc->bridge.driver_private = pdfc; + pdfc->bridge.funcs = &imx93_pdfc_bridge_funcs; + pdfc->bridge.of_node = dev->of_node; + + drm_bridge_add(&pdfc->bridge); + + return 0; +} + +static void imx93_pdfc_bridge_remove(struct platform_device *pdev) +{ + struct imx93_pdfc *pdfc = platform_get_drvdata(pdev); + + drm_bridge_remove(&pdfc->bridge); +} + +static const struct of_device_id imx93_pdfc_dt_ids[] = { + { .compatible = "nxp,imx93-pdfc", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx93_pdfc_dt_ids); + +static struct platform_driver imx93_pdfc_bridge_driver = { + .probe = imx93_pdfc_bridge_probe, + .remove_new = imx93_pdfc_bridge_remove, + .driver = { + .of_match_table = imx93_pdfc_dt_ids, + .name = DRIVER_NAME, + }, +}; +module_platform_driver(imx93_pdfc_bridge_driver); + +MODULE_DESCRIPTION("NXP i.MX93 parallel display format configuration driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME);