From patchwork Mon Jun 5 06:22:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13266955 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 A4E33C7EE2A for ; Mon, 5 Jun 2023 06:18:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KnkoMCpQo6aiXzQ/WaNXuerNtPjLm2DdbYLs6Bulbm0=; b=MitiWoohJlvXqE +G/lvmrzJupPYeU1/y3M3YT5+DZprQ04VThcj/KxfNgz6EP7sjxBiDg7M8FfGqTFZ+3jZLJ/o+0Jw uUuYMBHor5k29rWVeJ8Hs3kg9a0Zw3KczlKJT/JUHr7y5tXEs3KrVzLeJrzoBXIRhyyiW8e/h+o6J cqPrXGyKvSpD8gR5tL8/k5nOXJc4adNx4BIz6OO/3fggvBCdqzqalBEMXZPDxeYvC0bZ33EIvXeVM XKnigw+LKAVJlCUGXRtCyQOa5p0rQ+30NhbpvSZgCWVO16R2BwvRnzmS35pCf6ym2xrP/n8+XvMTr 1Y5JGgAOw41GAFCEp13Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q63XB-00EJOH-38; Mon, 05 Jun 2023 06:17:41 +0000 Received: from mail-vi1eur05on20610.outbound.protection.outlook.com ([2a01:111:f400:7d00::610] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q63X8-00EJJd-2f for linux-arm-kernel@lists.infradead.org; Mon, 05 Jun 2023 06:17:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SqOq5vqSv/qJy8h4x9OI0tCoA5OzwIPqov/cDy7991V4RvVfNZHcjZNhS7mTRKQYZtsycQ3yDAr6vSxkoaMoSAB21lmJmgLm0/6UgWtcr2nuwtDn9ZocjlRNia5W+/E/6bDus0oJXQoaq2OBiaCgAddTAzErb4mo+8ImcqsGMwcQbz2YRWnI0nlIFd7U+t9Jhq4AnGu9oY8IG1XHUiBRk66/0meu50zSbpESSw0HT2vwOaEZ07aDl3IsFlLmaZqqJms/4uCrRSqSQrWXcHjPXoG4fyiXhL0OXJDlT/C0K7M6FCg1OyB5b3FJ649vRJ2IliNSc8XX+J61t+ZmeWF8Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ELAhDmUVmj/Ec1l9Da6qZyWXbLsZz0z2k9yrqd6mvNo=; b=DglRNQKovMRO908VOmxDnm+uEGva1RJsBUWEFcoSNnX9d6Oqryv6U+5YwLmeLaRoK6BaP5zTPJzW8SJRVW/gm+Mn5dP3FSnC3end6KYy88kLC1iWJquetvmF/PSKCiitoaf/HoISqJSmy0vX7Cjcr+c1wH3ByY7IRUVK4WPGBz9GsHX4FLIp/tzywiXaD4ne1D4gCSCkOt8CFf8DYvXd93yXmNQe1dr406P+NNbfQiJM2wMFXJeRPNinR04G1tP5Xki8tQyGR1qbZI1BBjCQDW9euS3EYTCQciPs+6EdRfmqwkPtxG8pWFuCCO88V/hnQavA2EsurJokIKLk612NTA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ELAhDmUVmj/Ec1l9Da6qZyWXbLsZz0z2k9yrqd6mvNo=; b=EQQ3hO4y/VrW/NT4O6T3qJwW4jOrgaShGpCbW9pnnuEPOnffy2gnV1ddssmAJHgAGWVWCyZ8aT9cnUh46dXpkGCrrtV5x2tv6nw3AN8Prv1EBQXgnPzLsnYNAYCE7ZZAcuT3PEhXKKHRs/tdiLaP1gY8/8wVG/ccDBgD1MKFBTY= 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 AS8PR04MB8545.eurprd04.prod.outlook.com (2603:10a6:20b:420::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Mon, 5 Jun 2023 06:17:37 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::f3d5:528:d12d:50d0]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::f3d5:528:d12d:50d0%4]) with mapi id 15.20.6455.030; Mon, 5 Jun 2023 06:17:37 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@gmail.com, daniel@ffwll.ch, peng.fan@nxp.com, marex@denx.de Subject: [PATCH v3 1/2] dt-bindings: soc: imx93-media-blk-ctrl: Add PDFC subnode to schema and example Date: Mon, 5 Jun 2023 14:22:16 +0800 Message-Id: <20230605062217.3716328-2-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230605062217.3716328-1-victor.liu@nxp.com> References: <20230605062217.3716328-1-victor.liu@nxp.com> X-ClientProxiedBy: SI1PR02CA0045.apcprd02.prod.outlook.com (2603:1096:4:1f6::16) To AM0PR04MB7041.eurprd04.prod.outlook.com (2603:10a6:208:19a::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AS8PR04MB8545:EE_ X-MS-Office365-Filtering-Correlation-Id: 0dcdbfa0-a713-421e-7a01-08db658c8ee3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +iMN8lvYFUQkeFzTs4ZkI1vGXYHT0iv+/N9+FTRiHNzUDBk+/9A+MktBaR2jJwhsnqiK/iG/NjFG/fgZWRrVac59yrwpnvDu9l2ksukCbs7gWKW3Ky35cUhRhbLrh7ymgy49gRunwSO9u72SVXkiBMUDKFk3xlkKJlAm71TVYdyRPIOOoiT1K2+iOG+xIsUQ+m9/KnGDtuKgIOwZAqdgoU3mGDKmD0UVv0oFE2gRJ6Bqa/dLZorg7FW4QMyuKT0hT2LhobFjfoaXxJafTeJh3Dtt8MhW6V6vBHBGxQ27kvS722OZ/4LxCw2oj/AOC2uJsep/BIYuJTIyOf4dd3o0paVY/7APALH9Cqh09cOVLWs7Rbutw8kkerDf95xwpywziReJCjYINqwf2Vq2Eg4V1H18QN6OzD6jHq6XQtNEojhg6E31DcUM77zoVu6qgdf+nc/7IgTT+qzSiTABvKC1SXlwfk9sWFBIGoOWRMxqKTUgCYC97UMvlGoSKvZYSPKbhsdVrEI7C5jhRWQCIBrSqwuNvvSYLjkeJYEGMQI5iUbYql3Ty9uckvQUgSsydlziYyDHcgZmpDESBKjT5wwuSwzGrm1G4reehv8Jrk/CpqCvfQd2R1YSF3ogAjL7Thfj 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:(13230028)(4636009)(366004)(346002)(39860400002)(136003)(376002)(396003)(451199021)(2616005)(26005)(6512007)(1076003)(6506007)(38100700002)(83380400001)(38350700002)(41300700001)(52116002)(6486002)(6666004)(186003)(478600001)(4326008)(66476007)(66556008)(316002)(66946007)(7416002)(8936002)(8676002)(5660300002)(2906002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ADKiG7fOr0tq0xMl06k3O8ZwhH52SpC6NsAknUyWqXRDQx8ZgAdcLFf+VpMs+7dXH9AYdw5iuBIMF6LOow1Hx1FgH51sDQXB+4UphbvluBiKkxv28Yo31MdJ6u5epg9Sm8GVAF2DGSr9vhevBdqM3IzeOWO5CLYjl71JOsXkN8DN6jHaVU7UwKmGRsf5bdnwo/EYQoo+v/MbenV5dc29Gs1U4PiVyBXH2PB4GpzoPKV3R7qxNzql5F7FPLcgIxRU2J6jESg3AXcfBV7CDLEdCsuKCP68caly/XjA3ub0S9cqQaZpwNNg2v7FnQRSHYkOUji7Fk2fFsDiieBLa8vhVKPDV5Q3H7wuRQPAa7RmYssZrQEOk2DoCmqDrIgP3sqmC4aRWmBNCDoODGgWYBLNcPgfdmRHhZxbO/fnZIEl1d65nuUc4oq71wD8d+d8wsZTpF+clRcpoq7e4Dv3TwwtBSJn1aEk2aADLArleXegg76MvtuRAkMRfRpc6jSij526PzptaoG3vcASwLyDtTgtlp7uXRoqjAbXR2ME7ow27dLxmGHJme9RDHj/3ksvh+b9wPpiUDMEjiz/Z9JN0MFEFLfEQzb+1bchVq3kKk5qYgwt8B/PhOfyhBO+4ci2qaHawP23pap2qMWX72lyScwXtqrUESq87pOOwMNWrC0l8dNUuhjaGQjtFYNOHub/mjJ3WhQoF9Y+CYdqF21Q2no5xyY6qnJJ158bjQKr406nbRYIn6BZAn63eldSylmn12hYYNpk/6TxZsVggj7SGGpLnes5IYZAcPEnn6HGQqkr08SzwsOqf1l/FD6d0l192CoLER7hUkXmhSjBIxOw/zBLReu9dbLpax6cBy8xmwDE21wr4cM9G81aIBP2E6eTdCGlk1NqKVcqlTjifRQdiQRbBkkjbdv8hMB5Xbti+p38FaIrX5IjOLLAdS73CGIbWs4KJljHC14ijsI0VCQabScEgKQDO2Zu10ywTR5JpjwTF1iKmoLkzxvhzrBNSsM2WfPhp/hzUzKbXhjj08hma50u0dmss1THS7Pjocb9jQH3RLr8lEfMZcIRGFRsjc+PJVkkriGlSU8E5QiFx3Tz+GlC85OzH2vlsSiutEyKgxg92/M7gjLr4R4xTHSPkFJLkbGm5QWZsrv7yZAKaLg71lhLDfSO790GhQq0ERj2g2KrHq1DtLn4e0SeOdnHCPEFHJdDsptC6F2/s00B/co5jYuqDPrA8QgAqkKIhBw/F46ADA39tSQiKN9Gi3UX9ocuJfiZD0nK57g3gY77n2Hna1977pyeNmMigs80jlb5++mAhLOTixCGYiWR2Kzi1jfORZc/LiDkfZSWiTR8X394XubN+Tx9pkGMQ76E5JTYzr0xGWc8A0wKBN53aJhjFq1Dqnbwnfq38Op2X6gZY179L1Tr7uR/I4qpncvFp1Uz8WpxZxquSAphKlyCgq6TXMWTlxp7rzxmE9mWNszh/vNEPyBJ4EAWdW8wEtKGVR2UhcEL8R3UMl+PpQwS3vpBl9KgtuK62wc5YbdoWc6H2Y6DAT6V05npFggu4Qj3dNGol5/di20nvqdb3ccT729w2I1TzZfO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dcdbfa0-a713-421e-7a01-08db658c8ee3 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB7041.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2023 06:17:37.3204 (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: 4I9RFmOXjjS/LxSnSniNOYHhDg8+fzVWnlSx4i88QiTYccx53iryhtY+XSdsnZ10WXrB+gevzW2uo8HIZmgSOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8545 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230604_231738_865154_98F91735 X-CRM114-Status: UNSURE ( 9.77 ) 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 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) .../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 Mon Jun 5 06:22:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13266956 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 1F5D6C77B73 for ; Mon, 5 Jun 2023 06:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WjazyNyY7WLm9h8b8zQ0f075fgNU4dwiz/OyCosOvtI=; b=hMLXp0f2YhuB7t aCYHtMNDE5E2G2nJhJplrF3yjM+z1lmTqqrEc3pV+uEmj4fpwn6iStGstXdGE30B39F8a2aYr3C60 IN/Io3IpA/Ws35t5gZMUM1QPz5ozbe5Jg9Y+VX6bLELCKtdrwBL9Rf2ipVmCX3S3urCYwvrGfkzer K0D1Ru8exi3zN3yd/v7bj5+4/xtpRHb+mcfy+u7u53FtExi+jVD5o8fhbusAKmysgkeUU/hnH4YFd pJ4FXnN5a7OGZ4I/n0y+5nfbUkcI1X9CpnG+qK7J/83SWph8nECVECEyABzZG2KObOUE6/P71EbTz iGDc3nB7D7NfxcGKErgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q63XQ-00EJY9-08; Mon, 05 Jun 2023 06:17:56 +0000 Received: from mail-vi1eur05on20601.outbound.protection.outlook.com ([2a01:111:f400:7d00::601] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q63XM-00EJUg-14 for linux-arm-kernel@lists.infradead.org; Mon, 05 Jun 2023 06:17:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EzBO1aLWkv2V44f8DTgADYs7e2eJ3ydiggzQXNLIOSiYlphtGoymlbZ95za3CtOYbFt9NlfjYckhqKLKPF8VXgAZduAvENCiX8t36pdmbt25ACnjnficrkM+WWkKa3hS/fSlppgYCdMMSxuU48H5vVObUWNKfU9OybjyUvEN25GQs5Sv7sWyekd+MH6hB0CCado0ijMckYUdcfnT7s38AGX9uRNMEeoPDHTMH1HIxsewvMPCsTF3IJZ3O/q0S4CgEjqVh1+nSwDmz7vPt3TZmlBXXU1GjkdazHiEMuIWbBA7Bj/q6sdhOkW+K8xX1g0JdTS4C2smCENh5HYRsOR9Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VakjUWFETSvVtl/79p76W7XQ7Evafr+iNfzrtJ6sH6M=; b=f5OruUzv6ahMaMA3QUsTKK2HW9yxQ35QI77bheVnvzd9yFqzDZ1kwxjAoaHPqY5s992KypdUsFxHxxkQw2lxGQ7H5Dfy2S1dz5UcOZ1KiXdJLFBGfHsWu4PpqG8AmThXZAOm/YPcKxzOPkv03ZME7g9MtYEYurc/mAY1J1hfh3i2YIQDQv69GR4m5MnVEh6m5XL5T8Vqq8wJTECw1LHE8qX/K4j1+jpgrQ9mDLfHkWCT3hGEWZJN6+oDZY+XelXLJ9C2IPVhMlEFHQqKrvfEUHHgieoo62uHGKDNCsvFTG9j4QIHQ9YC5Sn4F7ayEyW0LpWE+6x/ImhhJWUwEUL3JQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VakjUWFETSvVtl/79p76W7XQ7Evafr+iNfzrtJ6sH6M=; b=DyCg/U6XJSmEvQtBkIyuyDisLnMeKNvk115EOGB4iqF2IITJdIW4XTeIrV6uyz/1Scvd+jZ7ncN/O7hByNLm29VDLtxxKu86E6ipSkBh0bTlipIF6ijGTf3jP7GXdkQaEpD8hC4l2mng1NReVwG2uzihHC6wMEd8JSbOZgShSVA= 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 AS8PR04MB8545.eurprd04.prod.outlook.com (2603:10a6:20b:420::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Mon, 5 Jun 2023 06:17:45 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::f3d5:528:d12d:50d0]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::f3d5:528:d12d:50d0%4]) with mapi id 15.20.6455.030; Mon, 5 Jun 2023 06:17:44 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@gmail.com, daniel@ffwll.ch, peng.fan@nxp.com, marex@denx.de Subject: [PATCH v3 2/2] drm/bridge: imx: Add i.MX93 parallel display format configuration support Date: Mon, 5 Jun 2023 14:22:17 +0800 Message-Id: <20230605062217.3716328-3-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230605062217.3716328-1-victor.liu@nxp.com> References: <20230605062217.3716328-1-victor.liu@nxp.com> X-ClientProxiedBy: SI1PR02CA0045.apcprd02.prod.outlook.com (2603:1096:4:1f6::16) To AM0PR04MB7041.eurprd04.prod.outlook.com (2603:10a6:208:19a::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AS8PR04MB8545:EE_ X-MS-Office365-Filtering-Correlation-Id: 17937315-57b3-45dd-44d8-08db658c92ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D2w0McSNpiKT/zctyLS/3zg1yQjPRTTvaFQAKlsQatusR9IEoFDUSWkNfN/eCeOT1EOnh2ttDOTSpB//arqroefnQLxSCKfwkLGMsQSlKZ5BNT0wlggcm1gTvG4Isp5fJ76Rh6FoAxdroe8KLnslsIz/MijtqqR/ZO9Y+QnCPUoxcGZ+/sBBLq0GBJEjUf+T03w25a+RAFB0zdrHITyyyVjYVjc+3GlGuuD6o+/ms9FrsnbCyC/xfxn0fy8JLC31gljnqadsfI29eP1f4vQe+k0+8CywpkUVXVbk8F/ICMfB2hmsxNW30idtZo6pRjSdZaUegpwlnyHbPekHbL4mPuA9CCzNsX6KLLmiU6wcFiwFLKhgSvCpzOOVKq8kF/5+whqBDgiHyMvsz7263Aq9611CrjPRcYikcv3W2huR8r6hC9x3zD+9JNL1BPiZ3qRMxblaI8INmc0JMIo+zWVvRaQVeVPkCEdNz0dBkSYZ1g9wNiep0T/HJQ2CPCx2x3J9p1YPuVnvR79nWbbaHo4Qia0RVadl56NsO+5p/shicBZZBE8ALIllbsbI2uetgAWos7DgzJX9FDp87QfopOYMuumy+i9VM5hf9lRzSdEKaRyZU7zSE2sQQLCRRSfxYMyW 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:(13230028)(4636009)(366004)(346002)(39860400002)(136003)(376002)(396003)(451199021)(2616005)(26005)(6512007)(1076003)(6506007)(38100700002)(83380400001)(38350700002)(41300700001)(52116002)(6486002)(6666004)(186003)(478600001)(4326008)(66476007)(66556008)(316002)(66946007)(7416002)(8936002)(8676002)(5660300002)(2906002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TOaND8Z6ppoNUYVpg15PidCICV+tVgobg6qX5Jn2h0822VQDjHT1voPnZ9u4M70SYRFbq11Ql3uItyEfz0vtQsIKjwL2mEL/3gnuc/xoUTE+EBTlY9pbUZBf3vMe+GbLRW3vjCXUnDyU2xmH2flF80zN116pq111fod06930t7m1Iu5a+W5H4YkFsNy95zhJKqtZoc+l0u1eQ2Rj3YtiiT109bvlTtxJGmPe17bahOXkJReyb/H4ygg/S0AGWs+4nfihW5KTzvNJBbfYBwnwipOn96knVcN19HW1285SrPFFYMzAn0F+fRCOnwItNuQhEygQblx2mrO+nWmHcVbqkwOAUoWo7/7OFrjiASjxmKRMVje4TlqOzjt7mBzdngRhU6doLscstmWvr1sAgzxMr/mGB5Bho9n8pEKSGZem/zUogjLzrEKCdoFYUP0axX5knWFoC1t7Dfiq8cDHpm9WDi/Ec5t/9zid502QrEujn4EFWl8K89DZ6Yu7SQ7c766wFf/kzNdkH1UqeVdjHk4NNzDo1XPlAy+0MTXHgD7hR9tcEDkRhdnd4GV7xVxEYddHCtRQEw1pkg86qt1TFeapcxaUF2XDkIk1Odk4C1kM75hub1bYK2mM5QOiZHyl3kei92zna5BpWsJM5ljIQO6DyPzeH2sCY4NXzC+mGxh1JFIYDn0/byVPlIgGvdSfkaLbur2t+RB3UOY0ePylaShboFszzInj08BZ2xtsfs8ESCxdTG9PUW1NwvSP6Zn5T+UI7S73BLDi1cCDKeueVZXAmZz3kOiKchGetHyHOmPAR5XZgM2uRDMQS9g03lhZCCZ9xxnnVqRpm0bbds3EiBJm9h5HeLFCFn4D0f50Nhtw4rIWDoxGPuhhnDG1yelaF0AKiHPvz1YEYyv38UlZEwCH2LetXtSMVXlSRgRxyF/bZTDf7DbRDehfw6KtSh6e23Me7+hXo0EVzdYWC7KSiFatxzTzYT8r4I/JMdFO6mxGGSg/vX1P77DWL93rwd+yTeGEPrOW2LDqGb/OFLYR4oVwimSeWjSjHlZ6wlmfKnPIwGNmetdTHHCXl5hSUbPDCURujFGSEcn928l1j5dPrst3LGC9BXYw0qQbGu7SL+YVvKYZLc3pBE5dzCm8yJjXv1EkY8jyXtpEt+sSkch+1N3q24uhkSCIDjrb/M7z3VJRRtTGb/jUIdWvlaLgFvNmK+ofn/BEKiMS7q5b6s1NlAd53UUkMNW15z2tkFDuVB1PYd/2yF/Ej1NkTmCjY809qInX84s2X0bUf5/Nm6Izee1JNidK2DJrj+AuIjyvy1JC66mkRRA9UlPuvYdhp/a+REfi4thoffZEYTz3L0/mBBe4+ZrBL9Wegfwc6Vwl/C9k32EQTbx7a1zWkQSCba15HOclD28goY2vnEw31Ac2uB1VIyiOTpmGoW05nUa3OzFuVQnxq+rvn0rGAqdnOlyudHcpzx1oWmKfOXdKIrnNbheT4H3HCL+921ao0VowuIujStaAWXhOxMCX8/H8N50JoVFmRPrzfiEOWrQvzPbk9ydA87m2MCWlq00GoWtb43UMlgA/XqNQKIsYBrMrh22Y1hgH X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17937315-57b3-45dd-44d8-08db658c92ca X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB7041.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2023 06:17:44.8216 (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: h+Eng4OOcPK2une3N3h5RjzR+jNnVfZ8zuXlgeI01sXb4GS30g3jmjIBqM7/bXJIz12mR47+QomqVzPwy9Nr2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8545 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230604_231752_529685_B0B270DF X-CRM114-Status: GOOD ( 20.93 ) 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 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. 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 608f47f41bcd..adbd75a924d1 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -44,4 +44,12 @@ config DRM_IMX8QXP_PIXEL_LINK_TO_DPI Choose this to enable pixel link to display pixel interface(PXL2DPI) found in Freescale i.MX8qxp 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 aa90ec8d5433..e88821733770 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_DRM_IMX8QXP_LDB) += imx8qxp-ldb.o 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_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);