From patchwork Sat Jun 11 14:14:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878529 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE2E0CCA47A for ; Sat, 11 Jun 2022 14:13:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234070AbiFKONM (ORCPT ); Sat, 11 Jun 2022 10:13:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233965AbiFKOND (ORCPT ); Sat, 11 Jun 2022 10:13:03 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70081.outbound.protection.outlook.com [40.107.7.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F61B64D1E; Sat, 11 Jun 2022 07:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/BKE545qdqG/MR5LceaqEqRSTZcUkiZupdpizdan9wErP43qQ7vo+w4kAR4TuIi0kuLIEVBvg3Mp0s2G/CHdftrq0zXdziJtvZKSW+YymBX3ah4ZVMe0G0f9TeViOsZO0wyfYPWbNSnd9jqdTcfthRDRYufREW/cQllpoDOpD2ImWoMPDmkOPr/bN7ptjKBsfDv7uXO8JC4s6FW8bu5LN+oWDrOAxWPyibz63jtpe7iuLiQH+sp+F+zoB0jQaDRjl5omoMhTdxyXUeM5ebfvKoYHlE7/j/dFueGcN5TfL1emw/JLVAyWDNxwMGlYBm6GIolxv5ia2a83U9Lys66vQ== 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=5DnUWEOsEtka9J39JoFas6+F/5dT8mgaVhBQ4SY40aI=; b=UeJZ7Zxi2l31w1Xs5EnBNNK4Xu4V4ZvDxxoaA/UddfJypCfbKjlmmbFXu5kQE5bO5i7yGocAYygodnBr6uIFZ5WkYO7ATNhgAktdqj+CxTVRmxsk7kMYxCgXICpatFsJJg1Tc28VOiq7aI8NmBfl3X0d/92aY9TcpucLcoF8wlpsfVdnQWfT/YtRVAJpweL+3wYLa2aanQtS4c7qDGRgdh6mZfaCVLDKvUd9jI9OLIBSc5Fs8RrFYGH3rKeLCjXHld1eSBAzAz0zWUoS5v6dcMo/ViuKmuuy7nhfWDCQ45aiiOmdq/3ii8U8vbTo9bAeNWpDVUNp5GLy0k0RYkMkHQ== 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=5DnUWEOsEtka9J39JoFas6+F/5dT8mgaVhBQ4SY40aI=; b=n+NtSiullbXSoL9m4mHilo7GlDVcrC84ptONP75mKCQiZ1MOpBq7sqRPcuEwu8MrVyNg8Hx0ObInLWUrbQ0UI8VuccAaRkaz8ZYcpO9ZsiZPln8qqg9vbQR9vH+96hGdztw0QJgh/umeiI+ByJdPf4D40vm/E0TeGC7Bb8MFayI= 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 DB8PR04MB6347.eurprd04.prod.outlook.com (2603:10a6:10:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Sat, 11 Jun 2022 14:12:59 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:12:59 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com, Laurent Pinchart Subject: [PATCH v9 01/14] media: uapi: Add some RGB bus formats for i.MX8qm/qxp pixel combiner Date: Sat, 11 Jun 2022 22:14:08 +0800 Message-Id: <20220611141421.718743-2-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a5f5d974-98dc-4869-a0d1-08da4bb47d40 X-MS-TrafficTypeDiagnostic: DB8PR04MB6347:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WrIQIxmxArCwBZCwdEcLn67GaMlGAFphSeiHnqpIkaGT5sVd4gsfqws/L9IAQGS/FROW3YQerGxSw7AKu6v4EeUReL7WNU7ZFTSoLIUK9TJGcpUNsPmhplrmLf1WDfqdByNnMMqwSAH7E1Xu8zBy021vCIf06/wOJJrmdAlxEy0gPAXInwZetEvEI+JEooMKQFy4IOzgw3MglhaBp5Ywubmpd/IQc/gGMhKbT58Z6a10oqq1tshI/ieK70JqmkfIDPkiErmjjYMR9WTKZZ1KIyGa70VKJ/ezRFxZQ13acUbkkxsyngDjWTHvHKmF5HIDAOqtNOHUXFEWp8/7HQEhXlWymrpXchZ0Cr9sedzMIT028aPRiDuayUkxleSuP2ubF0IvwuXXB4L4UEb3KYFeCBHwz9bJnl8eJbYIoH+SORKw2AV4eByORA+/hs2iXKTzD49urbYHiJyuahvBk0R1a8+x6UGimdBgv+If7Z43jiQ1T4/p/jI+vBnUbuvLB+p/Bg0rzwZn52Vu+Aln79/BK6JDC6hxJ2HOWwjEsoc7Uig+r6Jv+Wl137xdzLGkz2u9Sr3/0l9cKmo/LVIE5qJ3rmCmklQTIVwzcjDsjez8kpQC22chKtxUYjwBkfhngi9D1d2TkvxkUR965mMNHar8BcazybY7BZRBFSkQoXejmbLvmEQ+Pi3aiQd7lXYBRk08E1HsicTxmzR3C0rdUpFw0Q== 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:(13230016)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(1076003)(4326008)(8676002)(86362001)(316002)(186003)(8936002)(2616005)(7416002)(36756003)(83380400001)(52116002)(38350700002)(38100700002)(6512007)(26005)(6506007)(6666004)(508600001)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /jerfXVpOOSCVnzIOTo6dAnc/AFiL/bLQYY6JqKXVkVkX3vHnKnoM8CKTLH4eFEAPMe7zEiKZ0E9bTMaVpZeRXxWENQnQWkNyS6jFOsvnusaVt95Q3Vbwsnuv6KXHErnMDHx3Es6s4iIlorb0vxZWvMxVShH9q/uy9xwJbq5ZJ6OyMC2PxdZwJlWQ/VsybnTRnwhYNKeOkwr/hHgSJ5iwj6E/dSjVJKI1s3e59Hdc9tojAsS+Ys7fS6gNlf1qOrJdKUADa1bPVGciJorSGCbkmYpXbxZEiDq2SP3huD0mUROlnSRmgaGNxpMdO5lKcxm2Wcht+kqmfBsOZ8muhWpBKFEDTGw5/cSW8ZayGPY7QjxVDlqV82Q/vaHx5CJi2PXdyYqdBRoK+J+N/Yrx20NWZj3EUTUAnhARnq0tANGX/VsxRewmy+c3KW+lnSfVBlOuHY0iz5ZH2cuggwjlxpi4wUrHePYk0gE4iQ24lneNv0G/9fQlteVb/gOAh+g4AiFJ0fERLSxxZIYa0yYS6ddeZonQsR2BBC2uKLrDN2nUB128sKqG9TjKyx7/RZXifOUasJRZpSwJrAECkfg+4ugbgAyFpBrqRmmtTb4ygV61RH/qD/s1PvB5upFX7Or0y7DsGVj6/Kd4rlQmiqZw6d9tvGcBYtUVmQ7uzGP8qQvQMHDeKVy/MydtKLVJ3OzoQQFAaWrZthOCGowKqXYKpzuITP2LH74CKdAdw55bc0qlXAwQvrQaHZirHB9V/gOp+u0xzZ9mbgar5cVmxLuaY9SiaHaAYwrGROevJc8upYUHrEGpnT7uuo8EmVcjTyT2MRxLYquqjBBe3Ydzhv5O6iAMXo+a4rr6gTWLUzoXrzdQmnsf+ckhDQbd0SjZdtlmnY1hHjh/q1i+utpfB/4fzyY3NKOoBJ7Fzhm946+DrKMOySbkJmEXwyTPp25fJfAoPNmSJWN1RfD+R8S4IVSrRRYO8Cr+b4YcMwjpiovK8c4mwKHjpTShWP7WKpikTdyc/ekN11UGaaUwbUB+W34MaV4PFDJGRTOTO5HkY+vmYWhXUDQhV0LawIh0p0sWLJtSDeZGzU//XarV8vGilPuOdmgozWKzVSzwRPPGRcIGj/4tRIRHvWQJ5a3BsuDIZEqbMnoQOqCSebo2NTkjVF4O+PUdIlmUoMJ5wM9k8MZ7xkZsxprqspoVH20XkI3lnfMSL2SkFjfQp5Sxzp5TnZpF0sRa1m+hKTBURwqpZw8qwcWdPD/r6qrOwfRqmV0uhP5cnzoZnEHb+B5JJunKYiXY3yQ1qnTDGKkGB5NnTYh3/zECtuH9oxSnZ+B99hES5ddObwhbPc0D39DwTYgIitdAs8zirIbPRM0a1EXwkffAnqVryp1OEEkLieVcMUSQM9STaXDZy/GMgZQtH33r396ON+zaLoxD4Fy5DpGSyEbTNLt4LZaqsfjbFAhk3RcY7E7hMbzi2E0Ve45J70yh5UF5nb1kCiQD+rRly2o4Ud7aMcIUutz2VGIvi7IpcUQxlQrOa268AeMVPJHbw6ixhfj/8CrOnB/mJ0VEL31FcXVE6i687/3RKbg2+88oUAZ/R3JmUMfeXJO5FRI8zlQ8EAIPTu5EwVZ7AI75/WslMfpmkDI1pJPR46LMIOs6KLluOgY1Kzw4g1CdgVZKi+IiHwbymb5VNvZeJ6gZCtJtv2brAInDbf1VIhcwQ8Nc9Z2kIj+ZMLaPrJdTx5/2/PSskUetT6Y+A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5f5d974-98dc-4869-a0d1-08da4bb47d40 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:12:59.5492 (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: 5EwC2w73LetbJSynptDlwRW/Ee4lBlV7KyP5NGYXZauLDM/Qd5yXR+AF1lJODq9Du8zY+G+I26wmxhneNyNXMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6347 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds RGB666_1X30_CPADLO, RGB888_1X30_CPADLO, RGB666_1X36_CPADLO and RGB888_1X36_CPADLO bus formats used by i.MX8qm/qxp pixel combiner. The RGB pixels with padding low per component are transmitted on a 30-bit input bus(10-bit per component) from a display controller or a 36-bit output bus(12-bit per component) to a pixel link. Reviewed-by: Robert Foss Reviewed-by: Laurent Pinchart Signed-off-by: Liu Ying --- v8->v9: * No change. v7->v8: * No change. v6->v7: * No change. v5->v6: * Add Laurent's R-b tag. v4->v5: * Add Robert's R-b tag. v3->v4: * No change. v2->v3: * No change. v1->v2: * No change. include/uapi/linux/media-bus-format.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h index 0dfc11ee243a..ec3323dbb927 100644 --- a/include/uapi/linux/media-bus-format.h +++ b/include/uapi/linux/media-bus-format.h @@ -34,7 +34,7 @@ #define MEDIA_BUS_FMT_FIXED 0x0001 -/* RGB - next is 0x101e */ +/* RGB - next is 0x1022 */ #define MEDIA_BUS_FMT_RGB444_1X12 0x1016 #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001 #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002 @@ -59,9 +59,13 @@ #define MEDIA_BUS_FMT_RGB888_3X8_DELTA 0x101d #define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG 0x1011 #define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA 0x1012 +#define MEDIA_BUS_FMT_RGB666_1X30_CPADLO 0x101e +#define MEDIA_BUS_FMT_RGB888_1X30_CPADLO 0x101f #define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d #define MEDIA_BUS_FMT_RGB888_1X32_PADHI 0x100f #define MEDIA_BUS_FMT_RGB101010_1X30 0x1018 +#define MEDIA_BUS_FMT_RGB666_1X36_CPADLO 0x1020 +#define MEDIA_BUS_FMT_RGB888_1X36_CPADLO 0x1021 #define MEDIA_BUS_FMT_RGB121212_1X36 0x1019 #define MEDIA_BUS_FMT_RGB161616_1X48 0x101a From patchwork Sat Jun 11 14:14:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878531 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DE19CCA47A for ; Sat, 11 Jun 2022 14:13:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233838AbiFKONT (ORCPT ); Sat, 11 Jun 2022 10:13:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232129AbiFKONP (ORCPT ); Sat, 11 Jun 2022 10:13:15 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70059.outbound.protection.outlook.com [40.107.7.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE342403CF; Sat, 11 Jun 2022 07:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=INFo5PvARtYAQuNPtQORV+3gF1qhk8An6xxPL2C5tQgk5lmCaph8bji6nqyiZALqKn5kVCmD3UymdwGtlDyOXRNr7XLOdvXsu6KSnKSv6qSSAwPCnRGWF+0K4GmibfQYZa20lqzwDr1ihRXFdAJfdojf1E0gY0DevrtClZkcf/En4rRHbfSn5ICklZH+KcY6IZCn0p3NMJtM0ZeAO+3V0CWjjsNGeIM2YhXI4MK/jy7eh0pnL6Q439YwXc9mxIg8r9r+0SHwaU7rFvOa4AkylDV0Z1vHao51sFerZOGEOtuWs5eJZVuZF/E/u8QW9+019iqbfN2rp3cPJgNwub+MwQ== 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=6Vbjlx1f2d0W7MpjweSmd3hwR+10ZDfxDVnklOGbVOM=; b=AD5t9lxoxbjBg3sOD3Ob+ozOgm0J0CohaCicv/lstf8TV73fzLIxY+9zVszkl8bWB6mlB6qIGKV+BOqLb0uQ4vKAkuVgt5pby7LzlSNuUtn0k4ERupf+m7uzP/VRQ6FLEIQwSf78PnoQH8GGxyBBo2zCAKz/oFL6fHPyMtQABglG96QZuYpi4U9dp0R7oNkza0tg4joCZT0W7Sc/j/jQTCRZ+5nAfj2tRFXHFQT28FlBwdE5s1vI/XGEfJJvYAa3IIDjGc3fzHXeh1jmgVzE02mhPHszbJsS8oSWWK2FZTvw6srrpgeI5ECRlthfoZu/4GiYmGfww5W0jqy0pwfalQ== 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=6Vbjlx1f2d0W7MpjweSmd3hwR+10ZDfxDVnklOGbVOM=; b=CB2YHESdVFtyi0HOJtbhuG92l7NCBh3DmpREGQtbJa8xfhyEl6JEhyNrOze2qKIUHC7xBzTa+QJFYv23qWzTBfEyECoO+9Dge0R94k4pV/HPTFGTPCJLRdWjkKCAJj2eoeD3UN3K51RJeUcGht0jRfr6IyBxL9IF+5lWG6OoyVM= 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 DB8PR04MB6347.eurprd04.prod.outlook.com (2603:10a6:10:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Sat, 11 Jun 2022 14:13:12 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:13:06 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com, Laurent Pinchart Subject: [PATCH v9 02/14] media: docs: Add some RGB bus formats for i.MX8qm/qxp pixel combiner Date: Sat, 11 Jun 2022 22:14:09 +0800 Message-Id: <20220611141421.718743-3-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6e335ec-c11c-406d-38d6-08da4bb48110 X-MS-TrafficTypeDiagnostic: DB8PR04MB6347:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wMN2SIu6LS2hRqd+E/Z9u8gQhWqgWjShVgUkYO7DT/ynL3RDz/tF8WwNMS8BAHfBALcfy9udKbdkrD6IgUEgdKmI+TD5SWL+hXBTnbCQdSvkSVItqCLTbC04tFCr55Ug5dFC+5oyFdLvG7HhNK+OjyNzGhhRZNUr9+Tf+UcWNJctfkMjuKXecuEdCXNxn40BRYZ2HJ8K1lKM/+nHsduEGP276Z7ytG7a90IbUBwWQegTUEfz9u2KJ8icSfmQWCWuUtNjpYZy8P1bvS9J2WiZtfqPz96N9C8SBWTg6oSMkDhym6y01gnNL8Pgz4ue7jvs002tthquRSsk9/kr0x68T027n12mMaJd/TVNqN6079ri5L40GPoXQGdsj2ciSVUlKkiD5TZkDF1/BBVRCvM0XfqaEptKo49EZYSP1QXBDTzARS1Dzn56c86biPsu9d/kmCufj8HxGK9ecpVSFJ7vamD3EAwOAjJavzhpZmvK2SHfUTgo2N6dwtkJqS5ztcVqNmCSF201D1PLHawcrfwJDPjiMKVT/S17iM1VyK7xLSyCdHwflBQDXOsXji5xueGQDYwEM5XojI8cJVai1M1otZr4ZcTpV98aaQmw0U226XnVZbtmZb79x47uFeAyMQ4B5uOtBvj6LAKo6q7D0cREd90LtEws7sLNuGK5e69hIbD1MiwGwioNIa49Eee1MRBjIq8c4tjmO6l281NgbDj98Q== 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:(13230016)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(1076003)(4326008)(8676002)(86362001)(316002)(186003)(8936002)(2616005)(7416002)(36756003)(52116002)(38350700002)(38100700002)(6512007)(26005)(6506007)(508600001)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: O5h8tzKAE+eV7cwgOW3x6W+3e36wPndKX4rzozpK9MUTRQP36IIhzPkxXWTc1DiBBCSzPAb/LOLpXX9M5X5I1KsmGcFaMrKvih6WnRJxlc5LVL02lXBmHW3pahOiLvBTltmTfBKeTDlYLWESfwb7xdlt9lAUINGbbMS8ZUYoUBvIDMqOtdCU2hfyh+PnRaG5LasxT3joQobRtt7pfKnvaSU2lfhj9+L9aGJH0yQw7n3Y/KchpHgaada8q90aA9gNH8oTpj1Z4C09SMtqy81kAEio7roilD+jY85mJ0uLHCEG9KzLinU/8bx3O0a4dwIpY6Q5MVjkkVLCs8MHQIK6Arqc1emWVM2jWMLpmpZnu/yaDuAx40cDZGBN0jYwcVSlL6VxZyLbOSA0MGa4TTJjE4rSiXF14QXNtCwwJmvTf5WTt+Eqp9Ifuo3DSo308ZnQXd90Zli2hnjv1Q14i6xjIDHGMNgN72Hk5uSizZuUSzx79jT+8V4HflBKvBgFIXX7pb4mUbe+7NQS8cNgjYqRK8if9AiNpGK+1+VoI+exGLH4svTnsdm5uaLiuPJq1rrQsoF/UdJfjeIKAoL0wAgsIE9O3wJV0izIbC6eJi0O7T3UGvg3oBXRQ7xday/Ne0X7/trCd/2VSVjqybFdqmIJvAQ/mpPweBfLJd0WfC2lnlBuIhcneEc51fjbygep9lJaLX/iwnRR0wOX2xMWxaV4SaBcb3973QN3KRDcBf5rckv6QP5iSnrjhZ/3BdfPpK6o4Yqoqp5Sx1kNbO7cC802L5e98oiSrE8xWmQeG2GdcM5scW33WbIDI15BazCxiRyiw9/5vw2WxmHO8xH//zUWlnsrOZFaKWaFgNH46XNRf8RQ6dQ1UL8ro8nrsxd5grqaGZ0Z51A8TaraagdkXMtyWmdRkOunTOgLPVIgL98HqgBSf63SibOaiW1hpkrjaKThfzq8Yzlab+/FNK/X/HeiwzMYzAXJpSf0Bd/8zD1yuKjbyIYVebsHwzTnAXqZtYmvsa3d6MrSbX1ggwq1QaDUxwyz2dnBwI+msu8DE0coZm5w+JRncH7Y6JgeBxU/lV0YXGelTXcrSyMXjWbRgbIWirck7IWqhxahB7d+zoP4F+uf2mDnSRLllD6XRVmEiaY8LFLX7QXepZZyq72oxL5kGJyuOO0cLNyYDsvsFS46fDp7bTU3fbGlMcUUOMVDQroVNdG8MIvd9Os0CpjhL/QSAjHZ6MoEw/wRLs+ZSaKq/pMsez4E4IZotL5ZURWJb8TKA0i2b2B85s8UCPynUWkSatc+ZESfcZtIROKfsGWfEaIj8LrJCjavVWldF5Zz4wZrzuhDMkP4TBjBBdGuuuxhCelN671dZMYa1mVYKYbtgF6BHgQSr0R+Vxi1EXEfl6VBV/yI9tJ3U6Ve/H9Vd+jm60sDOvxPSow1tPgzq4/lKpGY8kWJuj+a9eZo0wf1SumhiQt+NCJG5jFCKENTblMnvbwOKBQslOF01esah3CWh+gSJlhvW7IkBGYR8E8wNnPZ5edv/BsqnBQH8fApLjSL1cPQif77hR5DWYZevB/6UAoR0piBvkhMfGZLSHC+lWCd0vgj+GT188t9bAhQ1yFuaRY7CMNxo2QeM8IvZtV4+At1TvmzrF6vYgdf9rQocPNLt+wCpiCwrLrL8zp3afXMipqF3VKy7hKmYxNZcFxNUCyPCHF7r6EWVBDRKl96S39MnrtDWVba/c1a6T64sMe/HQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6e335ec-c11c-406d-38d6-08da4bb48110 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:13:05.9272 (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: Q2zTHvNR0OORVUYN3O9DTC9ObfxBLYrKLnL2kfaFV3tgRxnW/5jSzRl47oPWgEX6oZ9ukDO3eQhmiMmmS7uiJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6347 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds documentations for RGB666_1X30_CPADLO, RGB888_1X30_CPADLO, RGB666_1X36_CPADLO and RGB888_1X36_CPADLO bus formats used by i.MX8qm/qxp pixel combiner. The RGB pixels with padding low per component are transmitted on a 30-bit input bus(10-bit per component) from a display controller or a 36-bit output bus(12-bit per component) to a pixel link. Reviewed-by: Robert Foss Reviewed-by: Laurent Pinchart Signed-off-by: Liu Ying --- Robert, I keep your R-b tag from v5. Let me know if you want me to drop it, as v6 contains a fix. v8->v9: * No change. v7->v8: * No change. v6->v7: * No change. v5->v6: * Fix data organizations of MEDIA_BUS_FMT_RGB{666,888}_1X30-CPADLO. (Laurent) * Add Laurent's R-b tag. v4->v5: * Add Robert's R-b tag. v3->v4: * No change. v2->v3: * No change. v1->v2: * No change. .../media/v4l/subdev-formats.rst | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/subdev-formats.rst b/Documentation/userspace-api/media/v4l/subdev-formats.rst index 0cbc045d5df6..d21d532eee15 100644 --- a/Documentation/userspace-api/media/v4l/subdev-formats.rst +++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst @@ -1492,6 +1492,80 @@ The following tables list existing packed RGB formats. - b\ :sub:`2` - b\ :sub:`1` - b\ :sub:`0` + * .. _MEDIA-BUS-FMT-RGB666-1X30-CPADLO: + + - MEDIA_BUS_FMT_RGB666_1X30-CPADLO + - 0x101e + - + - + - + - r\ :sub:`5` + - r\ :sub:`4` + - r\ :sub:`3` + - r\ :sub:`2` + - r\ :sub:`1` + - r\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - g\ :sub:`5` + - g\ :sub:`4` + - g\ :sub:`3` + - g\ :sub:`2` + - g\ :sub:`1` + - g\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - b\ :sub:`5` + - b\ :sub:`4` + - b\ :sub:`3` + - b\ :sub:`2` + - b\ :sub:`1` + - b\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + * .. _MEDIA-BUS-FMT-RGB888-1X30-CPADLO: + + - MEDIA_BUS_FMT_RGB888_1X30-CPADLO + - 0x101f + - + - + - + - r\ :sub:`7` + - r\ :sub:`6` + - r\ :sub:`5` + - r\ :sub:`4` + - r\ :sub:`3` + - r\ :sub:`2` + - r\ :sub:`1` + - r\ :sub:`0` + - 0 + - 0 + - g\ :sub:`7` + - g\ :sub:`6` + - g\ :sub:`5` + - g\ :sub:`4` + - g\ :sub:`3` + - g\ :sub:`2` + - g\ :sub:`1` + - g\ :sub:`0` + - 0 + - 0 + - b\ :sub:`7` + - b\ :sub:`6` + - b\ :sub:`5` + - b\ :sub:`4` + - b\ :sub:`3` + - b\ :sub:`2` + - b\ :sub:`1` + - b\ :sub:`0` + - 0 + - 0 * .. _MEDIA-BUS-FMT-ARGB888-1X32: - MEDIA_BUS_FMT_ARGB888_1X32 @@ -1669,6 +1743,88 @@ The following table list existing packed 36bit wide RGB formats. - 2 - 1 - 0 + * .. _MEDIA-BUS-FMT-RGB666-1X36-CPADLO: + + - MEDIA_BUS_FMT_RGB666_1X36_CPADLO + - 0x1020 + - + - r\ :sub:`5` + - r\ :sub:`4` + - r\ :sub:`3` + - r\ :sub:`2` + - r\ :sub:`1` + - r\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - g\ :sub:`5` + - g\ :sub:`4` + - g\ :sub:`3` + - g\ :sub:`2` + - g\ :sub:`1` + - g\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - b\ :sub:`5` + - b\ :sub:`4` + - b\ :sub:`3` + - b\ :sub:`2` + - b\ :sub:`1` + - b\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + * .. _MEDIA-BUS-FMT-RGB888-1X36-CPADLO: + + - MEDIA_BUS_FMT_RGB888_1X36_CPADLO + - 0x1021 + - + - r\ :sub:`7` + - r\ :sub:`6` + - r\ :sub:`5` + - r\ :sub:`4` + - r\ :sub:`3` + - r\ :sub:`2` + - r\ :sub:`1` + - r\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - g\ :sub:`7` + - g\ :sub:`6` + - g\ :sub:`5` + - g\ :sub:`4` + - g\ :sub:`3` + - g\ :sub:`2` + - g\ :sub:`1` + - g\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - b\ :sub:`7` + - b\ :sub:`6` + - b\ :sub:`5` + - b\ :sub:`4` + - b\ :sub:`3` + - b\ :sub:`2` + - b\ :sub:`1` + - b\ :sub:`0` + - 0 + - 0 + - 0 + - 0 * .. _MEDIA-BUS-FMT-RGB121212-1X36: - MEDIA_BUS_FMT_RGB121212_1X36 From patchwork Sat Jun 11 14:14:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878530 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56111C433EF for ; Sat, 11 Jun 2022 14:13:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234278AbiFKONV (ORCPT ); Sat, 11 Jun 2022 10:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234098AbiFKONS (ORCPT ); Sat, 11 Jun 2022 10:13:18 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70059.outbound.protection.outlook.com [40.107.7.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBCD864D1E; Sat, 11 Jun 2022 07:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GKGN44ZMM4pCpEYZ0dMnIfslqw5GB1SrZaj3nZuV5HQsGOVpmUCZQjpt0Hzp9SPlAOeq1PC8Fd2bX7OLB6za+jwvCeNbAHSuVkEqK/hAvQcz66vq6mHXoYUSTyQnNPNY3bx9TAGB7xaPAgv2rN38y7sUyHMwWefZvAorz9Jn2MtErtKjNHWiuvXIHtJ1fuQQm+O7kxg7HG5HqPqmCtUQQnAjFyupLoFRiCtkHciAHco7UycGCgZUFNMg5SlGy+l5bpTlMuLbq79MwbIUaZiRqfateSXClb326zsDWXoKkhQwHScbwL3GGsCCG4xNyg2SiaIBs4fesxkTjTTQ/LEVNw== 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=e1BfWpm32TObyNwHhWqJTBk5kH+meizE/V6mBV39rBk=; b=RYdqpqE46T1H8z0IuzuMcU/v5MQv2bmbTNtcqRlv5aL4YczWjXTg2o6k8jl/WrAd8MZCXQ6Mgjdt29k6stId3hhpyTTIPUsYxZWFWM/pCDMRmUqEOLEmQbdykZAak8d6nS8Nqau7eM/X6VF1/lH4EdHNYxvdv02znF0JdzzsK0c5W2XgQ5oTgCAGMNTt2nLY6h5cK8d/ecDgkqPZwGNjZfd0conbAOo+RrS6Ah4EsguT1MKsjP5MgwJ4hd/JyOejsDa1CZbz50lxI2X3HUR0RuQM2hA+QYU1alULl7XQydcQ88QHxfyu0a3Upt8Tmonn3s/RqxtdaGU5bDWsKoQkKg== 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=e1BfWpm32TObyNwHhWqJTBk5kH+meizE/V6mBV39rBk=; b=UivQj9+IGAigSsbW617IxwmyDJZNc7K31r2yGEZrqog2ZE9rQlXvGwBAjSIp8h/l0YbFFhdBC+mqTASa3fTo8F9Ox7MKdGvfuHrL+TBF5x9+nHz328JYbVDAUJ85pOz9l0sr00W1JHekkrDOCMgVGWrLrwRxAuGSmqdBW6inu50= 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 DB8PR04MB6347.eurprd04.prod.outlook.com (2603:10a6:10:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Sat, 11 Jun 2022 14:13:12 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:13:12 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com, Rob Herring Subject: [PATCH v9 03/14] dt-bindings: display: bridge: Add i.MX8qm/qxp pixel combiner binding Date: Sat, 11 Jun 2022 22:14:10 +0800 Message-Id: <20220611141421.718743-4-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2d03f43-f249-40a8-7bdb-08da4bb484db X-MS-TrafficTypeDiagnostic: DB8PR04MB6347:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 69R4CRbMkFRGJHSwmyjjLfuOtglPpqXEVVeQYX3HV7+mkCZD1i6r2yKcHKeLuCx5xoBM1LkyPa2/+9hWc53oMrawqvPBdIAqI3tDDb6l2fyjxI/YXGkYLRG5mJLJk503hW1OHkO5uCELxivUfjQfv2LXyiHB33u37FERM1v037xzzQvgGFD29F6YS6KSLoxjZx4U7UxT0YSfpxODQmnjKau/MOwgEEoooWSz4FylmjRrLsFu3Ob/ny4xpLqqctZHWCOcn6u6EwVxzDxuMGdlxwfT5E8Pzt3yl0vdMgKK/pcwTbjFI9/6aWb4I6N9wQC1vGZkCRaps48zuEuQpQt3h/8dLXShiOzKZD+QCh1j8Xm4D3kkVOpomMCnzzmvP0jPOH40YnXUe92opqXyFZCKF54QeElFeskd+c9bxsvrf1oEbEn+a6J8W9gafNpUZ3g0Smyw2uvta0Z8bWBWTU3ehWUJmphlNV8onh9zfYxkgcW6n1QM5m2hRSq6wLnqHmUsqIP9lsdb171g9CKMDjaDXtlYq94U+qbFGpeVUlFeipTXgSD+BrL4rpDZHjokuaHBzOQ4xPk+JMmW9wJ4zHM3cIkx3D6NAP0qCRtR86B/Qeftib5jNa+DEY2XBapXI4wsPumrXUDzfILdUBqGTzpQXl+kqBSXh0eT2THACoYrtR2NjdW8OXEdV7H4vkQB+jqz/xXStspuUn3lPBP6VwxkYwm0hHmqrjXQ0+z5HsZstng0jo3BNIcy3/aUDuCZsFy1QCxPg5+8ZGi24sqBjrJeZJntaPF7xKzR2m2HSiOO8w3R2SmZEySdnNH3TjtxoyoxK7RTbI8E95pQO0ZgH+usww== 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:(13230016)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(1076003)(4326008)(8676002)(86362001)(316002)(186003)(8936002)(2616005)(7416002)(36756003)(83380400001)(52116002)(38350700002)(38100700002)(6512007)(26005)(966005)(6506007)(508600001)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vFbO2yMtbQ+mqweMAIRGjaJor6HF6oCfkxsRV5U8++DkIGJmRRHbiAvDFbmVy63n4x4Y7S2TedO5m6aPW/vaGitkQrN7YuGACFJB7otDS8LHl83b7onqDmyEctp1bIifHP25ghM6GcDbhzDof+0DpgnkRlmxz4eOtFTFp2c/E5S9crOCsdp0EAoH0IgQ2svn7OAgEJaqTZBox9R3VY13tk2Glxvjgkt7qiWWvGTjs7vI4aJvCVDrptX406ZJL+2cbjSLm3f40zLl+d3NYOYDinXjdCxpdaQk9fxdNLLV8Gi/mDB08o9g3bgo9j9QHl947V/OGs+9HKzbdv6z1sdQy7lvP1thKHi119fMAEw8v4wGITWazyxg2hrNm0Fj6K1xiB4JD5WugGjAv4Ai7i5jambpEdsi/XqunTGV/D9I5PlhOJ/3oxEbpmzZec54LmcQN6800N3JWp6FY+FfKO+0mxaUcKfDhIVz9gOKL2EUkKLVWL+tqBZp5Jfyi194Cwki+jeY8Kp6vl7g8Ya4MwV0Xmw9mPSjZZxkGkVEDZuHdb5N2k6d6a8EGHVwdOHS5S1ks9acByIal/BTeLT0nAjtmcFcG65cO1R9Py9N9c2vj+HNfj+9DF9666cQ2oDc3l7TxmdS1+JoP4OeHJqxaPEvz4Otpisprl05fOeLymcUhjsCju2K5sq3ceYYAEgK11Kicos1z4VTYeOuDUp1JYelPAuOYviFaKXi/oKV/ytHTGk7Yt+HFnnqZjQl13Ros/dW5WNepfmn1xHVZF2HD2wCxeoWytqnIeLPAZ0h63+x+NDyJHmJQ8OlWHNzZqys+CTMELYcFFX4SokaDDiHetZ51z8k6HBTA3ULVktEMbH+jsxvIQCvQdGe5Ah9rer0SvlMt2/mlBPBCJJLIcFA13dh2g+9klBwPvcAJeAJmpzNiJnf/NgyJBsj2bjIPr9grgl+ef+yROFRsB1nsHcLjuRAcolCEwB2drzuh5CrtkJUhmCMxd+GuTMC0jxLG3wp5QGHE6pZIqYapi6ZfsSl+hEJkQITdm6Bh43w4GQIJbi3nzdp4bIe19JlJzWmHmrIL+rFi9PWhoRiTfxlRkdyzjaDhwSqHefonEKlqQwpHf0mHKsrzM7LDAx9zcxIIE1FsbKs56I3XDKsMzypP1WrwnGV0g7gwBMv5oIKQi1ClaKoRbJNH0qbyyqPWuchTXhJDIYv5Owq5Zw7B2Y5pBtqDqem5Lf8kNcKwf/k2OS30EXy7lK1vCeLVYks5kd30V/+L2bTP2E/7axf4g7Y3ecpktOg6aKQl8ZVMf1vZT4TaSbvFhpO7wYIez30hWwRpwfB8jc3J3ioeoJ6Kxch50eLuNAwX55anbzIM5gCxAtyXAgfeFk6CHAL5oB8OavI8iD4vQv+BwL9Vj/pfKdFaZg8OVNPTtwd6WKeBMONhHiswnwkMoV3TUQefanFEOT13wZ2EqeTiVcYWUYZh35iU4lh7ZR4lilMHnSWOyaFE7BTVxBAXXoGk+VVSRTpElAn0XWcEqezt86vZAMvZ/2O5aJ7h+4rGDGMQCqLD7YR62XuqHq8jbgq+D4cFArdI+m2Uf075xMr3v2CzcAS4VbFS1+P5Y/t2TxrmUOqz/vHfCnStAvj5GNQT11a9jO/ybxhbF4fMoTmkN8qRlZT8Z8tN5YDj4HgbVa5HTtn7K0swMdvjlomp7reUEmTCJgvraP1n/TMNQ2kRSqXzcJIetd82gbQYFtvqg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c2d03f43-f249-40a8-7bdb-08da4bb484db X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:13:12.3862 (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: F7WWj6DHAsLcnC9CGvg/i2MUAdYBYfAKTy8D2SuUANu5q9Kz0DmeBAI1BW3j9WJjyqG8YSDJaci+VUrdvv+GdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6347 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds bindings for i.MX8qm/qxp pixel combiner. Reviewed-by: Rob Herring Signed-off-by: Liu Ying --- v8->v9: * No change. v7->v8: * No change. v6->v7: * No change. v5->v6: * No change. v4->v5: * No change. v3->v4: * No change. v2->v3: * Add Rob's R-b tag. v1->v2: * Use graph schema. (Laurent) * Use enum instead of oneOf + const for the reg property of pixel combiner channels. (Rob) .../bridge/fsl,imx8qxp-pixel-combiner.yaml | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-combiner.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-combiner.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-combiner.yaml new file mode 100644 index 000000000000..50bae2122183 --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-combiner.yaml @@ -0,0 +1,144 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/fsl,imx8qxp-pixel-combiner.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qm/qxp Pixel Combiner + +maintainers: + - Liu Ying + +description: | + The Freescale i.MX8qm/qxp Pixel Combiner takes two output streams from a + single display controller and manipulates the two streams to support a number + of modes(bypass, pixel combine, YUV444 to YUV422, split_RGB) configured as + either one screen, two screens, or virtual screens. The pixel combiner is + also responsible for generating some of the control signals for the pixel link + output channel. + +properties: + compatible: + enum: + - fsl,imx8qm-pixel-combiner + - fsl,imx8qxp-pixel-combiner + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + const: apb + + power-domains: + maxItems: 1 + +patternProperties: + "^channel@[0-1]$": + type: object + description: Represents a display stream of pixel combiner. + + properties: + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + reg: + description: The display stream index. + enum: [ 0, 1 ] + + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Input endpoint of the display stream. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Output endpoint of the display stream. + + required: + - "#address-cells" + - "#size-cells" + - reg + - port@0 + - port@1 + + additionalProperties: false + +required: + - compatible + - "#address-cells" + - "#size-cells" + - reg + - clocks + - clock-names + - power-domains + +additionalProperties: false + +examples: + - | + #include + #include + pixel-combiner@56020000 { + compatible = "fsl,imx8qxp-pixel-combiner"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x56020000 0x10000>; + clocks = <&dc0_pixel_combiner_lpcg IMX_LPCG_CLK_4>; + clock-names = "apb"; + power-domains = <&pd IMX_SC_R_DC_0>; + + channel@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + port@0 { + reg = <0>; + + dc0_pixel_combiner_ch0_dc0_dpu_disp0: endpoint { + remote-endpoint = <&dc0_dpu_disp0_dc0_pixel_combiner_ch0>; + }; + }; + + port@1 { + reg = <1>; + + dc0_pixel_combiner_ch0_dc0_pixel_link0: endpoint { + remote-endpoint = <&dc0_pixel_link0_dc0_pixel_combiner_ch0>; + }; + }; + }; + + channel@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + port@0 { + reg = <0>; + + dc0_pixel_combiner_ch1_dc0_dpu_disp1: endpoint { + remote-endpoint = <&dc0_dpu_disp1_dc0_pixel_combiner_ch1>; + }; + }; + + port@1 { + reg = <1>; + + dc0_pixel_combiner_ch1_dc0_pixel_link1: endpoint { + remote-endpoint = <&dc0_pixel_link1_dc0_pixel_combiner_ch1>; + }; + }; + }; + }; From patchwork Sat Jun 11 14:14:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878540 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4E0ACCA47A for ; Sat, 11 Jun 2022 14:15:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234148AbiFKOPZ (ORCPT ); Sat, 11 Jun 2022 10:15:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234681AbiFKONX (ORCPT ); Sat, 11 Jun 2022 10:13:23 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70074.outbound.protection.outlook.com [40.107.7.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B83F5403CF; Sat, 11 Jun 2022 07:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MAE/Iwchmjer9KAAeJHqtiAr6mf/W8+yn1nJSlun05+Jo0A1JTxE8YrtrilRWSQC+w/qS6aM0JwOSBxIUiBIKGSQwPw0Xw7So0S7TJv/heJ5C7m4NfgCe2OCUtVUFL8LDsNt88Ifi/YBsMt/GTbNo51lx9iFYsnAXtxhfxJ1nSlBsLeNEEEqssEGDVHOjVSw/oyYOy8Ln0bet7HMfrI8d2VgRK1mpqL/yIhKQfTZiurx2KlYDyfhuUbn0HA+vF4O83uWF4DpMB28VY9vmNIFT6ZgsElEqOdebqqoqMxhdY5aHDFvbW/+uXf6Y40EmzQAu/C8K/6C0RC/pBXMD/pmzg== 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=j0IbIvxeaH5gt9hya9F+OOaqffXJf4kP1nnlR/O0hFw=; b=mMzVUtQzuPAaTmBO+xev0qI6zNvU5qJZEReteAuXCQoOUf0iqf5DHYQV4FTQfY9tIej5KkzynUDkJnF/P7n/7PzQ87GVoc9AuDiBsueOVZgVUkxeLRPARlydeF8Upnnb+expdiBd8LrgTB3uBzPDqVv5IX5a3xqwAqImhmQdz7Iq7iiGx9s8hstZpWlMV09FQPem4EZ0mIy1g6lnb1OGZmLmcjifXhIynYILevy9gc9M1eYg/kvPpb5CVJ/mGSji9fmHN4a/gqtrtSskkQHm2rxOjnjiB0Vip+GChd7vYLcZ/1PjOy9CfAH5lUGiK3vEIKAfaSQ9mCvzw+mXc298hA== 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=j0IbIvxeaH5gt9hya9F+OOaqffXJf4kP1nnlR/O0hFw=; b=gM5K8cQyi7HybufttxXLWve/PGwl5do3obY10S58k73ogbSM+BtGAlTtlz8AMq7bWb25AAfeaZecoS5H1H9FFeYwVxwOnPukH4hckGUKrHcrR5qu/hpKkn3zb9XOvUEkW+rcMeCElDkoZjpIwrauaRajMl++mOs++07QMtgrmlU= 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 DB8PR04MB6347.eurprd04.prod.outlook.com (2603:10a6:10:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Sat, 11 Jun 2022 14:13:18 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:13:18 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com Subject: [PATCH v9 04/14] drm/bridge: imx: Add i.MX8qm/qxp pixel combiner support Date: Sat, 11 Jun 2022 22:14:11 +0800 Message-Id: <20220611141421.718743-5-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6491c68a-7f00-45e8-438e-08da4bb48893 X-MS-TrafficTypeDiagnostic: DB8PR04MB6347:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7ELrVNKzLiQms8FJuKYfjcLxvLc8mNDu5OOzHFDWcN25n4fUz00SdzjXV6TK+xVo+fjKsQCnKkipbC1jIOBj7TGoCK1kkG+jIXc7fiC89/3aukDOOzfZTExq/OuuOUIzC8qQVTbjLoXQlBhZkMMTRfCYe75smg0H5G7mV1DEO9IZuKI7r3QwiYYqZu1cfCtGTGP5tlbPcnt9dsq3WiMktWdD7ca9L9pCDS7C3K6xnmU6x4lq31eFF1WtcNnjdSG5a5Kys1Hob6RS3xoX9Ub8G5w0eJ8DKy9eiHbfrAM8pL/7ik+ldzpOWYUdbF2IS7V/Si5FJX3waOW9YCihVbzBuUk4Nb98tMEbrVRu7k7C2rN0PrjMPL2Y+L8mIYMQpOlOIHfI6TdhxNXPaKu5AdfGh0FqI6SN33nRunWWhKciKj5P4GtnFpK6ql2RrZK2Cs54tjaqYarfpC/j2JSSkKh+h4jreDwFKSOicyVKwCUWas0fgCx3nQvoOG5G/eQmiifPgdKbxInEICJSfL/Wr1Lpk0yPYSNwfN4L5FE//fZJgdJoZENuaoM64FagtXbJ6Y+0b29bTWqhDbo0g/7mGjG3M67MEdwTxGssUJMy5mBpoxIq5eNgZnuhE4bW+jzrtC1liqfy8QiWrVUxEGKoVbpyzgGEoHxY+4tFJOcPGEXLq7+vjKWWwgi4GzYV+QyIwdfw5yZpwZ7G9dcdp8moxgNMtQ== 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:(13230016)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(1076003)(4326008)(8676002)(86362001)(316002)(186003)(8936002)(2616005)(7416002)(30864003)(36756003)(83380400001)(52116002)(38350700002)(38100700002)(6512007)(26005)(6506007)(6666004)(508600001)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r8+qIEJfCqzyOUX14Dj/c5VMZmbjRexIRw6XuCMvix6zBtqTqfFyp1vFV6F+OCwypnuYTty13Iu+BKUfhMW74dWStgQZ17LdDug3sYUMkK5suTHaxPyCQ2jsfonXSHKVPL9cJ51sL3aFfv93MULrGqfcaLQk2CI315PLvprwqOuGZcYmsi09optW9zwzwmS5aTmLvre0fIWSKXMvLbQ2PjCVswxTmlrIQNlZipOEeHCAunZIdml3IyEfDAEQ/FgoM9fISDx81+AUKafSuwfNYBZ8LKEv6NE/w7yLG7gybgXQ8MCI/hMu4f2xZ3I+rhe5UlhTG7ZLglqOsM9CQ9XnZVqDU0NrNjxclj6Bz+BX1lI7EffyBE024zrPmwYsDFCO0TjXGZgDzWd60yRaEyfuXLyqbt/qoUE+6oPiTtivTEpeP2NXsymTEPyZDzRUHBxOQGdHjaovrYPGEjLFAb+9a6FHmzTCxKu9U8QZADHaPuHFr99IAQS8gm0YUPRNcpc3qP5QvEJhwKWp+v3hmSm2Aqemtw8qAFkR3IY8mbF0Xc1Gy7Q75MxNMeVjU7jYGX/8vKRxi3inBCf5M2HLkPyfOicJ4/YfNPpY3UCepM4HHkMDbtIITK3yE/wMgIfL4QORwQtf8rQV7iQ7hPiaQcCpgxSojW3xnUpGvVQFupCh/2vX0aV1sZ/QYWh7BWn1nV/aEEuii4EVZLymkvrkR8RIw6pd32rRAoUx1Q2VHWFfM4X7W5/6VcmkZjSiZYE8zz+HAY5TsgM1MD5kQNur19ClJ8TZfuLcZSVxXfD+r7gDtqkp0QhYsXDSbrJ4upxG0pBFHS83D/+KSIQ5rNzQCWvuVGL8HrJPPyarHjouRpNdrp0f8jE3NMhGWJhekGbJsC81BaOjbw3oQSyjxEocO8QepVJT+zqJpmYcu3/qVYiCd++6FHmb/slfv3b3KUeNXcRpoJZxRsMThxIheFkBQFE2XkPdwJWSeMwrf5lOAma5yhrfiOsMKB2TkiokLqrev6mtCZezqqGphwR8Fmtm5RJYfH8Tdj650vyYHv1yYsrRF5IyvGMgWwZLmv/RSp8APnKwmSdRo+DIuxfw6KIU6T8S2JZV2zy6E2JU27PDTlUghi8lzaSJ4C7FtkKAj+/HykCkaAQV7+WJ2kSik/s52CBkZFSFdCt94yT88MMFC5aSadpGhJKGt++xRDRkW5V0O4lOGBbMPCItNLRcdhnOcTZAV39BJtADh5Llh9rRSuLp418aI5jMiY8wR6yU3d8nRrUFpGCsom9nDX9cee0VlVR787x1B/s6c/3vihGKo1dgEf8PP0ecDz0LdtYbPZVXH6UDrCtJRnHdYlbGWUw6k/xPdMGOTENzdLTF0G51InYPGpk79QA9bMAIH4s3p3DOCwffkt7kggkDUBeq7slfvarczghZ0CnsnezJzJ5XLa5ZCBsqA2QXsN0cZOkUvsyel9EzX9jg2SNzP7oBvnMIwn6WgrfqJTVM0pWWUlDlSBhwgsWV8EYhXPLhekj96UPhuNHczBektptnMEdyDVKAmdW0klXCzOKlRhGDT3FzROZfXjdCO7SVPN4l206OfFA80kLHLKd8/teA3tVVRg9wA8+J1q2Six6ZXVma44Eaxb6mrGRkWyBeS6/eLUiS+BeDYXSweNK79eeW4yRczn62Qhi7voqQVhcOAho1pXEZZzaZ2oAvBYZbHjWySYx0ksHWjcnnSuxZ5/T8DYPR1FJRwKWVWg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6491c68a-7f00-45e8-438e-08da4bb48893 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:13:18.6082 (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: QlJ5LqogWC6mQQMyvthkr2mnHYMJur9nhhf8QHNleZtQLenh5fzddfMPBCM5JdW/1pF32riDDvIqApr+HFbETQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6347 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds a drm bridge driver for i.MX8qm/qxp pixel combiner. The pixel combiner takes two output streams from a single display controller and manipulates the two streams to support a number of modes(bypass, pixel combine, YUV444 to YUV422, split_RGB) configured as either one screen, two screens, or virtual screens. The pixel combiner is also responsible for generating some of the control signals for the pixel link output channel. For now, the driver only supports the bypass mode. Reviewed-by: Robert Foss Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Signed-off-by: Liu Ying --- Robert, I keep your R-b tag from v5. Let me know if you want me to drop it, as v7 contains a fix for checkpatch complaints. Marcel, as the fix is trivial, I add your T-b tag. Let me know if you want me to drop it. v8->v9: * No change. v7->v8: * No change. v6->v7: * Fix 'Alignment should match open parenthesis' complaints from 'checkpatch.pl --strict'. * Add Marcel's T-b tag. v5->v6: * No change. v4->v5: * Drop the 'PC_BUF_PARA_REG' register definition. (Robert) * Add Robert's R-b tag. v3->v4: * No change. v2->v3: * No change. v1->v2: * No change. drivers/gpu/drm/bridge/Kconfig | 2 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/imx/Kconfig | 8 + drivers/gpu/drm/bridge/imx/Makefile | 1 + .../drm/bridge/imx/imx8qxp-pixel-combiner.c | 448 ++++++++++++++++++ 5 files changed, 460 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/Kconfig create mode 100644 drivers/gpu/drm/bridge/imx/Makefile create mode 100644 drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 307b135da2f6..236a1342a390 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -366,6 +366,8 @@ source "drivers/gpu/drm/bridge/adv7511/Kconfig" source "drivers/gpu/drm/bridge/cadence/Kconfig" +source "drivers/gpu/drm/bridge/imx/Kconfig" + source "drivers/gpu/drm/bridge/synopsys/Kconfig" endmenu diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index f6c0a95de549..d15c86e14243 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -35,4 +35,5 @@ obj-$(CONFIG_DRM_ITE_IT66121) += ite-it66121.o obj-y += analogix/ obj-y += cadence/ +obj-y += imx/ obj-y += synopsys/ diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig new file mode 100644 index 000000000000..f1c91b6814a5 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -0,0 +1,8 @@ +config DRM_IMX8QXP_PIXEL_COMBINER + tristate "Freescale i.MX8QM/QXP pixel combiner" + depends on OF + depends on COMMON_CLK + select DRM_KMS_HELPER + help + Choose this to enable pixel combiner found in + Freescale i.MX8qm/qxp processors. diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile new file mode 100644 index 000000000000..7d7c8d674bf0 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_DRM_IMX8QXP_PIXEL_COMBINER) += imx8qxp-pixel-combiner.o diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c new file mode 100644 index 000000000000..86ae98a211b4 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c @@ -0,0 +1,448 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define PC_CTRL_REG 0x0 +#define PC_COMBINE_ENABLE BIT(0) +#define PC_DISP_BYPASS(n) BIT(1 + 21 * (n)) +#define PC_DISP_HSYNC_POLARITY(n) BIT(2 + 11 * (n)) +#define PC_DISP_HSYNC_POLARITY_POS(n) DISP_HSYNC_POLARITY(n) +#define PC_DISP_VSYNC_POLARITY(n) BIT(3 + 11 * (n)) +#define PC_DISP_VSYNC_POLARITY_POS(n) DISP_VSYNC_POLARITY(n) +#define PC_DISP_DVALID_POLARITY(n) BIT(4 + 11 * (n)) +#define PC_DISP_DVALID_POLARITY_POS(n) DISP_DVALID_POLARITY(n) +#define PC_VSYNC_MASK_ENABLE BIT(5) +#define PC_SKIP_MODE BIT(6) +#define PC_SKIP_NUMBER_MASK GENMASK(12, 7) +#define PC_SKIP_NUMBER(n) FIELD_PREP(PC_SKIP_NUMBER_MASK, (n)) +#define PC_DISP0_PIX_DATA_FORMAT_MASK GENMASK(18, 16) +#define PC_DISP0_PIX_DATA_FORMAT(fmt) \ + FIELD_PREP(PC_DISP0_PIX_DATA_FORMAT_MASK, (fmt)) +#define PC_DISP1_PIX_DATA_FORMAT_MASK GENMASK(21, 19) +#define PC_DISP1_PIX_DATA_FORMAT(fmt) \ + FIELD_PREP(PC_DISP1_PIX_DATA_FORMAT_MASK, (fmt)) + +#define PC_SW_RESET_REG 0x20 +#define PC_SW_RESET_N BIT(0) +#define PC_DISP_SW_RESET_N(n) BIT(1 + (n)) +#define PC_FULL_RESET_N (PC_SW_RESET_N | \ + PC_DISP_SW_RESET_N(0) | \ + PC_DISP_SW_RESET_N(1)) + +#define PC_REG_SET 0x4 +#define PC_REG_CLR 0x8 + +#define DRIVER_NAME "imx8qxp-pixel-combiner" + +enum imx8qxp_pc_pix_data_format { + RGB, + YUV444, + YUV422, + SPLIT_RGB, +}; + +struct imx8qxp_pc_channel { + struct drm_bridge bridge; + struct drm_bridge *next_bridge; + struct imx8qxp_pc *pc; + unsigned int stream_id; + bool is_available; +}; + +struct imx8qxp_pc { + struct device *dev; + struct imx8qxp_pc_channel ch[2]; + struct clk *clk_apb; + void __iomem *base; +}; + +static inline u32 imx8qxp_pc_read(struct imx8qxp_pc *pc, unsigned int offset) +{ + return readl(pc->base + offset); +} + +static inline void +imx8qxp_pc_write(struct imx8qxp_pc *pc, unsigned int offset, u32 value) +{ + writel(value, pc->base + offset); +} + +static inline void +imx8qxp_pc_write_set(struct imx8qxp_pc *pc, unsigned int offset, u32 value) +{ + imx8qxp_pc_write(pc, offset + PC_REG_SET, value); +} + +static inline void +imx8qxp_pc_write_clr(struct imx8qxp_pc *pc, unsigned int offset, u32 value) +{ + imx8qxp_pc_write(pc, offset + PC_REG_CLR, value); +} + +static enum drm_mode_status +imx8qxp_pc_bridge_mode_valid(struct drm_bridge *bridge, + const struct drm_display_info *info, + const struct drm_display_mode *mode) +{ + if (mode->hdisplay > 2560) + return MODE_BAD_HVALUE; + + return MODE_OK; +} + +static int imx8qxp_pc_bridge_attach(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct imx8qxp_pc_channel *ch = bridge->driver_private; + struct imx8qxp_pc *pc = ch->pc; + + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { + DRM_DEV_ERROR(pc->dev, + "do not support creating a drm_connector\n"); + return -EINVAL; + } + + if (!bridge->encoder) { + DRM_DEV_ERROR(pc->dev, "missing encoder\n"); + return -ENODEV; + } + + return drm_bridge_attach(bridge->encoder, + ch->next_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); +} + +static void +imx8qxp_pc_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct imx8qxp_pc_channel *ch = bridge->driver_private; + struct imx8qxp_pc *pc = ch->pc; + u32 val; + int ret; + + ret = pm_runtime_get_sync(pc->dev); + if (ret < 0) + DRM_DEV_ERROR(pc->dev, + "failed to get runtime PM sync: %d\n", ret); + + ret = clk_prepare_enable(pc->clk_apb); + if (ret) + DRM_DEV_ERROR(pc->dev, "%s: failed to enable apb clock: %d\n", + __func__, ret); + + /* HSYNC to pixel link is active low. */ + imx8qxp_pc_write_clr(pc, PC_CTRL_REG, + PC_DISP_HSYNC_POLARITY(ch->stream_id)); + + /* VSYNC to pixel link is active low. */ + imx8qxp_pc_write_clr(pc, PC_CTRL_REG, + PC_DISP_VSYNC_POLARITY(ch->stream_id)); + + /* Data enable to pixel link is active high. */ + imx8qxp_pc_write_set(pc, PC_CTRL_REG, + PC_DISP_DVALID_POLARITY(ch->stream_id)); + + /* Mask the first frame output which may be incomplete. */ + imx8qxp_pc_write_set(pc, PC_CTRL_REG, PC_VSYNC_MASK_ENABLE); + + /* Only support RGB currently. */ + val = imx8qxp_pc_read(pc, PC_CTRL_REG); + if (ch->stream_id == 0) { + val &= ~PC_DISP0_PIX_DATA_FORMAT_MASK; + val |= PC_DISP0_PIX_DATA_FORMAT(RGB); + } else { + val &= ~PC_DISP1_PIX_DATA_FORMAT_MASK; + val |= PC_DISP1_PIX_DATA_FORMAT(RGB); + } + imx8qxp_pc_write(pc, PC_CTRL_REG, val); + + /* Only support bypass mode currently. */ + imx8qxp_pc_write_set(pc, PC_CTRL_REG, PC_DISP_BYPASS(ch->stream_id)); + + clk_disable_unprepare(pc->clk_apb); +} + +static void +imx8qxp_pc_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct imx8qxp_pc_channel *ch = bridge->driver_private; + struct imx8qxp_pc *pc = ch->pc; + int ret; + + ret = pm_runtime_put(pc->dev); + if (ret < 0) + DRM_DEV_ERROR(pc->dev, "failed to put runtime PM: %d\n", ret); +} + +static const u32 imx8qxp_pc_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB888_1X36_CPADLO, + MEDIA_BUS_FMT_RGB666_1X36_CPADLO, +}; + +static bool imx8qxp_pc_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx8qxp_pc_bus_output_fmts); i++) { + if (imx8qxp_pc_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx8qxp_pc_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; + + if (!imx8qxp_pc_bus_output_fmt_supported(output_fmt)) + return NULL; + + *num_input_fmts = 1; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_RGB888_1X36_CPADLO: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X30_CPADLO; + break; + case MEDIA_BUS_FMT_RGB666_1X36_CPADLO: + input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X30_CPADLO; + break; + default: + kfree(input_fmts); + input_fmts = NULL; + break; + } + + return input_fmts; +} + +static u32 * +imx8qxp_pc_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + unsigned int *num_output_fmts) +{ + *num_output_fmts = ARRAY_SIZE(imx8qxp_pc_bus_output_fmts); + return kmemdup(imx8qxp_pc_bus_output_fmts, + sizeof(imx8qxp_pc_bus_output_fmts), GFP_KERNEL); +} + +static const struct drm_bridge_funcs imx8qxp_pc_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .mode_valid = imx8qxp_pc_bridge_mode_valid, + .attach = imx8qxp_pc_bridge_attach, + .mode_set = imx8qxp_pc_bridge_mode_set, + .atomic_disable = imx8qxp_pc_bridge_atomic_disable, + .atomic_get_input_bus_fmts = + imx8qxp_pc_bridge_atomic_get_input_bus_fmts, + .atomic_get_output_bus_fmts = + imx8qxp_pc_bridge_atomic_get_output_bus_fmts, +}; + +static int imx8qxp_pc_bridge_probe(struct platform_device *pdev) +{ + struct imx8qxp_pc *pc; + struct imx8qxp_pc_channel *ch; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct device_node *child, *remote; + u32 i; + int ret; + + pc = devm_kzalloc(dev, sizeof(*pc), GFP_KERNEL); + if (!pc) + return -ENOMEM; + + pc->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(pc->base)) + return PTR_ERR(pc->base); + + pc->dev = dev; + + pc->clk_apb = devm_clk_get(dev, "apb"); + if (IS_ERR(pc->clk_apb)) { + ret = PTR_ERR(pc->clk_apb); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get apb clock: %d\n", ret); + return ret; + } + + platform_set_drvdata(pdev, pc); + pm_runtime_enable(dev); + + for_each_available_child_of_node(np, child) { + ret = of_property_read_u32(child, "reg", &i); + if (ret || i > 1) { + ret = -EINVAL; + DRM_DEV_ERROR(dev, + "invalid channel(%u) node address\n", i); + goto free_child; + } + + ch = &pc->ch[i]; + ch->pc = pc; + ch->stream_id = i; + + remote = of_graph_get_remote_node(child, 1, 0); + if (!remote) { + ret = -ENODEV; + DRM_DEV_ERROR(dev, + "channel%u failed to get port1's remote node: %d\n", + i, ret); + goto free_child; + } + + ch->next_bridge = of_drm_find_bridge(remote); + if (!ch->next_bridge) { + of_node_put(remote); + ret = -EPROBE_DEFER; + DRM_DEV_DEBUG_DRIVER(dev, + "channel%u failed to find next bridge: %d\n", + i, ret); + goto free_child; + } + + of_node_put(remote); + + ch->bridge.driver_private = ch; + ch->bridge.funcs = &imx8qxp_pc_bridge_funcs; + ch->bridge.of_node = child; + ch->is_available = true; + + drm_bridge_add(&ch->bridge); + } + + return 0; + +free_child: + of_node_put(child); + + if (i == 1 && pc->ch[0].next_bridge) + drm_bridge_remove(&pc->ch[0].bridge); + + pm_runtime_disable(dev); + return ret; +} + +static int imx8qxp_pc_bridge_remove(struct platform_device *pdev) +{ + struct imx8qxp_pc *pc = platform_get_drvdata(pdev); + struct imx8qxp_pc_channel *ch; + int i; + + for (i = 0; i < 2; i++) { + ch = &pc->ch[i]; + + if (!ch->is_available) + continue; + + drm_bridge_remove(&ch->bridge); + ch->is_available = false; + } + + pm_runtime_disable(&pdev->dev); + + return 0; +} + +static int __maybe_unused imx8qxp_pc_runtime_suspend(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct imx8qxp_pc *pc = platform_get_drvdata(pdev); + int ret; + + ret = clk_prepare_enable(pc->clk_apb); + if (ret) + DRM_DEV_ERROR(pc->dev, "%s: failed to enable apb clock: %d\n", + __func__, ret); + + /* Disable pixel combiner by full reset. */ + imx8qxp_pc_write_clr(pc, PC_SW_RESET_REG, PC_FULL_RESET_N); + + clk_disable_unprepare(pc->clk_apb); + + /* Ensure the reset takes effect. */ + usleep_range(10, 20); + + return ret; +} + +static int __maybe_unused imx8qxp_pc_runtime_resume(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct imx8qxp_pc *pc = platform_get_drvdata(pdev); + int ret; + + ret = clk_prepare_enable(pc->clk_apb); + if (ret) { + DRM_DEV_ERROR(pc->dev, "%s: failed to enable apb clock: %d\n", + __func__, ret); + return ret; + } + + /* out of reset */ + imx8qxp_pc_write_set(pc, PC_SW_RESET_REG, PC_FULL_RESET_N); + + clk_disable_unprepare(pc->clk_apb); + + return ret; +} + +static const struct dev_pm_ops imx8qxp_pc_pm_ops = { + SET_RUNTIME_PM_OPS(imx8qxp_pc_runtime_suspend, + imx8qxp_pc_runtime_resume, NULL) +}; + +static const struct of_device_id imx8qxp_pc_dt_ids[] = { + { .compatible = "fsl,imx8qm-pixel-combiner", }, + { .compatible = "fsl,imx8qxp-pixel-combiner", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qxp_pc_dt_ids); + +static struct platform_driver imx8qxp_pc_bridge_driver = { + .probe = imx8qxp_pc_bridge_probe, + .remove = imx8qxp_pc_bridge_remove, + .driver = { + .pm = &imx8qxp_pc_pm_ops, + .name = DRIVER_NAME, + .of_match_table = imx8qxp_pc_dt_ids, + }, +}; +module_platform_driver(imx8qxp_pc_bridge_driver); + +MODULE_DESCRIPTION("i.MX8QM/QXP pixel combiner bridge driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME); From patchwork Sat Jun 11 14:14:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878533 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48C5FC43334 for ; Sat, 11 Jun 2022 14:13:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234860AbiFKONw (ORCPT ); Sat, 11 Jun 2022 10:13:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234962AbiFKONd (ORCPT ); Sat, 11 Jun 2022 10:13:33 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 367BA49F20; Sat, 11 Jun 2022 07:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G5PX0WKIw5Tao5GdoDii7uOk97vngJNSfaVxLxP8USt/safhNAbq1B5CWzS+TCaZ4VDo9xU741iKEuYpRa5h44RoxW0UT/Z7o+bH9BYLFNxTfv7abyLrIRHmQbtKO7OQ0VI/DbWxcHVuA2bdBJn960fWlroRYegu8enjTl7rUbli5PCQmT8igYMhmT8Qr+cq8kWe9gXjokadv75miKp3J30ALOAQThM4/pVVf4roUfwc+axYD9weXBxkZv0L3X4K21zXlN+hXb/X09ig9voAuL8tTcUmc5Pb3Q2SBba2nMfKhRF/K6L+FODeT2+sxyHZs5DQjqra3cOJxFYdVkFFDA== 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=XB4N3h4KDQDH7/OD+MMKIh4S99pDER2aUMfpvXukJY4=; b=oHA8VOPu3jqLuYdakzKuQ/BxtnDhhWKg43mS8GQ85Y1nNjeVZGALXONMPblPFfoAUymxhO/8VptfA5MkAq3xTXO9XEcKDdFXSJ9cUdyVVpSIUPckRW+FLfqb/CQ3a1JNpFQ2oK7F2KawxunfWjBQO9z1tDsVoM4uUD6u0lSXy/9duCHBCcry1gwPT1rOlldw1Im959n2Zm4tQRbYAPqsU4oQngIau8zknWIBLrAZuWXcJWmqJLxkTHbsBcBh7yxf6KPhM5y4RgxUcULCSy+NwQ8orxrKYsA5yfHzTR5Zy37TIAd0N1pgzIaGjZI/e1NuyArYnRHa9h8rHeHeSbAXvw== 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=XB4N3h4KDQDH7/OD+MMKIh4S99pDER2aUMfpvXukJY4=; b=kjILzf5ABhtfygw12niJz+KDxpmccAPRRCLTcsnO+P7M+UpK3X/jG0R7HpO6yLj/I2175zYo6H+qfGDNahvv9z0XnLOC3uB9IQK+JTbA+0cD76hyVN3bbUgRhxuPZP9VnxfOHjcB89LGtzifq9a3UZFbOBi5kh5JcPufEN9aShY= 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 DB8PR04MB6347.eurprd04.prod.outlook.com (2603:10a6:10:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Sat, 11 Jun 2022 14:13:24 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:13:24 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com Subject: [PATCH v9 05/14] dt-bindings: display: bridge: Add i.MX8qm/qxp display pixel link binding Date: Sat, 11 Jun 2022 22:14:12 +0800 Message-Id: <20220611141421.718743-6-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f60def6-147a-40e3-07ae-08da4bb48c49 X-MS-TrafficTypeDiagnostic: DB8PR04MB6347:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lHG/lZWOI+2k2nWJWUcMn5pc2+sY4EtdU8Q+r2a8cx0lyWoN3KfXbpv2HBWvqM6jGvMDMkht5Khdg/fahH/zZlCCLtWSP4p/ugx4sVDEH3GwExeocy2X8FC/tCKw7WWmFZL7Qyie7NG8yc8p9tk43hz4555TnFo7joZ/PMuxrkULZz4/UO+ATpJrAod+Uin58mMnoXlE6Lljhw2HpxoVJvLx/Xx4Qy+WtAqvAo6Tqq7PoZLnLpv+APEGZBHxhpSwZAPMjoQoUqmsBye6Ja6k3aewKOMwvJBVnND5hybskYrfJBzjPFjAjj+GAPE/Id4Cd5yYdPVBf9eRAT/DkpANi/WWY5uFGREy7lcwdkriXx//nkMYETX7c1ouAwyKt7PddK0vKO+vOmTYq2DhyQ0zKxPvTKd/70mgN9Vaczj8EW9BGfgdMF2zjxeRAuyfOgJoXGPzlyJhnIK4RrftwpuRuRimXLF1E8pc7H/Gdab+PQZe9UvxVwtAVdZ07oLPjuURQjqmWjr5g8+TbAOdNtyAXnTpyDhHJVYPHCWO4i7RnagDQIGFKOJ1ssyMPQ6LkiiHlLlJuPM9i0G+zvkEW4rdP1+mX4GywRgn6lZD2AcyCKRhYipSimQfwCdmyqFKYnv+laSJ3jXPoY3fCvFP5gO+jxa2pZjlBlvoe0U3fmll/S7dJxtRQVuTKNbqeN9BVfuPR3QXo5msO4ugFpAOTnOaQxlMRaQm9S68Qafm3LQNN5vZ2+viAQNOPTrwYC9vmqjFg8pL1X0owuI4F6pDzLeico9a+jlCfx6ELLhjR10FQ4QFdZrzEFe376yFf2sr2OeDNqSsVPv+RnfFeLHwPmZEnA== 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:(13230016)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(1076003)(4326008)(8676002)(86362001)(316002)(186003)(8936002)(2616005)(7416002)(36756003)(83380400001)(52116002)(38350700002)(38100700002)(6512007)(26005)(966005)(6506007)(6666004)(508600001)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jCB5SFbJSsqzQ5WgAQR8JpYHhRzR9iukt+XM0rprd7AjaY037rnmDqXA2TJquXcYps+gYAr7E5p9264hL8ZQl8X4wDm3aH7Z4+EDKSg9DJREv8zJTCeDuzN52YAmIkzTHtAuonPp8HoIVMgKONAJAwi0mnUfYJRMl6Gg/AZYUMfyO7GuUrbm61VkQjzTK4Ux7P9OxsZxvT62CqH7ur47KnSF/YRLjj2yqeG75xqXF1EHWZCpCsfRbxsEBCS77OiA21eEn9+KDJmuOceXCTCqFeT2fgHZkjwnxpsIub4H8ZVU/ekZONc/sBYkToA0WcVk/avomfsrD6e6M0vaCs1jbFvJ98+7iN4hbsf0K1n8M/ntuL+VXkSDGynJTMMUjHGjdWO3pfP7Le/4bvahIdAWwqjLv7Tmcp9/OVkP6JLT4DiC/Yyl2HdYuCl6GlsjrJ6JXKQDuW73NJGmUx++VOF2nFXAECWyRaWe/A8lTWoScRnR7XbmzWlzApuD2nuxgJIGuMsPGiTaHMYmOTtvNRs5h8ITWOzz0h9KYN9ucD3PcSJkat6aBVxfNTTz9mytgxvp5En5HE+E974231xKi5/cLkpAkIDXyfLdou9evFZpWam5nh6+J8SYi+iAD5NboUDpqy9eIG+YLxXVc6p7YhbUrNjJAPtwNbpvQF7wfASQMkffkpI0L0hvYTcPVt0PyCfh5uVSacnrF6F1FksnJfA+XjOY6edVJRT0h/ivdvJOrp66WLg7/zQe3jaTJbLVXDMemOT0t9pgDi4zre55BCi0+dHvCUOP9+tNeUwhinLOvs3T8a2RMX3gHpXiK5vCWjebDGxGE460zgwaYhfUTKwvkXOoKXNDGQ72K8fKsZC1uIbOusImkfZMZHj8sj0HPRUVHVE0+Ail/zzCRYG789zsYV11dnA5762ObJY+/suziF1qiYHWCC+vHxq0Plie49+Zpu7m6sPgpA56bILMUcVX1H9xNOjINS1RAG4po9NSRWULrNmHUqnGLYFrPjDWpJFhaBFiNkh/4xMYE/CNbH/XGtE58sW4531TvSWyKJrJXOXjh+iWRDEH15SW9KJ8/PmC11r74cwCKA1KKyg0fDRGwaRaLwVaEeuI6r+hDy7voZSk7mof1CL9esFfVOK5TauAxXpMqd5ANJ6hr2PsHNDBlsVbC7c2vZ8hAs/5n9vx7F85XVI2V4mEixGUU0vHG6nUa3TNkMUJu9d2rE4GqnO4P+DITVBAjtiIySrB0u+KPNP+9i9ec+/VV8IJ4MWB2ocmbc2iiP8cOC7PWz1Si5ETZez88TjkTiubeKmKdjyvz5sLbuNn0zg9daEOHh+k8BpxudflQ7ZExHSYL0BqgUanIwpqq7syudWaNmLPjhqd3nHI8qoHb0LkuRlIAZk83cwdOxDEtMt+0FPZT94XK0cjWxbU8UjnNQ40pgN5Tq1iuCkgOfNS8EGTKpP4emqmzhbIsxvR+knzG/7006NV+ljvpL77i1cnn5+azuB5MisWujN0Mhhkf+I6TzqUUTRumUEikyRo3cyEDOS3k3/4reprZ0ODvpoxDz0APDE5scGW4sKQvX1jBcaHn30OqAvaMzYIPN8oOvIRghn9avqKAiC6EfgLurFrI4Y9IbWI6xOE9A3fr2PVdHcOWUk7hVwpCz6g0r9J8TgmuAnMzOxk02MwLLkfK/Pr3zjAbABf0hUVtTx3+tHn07IaIOdzLDzQufcATjDuSZNwnjxjNQXV2+4p4A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f60def6-147a-40e3-07ae-08da4bb48c49 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:13:24.7545 (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: nZcIHNtK4TtygxfYesi8oyHmSRX88jci3ir+lOK7CxROYb7uCJvpI2iCy3QgiY/I69GHRbGK7wabsJmPN8syxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6347 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds bindings for i.MX8qm/qxp display pixel link. Signed-off-by: Liu Ying --- v8->v9: * Add 'fsl,dc-id' and 'fsl,dc-stream-id' properties. (Laurent) * Drop Rob's R-b tag. v7->v8: * No change. v6->v7: * No change. v5->v6: * No change. v4->v5: * No change. v3->v4: * No change. v2->v3: * Add Rob's R-b tag. v1->v2: * Use graph schema. (Laurent) * Require all four pixel link output ports. (Laurent) * Mention pixel link is accessed via SCU firmware. (Rob) .../bridge/fsl,imx8qxp-pixel-link.yaml | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-link.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-link.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-link.yaml new file mode 100644 index 000000000000..38ecc7926fad --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-link.yaml @@ -0,0 +1,144 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/fsl,imx8qxp-pixel-link.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qm/qxp Display Pixel Link + +maintainers: + - Liu Ying + +description: | + The Freescale i.MX8qm/qxp Display Pixel Link(DPL) forms a standard + asynchronous linkage between pixel sources(display controller or + camera module) and pixel consumers(imaging or displays). + It consists of two distinct functions, a pixel transfer function and a + control interface. Multiple pixel channels can exist per one control channel. + This binding documentation is only for pixel links whose pixel sources are + display controllers. + + The i.MX8qm/qxp Display Pixel Link is accessed via System Controller Unit(SCU) + firmware. + +properties: + compatible: + enum: + - fsl,imx8qm-dc-pixel-link + - fsl,imx8qxp-dc-pixel-link + + fsl,dc-id: + $ref: /schemas/types.yaml#/definitions/uint8 + description: | + u8 value representing the display controller index that the pixel link + connects to. + + fsl,dc-stream-id: + $ref: /schemas/types.yaml#/definitions/uint8 + description: | + u8 value representing the display controller stream index that the pixel + link connects to. + enum: [0, 1] + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: The pixel link input port node from upstream video source. + + patternProperties: + "^port@[1-4]$": + $ref: /schemas/graph.yaml#/properties/port + description: The pixel link output port node to downstream bridge. + + required: + - port@0 + - port@1 + - port@2 + - port@3 + - port@4 + +allOf: + - if: + properties: + compatible: + contains: + const: fsl,imx8qxp-dc-pixel-link + then: + properties: + fsl,dc-id: + const: 0 + + - if: + properties: + compatible: + contains: + const: fsl,imx8qm-dc-pixel-link + then: + properties: + fsl,dc-id: + enum: [0, 1] + +required: + - compatible + - fsl,dc-id + - fsl,dc-stream-id + - ports + +additionalProperties: false + +examples: + - | + dc0-pixel-link0 { + compatible = "fsl,imx8qxp-dc-pixel-link"; + fsl,dc-id = /bits/ 8 <0>; + fsl,dc-stream-id = /bits/ 8 <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + /* from dc0 pixel combiner channel0 */ + port@0 { + reg = <0>; + + dc0_pixel_link0_dc0_pixel_combiner_ch0: endpoint { + remote-endpoint = <&dc0_pixel_combiner_ch0_dc0_pixel_link0>; + }; + }; + + /* to PXL2DPIs in MIPI/LVDS combo subsystems */ + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + dc0_pixel_link0_mipi_lvds_0_pxl2dpi: endpoint@0 { + reg = <0>; + remote-endpoint = <&mipi_lvds_0_pxl2dpi_dc0_pixel_link0>; + }; + + dc0_pixel_link0_mipi_lvds_1_pxl2dpi: endpoint@1 { + reg = <1>; + remote-endpoint = <&mipi_lvds_1_pxl2dpi_dc0_pixel_link0>; + }; + }; + + /* unused */ + port@2 { + reg = <2>; + }; + + /* unused */ + port@3 { + reg = <3>; + }; + + /* to imaging subsystem */ + port@4 { + reg = <4>; + }; + }; + }; From patchwork Sat Jun 11 14:14:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878539 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60E51CCA47A for ; Sat, 11 Jun 2022 14:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233061AbiFKOPX (ORCPT ); Sat, 11 Jun 2022 10:15:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235156AbiFKONh (ORCPT ); Sat, 11 Jun 2022 10:13:37 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0F4C64D1E; Sat, 11 Jun 2022 07:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OzESpkEw14E/Y24icc5OgrjmFsT90L9imK9zF8Ve114I1/47p7mSuAa5s4v6ND/TI7bxrtObWOq9mUl9AwB5tY+WpWhRPJXbBveRUi3PHqlZ27Ze1810e63xwH8IzNc+ZKudgBS/f4bAWQo4xQ2u56Kh9X39LzAG1PeUWZfsfGtvD4AIVtmk7ljqB/ba+9tXgHSRg1faebckUl32EpqE7pblkZT9OCN1lYGdJ5mOQmlGdnh5YENvsJ8w5FRQ/MWZE9PNoR2WfdETTZDhGqJr5NU5+FuvrIJdLqLO7BsSU3fonK0MtlhZQt/7mfe3rIHfPQirNzR4aj+M8pIMyZzhbA== 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=I3mXuJUoNJDuf+vqgjpQNqYnj0IY5r4aDzEpFJRhQ1g=; b=UD46Yo2xsyA1UJuomyr8sO73wq29lOkgiRVgyO0yT+ic+RVAbKnv3MbzlHc4dOUsnyUlWnGtWlNZfOS4876ExqlGtBNwBdgyRnKk11gNqTb3FEvy+puBSWgrFe+gsxfuK4lFVT9Quf6ndO3HwNOjYjDrnKo7AZ1tymbpfRC1whUIXVhuTWCwA2AEouTe0Nm2tT4p9c1wTgGPURJGlUuoxag8iKC/f832mH0IHgk1dGTIk+btZmFVq8j2dPWGNhRVMZkMaiIvNU2mLEMlapnZC2OXTLnAp6J2MCZ53MQFeNI996aZxjKSILCsE14zIbDiyI8Jx1o2MeH3b5SIB3Y12Q== 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=I3mXuJUoNJDuf+vqgjpQNqYnj0IY5r4aDzEpFJRhQ1g=; b=P48KphX4hq9KOy+XWkZSktvSGtNTLJlnOA6qy7WAWKhk5Ecp+qAtuA4l00YVbPiSdOCRvJunzh5zIR8g3VsgYmvTBo5IwXZMKmffScSNxIIxsx0JxgLk7/W/umJ1Hz9g9CgdXbLSOrnRviVWhD9FULvj6tMhw+ysY0faAEM6lGo= 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 DB8PR04MB6347.eurprd04.prod.outlook.com (2603:10a6:10:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Sat, 11 Jun 2022 14:13:31 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:13:30 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com Subject: [PATCH v9 06/14] drm/bridge: imx: Add i.MX8qm/qxp display pixel link support Date: Sat, 11 Jun 2022 22:14:13 +0800 Message-Id: <20220611141421.718743-7-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 94bd883d-51fc-4e48-7fc1-08da4bb48ff0 X-MS-TrafficTypeDiagnostic: DB8PR04MB6347:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: umnLMEKBOq4ccRX529dG3vbOl+EE5GDsFdIV1HIRRAjlma5gbtTnQTojCXwp7jT64twLt8GUGj6AUKXjs0TWj5HtkNkBYwOf2H7hIEV4NkTG2+ynLR6GIYf0uOeM4JRoK7HxHW86Bl3pOlAmF/JmOufg9YXiFLz7XSteSqKGQzeDc706Fb7OTEtDSLoOmd6mN7KaB0KBTzjHDp+qGM9+Xpy1V6/JMFcf/5FKNp3vKLvwQOFzO6ZWxkn6imXkkqQGZPigVDa03ld1PDSjZGIiBLthDLANyMlEsUn1Fhr6ZU84p41Pk0fDSQnsvIqihWdPFVbYctSvG+rsBqzEwW9OShAFOmWREpZCqq17UDLlZBBiIjyZv+DFr7z8ttXNdmmaGwZhGi4mMG+RtwWQoar3/63yt06wBqF8syMyr3EKG99DDy+T1U3x+2fq3MiTCeX7pv9RiREnA54tXTxomIA/7PCBpORQtlx8OAfPrTQLZDQTgLkB/m59f0enoRo+85eKyykPN7Z7j+Mr5ZFaST+/oEE9HWD+SYQRPGaWsWLhl1ihwHLy1OdRAeNbjilZR6TXpwJ2yfkuagWKdaEOWhSHHc6i45bLfHuvkaUlw17SdJS0kpBY+UOawGIyriuLSng8XQLgmPDlvM2G/O99H5Pf0zXqM456c9bNchmwO9i17Mwezc+0PuAmIU7ZhFuZQvZuD4zFP3wSBFyqOkFNpSOs1A== 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:(13230016)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(1076003)(4326008)(8676002)(86362001)(316002)(186003)(8936002)(2616005)(7416002)(30864003)(36756003)(52116002)(38350700002)(38100700002)(6512007)(26005)(6506007)(6666004)(508600001)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ATyCvycCnuSKvh3K6jtk/gKUIJJX2rhUokJ8ggueoeogYjoKZB8apiHJxIMIvut/AcCf3IuxG99t1FtLZki/Vgme1JC51L6cmqYjKL28R0ERu0H0hRt/x9zNIIFXq7blT/b/YWhQtcMGH/W30ZYVYU3+fvos2zcOoo7plRPIS2CTuzcVA41MCNk2ifYO1fc7J+ldD4Hjp+TZ7a1GId2cqVxVNpg+IB9YnJ8FcqwEe9yeTAUsJVKj4VVajr017TXXcS8puOB1J9WIcITHgyGVc61jMQwkQMge8gBYK7sT18sMwp5KnNE1VyvG9Hj950Rbd3nN/KZviXIUDQqNvb9FYTh4B7WCGtdYZL9pXu9URRDK8HKR0hPJbQieUY8L0GFMaJcwUzXqhZcf31dQ7DQEbgWYjd8hP1I7Lma9RopVCK92iyStF+wjGUM0gi7HZt+/IDdNX+QlAvaOiwjRZLaF3NE6Dc50pD78HNUQHqhMRWeuLXfPxKcXCbLZccSTDsS8pL+9yZvCVHHcMHZo9mql23QVXRcFKBcB5gAnDMuWznRcqiLkNTXx5ZkBdJ+/G7XiUDZIhg4a2MNT+PYGdRfrpG+raF3l3Kc8CI0JqT8vY+Qy2bm0mEQANeBH6PyTz2IWOClDuiUtqxZSRtWuKJCrcnD4Ev6R2guCRO7IvLfe/zQIWQ66kONqtKqSBYUgwqYUCqJWsm5bgNqnRRG52bbEZv4L5sB6gYCy6CByAan39ln/FNwc/fzRAiZUjKH3ysYIL5NnTHbJfnu1Jjce7iGpdpaMpn1Z+FWnuNv4fLQy9+HU7cqDhJhYWVTDsIyqjE9VBeKGNiywIOQNy1NpTXeHO6rS+QjghU8m+8963tsFy9kjxeNwnjV27H0ZlL+bBB7BszDYuQxg8pS+6hkFbDE9xX99hb+JoX0qgKeYY1wToCrHbgPMZPmT3DJCz22GMyifKbEJ/Fzs5txBOQCasCvAjDOwQDXv22rMDsVhA03K60rJCMn3CoMS9o09aNU4Hr0MBp+OeSkP3WAv/SiVXePj0Ke5KSHN1nVrS7o/ACcHHoisEVdqKr4cxjZSmppoaamN7TZ+KOPzt4wW6+bryiDzjAEXhzTjFpIf3KuappwWI+xCFkWuTf5vF8VYNrWStg+n6OSpNXWhC7MHfh413+F0TCfxOf/N5v7ULnQzUHZO81dSCDnfQPccKnAfgalOkCWmTMqzVRS15itIfWIabB9m1Xbr53kIjfrLHOPf70qZvozv/G1Gz1KHl4yCQ2e2dxooHQa9GUFr+58rZps2pPGYNsajwYJEmzknuqzZSoHm+7YEU2+rqIzIulnjm8B3JIIdQCWqCf1DSD0roorz2HK2ucT4JJnXQFvcBvxbOk+fyReY+FWYchAxbk8tksxASNp6vK5tzP6tfKERMMU7zSEMa6X/zYiEhr41KfNz7HKM3MQMGEu29Q02mRhYUkonpTHM/q0g3Wt2W7ACfBAwseQXnQlO6kVK252AECQtBCvTrwtMQ+q8Q7CIUAQ6tfNIAHIHuZCpE1pHQsXu/IW6K9+JUWTDr/EE9Rz7ECXbD8Pjx0RHHSQQJhCByuot2i1ezUPhYVfXaOWSyxWajEkzljXoZH1p4jR+JLfPK7eaF8nggohwmW0drm2UvB9DayakQ2duWEMX7xCJhYRrklsQDFLpDpnUDGeDDW7EzYbB79OeXCqW/UDcadPmEWsWMc9U9YijzlVOaxXGMnFVSFBgdAcbHg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94bd883d-51fc-4e48-7fc1-08da4bb48ff0 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:13:30.8864 (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: CZVo40x/Pmn9kaKr4/Xs4bAXvVm3CAjcJEdGD0vCj2iJf4xiWJQqkPghkHneH16gwh8lKurTqaKlfKPS7N0qpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6347 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds a drm bridge driver for i.MX8qm/qxp display pixel link. The pixel link forms a standard asynchronous linkage between pixel sources(display controller or camera module) and pixel consumers(imaging or displays). It consists of two distinct functions, a pixel transfer function and a control interface. Reviewed-by: Robert Foss Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Signed-off-by: Liu Ying --- Robert, I keep your R-b tag from v5. Let me know if you want me to drop it, as v7 contains a fix for checkpatch complaints and change in v9 is kinda trivial. Marcel, as the v7 fix and v9 change are kinda trivial, I add your T-b tag. Let me know if you want me to drop it. v8->v9: * Depend on IMX_SCU. (Laurent) * Get DC index and DC stream index from 'fsl,dc-id' and 'fsl,dc-stream-id' properties instead of OF alias. (Laurent) v7->v8: * No change. v6->v7: * Fix 'Alignment should match open parenthesis' complaints from 'checkpatch.pl --strict'. * Add Marcel's T-b tag. v5->v6: * No change. v4->v5: * Make a comment occupy a line. (Robert) * Add Robert's R-b tag. v3->v4: * No change. v2->v3: * Drop two macros which help define functions and define them directly. * Properly disable all pixel link controls to POR value by calling imx8qxp_pixel_link_disable_all_controls() from imx8qxp_pixel_link_bridge_probe(). v1->v2: * Rewrite the function to find the next bridge by properly using OF APIs and dropping unnecessary DT validation. (Rob) drivers/gpu/drm/bridge/imx/Kconfig | 9 + drivers/gpu/drm/bridge/imx/Makefile | 1 + .../gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 429 ++++++++++++++++++ 3 files changed, 439 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index f1c91b6814a5..9f6ec601af37 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -6,3 +6,12 @@ config DRM_IMX8QXP_PIXEL_COMBINER help Choose this to enable pixel combiner found in Freescale i.MX8qm/qxp processors. + +config DRM_IMX8QXP_PIXEL_LINK + tristate "Freescale i.MX8QM/QXP display pixel link" + depends on OF + depends on IMX_SCU + select DRM_KMS_HELPER + help + Choose this to enable display pixel link found in + Freescale i.MX8qm/qxp processors. diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile index 7d7c8d674bf0..c15469fb5789 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -1 +1,2 @@ obj-$(CONFIG_DRM_IMX8QXP_PIXEL_COMBINER) += imx8qxp-pixel-combiner.o +obj-$(CONFIG_DRM_IMX8QXP_PIXEL_LINK) += imx8qxp-pixel-link.o diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c new file mode 100644 index 000000000000..305c833f11ee --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -0,0 +1,429 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020,2022 NXP + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define DRIVER_NAME "imx8qxp-display-pixel-link" +#define PL_MAX_MST_ADDR 3 +#define PL_MAX_NEXT_BRIDGES 2 + +struct imx8qxp_pixel_link { + struct drm_bridge bridge; + struct drm_bridge *next_bridge; + struct device *dev; + struct imx_sc_ipc *ipc_handle; + u8 stream_id; + u8 dc_id; + u32 sink_rsc; + u32 mst_addr; + u8 mst_addr_ctrl; + u8 mst_en_ctrl; + u8 mst_vld_ctrl; + u8 sync_ctrl; +}; + +static void imx8qxp_pixel_link_enable_mst_en(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->mst_en_ctrl, true); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to enable DC%u stream%u pixel link mst_en: %d\n", + pl->dc_id, pl->stream_id, ret); +} + +static void imx8qxp_pixel_link_enable_mst_vld(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->mst_vld_ctrl, true); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to enable DC%u stream%u pixel link mst_vld: %d\n", + pl->dc_id, pl->stream_id, ret); +} + +static void imx8qxp_pixel_link_enable_sync(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->sync_ctrl, true); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to enable DC%u stream%u pixel link sync: %d\n", + pl->dc_id, pl->stream_id, ret); +} + +static int imx8qxp_pixel_link_disable_mst_en(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->mst_en_ctrl, false); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to disable DC%u stream%u pixel link mst_en: %d\n", + pl->dc_id, pl->stream_id, ret); + + return ret; +} + +static int imx8qxp_pixel_link_disable_mst_vld(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->mst_vld_ctrl, false); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to disable DC%u stream%u pixel link mst_vld: %d\n", + pl->dc_id, pl->stream_id, ret); + + return ret; +} + +static int imx8qxp_pixel_link_disable_sync(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->sync_ctrl, false); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to disable DC%u stream%u pixel link sync: %d\n", + pl->dc_id, pl->stream_id, ret); + + return ret; +} + +static void imx8qxp_pixel_link_set_mst_addr(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, + pl->sink_rsc, pl->mst_addr_ctrl, + pl->mst_addr); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to set DC%u stream%u pixel link mst addr(%u): %d\n", + pl->dc_id, pl->stream_id, pl->mst_addr, ret); +} + +static int imx8qxp_pixel_link_bridge_attach(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct imx8qxp_pixel_link *pl = bridge->driver_private; + + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { + DRM_DEV_ERROR(pl->dev, + "do not support creating a drm_connector\n"); + return -EINVAL; + } + + if (!bridge->encoder) { + DRM_DEV_ERROR(pl->dev, "missing encoder\n"); + return -ENODEV; + } + + return drm_bridge_attach(bridge->encoder, + pl->next_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); +} + +static void +imx8qxp_pixel_link_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct imx8qxp_pixel_link *pl = bridge->driver_private; + + imx8qxp_pixel_link_set_mst_addr(pl); +} + +static void +imx8qxp_pixel_link_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct imx8qxp_pixel_link *pl = bridge->driver_private; + + imx8qxp_pixel_link_enable_mst_en(pl); + imx8qxp_pixel_link_enable_mst_vld(pl); + imx8qxp_pixel_link_enable_sync(pl); +} + +static void +imx8qxp_pixel_link_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct imx8qxp_pixel_link *pl = bridge->driver_private; + + imx8qxp_pixel_link_disable_mst_en(pl); + imx8qxp_pixel_link_disable_mst_vld(pl); + imx8qxp_pixel_link_disable_sync(pl); +} + +static const u32 imx8qxp_pixel_link_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB888_1X36_CPADLO, + MEDIA_BUS_FMT_RGB666_1X36_CPADLO, +}; + +static bool imx8qxp_pixel_link_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx8qxp_pixel_link_bus_output_fmts); i++) { + if (imx8qxp_pixel_link_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx8qxp_pixel_link_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; + + if (!imx8qxp_pixel_link_bus_output_fmt_supported(output_fmt)) + return NULL; + + *num_input_fmts = 1; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + input_fmts[0] = output_fmt; + + return input_fmts; +} + +static u32 * +imx8qxp_pixel_link_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + unsigned int *num_output_fmts) +{ + *num_output_fmts = ARRAY_SIZE(imx8qxp_pixel_link_bus_output_fmts); + return kmemdup(imx8qxp_pixel_link_bus_output_fmts, + sizeof(imx8qxp_pixel_link_bus_output_fmts), GFP_KERNEL); +} + +static const struct drm_bridge_funcs imx8qxp_pixel_link_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .attach = imx8qxp_pixel_link_bridge_attach, + .mode_set = imx8qxp_pixel_link_bridge_mode_set, + .atomic_enable = imx8qxp_pixel_link_bridge_atomic_enable, + .atomic_disable = imx8qxp_pixel_link_bridge_atomic_disable, + .atomic_get_input_bus_fmts = + imx8qxp_pixel_link_bridge_atomic_get_input_bus_fmts, + .atomic_get_output_bus_fmts = + imx8qxp_pixel_link_bridge_atomic_get_output_bus_fmts, +}; + +static int imx8qxp_pixel_link_disable_all_controls(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx8qxp_pixel_link_disable_mst_en(pl); + if (ret) + return ret; + + ret = imx8qxp_pixel_link_disable_mst_vld(pl); + if (ret) + return ret; + + return imx8qxp_pixel_link_disable_sync(pl); +} + +static struct drm_bridge * +imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pixel_link *pl) +{ + struct device_node *np = pl->dev->of_node; + struct device_node *port, *remote; + struct drm_bridge *next_bridge[PL_MAX_NEXT_BRIDGES]; + u32 port_id; + bool found_port = false; + int reg, ep_cnt = 0; + /* select the first next bridge by default */ + int bridge_sel = 0; + + for (port_id = 1; port_id <= PL_MAX_MST_ADDR + 1; port_id++) { + port = of_graph_get_port_by_id(np, port_id); + if (!port) + continue; + + if (of_device_is_available(port)) { + found_port = true; + of_node_put(port); + break; + } + + of_node_put(port); + } + + if (!found_port) { + DRM_DEV_ERROR(pl->dev, "no available output port\n"); + return ERR_PTR(-ENODEV); + } + + for (reg = 0; reg < PL_MAX_NEXT_BRIDGES; reg++) { + remote = of_graph_get_remote_node(np, port_id, reg); + if (!remote) + continue; + + if (!of_device_is_available(remote->parent)) { + DRM_DEV_DEBUG(pl->dev, + "port%u endpoint%u remote parent is not available\n", + port_id, reg); + of_node_put(remote); + continue; + } + + next_bridge[ep_cnt] = of_drm_find_bridge(remote); + if (!next_bridge[ep_cnt]) { + of_node_put(remote); + return ERR_PTR(-EPROBE_DEFER); + } + + /* specially select the next bridge with companion PXL2DPI */ + if (of_find_property(remote, "fsl,companion-pxl2dpi", NULL)) + bridge_sel = ep_cnt; + + ep_cnt++; + + of_node_put(remote); + } + + pl->mst_addr = port_id - 1; + + return next_bridge[bridge_sel]; +} + +static int imx8qxp_pixel_link_bridge_probe(struct platform_device *pdev) +{ + struct imx8qxp_pixel_link *pl; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + int ret; + + pl = devm_kzalloc(dev, sizeof(*pl), GFP_KERNEL); + if (!pl) + return -ENOMEM; + + ret = imx_scu_get_handle(&pl->ipc_handle); + if (ret) { + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get SCU ipc handle: %d\n", + ret); + return ret; + } + + ret = of_property_read_u8(np, "fsl,dc-id", &pl->dc_id); + if (ret) { + DRM_DEV_ERROR(dev, "failed to get DC index: %d\n", ret); + return ret; + } + + ret = of_property_read_u8(np, "fsl,dc-stream-id", &pl->stream_id); + if (ret) { + DRM_DEV_ERROR(dev, "failed to get DC stream index: %d\n", ret); + return ret; + } + + pl->dev = dev; + + pl->sink_rsc = pl->dc_id ? IMX_SC_R_DC_1 : IMX_SC_R_DC_0; + + if (pl->stream_id == 0) { + pl->mst_addr_ctrl = IMX_SC_C_PXL_LINK_MST1_ADDR; + pl->mst_en_ctrl = IMX_SC_C_PXL_LINK_MST1_ENB; + pl->mst_vld_ctrl = IMX_SC_C_PXL_LINK_MST1_VLD; + pl->sync_ctrl = IMX_SC_C_SYNC_CTRL0; + } else { + pl->mst_addr_ctrl = IMX_SC_C_PXL_LINK_MST2_ADDR; + pl->mst_en_ctrl = IMX_SC_C_PXL_LINK_MST2_ENB; + pl->mst_vld_ctrl = IMX_SC_C_PXL_LINK_MST2_VLD; + pl->sync_ctrl = IMX_SC_C_SYNC_CTRL1; + } + + /* disable all controls to POR default */ + ret = imx8qxp_pixel_link_disable_all_controls(pl); + if (ret) + return ret; + + pl->next_bridge = imx8qxp_pixel_link_find_next_bridge(pl); + if (IS_ERR(pl->next_bridge)) { + ret = PTR_ERR(pl->next_bridge); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to find next bridge: %d\n", + ret); + return ret; + } + + platform_set_drvdata(pdev, pl); + + pl->bridge.driver_private = pl; + pl->bridge.funcs = &imx8qxp_pixel_link_bridge_funcs; + pl->bridge.of_node = np; + + drm_bridge_add(&pl->bridge); + + return ret; +} + +static int imx8qxp_pixel_link_bridge_remove(struct platform_device *pdev) +{ + struct imx8qxp_pixel_link *pl = platform_get_drvdata(pdev); + + drm_bridge_remove(&pl->bridge); + + return 0; +} + +static const struct of_device_id imx8qxp_pixel_link_dt_ids[] = { + { .compatible = "fsl,imx8qm-dc-pixel-link", }, + { .compatible = "fsl,imx8qxp-dc-pixel-link", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qxp_pixel_link_dt_ids); + +static struct platform_driver imx8qxp_pixel_link_bridge_driver = { + .probe = imx8qxp_pixel_link_bridge_probe, + .remove = imx8qxp_pixel_link_bridge_remove, + .driver = { + .of_match_table = imx8qxp_pixel_link_dt_ids, + .name = DRIVER_NAME, + }, +}; +module_platform_driver(imx8qxp_pixel_link_bridge_driver); + +MODULE_DESCRIPTION("i.MX8QXP/QM display pixel link bridge driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME); From patchwork Sat Jun 11 14:14:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878532 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A5C1CCA480 for ; Sat, 11 Jun 2022 14:13:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235272AbiFKONx (ORCPT ); Sat, 11 Jun 2022 10:13:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235389AbiFKONm (ORCPT ); Sat, 11 Jun 2022 10:13:42 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70050.outbound.protection.outlook.com [40.107.7.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D3094754D; Sat, 11 Jun 2022 07:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hyId5QxWH0y12LNXBVirka+pGFiWgshoXayu7Gy7tQ+i2trkZsIjDTjbmEDeoHwWoCPWFTqHVCB3UNuRblVgNvw77AuiS7HunIx3NDS5udqQnL2N77pzbb/z8stA68iL3pTSlmxPsjeeJpeZNlPhMraq8s6G91lPGCdGWzHs1N0Calmcnbwd/BaLWAeoqN2rTFlj099r18x+6RbPnaRVwgmFKi8p+n/0D3/BRW1KyK+N+H/zSxEpn7OdZlH+7es6T11b7J5bVmyfH+s0Hi/5h+xX9YGABejvYi48fjVQD+2kW4f47MdtG3ySvud3yJjeFWhRIriuaTiuHwR8arYWDw== 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=g/0pOCAE6KiSH8FeMTDOJZD4jYaFoaD2kRh+MtNrlaA=; b=GFpvMLhUY+FqPHdPa14kCqgdEO80G/pFqf2l8kbn5MfjfHD81iimhRCYWPoKMrBTdyCcTIDfQQPl2RbbbaQD1O+eo9bp2PiHH+nP03ec5xoZM4fl/eSopEl4fI6LiNuk/f2JYBLBE+2ed4vUdXXuk4VYudabwnG/G221Y7ur+Xx85fu7Q08NDkXM5YJhPb1da4AhZJ3XzoCXo9xb1xPWRQlXbH8UPR7PYvbjStKmGI1cEuqFW7JY6cw0gsCEi/jRaLzHrdvzXVwT3Bk1jdBOtEFdE/19z3ogUJD9ylu6Xgi+A2OdwuZn7bo26PQX+v/5olHxA7qP/tyWRyP52mZfWQ== 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=g/0pOCAE6KiSH8FeMTDOJZD4jYaFoaD2kRh+MtNrlaA=; b=BjjKy4TV6APTwtOWYFKhH+0cVS7KIkAy2So/saGPBFyC7cDRX4lFc52In3+5E+IlHfEGodNSBN7+LvMaWVMBOFOMclzbUCMkPIPl2P4Eq+GXvCM02Go/dUwEM0aaHBtqOmbAghtW8uZ7E3qUEY8ggJFgGHH9lX7A6m5bi3ShvCo= 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 DB8PR04MB6347.eurprd04.prod.outlook.com (2603:10a6:10:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Sat, 11 Jun 2022 14:13:37 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:13: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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com, Rob Herring Subject: [PATCH v9 07/14] dt-bindings: display: bridge: Add i.MX8qxp pixel link to DPI binding Date: Sat, 11 Jun 2022 22:14:14 +0800 Message-Id: <20220611141421.718743-8-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be87a9b6-d69b-4bee-76c1-08da4bb493bd X-MS-TrafficTypeDiagnostic: DB8PR04MB6347:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F43BbUTtYc90wBntw/VyEJexy8UBgTvE4PrwhS9oeTr1Qy3vWNE0stpEtccrls9pLKMgdk0fQ6umRY+FRxnJsK/whalYtGTQczaJeoGmEP2yBrJCMnc5WghUL51+HXIyOb9K7lG7u4J/gX/ix55iIif1qmsBDNyGeAoGTeMi0mEWx/065Gc5ZmX7TiLEXjwC/XQ/xCr2F3iaUUe3Zi3r1xNpFzEbDKSUrUvivEhdPPRCwVY9UrDGmUjbql8Hk6xNQeECsHadAiTMELGqAMlYqhzqJOdmRoN+WZ93qq0+s3M3MRaS6O43aNQxLbpjGZK3TF2VibptKYthR+tRpef6J/noQpkUCU3E6QpBQOrxvHI3FfXl2xDoOETXQVG9PG5ve7i7eXkIJ11zhazqI373YJpJxxjkChDwBmB5GCn67d1B88vRVn20/4pyIG7pjgBYVi1OQNPy2jsjmjTwEcIsTI9rsgj+lh5TqeMr6c9TCc70oiJ1mYU9mJtPKH27vEBQrPrr+IvQGrEdNrQyKx+tKHN4csQZo/Y5XzZmKICLB9aDoOw83h8XULVh2fKDfXu1x3C/ON3qKBe0M71PAQ86+fPtM2dJXrOB9xElk35QqaD27hZ4cHPICLLMM3WRzektqKU6fq5o/DQ6F5C4S6dh0T/7+kuUHol63P12ONGm/uDFh0CJXZGQ+5mKZsmVDJFc8sqSRmIgLIUqPfeqBnxLh4yOiU36BLZbnrnF5s2/jatMZ7xJvgMHxr4CMSjmYNgwBJVsntScI1WwlpYbtB1TxIEvWAWryFvxw4KTGcURrYAXkLWJr+GcdU9c061Q8EmH 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:(13230016)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(1076003)(4326008)(8676002)(86362001)(316002)(186003)(8936002)(2616005)(7416002)(36756003)(52116002)(38350700002)(38100700002)(6512007)(26005)(966005)(6506007)(6666004)(508600001)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?La/CssBBBXPXjariYLO68RvJT12r?= =?utf-8?q?w6erAi2iBFe4N16GGvB2yRHj+O/jSJSGEymGNoXKItqSEtTFToTCByJFToOHBeOF9?= =?utf-8?q?fz5r3kaY9GyQPJUKkP2lCToiJmIPXlif869V9GsYruG46ju/iIIXWIY4kQHSRupvc?= =?utf-8?q?l3WS+xD3r0233p+tq3gl4DtYVjBdri++Qkr0ToZnhSgvB9C2tJzsal1t1tzRe622W?= =?utf-8?q?3DNb4LyDWXH03nlDAfIGtQFDxqVr4jjmBSAFxNYYoO/ddLWEgMHZrrmwVnmFFdByH?= =?utf-8?q?F8imfOM+AWaop9c8vjEP+eTFQh68UbHRlcoAnkKwiM27F1eQ6jO/PFvfim7zPv7zv?= =?utf-8?q?WnA784kwGtXLs6g9/nUbwTuEDv2w0/m1d0UaSUEeet7128emgX0Y8U15RLk6si9Dd?= =?utf-8?q?SLylydx3+9tGpo4zmPdKicg2usvcMzl0GhAizwZlWjzxbK+J41cD0rwhX42EzhG/1?= =?utf-8?q?uaT/i6TuEgfeSb79x5iFyxo7vsk0wq9q4DXE+8U6Swkn0LV+NVw+7UPquc44CJuba?= =?utf-8?q?K5h2qDB2j2HU/OV5wuVkn7sSOKjNa62Yxz6zQJn7RXc6uxFhZZ+Rggwkevaordu5t?= =?utf-8?q?iFqJYm11AJLDD8gS2dL8+Ixzv597d43S8qtCidVHCrx19GKziavu4hN0NpCuNm1Sg?= =?utf-8?q?eLQrlpGT5JBpQjZIFUsD4YL9Fe3WAivmsBhRCrGIfL72MPIfYgQDK8d0qwNRGW267?= =?utf-8?q?Kb+6qh55NpMJKW2b/K0eZv1cNiX4+1LB1KHSbKwa9CjNtpKZqN5aVkqeTQ7s7+xW2?= =?utf-8?q?sIySkxZb4zPOh9Zd0+mm4A+wpvnElQvmK9Sr5syrSkC8RfQKPovtwqT2W7QmiA1zQ?= =?utf-8?q?++eNtvvdjkNg4QIGgm63ZS8ICBjDQb6sroHYbD9Ju9sOS8MQEWcDagt7jflK+q7vV?= =?utf-8?q?8yWKcdMEov07avcXSpqcYSK6HNH/NytjyJw25/Eu91Bx3i6AWHpmT3nppcZVJPAxr?= =?utf-8?q?K3NfEk9PeaTfGQ/9EgE0v/oNMk0MuzN+uCNjSlhZtOYGTMnjAlB7pQtFvbjvegjAI?= =?utf-8?q?AO2GJDQ6BTvaf7tpjTHj4UPiQbQegfZ7Bk4yBphEy2iO4iATPCtrurzL8qVmliXk6?= =?utf-8?q?f1+n4WnggPaCwwvUKSi/vbj24mlYD+8E7osAsszGjPGo8QhaqLEpNKvl0duB7xh9b?= =?utf-8?q?fPruQ8wV8oLdt3aNscF1PYx0b7axVlRKwVE1hqkwH4LO05QUIC3GKZUabxSBrK5bX?= =?utf-8?q?JkQwSQeJCuMcVmup5tO6FRI2XwtgJJomhlIrsGLkp4QmJKrAbI6z547u7KXsuZM1k?= =?utf-8?q?dxtOWYQ3vjl2A1N5UXEfqqtcZppKurUJ9UBDG3ukhXF71UAPxe//1KO4fBPGU/tKg?= =?utf-8?q?GvLWXRuf7gtz0Edi3EgqTWCURdqgF/vKLMr7HDOUbGhd7z4ezU1Ev8lrz4SkQtgw9?= =?utf-8?q?m8+DZpKmfX2np/LQxaBrd1yaO/pgw7YnMO0KNv3UxvRMAb8t4rBU41F9fEd/JItBx?= =?utf-8?q?BBDQIn8beOQY3mP84bh6AAkcLCmQr45REQtGQMyai4BRygjwRv/jium2DD/yQoap9?= =?utf-8?q?XU4zKhRo9pTlf+N2YkxdlM8ATbgwduZZuGtwe93uQeCdYyYDHRVfl5M1Ok9VTe02I?= =?utf-8?q?Qmm2Rcyjyb0qGsv66WpJr8XA62lfI6dM8LXNEHwX4J1s08bpgl7CgK2VgTzaSV381?= =?utf-8?q?Hwk7yBT0EVxDr0pOz4sFhuB1COGPtSeA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: be87a9b6-d69b-4bee-76c1-08da4bb493bd X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:13:37.4336 (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: vAXYnWj6bcFhTeEMkKLXL738RRvrBw6C6JiZRtESI6EFH0dfyqMZ4UXIvlhZwqRYjLOCBLmxLGoB8rRk+bNR3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6347 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds bindings for i.MX8qxp pixel link to DPI(PXL2DPI). Reviewed-by: Rob Herring Signed-off-by: Liu Ying --- v8->v9: * No change. v7->v8: * No change. v6->v7: * No change. v5->v6: * Add Rob's R-b tag. v4->v5: * No change. v3->v4: * Add 'fsl,sc-resource' property. (Rob) v2->v3: * Drop 'fsl,syscon' property. (Rob) * Mention the CSR module controls PXL2DPI. v1->v2: * Use graph schema. (Laurent) .../display/bridge/fsl,imx8qxp-pxl2dpi.yaml | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml new file mode 100644 index 000000000000..e4e77fad05f1 --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml @@ -0,0 +1,108 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/fsl,imx8qxp-pxl2dpi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Pixel Link to Display Pixel Interface + +maintainers: + - Liu Ying + +description: | + The Freescale i.MX8qxp Pixel Link to Display Pixel Interface(PXL2DPI) + interfaces the pixel link 36-bit data output and the DSI controller’s + MIPI-DPI 24-bit data input, and inputs of LVDS Display Bridge(LDB) module + used in LVDS mode, to remap the pixel color codings between those modules. + This module is purely combinatorial. + + The i.MX8qxp PXL2DPI is controlled by Control and Status Registers(CSR) module. + The CSR module, as a system controller, contains the PXL2DPI's configuration + register. + +properties: + compatible: + const: fsl,imx8qxp-pxl2dpi + + fsl,sc-resource: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The SCU resource ID associated with this PXL2DPI instance. + + power-domains: + maxItems: 1 + + fsl,companion-pxl2dpi: + $ref: /schemas/types.yaml#/definitions/phandle + description: | + A phandle which points to companion PXL2DPI which is used by downstream + LVDS Display Bridge(LDB) in split mode. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: The PXL2DPI input port node from pixel link. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: The PXL2DPI output port node to downstream bridge. + + required: + - port@0 + - port@1 + +required: + - compatible + - fsl,sc-resource + - power-domains + - ports + +additionalProperties: false + +examples: + - | + #include + pxl2dpi { + compatible = "fsl,imx8qxp-pxl2dpi"; + fsl,sc-resource = ; + power-domains = <&pd IMX_SC_R_MIPI_0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + mipi_lvds_0_pxl2dpi_dc_pixel_link0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dc_pixel_link0_mipi_lvds_0_pxl2dpi>; + }; + + mipi_lvds_0_pxl2dpi_dc_pixel_link1: endpoint@1 { + reg = <1>; + remote-endpoint = <&dc_pixel_link1_mipi_lvds_0_pxl2dpi>; + }; + }; + + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch0: endpoint@0 { + reg = <0>; + remote-endpoint = <&mipi_lvds_0_ldb_ch0_mipi_lvds_0_pxl2dpi>; + }; + + mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch1: endpoint@1 { + reg = <1>; + remote-endpoint = <&mipi_lvds_0_ldb_ch1_mipi_lvds_0_pxl2dpi>; + }; + }; + }; + }; From patchwork Sat Jun 11 14:14:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878542 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DEA7CCA47A for ; Sat, 11 Jun 2022 14:15:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232066AbiFKOP2 (ORCPT ); Sat, 11 Jun 2022 10:15:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235499AbiFKONs (ORCPT ); Sat, 11 Jun 2022 10:13:48 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60053.outbound.protection.outlook.com [40.107.6.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A49D726AE5; Sat, 11 Jun 2022 07:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UA2Jst12x6EoNzZsCiRVJhmlD3F4dWCgohKtvoV6n0r5i6ROtYIjawyV1lsACStHJUiZcjMzVr2SQT4jzrjSA3ak/L1dT+PuhAX9xJl576OfXHk/s/xHcsBEInClj+U4gA57FlXa4qN0lX3ZX/m0DGrY8k8xY+3ZpaAPEm9rX/jKvymVdjf4qa47whNFrVySaArTnBRrrs1fljskIb3XVE948WGiZ6WuAh7HQpzY2uSi6u5tVN/YHMlJG2OGKFENAQd4G+jZKO6+mtiQaMFqetO+kXXi4BpR27AK69IvgfncCdLBjnhoOZI5z2MKg0z7quTFzFPbSyi2K6r5CT/SOA== 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=kPv9/pkV2T0aAGsGWCffw9RyRwxn/C/yHQfmzKD8KYA=; b=BHP+kkveinBpDbjV0NYHW/gAh0XI4jmGfLMg6NXBIbNaageHIu3459kztzOIaI3GRNAmdckz15QHzgT+RqGa2s9ajlnphCPUbfSwb4LIRGam40YW+S+0aodWh5SZ7Swu+7hIfJUfJOS8iVFtj18r8r2C27kPPBaT8PwF4BMVFQIFWRAQbH88vRD5uUkj3+6RvshIA9qH9gVDgAzGc47cn5+Xenzos3X63fW9FN/orbYMolU/Vx8VVN0yUghd/hWSRdzyg97WsL5y6MUyX3ajQiEq9bqW2YxyGSytSABjaDAXWKnme72KuXlLp0Pt5VFpHHQzONNuSzVs+7ltf5tXBQ== 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=kPv9/pkV2T0aAGsGWCffw9RyRwxn/C/yHQfmzKD8KYA=; b=swjP7oDdcPhBGqK7fPdmk+wfN+cYIcGXX7e5m5Isbwc+2q49740o/K+8PkkVypSbsxLVn0CtQkT/SfYFtBc+p5HO7FffObpvWYD7QC4DGmHYeN0qOZ/9A+5K78Y6fkJM0z71tjwZNs2ElXycPjbI5O2Jdy59XQ4F0s/MCWD/kl0= 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 DB8PR04MB6347.eurprd04.prod.outlook.com (2603:10a6:10:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Sat, 11 Jun 2022 14:13:44 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:13: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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com Subject: [PATCH v9 08/14] drm/bridge: imx: Add i.MX8qxp pixel link to DPI support Date: Sat, 11 Jun 2022 22:14:15 +0800 Message-Id: <20220611141421.718743-9-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9eaa3a73-2047-45da-e73f-08da4bb497a4 X-MS-TrafficTypeDiagnostic: DB8PR04MB6347:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 00nwUp2KcecCJjVAFZszy1A5EVpIqB1PdGkG2X2prOHV36UnXXsN6i7HYTxfdKrDiPRQGTGw1PPVVLXz6mabgo29udFCKsPcNqCG8hl1RshWlkpkOeitegU/J3xJVQb9y9D92hE/DhSnJyktKUfPMHFd6VCAbOEz/uCJDHRfFBtsn3/zQMonhcFnRQNZmKCHfWBC7GPiv1bzVL0bGhFHHNpTYXU5YEnVl9menI8uWKGOzutERzuKnVFSEDI4UtCcykZx6YcUTH4V1zI7AsvSRRlm/9krZql5jikN4Yw0D8FP3NWT9Fsyh68p7dlVNU+DZJ87UiPTnOo/Py0LR2YMGj4BFAA4RfDjuEprYm5UuBG8DD7A7Hydj1cnQCKkUEa7ZD9PiVa0yr8tRkXpWoF627W1NfHqh8ItkO4DicKAJiaoaoZ8lklnToR2Xd64sNuI/pDOw9LCSemU40IOWPp6kMKQPsw3cP1EbguJON9wRDd9CDbO65+1rerGcE1POHlOhfwYZICjH2EnOzUVOcppEjtLXQBArRV5pHjl2xOZPVSs2+WkOIASmq+vmCpS3hQO1ujvIYed4iYqSdyX6ZMNh9hBOdSexDQTsvxLUKeiWl/Y8jAGTCxmB7Y+xnRZ7RA7kMLxoaT35AKW073d8YLj+uBubwKRMEIgKn6nF+cuOQBa2Qm80B4uoPXEAy0SoUx+jyg3FNUH3dtxYMP1dlO0Lg== 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:(13230016)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(1076003)(4326008)(8676002)(86362001)(316002)(186003)(8936002)(2616005)(7416002)(30864003)(36756003)(83380400001)(52116002)(38350700002)(38100700002)(6512007)(26005)(6506007)(6666004)(508600001)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?tdbd9Z7rHoYh45Q9LLsjrfOtQe/9?= =?utf-8?q?2qEzaPlM698WXuPbuFlPSxfPhtoD/AaxthZ2lCMxV8yXsXHT3sEk/EFJOoUfl/gAs?= =?utf-8?q?Plz+kGAPImAkqc6zf9CGdopQFAwy4nhwtTP7pcK/Qhx5jeF/CJXqKwy3YiJ6gLYqd?= =?utf-8?q?qyh/doSRJBvSl47PhB1/C6eqvW/uiLjHboME8sut1rXVOcGDENZM5aWC8+odNyVI5?= =?utf-8?q?YE34d2sUcl1sS9N21c0oNtn5t2iCwaqh/2dIDMP7elZqnSscEpikd9SNicxPQKNEM?= =?utf-8?q?Cct7Gc+KHXs4LCjESQOZrsLeSMs8pFbOI6a9xfyEXUer7Us98b2B6b+3fGyMP/55H?= =?utf-8?q?FEpcCc2Jn743Ee7wWUratX5eytRw0+oEeMBasW2pnBY8N6lbodY6wm234N6C4H39B?= =?utf-8?q?Wzwe8h4fOutQIWW5iQq327nqMJzi/2neqQDtbWUO6oflcwlwMATtaOKRtoFxGNVMZ?= =?utf-8?q?xhnN2/XRmhYzL8/z+ITkpxkpg8ob20fYLJnYUBzPmqt6d3lfXaKbtTH2oUsXWDQ70?= =?utf-8?q?7/ZuSLGbMDOd+WHLarXtD9blbl5mgUuL4sHse0WEem9Pr2w02OYMQ9Dg5e9nUgVF4?= =?utf-8?q?hzLLfeT6A9tL4Oaa79uCmKtc2lSI1ur8fcsmDxWnZXbFSX7O3RE/3vvrrR7tDE1ji?= =?utf-8?q?K1g+90tM6depfwzms/qj16dCreq0rdBPXGfvzAldXyN+GlNB57ObG6IajuOjZ7mO2?= =?utf-8?q?bBJl6fHJy2HpJTGvl3TVcxWNMkiq02e8NaWqKTFFrAi+PDcezLT5IdOLLaW4SIduw?= =?utf-8?q?wEp7ShN/n13rOitNTOv2RDCwZSYRnGcEhT0F1cOI/EYm2SyfG0vknFUHMIgelkvbx?= =?utf-8?q?UEdcftZlviipm2OoaLE6jAvASEKjnuZ9erhbWgLYK8C/TF1YDIlRqFywH+4wQEmdQ?= =?utf-8?q?tsndlyJvD389hbJLWnUqn1vwNqzUWbKtOw4sb9nmzlnEmgvnwygDgsHCve3HYao8f?= =?utf-8?q?z7WiMK2Y/yxTTo3QxXxhf5g8/dxIQMiyVUuruAsDgfqT5id8Y7ISodezaIasAGV6n?= =?utf-8?q?4rEl08fAT0CPXQ4+b8HfWXQf5ZZjlZXkG1ClWyN5u8z4pNtEbSeZDy88sNszTT40v?= =?utf-8?q?1/z6dEvxAQodZcTomw3f9T9okI/XYArFwZWoWb4uCnt0MOua3oYoQDaQX/gpLUubo?= =?utf-8?q?2/dQ5TPSumVFcKLl9Tl7vgEdcN2iLTzVLFBxgfpxErTGRcI40vCAnyJYPwmefbiXJ?= =?utf-8?q?L9DxA3IoPIA4xTKzC72Go63Gk0e/j76fUT38ZAWlssFNNx/jEbkSgNdOP7Xg/gXlM?= =?utf-8?q?8cClAh3iTfHJLrY8A+cFSvB0iZtLBWMWR6pHNx67RGC4Utoc0FU45RYR7BXbOajQm?= =?utf-8?q?ZlQ1R943seDnkClmmiN4tINXHDZCCfxKttfhJYKWYzI+Oq2AiiOeTSayfblgW/Mbu?= =?utf-8?q?LVCm9kg862rTio40bPcv3Nr7VvUAqB1BJ8TOef/wl1deI9b8tJMMQ2pnXwI1urDbC?= =?utf-8?q?8yqFrDWnyJOiPRlOxLsd0JA2DappyFFKzave3q4DpVCAhCQZYiGNSwzCX0hLk07WA?= =?utf-8?q?vMO4BVqs1wSxzuV4Xi4nVEIxWEuE4qkAtUOI0thIxetRAkwHd6wWYPbWA8SikajLL?= =?utf-8?q?zEBvz3jbWKD2dLcegcmgit1rbaZWny7BptMaIUGXEhvy2X+Uu5OLFtQN6dJE1cUoN?= =?utf-8?q?8YUn7QoXqcyzZOOb2ly0+c8PvPyZfqRA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9eaa3a73-2047-45da-e73f-08da4bb497a4 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:13:43.9521 (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: 5nWbNDvFiZ2gO6SqiuOTl8rm85H8B9rMwV8/N/Ddd874alEksjmmmsGKcFawVSGTuVjtHYn8IeO9tQlZv+vU8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6347 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds a drm bridge driver for i.MX8qxp pixel link to display pixel interface(PXL2DPI). The PXL2DPI interfaces the pixel link 36-bit data output and the DSI controller’s MIPI-DPI 24-bit data input, and inputs of LVDS Display Bridge(LDB) module used in LVDS mode, to remap the pixel color codings between those modules. The PXL2DPI is purely combinatorial. Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- Marcel, I add your T-b tag from v6, let me know if you want me to drop it, as the checkpatch fix and indentation fix in v7 are trivial. v8->v9: * No change. v7->v8: * No change. v6->v7: * Fix below complaints from 'checkpatch.pl --strict'. (Robert) - 'Alignment should match open parenthesis' - 'ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP' * A trivial indentation fix. (Robert) * Add Marcel's T-b tag. * Add Robert's R-b tag. v5->v6: * No change. v4->v5: * No change. v3->v4: * Use 'fsl,sc-resource' DT property to get the SCU resource ID associated with the PXL2DPI instance instead of using alias ID. (Rob) v2->v3: * Call syscon_node_to_regmap() to get regmap instead of syscon_regmap_lookup_by_phandle(). v1->v2: * Drop unnecessary port availability check. drivers/gpu/drm/bridge/imx/Kconfig | 8 + drivers/gpu/drm/bridge/imx/Makefile | 1 + drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 487 +++++++++++++++++++ 3 files changed, 496 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index 9f6ec601af37..53001650a61a 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -15,3 +15,11 @@ config DRM_IMX8QXP_PIXEL_LINK help Choose this to enable display pixel link found in Freescale i.MX8qm/qxp processors. + +config DRM_IMX8QXP_PIXEL_LINK_TO_DPI + tristate "Freescale i.MX8QXP pixel link to display pixel interface" + depends on OF + select DRM_KMS_HELPER + help + Choose this to enable pixel link to display pixel interface(PXL2DPI) + found in Freescale i.MX8qxp processor. diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile index c15469fb5789..e74dd6422e95 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -1,2 +1,3 @@ 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 diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c new file mode 100644 index 000000000000..309f47a14cb6 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c @@ -0,0 +1,487 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define PXL2DPI_CTRL 0x40 +#define CFG1_16BIT 0x0 +#define CFG2_16BIT 0x1 +#define CFG3_16BIT 0x2 +#define CFG1_18BIT 0x3 +#define CFG2_18BIT 0x4 +#define CFG_24BIT 0x5 + +#define DRIVER_NAME "imx8qxp-pxl2dpi" + +struct imx8qxp_pxl2dpi { + struct regmap *regmap; + struct drm_bridge bridge; + struct drm_bridge *next_bridge; + struct drm_bridge *companion; + struct device *dev; + struct imx_sc_ipc *ipc_handle; + u32 sc_resource; + u32 in_bus_format; + u32 out_bus_format; + u32 pl_sel; +}; + +#define bridge_to_p2d(b) container_of(b, struct imx8qxp_pxl2dpi, bridge) + +static int imx8qxp_pxl2dpi_bridge_attach(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; + + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { + DRM_DEV_ERROR(p2d->dev, + "do not support creating a drm_connector\n"); + return -EINVAL; + } + + if (!bridge->encoder) { + DRM_DEV_ERROR(p2d->dev, "missing encoder\n"); + return -ENODEV; + } + + return drm_bridge_attach(bridge->encoder, + p2d->next_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); +} + +static int +imx8qxp_pxl2dpi_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 imx8qxp_pxl2dpi *p2d = bridge->driver_private; + + p2d->in_bus_format = bridge_state->input_bus_cfg.format; + p2d->out_bus_format = bridge_state->output_bus_cfg.format; + + return 0; +} + +static void +imx8qxp_pxl2dpi_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; + struct imx8qxp_pxl2dpi *companion_p2d; + int ret; + + ret = pm_runtime_get_sync(p2d->dev); + if (ret < 0) + DRM_DEV_ERROR(p2d->dev, + "failed to get runtime PM sync: %d\n", ret); + + ret = imx_sc_misc_set_control(p2d->ipc_handle, p2d->sc_resource, + IMX_SC_C_PXL_LINK_SEL, p2d->pl_sel); + if (ret) + DRM_DEV_ERROR(p2d->dev, + "failed to set pixel link selection(%u): %d\n", + p2d->pl_sel, ret); + + switch (p2d->out_bus_format) { + case MEDIA_BUS_FMT_RGB888_1X24: + regmap_write(p2d->regmap, PXL2DPI_CTRL, CFG_24BIT); + break; + case MEDIA_BUS_FMT_RGB666_1X24_CPADHI: + regmap_write(p2d->regmap, PXL2DPI_CTRL, CFG2_18BIT); + break; + default: + DRM_DEV_ERROR(p2d->dev, + "unsupported output bus format 0x%08x\n", + p2d->out_bus_format); + } + + if (p2d->companion) { + companion_p2d = bridge_to_p2d(p2d->companion); + + companion_p2d->in_bus_format = p2d->in_bus_format; + companion_p2d->out_bus_format = p2d->out_bus_format; + + p2d->companion->funcs->mode_set(p2d->companion, mode, + adjusted_mode); + } +} + +static void +imx8qxp_pxl2dpi_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; + int ret; + + ret = pm_runtime_put(p2d->dev); + if (ret < 0) + DRM_DEV_ERROR(p2d->dev, "failed to put runtime PM: %d\n", ret); + + if (p2d->companion) + p2d->companion->funcs->atomic_disable(p2d->companion, + old_bridge_state); +} + +static const u32 imx8qxp_pxl2dpi_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB888_1X24, + MEDIA_BUS_FMT_RGB666_1X24_CPADHI, +}; + +static bool imx8qxp_pxl2dpi_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx8qxp_pxl2dpi_bus_output_fmts); i++) { + if (imx8qxp_pxl2dpi_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx8qxp_pxl2dpi_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; + + if (!imx8qxp_pxl2dpi_bus_output_fmt_supported(output_fmt)) + return NULL; + + *num_input_fmts = 1; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_RGB888_1X24: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X36_CPADLO; + break; + case MEDIA_BUS_FMT_RGB666_1X24_CPADHI: + input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X36_CPADLO; + break; + default: + kfree(input_fmts); + input_fmts = NULL; + break; + } + + return input_fmts; +} + +static u32 * +imx8qxp_pxl2dpi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + unsigned int *num_output_fmts) +{ + *num_output_fmts = ARRAY_SIZE(imx8qxp_pxl2dpi_bus_output_fmts); + return kmemdup(imx8qxp_pxl2dpi_bus_output_fmts, + sizeof(imx8qxp_pxl2dpi_bus_output_fmts), GFP_KERNEL); +} + +static const struct drm_bridge_funcs imx8qxp_pxl2dpi_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .attach = imx8qxp_pxl2dpi_bridge_attach, + .atomic_check = imx8qxp_pxl2dpi_bridge_atomic_check, + .mode_set = imx8qxp_pxl2dpi_bridge_mode_set, + .atomic_disable = imx8qxp_pxl2dpi_bridge_atomic_disable, + .atomic_get_input_bus_fmts = + imx8qxp_pxl2dpi_bridge_atomic_get_input_bus_fmts, + .atomic_get_output_bus_fmts = + imx8qxp_pxl2dpi_bridge_atomic_get_output_bus_fmts, +}; + +static struct device_node * +imx8qxp_pxl2dpi_get_available_ep_from_port(struct imx8qxp_pxl2dpi *p2d, + u32 port_id) +{ + struct device_node *port, *ep; + int ep_cnt; + + port = of_graph_get_port_by_id(p2d->dev->of_node, port_id); + if (!port) { + DRM_DEV_ERROR(p2d->dev, "failed to get port@%u\n", port_id); + return ERR_PTR(-ENODEV); + } + + ep_cnt = of_get_available_child_count(port); + if (ep_cnt == 0) { + DRM_DEV_ERROR(p2d->dev, "no available endpoints of port@%u\n", + port_id); + ep = ERR_PTR(-ENODEV); + goto out; + } else if (ep_cnt > 1) { + DRM_DEV_ERROR(p2d->dev, + "invalid available endpoints of port@%u\n", + port_id); + ep = ERR_PTR(-EINVAL); + goto out; + } + + ep = of_get_next_available_child(port, NULL); + if (!ep) { + DRM_DEV_ERROR(p2d->dev, + "failed to get available endpoint of port@%u\n", + port_id); + ep = ERR_PTR(-ENODEV); + goto out; + } +out: + of_node_put(port); + return ep; +} + +static struct drm_bridge * +imx8qxp_pxl2dpi_find_next_bridge(struct imx8qxp_pxl2dpi *p2d) +{ + struct device_node *ep, *remote; + struct drm_bridge *next_bridge; + int ret; + + ep = imx8qxp_pxl2dpi_get_available_ep_from_port(p2d, 1); + if (IS_ERR(ep)) { + ret = PTR_ERR(ep); + return ERR_PTR(ret); + } + + remote = of_graph_get_remote_port_parent(ep); + if (!remote || !of_device_is_available(remote)) { + DRM_DEV_ERROR(p2d->dev, "no available remote\n"); + next_bridge = ERR_PTR(-ENODEV); + goto out; + } else if (!of_device_is_available(remote->parent)) { + DRM_DEV_ERROR(p2d->dev, "remote parent is not available\n"); + next_bridge = ERR_PTR(-ENODEV); + goto out; + } + + next_bridge = of_drm_find_bridge(remote); + if (!next_bridge) { + next_bridge = ERR_PTR(-EPROBE_DEFER); + goto out; + } +out: + of_node_put(remote); + of_node_put(ep); + + return next_bridge; +} + +static int imx8qxp_pxl2dpi_set_pixel_link_sel(struct imx8qxp_pxl2dpi *p2d) +{ + struct device_node *ep; + struct of_endpoint endpoint; + int ret; + + ep = imx8qxp_pxl2dpi_get_available_ep_from_port(p2d, 0); + if (IS_ERR(ep)) + return PTR_ERR(ep); + + ret = of_graph_parse_endpoint(ep, &endpoint); + if (ret) { + DRM_DEV_ERROR(p2d->dev, + "failed to parse endpoint of port@0: %d\n", ret); + goto out; + } + + p2d->pl_sel = endpoint.id; +out: + of_node_put(ep); + + return ret; +} + +static int imx8qxp_pxl2dpi_parse_dt_companion(struct imx8qxp_pxl2dpi *p2d) +{ + struct imx8qxp_pxl2dpi *companion_p2d; + struct device *dev = p2d->dev; + struct device_node *companion; + struct device_node *port1, *port2; + const struct of_device_id *match; + int dual_link; + int ret = 0; + + /* Locate the companion PXL2DPI for dual-link operation, if any. */ + companion = of_parse_phandle(dev->of_node, "fsl,companion-pxl2dpi", 0); + if (!companion) + return 0; + + if (!of_device_is_available(companion)) { + DRM_DEV_ERROR(dev, "companion PXL2DPI is not available\n"); + ret = -ENODEV; + goto out; + } + + /* + * Sanity check: the companion bridge must have the same compatible + * string. + */ + match = of_match_device(dev->driver->of_match_table, dev); + if (!of_device_is_compatible(companion, match->compatible)) { + DRM_DEV_ERROR(dev, "companion PXL2DPI is incompatible\n"); + ret = -ENXIO; + goto out; + } + + p2d->companion = of_drm_find_bridge(companion); + if (!p2d->companion) { + ret = -EPROBE_DEFER; + DRM_DEV_DEBUG_DRIVER(p2d->dev, + "failed to find companion bridge: %d\n", + ret); + goto out; + } + + companion_p2d = bridge_to_p2d(p2d->companion); + + /* + * We need to work out if the sink is expecting us to function in + * dual-link mode. We do this by looking at the DT port nodes that + * the next bridges are connected to. If they are marked as expecting + * even pixels and odd pixels than we need to use the companion PXL2DPI. + */ + port1 = of_graph_get_port_by_id(p2d->next_bridge->of_node, 1); + port2 = of_graph_get_port_by_id(companion_p2d->next_bridge->of_node, 1); + dual_link = drm_of_lvds_get_dual_link_pixel_order(port1, port2); + of_node_put(port1); + of_node_put(port2); + + if (dual_link < 0) { + ret = dual_link; + DRM_DEV_ERROR(dev, "failed to get dual link pixel order: %d\n", + ret); + goto out; + } + + DRM_DEV_DEBUG_DRIVER(dev, + "dual-link configuration detected (companion bridge %pOF)\n", + companion); +out: + of_node_put(companion); + return ret; +} + +static int imx8qxp_pxl2dpi_bridge_probe(struct platform_device *pdev) +{ + struct imx8qxp_pxl2dpi *p2d; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + int ret; + + p2d = devm_kzalloc(dev, sizeof(*p2d), GFP_KERNEL); + if (!p2d) + return -ENOMEM; + + p2d->regmap = syscon_node_to_regmap(np->parent); + if (IS_ERR(p2d->regmap)) { + ret = PTR_ERR(p2d->regmap); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get regmap: %d\n", ret); + return ret; + } + + ret = imx_scu_get_handle(&p2d->ipc_handle); + if (ret) { + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get SCU ipc handle: %d\n", + ret); + return ret; + } + + p2d->dev = dev; + + ret = of_property_read_u32(np, "fsl,sc-resource", &p2d->sc_resource); + if (ret) { + DRM_DEV_ERROR(dev, "failed to get SC resource %d\n", ret); + return ret; + } + + p2d->next_bridge = imx8qxp_pxl2dpi_find_next_bridge(p2d); + if (IS_ERR(p2d->next_bridge)) { + ret = PTR_ERR(p2d->next_bridge); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to find next bridge: %d\n", + ret); + return ret; + } + + ret = imx8qxp_pxl2dpi_set_pixel_link_sel(p2d); + if (ret) + return ret; + + ret = imx8qxp_pxl2dpi_parse_dt_companion(p2d); + if (ret) + return ret; + + platform_set_drvdata(pdev, p2d); + pm_runtime_enable(dev); + + p2d->bridge.driver_private = p2d; + p2d->bridge.funcs = &imx8qxp_pxl2dpi_bridge_funcs; + p2d->bridge.of_node = np; + + drm_bridge_add(&p2d->bridge); + + return ret; +} + +static int imx8qxp_pxl2dpi_bridge_remove(struct platform_device *pdev) +{ + struct imx8qxp_pxl2dpi *p2d = platform_get_drvdata(pdev); + + drm_bridge_remove(&p2d->bridge); + + pm_runtime_disable(&pdev->dev); + + return 0; +} + +static const struct of_device_id imx8qxp_pxl2dpi_dt_ids[] = { + { .compatible = "fsl,imx8qxp-pxl2dpi", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qxp_pxl2dpi_dt_ids); + +static struct platform_driver imx8qxp_pxl2dpi_bridge_driver = { + .probe = imx8qxp_pxl2dpi_bridge_probe, + .remove = imx8qxp_pxl2dpi_bridge_remove, + .driver = { + .of_match_table = imx8qxp_pxl2dpi_dt_ids, + .name = DRIVER_NAME, + }, +}; +module_platform_driver(imx8qxp_pxl2dpi_bridge_driver); + +MODULE_DESCRIPTION("i.MX8QXP pixel link to DPI bridge driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME); From patchwork Sat Jun 11 14:14:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878534 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16ECEC43334 for ; Sat, 11 Jun 2022 14:14:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235389AbiFKOOF (ORCPT ); Sat, 11 Jun 2022 10:14:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232066AbiFKONy (ORCPT ); Sat, 11 Jun 2022 10:13:54 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70053.outbound.protection.outlook.com [40.107.7.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEA2237A3B; Sat, 11 Jun 2022 07:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B3YX491rzac6wuYWglEnxcgnjW6HMtRu8MQum1fgy1SDO+Ol2JfK1/irJZ2a/oB31KSLTFhcKCyyW9JlD+FY7wgW6t9hQA0ePeYuH+ovRSHZLIV/K/meIqF50gC+b4jTxXUVD60nOjm542BDPIBM2rwhTZJPrIyHaPk8ymX7RT9PLEy5+Ijr49CjMvDxeEaYauyBG1RctOfe0u61mtdwk++Lc7zhUEvFeMu66BN/Fbei8Uz0cJvHzk9u/kogZmW4NLgbAcPCoRJmDq7gDfrG0kcdeuZk8GkYsZUnnsXE2x4JFgJxvzL4U3dEH6NUa87r1geWE0/373SrzWJ8FuF5bQ== 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=cqxJHncyHDZC6j30CWtx/fQT2935DAoNgRnUO3Oe7uc=; b=WV7N3OnmXjr4l/efOIIUjIu354yMMmT8iypwy1hVGGI9l2KsifwVLRSCMCSUSIWLJednAA6mepc0PbHM2/jqMUyQbmhwSbpPoUnuiO4rQnN+plBNUG7MjtKQ74Xc2DMF5glKyxfwg1ECBrKmHZJP6Nc5xNGf2MK3IqwR4ZdDQq6f9sAzDvvZRyrrvRVWTOb5dhUElr3JS6p2atAH5+pb/GPX5oViSvHxmC0O7ZV/oBlOH9uWUYMeQWdpELfxlvnTHres4gGlui4Xya7IU1IrtwkzGiv7ugPJ/Tkwwj+ZJEBXsIikE+NCT4i9iPoaKaG9eeuj4E8ZGcwUTxTWXd7vUA== 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=cqxJHncyHDZC6j30CWtx/fQT2935DAoNgRnUO3Oe7uc=; b=VK+tVzauDAB2bFnHQ1nk3dFE7loGWj8HFjaF1+VFiXe7/5gj6TNZd9ix5BvgwVHD13n9UBhNis5qe9ZrfvZjWxq2HH2eWMUSaG4uSRPHo0OpNvszClZ1FW/C87Q4i9UxJuuxryviKh/CQ67tAiukdUCQxaKN2QrSQoE8VJzaMRo= 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 DB8PR04MB6347.eurprd04.prod.outlook.com (2603:10a6:10:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Sat, 11 Jun 2022 14:13:50 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:13:50 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com Subject: [PATCH v9 09/14] drm/bridge: imx: Add LDB driver helper support Date: Sat, 11 Jun 2022 22:14:16 +0800 Message-Id: <20220611141421.718743-10-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e6d38659-b97f-40a2-6256-08da4bb49b68 X-MS-TrafficTypeDiagnostic: DB8PR04MB6347:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JsbZB2yKTIo1pHNzOMDqKsrXVK/mSmWk4TyEbyqfoFJtLvVRyANprOR5GCAsDJCTWxK5s1xgqQk50MoUhxppekln1/crTgnhtBG426yLpA9ox6/CG75iyKsWmhP4AvDRRMuGHgBHu36w5vfcNnuet7yNiKUxjZxmVEsZxC12XeOJnfMErssrGyEaPopK6+VrBomeT84Q+YqBuXObWR8KUe+D6JGqglWdEccr/8352EIfNVuZs+1NXObXjQNS4IQS8+nyeO21oeHvohrS8Js0zDr85maaCbrH9GjW69CkthL/15HFChKWcD9+vO7LK0qFNeyvjOiJ4YXg7tqr83bfI/Zc3w1kvxf7N2OfJMY/SBmi1BZDJ4AzyykTiin7lakOWIGAjuLF+mbfFDLU/jPCqatSQ7DlPmdaO7QkIdW4fKkJMed/czU0gE/y3AwAMQmWgFGBdek6Am/WftqR51q+KbWLvZd0AS1DbICFoq4DoSOwHyOVxTPVYyI5euDkFoTM6ke/gbwmUL1crNy+oAlvg76yztdlOZlFE9T71sCHGsRmFsUSapkl5wVTaQGyUB7KMMYTsCap/jsgHCq3oJuRda4Prxb4d/oUjH9DZBFAhQMY/beDmtyz24JruMTRJj6ZG0j6N1/yQVqJFCgBFXvh+4bH6sDiD/lqKqwftevJ+P7K2IMcT5+gr+3JoOCgfdvhycm6qp31WH8WP07A5NQjIw== 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:(13230016)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(1076003)(4326008)(8676002)(86362001)(316002)(186003)(8936002)(2616005)(7416002)(36756003)(52116002)(38350700002)(38100700002)(6512007)(26005)(6506007)(6666004)(508600001)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +XNWyrfhUgItJv2QaWGpQ06qedv3Y59CqgbZVIoKUSraQcdtQ4louJXkRjb3UcfTnEzGxfjS83QjyfFeyJYmQnEaapBR0E4sWbmk5I31rYjVgs7wpDkLmkMAhgH5uKoCFf0KM9c3i5l3H1gtQ1LNEkgLuwmkD5Fnntcs8auFqHCnUmLLEK5FeuzHMK7wKYJdjAD+3GzU5NAQVGKXWla34+Cj/SskCrxXIkf7kCa+MtYw7uc41NfrNHRWkuVv7NDUfHLauM4ZbbGKTz/fToKzFIB4e8c9l6J1RHUTDV3SjzpT2dZlqJG4g6wcaH29vxK5uJB5W+IOZFVXy6fYOxv/IvmYC1H77c32a44dbxrRoewqjsbCF9oNRaM+2U4IV1xLE1oSxVPq4pOZQny+9x6jIi5OwsIGKj3/zj7y9IitREd1x+53HwIufDhtZ9LI+nMd9Llendu9dYM+dqv5H53okeUmLa8thY3r3EriEu1SVpPyfy6IwYiHNvF2nz6T6d1i5GaKOPg/0e+N4ClRpRGUtDPDL/RFWm73PUffWF16fvOam6E5iJGljuiosB7A7sG1XnDllsysuRygn90nzhaUGIvm8Tpn41VEnCPBlN4bAbjIrUlvsO+JQNgJkjMX3xsTVHs+LYFHMfSn3CbyNthw/bVAUawJxmb4LfBxNM6eaAIE7L+g1caaY9z6liGntO+FYdM7abh/SOgdyUOzEuBUtRIpL0HCQWT/Blml6XQRRKzu964IDY3pbDdF4Qm1CDes494LPHZhJzhZNrZm75k25W7ne741fZxA32yP7tv8RhNGCRbOZPCNmhftJQUFy285MCcQ3k3aiN2YrSZK4G071m6PXf3nVDb4u+1FNGx87MHhAxJ5c2YQLkNhSgvW/4wIsc3wotX1FW2zANzCkCPY5P8UoMVRoL7tnkkI0jnqTekqs+e4lxLPzFtj4Bo085yUqZh1BWhy/99TRHzV4Ab5xEbnnbnl4BR6a6QufMO0uW5UmDXkqZU9VMqFMqhX4e6aPAt6nuj1PHyI+kFFoCwXguq8n1qidB01YGcBXmLfkaRLlnjFpXpsii/cnqANnU2F1dpeDwQTPKkz81KltGQpHjNmek5WET7DUQawBwYySC9ATdrAmWcQ5dJgNwL3yNWb2eUEOHotFQ1T8vEFIRgl2sMcAr18vwWR+hPJWh05vZdGNIEUrTClvztMWDfIEQJg2TqQFIxtQjG/xtawHX+yB4TsM35jzTUyQq/Jb/qxZalKqyLmsjnZJdjEgchD7HdhpmjxuZi4/68cv2QuMaPcb1K2h6atzpBG9O6HfHQvSbtS7G+Ih8WosWx2n+gJkwobW1lyM0MWfIUHVtsZ3fAC7OibEDop5NT0oNdgI+jqnLm1Sf87RNNl70PvBK55wdxUeOv0Vc172e+Ol38P8YnadFVRmeEFCryzNZmsTwyREYeUJmog2OiWMqDFzsAgOWBxQbpo2mkCNOaKq1G2PPlVEVU/agi6atKri3A29LwYOASmWB9VL2ADj9HsbaBP+3BzfrszzIRPh0IrNNJw+va6SAJQJzXpZsrpRlBFVJMTL7cMgt8SY9cTsfGwpWc1DO175w84JBKnizNGlpskodo8vVt3/DbAu+QUvVkwpwyGu7s3PezpbGSKTA6tymozr95WBq0Uk1pu7Ykk0I7lHn7qxukWk49IlFwvlZyGxhuOgS8ZcNlMuRjj6Sdm8s6U2McCAMiwZKg408I8gjz0PJbdVg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6d38659-b97f-40a2-6256-08da4bb49b68 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:13:50.1271 (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: kdk4NdMD6nRFdVG1RhL1We/U4hqAYcbJMp943qxEccaxelDhdW7NvEeJMtipJgB+siv7RW5ZiScHRkfYJ3uIFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6347 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds a helper to support LDB drm bridge drivers for i.MX SoCs. Helper functions supported by this helper should implement common logics for all LDB modules embedded in i.MX SoCs. Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- Marcel, I add your T-b tag from v6, let me know if you want me to drop it, as the checkpatch fix in v7 and the rebase in v8 are trivial. v8->v9: * No change. v7->v8: * Use devm_drm_of_get_bridge() due to the rebase upon v5.19-rc1. v6->v7: * Fix below complaints from 'checkpatch.pl --strict'. (Robert) - 'Alignment should match open parenthesis' - 'Prefer using the BIT macro' * Add Marcel's T-b tag. * Add Robert's R-b tag. v5->v6: * No change. v4->v5: * Make imx-ldb-helper be a pure object to be linked with i.MX8qxp LDB bridge driver and i.MX8qm LDB bridge driver. (Robert) * Move 'imx_ldb_helper.h' to 'drivers/gpu/drm/bridge/imx/imx-ldb-helper.h'. (Robert) * s/__FSL_IMX_LDB__/__IMX_LDB_HELPER__/ for 'imx-ldb-helper.h'. v3->v4: * No change. v2->v3: * Call syscon_node_to_regmap() to get regmap instead of syscon_regmap_lookup_by_phandle(). v1->v2: * No change. drivers/gpu/drm/bridge/imx/imx-ldb-helper.c | 220 ++++++++++++++++++++ drivers/gpu/drm/bridge/imx/imx-ldb-helper.h | 96 +++++++++ 2 files changed, 316 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx-ldb-helper.c create mode 100644 drivers/gpu/drm/bridge/imx/imx-ldb-helper.h diff --git a/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c new file mode 100644 index 000000000000..e85eb9ab5947 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c @@ -0,0 +1,220 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2012 Sascha Hauer, Pengutronix + * Copyright 2019,2020,2022 NXP + */ + +#include +#include +#include + +#include +#include +#include + +#include "imx-ldb-helper.h" + +bool ldb_channel_is_single_link(struct ldb_channel *ldb_ch) +{ + return ldb_ch->link_type == LDB_CH_SINGLE_LINK; +} + +bool ldb_channel_is_split_link(struct ldb_channel *ldb_ch) +{ + return ldb_ch->link_type == LDB_CH_DUAL_LINK_EVEN_ODD_PIXELS || + ldb_ch->link_type == LDB_CH_DUAL_LINK_ODD_EVEN_PIXELS; +} + +int ldb_bridge_atomic_check_helper(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + + ldb_ch->in_bus_format = bridge_state->input_bus_cfg.format; + ldb_ch->out_bus_format = bridge_state->output_bus_cfg.format; + + return 0; +} + +void ldb_bridge_mode_set_helper(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + bool is_split = ldb_channel_is_split_link(ldb_ch); + + if (is_split) + ldb->ldb_ctrl |= LDB_SPLIT_MODE_EN; + + switch (ldb_ch->out_bus_format) { + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: + if (ldb_ch->chno == 0 || is_split) + ldb->ldb_ctrl |= LDB_DATA_WIDTH_CH0_24; + if (ldb_ch->chno == 1 || is_split) + ldb->ldb_ctrl |= LDB_DATA_WIDTH_CH1_24; + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: + if (ldb_ch->chno == 0 || is_split) + ldb->ldb_ctrl |= LDB_DATA_WIDTH_CH0_24 | + LDB_BIT_MAP_CH0_JEIDA; + if (ldb_ch->chno == 1 || is_split) + ldb->ldb_ctrl |= LDB_DATA_WIDTH_CH1_24 | + LDB_BIT_MAP_CH1_JEIDA; + break; + } +} + +void ldb_bridge_enable_helper(struct drm_bridge *bridge) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + + /* + * Platform specific bridge drivers should set ldb_ctrl properly + * for the enablement, so just write the ctrl_reg here. + */ + regmap_write(ldb->regmap, ldb->ctrl_reg, ldb->ldb_ctrl); +} + +void ldb_bridge_disable_helper(struct drm_bridge *bridge) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + bool is_split = ldb_channel_is_split_link(ldb_ch); + + if (ldb_ch->chno == 0 || is_split) + ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK; + if (ldb_ch->chno == 1 || is_split) + ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK; + + regmap_write(ldb->regmap, ldb->ctrl_reg, ldb->ldb_ctrl); +} + +int ldb_bridge_attach_helper(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { + DRM_DEV_ERROR(ldb->dev, + "do not support creating a drm_connector\n"); + return -EINVAL; + } + + if (!bridge->encoder) { + DRM_DEV_ERROR(ldb->dev, "missing encoder\n"); + return -ENODEV; + } + + return drm_bridge_attach(bridge->encoder, + ldb_ch->next_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); +} + +int ldb_init_helper(struct ldb *ldb) +{ + struct device *dev = ldb->dev; + struct device_node *np = dev->of_node; + struct device_node *child; + int ret; + u32 i; + + ldb->regmap = syscon_node_to_regmap(np->parent); + if (IS_ERR(ldb->regmap)) { + ret = PTR_ERR(ldb->regmap); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get regmap: %d\n", ret); + return ret; + } + + for_each_available_child_of_node(np, child) { + struct ldb_channel *ldb_ch; + + ret = of_property_read_u32(child, "reg", &i); + if (ret || i > MAX_LDB_CHAN_NUM - 1) { + ret = -EINVAL; + DRM_DEV_ERROR(dev, + "invalid channel node address: %u\n", i); + of_node_put(child); + return ret; + } + + ldb_ch = ldb->channel[i]; + ldb_ch->ldb = ldb; + ldb_ch->chno = i; + ldb_ch->is_available = true; + ldb_ch->np = child; + + ldb->available_ch_cnt++; + } + + return 0; +} + +int ldb_find_next_bridge_helper(struct ldb *ldb) +{ + struct device *dev = ldb->dev; + struct ldb_channel *ldb_ch; + int ret, i; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + ldb_ch = ldb->channel[i]; + + if (!ldb_ch->is_available) + continue; + + ldb_ch->next_bridge = devm_drm_of_get_bridge(dev, ldb_ch->np, + 1, 0); + if (IS_ERR(ldb_ch->next_bridge)) { + ret = PTR_ERR(ldb_ch->next_bridge); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get next bridge: %d\n", + ret); + return ret; + } + } + + return 0; +} + +void ldb_add_bridge_helper(struct ldb *ldb, + const struct drm_bridge_funcs *bridge_funcs) +{ + struct ldb_channel *ldb_ch; + int i; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + ldb_ch = ldb->channel[i]; + + if (!ldb_ch->is_available) + continue; + + ldb_ch->bridge.driver_private = ldb_ch; + ldb_ch->bridge.funcs = bridge_funcs; + ldb_ch->bridge.of_node = ldb_ch->np; + + drm_bridge_add(&ldb_ch->bridge); + } +} + +void ldb_remove_bridge_helper(struct ldb *ldb) +{ + struct ldb_channel *ldb_ch; + int i; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + ldb_ch = ldb->channel[i]; + + if (!ldb_ch->is_available) + continue; + + drm_bridge_remove(&ldb_ch->bridge); + } +} diff --git a/drivers/gpu/drm/bridge/imx/imx-ldb-helper.h b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.h new file mode 100644 index 000000000000..a0a5cde27fbc --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +/* + * Copyright 2019,2020,2022 NXP + */ + +#ifndef __IMX_LDB_HELPER__ +#define __IMX_LDB_HELPER__ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define LDB_CH0_MODE_EN_TO_DI0 BIT(0) +#define LDB_CH0_MODE_EN_TO_DI1 (3 << 0) +#define LDB_CH0_MODE_EN_MASK (3 << 0) +#define LDB_CH1_MODE_EN_TO_DI0 BIT(2) +#define LDB_CH1_MODE_EN_TO_DI1 (3 << 2) +#define LDB_CH1_MODE_EN_MASK (3 << 2) +#define LDB_SPLIT_MODE_EN BIT(4) +#define LDB_DATA_WIDTH_CH0_24 BIT(5) +#define LDB_BIT_MAP_CH0_JEIDA BIT(6) +#define LDB_DATA_WIDTH_CH1_24 BIT(7) +#define LDB_BIT_MAP_CH1_JEIDA BIT(8) +#define LDB_DI0_VS_POL_ACT_LOW BIT(9) +#define LDB_DI1_VS_POL_ACT_LOW BIT(10) + +#define MAX_LDB_CHAN_NUM 2 + +enum ldb_channel_link_type { + LDB_CH_SINGLE_LINK, + LDB_CH_DUAL_LINK_EVEN_ODD_PIXELS, + LDB_CH_DUAL_LINK_ODD_EVEN_PIXELS, +}; + +struct ldb; + +struct ldb_channel { + struct ldb *ldb; + struct drm_bridge bridge; + struct drm_bridge *next_bridge; + struct device_node *np; + u32 chno; + bool is_available; + u32 in_bus_format; + u32 out_bus_format; + enum ldb_channel_link_type link_type; +}; + +struct ldb { + struct regmap *regmap; + struct device *dev; + struct ldb_channel *channel[MAX_LDB_CHAN_NUM]; + unsigned int ctrl_reg; + u32 ldb_ctrl; + unsigned int available_ch_cnt; +}; + +#define bridge_to_ldb_ch(b) container_of(b, struct ldb_channel, bridge) + +bool ldb_channel_is_single_link(struct ldb_channel *ldb_ch); +bool ldb_channel_is_split_link(struct ldb_channel *ldb_ch); + +int ldb_bridge_atomic_check_helper(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state); + +void ldb_bridge_mode_set_helper(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode); + +void ldb_bridge_enable_helper(struct drm_bridge *bridge); + +void ldb_bridge_disable_helper(struct drm_bridge *bridge); + +int ldb_bridge_attach_helper(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags); + +int ldb_init_helper(struct ldb *ldb); + +int ldb_find_next_bridge_helper(struct ldb *ldb); + +void ldb_add_bridge_helper(struct ldb *ldb, + const struct drm_bridge_funcs *bridge_funcs); + +void ldb_remove_bridge_helper(struct ldb *ldb); + +#endif /* __IMX_LDB_HELPER__ */ From patchwork Sat Jun 11 14:14:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878535 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E84D6C43334 for ; Sat, 11 Jun 2022 14:14:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233449AbiFKOOK (ORCPT ); Sat, 11 Jun 2022 10:14:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235740AbiFKOOF (ORCPT ); Sat, 11 Jun 2022 10:14:05 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70072.outbound.protection.outlook.com [40.107.7.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B82AE65413; Sat, 11 Jun 2022 07:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ms/ALPDcKIIzIIxGSyIAiubvRn+b7hEMr1qir2st4liLUT1rqP85Hl+JIO+dT/4rolQX8+4xVowZvB6nKuDkYYSVUjHVr5tGFSq2PSDQnNBL7IAhv2bMsrcwUK9qE+IdM6pC1mudLf9xvsvpqkXu5OAMkfWjFDDTXN4fmuiRHAuRLpDrvrI852ehcNUXkNBiRna9bkSsDJvzJgLml89GSs0gaoTB6T0gO5FDodzYqFPNVtz4vzAvpN1hew0qIaq7vRsAbMa9K0AUSfIDcXfNW8s/OIwgindasH+py/yvRI4JNlQAsLbPmXUkLwPYzTjcyz+49w1dhoczccJxw74RlQ== 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=8nzwiaILeTGvvZlpFW2CN9yrCZ0Qr8QEleqjeVGUrwA=; b=NWw/+YLumMpmgsIAOx3LfHA9TtcOh3obRRC94l1HxdjRnnTOO3NF04ECzLqpWPg0m4s7wisll6PxIeMPX9y2uxtJYNP3D1CqYDlhf2q7738PNj8hqYWDNdXuF6byZ9Ls4Az6tMLpx7TEVKYUbcSaeduU7TA86q32w7W9dJP7sIQtYlbqxpykSLMnfPJ7WMirJkXUgitq0Jpx7yje0dGgfUEd6B06lmt5iZ7f7yWV0pGxKoH8FyQADw6DLm5NefyQBxzovDjAoCZPZhd8eEMcunrBE7JtNMsTu7EnPurOOYkDT9yiTGTZszEbQc8LLXB8gVoZ1SrbImfVg90pLjQIQw== 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=8nzwiaILeTGvvZlpFW2CN9yrCZ0Qr8QEleqjeVGUrwA=; b=NAnvQJtx2EZeCNfK537uXaCBjKVWHWtiJ61Xgh4XhiELjg/esb8WjP/pYeaJd1vy5mHrgVqS1MjCLySCrLxPUGy5iODPUJVC4TWUrWLe4Ye8vkYrlqeSojZdT/yx0qet/r3bW9pGOxpUCUVbmcE8cz5a4b3cL4ypSh0oZd3R8Ow= 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 DB8PR04MB6347.eurprd04.prod.outlook.com (2603:10a6:10:107::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Sat, 11 Jun 2022 14:13:56 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:13:56 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com, Rob Herring Subject: [PATCH v9 10/14] dt-bindings: display: bridge: Add i.MX8qm/qxp LVDS display bridge binding Date: Sat, 11 Jun 2022 22:14:17 +0800 Message-Id: <20220611141421.718743-11-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3eea83e0-6be7-436e-c0b6-08da4bb49f35 X-MS-TrafficTypeDiagnostic: DB8PR04MB6347:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CaJkSJ57R7TU/wwc6H5ZNNQTPHkC8mH9ifl45Uhtr47rosOYouTt6nNl2s750cmm6+xcdQymQJfGDD/udui/tt44QWcPewFYQSeT0XuB46YVddWF6rL63crm/pOQTN5jZrFifam86r5DpPOCaLHspOQuCXqaa2MYFRzYExgn9rSVPL2+NFwUciO0e4VU2ye896ttqK8VUfqhAScpHaV9ZaGaPXpdovx5lJRW+sNnNzAX1s2uoj5yy1WKW3iCtk2NKV6jw8fJixidbaMPrHVRtj9wRom4Ov6Af8eSOdHeXIJpo+ZT2Il3b7xPwqaN/WHqF/4eMIWcJjkocQJRKCRH0WIUDpUp1M0XAQh/EUBW8u00Tb1ECULpEQDi1sMeDKF4DPRiseZ0Dmvjdvs6E5mkhT7vPBkEVxcpkJTSo3ipZ9Y+imXNSyHDE2Bq2tNJOfoxVMi3kX4+J+m8Yulj0dXSxipWkR0ZiQ4kN7iGPQEQj1VLo+wmZCnQ+eGVENLBkJ20IUq0of2gLfJgF9FH7CjDmcWOp8nWAhhloH/XjPtUDfCScvP2Ro1N69suPCCROMXVReLQBXTcVprjo3hSQ82zw1+nNVkdrXXJjdut2kjLwUHivGyFmZFiIfWNpkQHLE967Y9nWFuRtbCITo7cBtPFbyfgmTdbpGhuhPheCQ3+6lV5+jqR2pHoL/p0WxCkKgNdwMrgeU5Qdu/5fcaKvLVVVJ9CqfRtSh3dDh1dw6uQYfaREUNkok28WkLxeRkyavF3GriKYVhLLpPpssOY00xG8b2RLn7Rtok0YI1ymd7CbeZtm4zeS2I3nmvror/PMzcykLcZVP56DNiWmF1HRq5++w== 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:(13230016)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(1076003)(4326008)(8676002)(86362001)(316002)(186003)(8936002)(2616005)(7416002)(36756003)(83380400001)(52116002)(38350700002)(38100700002)(6512007)(26005)(966005)(6506007)(6666004)(508600001)(6486002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ol73s/IT6oB+3pjlGf27h873W0uOQwOhrDVg4cWvPIdnFnrB3rB6wrXERURb96SqG8Rw1YXxGsiGQtyZG2/CPwrmyOHltuh3KwwKsxkpMGu+v4n10ewt6AcvZI/Ln4Q7JlmWpJnyVHq7PNVQGV4e2TSOaSpTCYNyGFNn8D3tTwP1dWqJGR4GQIbKO8nfAoSIcBl1yq2N4nwnYw9p6UIoIJGiBSaY2G39xawNvxIjdcGMB/mr/gi2/L17otH7VMWESWZ9mz5XIME9rGkLaArNVEmLa9JOW+IVYDF2QecFSRWihI+4ZwCPxsq3tEEBpkpwrJuEHmiMszE1t4G1wq9SsaFXxr+43Wr0YXIJePxOu7nzs6kI0gAkqMDUZ82PM9V2/gy1+cxorUiGAWnMdeQ1qt83fa0aGh0wuykMkn9oAQqMlX1jYE+QjMmQkO32tThXKIewMRiadgGYK6vPsVTJPbhv5ViPe0oDN7ZAy/ipiyD3mE8XuZtptGRrbm3C6mgszCqhAhLEA6iwg14YedKUvNMV8N1fX5R5hcV1UkbqbETLxETLgRyyt+MXXDvIMQPoL8Y53yz2qP0c1pA5T8GHsrkxlB5I/t1MGdOs7Z8o3I3OlSK6DzSteCIMfY7pR7rbh8LE14FNJfPidTe12WUUER2/hSNovSq446p3s3SvXUKXgcrofTdSzf/Bec4bMLmQKGKJ3umwoFnw9oz5KOgYXqRMdib6cTn0EKLx+Zbrhbylo0QzgrEdiC9nXcykJvzZFmQE6TM4BaPE8kVlNZHlqESLEvtjjkbQKny/hAG7gMF6n9dir4vPAVEsbe/6VEZYLFd33e8q0Wrc/tnGLndrqBQcX299Si4rX6vc7ItP8LacUNEOsxyrF+P/KfcU1lHmfAs3X6btZoulsfqgyI2CAycjZaUYAXShLh0NhqWRgagIadk4/aGC9VoKKtel2kEXuAnoO2MHmds07Mpltd2HNJULAixLA6fIFB0GSDlXAfv371s0odz6kct7QY9Cy+lqYqAtEZ52tL1UuUPnS8jTYL4nIiRqIGpkKOzSZYI8MnlYMxQQqE8ZJ1t0NG2XNEiLuT16TQFxGqzoOExTbdBBKYs0mrW2QV9JdTgYTSHAvC04WYmjbgA+LGlILndEr5BMRO+NjZBwwUseAr0omzw8t3e32uk69IybCPKYpJWOy4G7v74i3U7l0KNyAwWMRt+nSxeGR42RK+/zjQ2iV7iA9xNmlsdEBWzjGFusiIhLsxp2wkC3W/bmsZmqc3p7l0Ieocx1cIuTjeb8lKBvkxih0+mB9jLSpaUmuLG5lHZehoQf3lJAVXWGXJ7O2f7hKBcd5Tbe6V90T1qBNKlCCsM47R2WYc5yL2CCLezP7W4VZuUTJFW/KFl/y/iVEOVT1+1hZzA+D2n/Iy6GQLA9sz+51NiMi4jBL3Ob3DKLUaAQ8BpHOtX6QjQb0J8waq0DsXdjpzWEcTQcrqGHaw7k/pEAyTXQUjeqKpvbrWVTG/VI0Q6Z54HVDaahzyCQpcunn++9Csi/J/O+ukAWRFVuc2DnDKjhqO7EmMavyc4h8vNintZgVC8ku1bD5qzA3DCP3KtDeZTR4l4vvljaYJVMoJIFiHhCC4PHaGLA2XAsUvYdP7hkR5xLY0kSkSzP7ZteR4OYH+DbHp4xw3Ugqx2ZyidShHzVvJLZ5jK4vlientxcm4ppSHU+SV6vZhxrhkj0zpcqMQ04sKU8/u8lXVRUUA0VKQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3eea83e0-6be7-436e-c0b6-08da4bb49f35 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:13:56.5049 (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: uXMzfFTHkM5zpUf0edWbbFXdY/8hgsHthNy/z/+unB6XmAZJt+lqK7cQHaLLeodkdaR0OxKvEtWR80CMxdUsoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6347 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds bindings for i.MX8qm/qxp LVDS display bridge(LDB). Reviewed-by: Rob Herring Signed-off-by: Liu Ying --- v8->v9: * No change. v7->v8: * No change. v6->v7: * No change. v5->v6: * No change. v4->v5: * No change. v3->v4: * Add Rob's R-b tag. v2->v3: * Drop 'fsl,syscon' property. (Rob) * Mention the CSR module controls LDB. v1->v2: * Use graph schema. (Laurent) * Side note i.MX8qxp LDB official name 'pixel mapper'. (Laurent) .../display/bridge/fsl,imx8qxp-ldb.yaml | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-ldb.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-ldb.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-ldb.yaml new file mode 100644 index 000000000000..94543006f5de --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-ldb.yaml @@ -0,0 +1,173 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/fsl,imx8qxp-ldb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qm/qxp LVDS Display Bridge + +maintainers: + - Liu Ying + +description: | + The Freescale i.MX8qm/qxp LVDS Display Bridge(LDB) has two channels. + + The i.MX8qm/qxp LDB is controlled by Control and Status Registers(CSR) module. + The CSR module, as a system controller, contains the LDB's configuration + registers. + + For i.MX8qxp LDB, each channel supports up to 24bpp parallel input color + format and can map the input to VESA or JEIDA standards. The two channels + cannot be used simultaneously, that is to say, the user should pick one of + them to use. Two LDB channels from two LDB instances can work together in + LDB split mode to support a dual link LVDS display. The channel indexes + have to be different. Channel0 outputs odd pixels and channel1 outputs + even pixels. + + For i.MX8qm LDB, each channel additionally supports up to 30bpp parallel + input color format. The two channels can be used simultaneously, either + in dual mode or split mode. In dual mode, the two channels output identical + data. In split mode, channel0 outputs odd pixels and channel1 outputs even + pixels. + + A side note is that i.MX8qm/qxp LDB is officially called pixel mapper in + the SoC reference manuals. The pixel mapper uses logic of LDBs embedded in + i.MX6qdl/sx SoCs, i.e., it is essentially based on them. To keep the naming + consistency, this binding calls it LDB. + +properties: + compatible: + enum: + - fsl,imx8qm-ldb + - fsl,imx8qxp-ldb + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + clocks: + items: + - description: pixel clock + - description: bypass clock + + clock-names: + items: + - const: pixel + - const: bypass + + power-domains: + maxItems: 1 + + fsl,companion-ldb: + $ref: /schemas/types.yaml#/definitions/phandle + description: | + A phandle which points to companion LDB which is used in LDB split mode. + +patternProperties: + "^channel@[0-1]$": + type: object + description: Represents a channel of LDB. + + properties: + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + reg: + description: The channel index. + enum: [ 0, 1 ] + + phys: + description: A phandle to the phy module representing the LVDS PHY. + maxItems: 1 + + phy-names: + const: lvds_phy + + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Input port of the channel. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Output port of the channel. + + required: + - "#address-cells" + - "#size-cells" + - reg + - phys + - phy-names + + additionalProperties: false + +required: + - compatible + - "#address-cells" + - "#size-cells" + - clocks + - clock-names + - power-domains + - channel@0 + - channel@1 + +allOf: + - if: + properties: + compatible: + contains: + const: fsl,imx8qm-ldb + then: + properties: + fsl,companion-ldb: false + +additionalProperties: false + +examples: + - | + #include + ldb { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,imx8qxp-ldb"; + clocks = <&clk IMX_SC_R_LVDS_0 IMX_SC_PM_CLK_MISC2>, + <&clk IMX_SC_R_LVDS_0 IMX_SC_PM_CLK_BYPASS>; + clock-names = "pixel", "bypass"; + power-domains = <&pd IMX_SC_R_LVDS_0>; + + channel@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + phys = <&mipi_lvds_0_phy>; + phy-names = "lvds_phy"; + + port@0 { + reg = <0>; + + mipi_lvds_0_ldb_ch0_mipi_lvds_0_pxl2dpi: endpoint { + remote-endpoint = <&mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch0>; + }; + }; + }; + + channel@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + phys = <&mipi_lvds_0_phy>; + phy-names = "lvds_phy"; + + port@0 { + reg = <0>; + + mipi_lvds_0_ldb_ch1_mipi_lvds_0_pxl2dpi: endpoint { + remote-endpoint = <&mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch1>; + }; + }; + }; + }; From patchwork Sat Jun 11 14:14:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878536 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88471C433EF for ; Sat, 11 Jun 2022 14:14:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232347AbiFKOOb (ORCPT ); Sat, 11 Jun 2022 10:14:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235563AbiFKOOJ (ORCPT ); Sat, 11 Jun 2022 10:14:09 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80053.outbound.protection.outlook.com [40.107.8.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0682364D3B; Sat, 11 Jun 2022 07:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l1Ty/+PAEBUU7ifPDh/V1NBr0yZgqupUFqaLhTZ7xhG3hmdyfYmX/JjDkgoFkLQ1FammqbIq/hffouxnmRCQHIDp/MzJbA5z31sh/XTR+fcPeWIrcMnwo9j5rzDA3Ins9SaVxHyHnHa3Vq61JGbZTCXCxYwLSYT4ywkl3BO0iEuUjsnBcoEaPKXfUNadq3OVnyVcIDHpbIedTtH7504hKnQdkuCpgxPf/AhOWL1wFHaTF3GzHCPsLouI41U82T+sCXQTNcKkrqTR+0ARGjVbfyhNX/B+zUfemlxr1NW4bhIbzweXcP0ldME75vGsZz/s+yHSTTng1m5zoEOJiLPgBQ== 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=0IcYQliG2B0EGhA7wp0AXNr347RF7BaEmrfkGwRr5AA=; b=c2pIfLcYtsgYAX/cyGm/jzkRu0dpDIfimd1vyRq8Jc248sVoA1ElioQGUTWdfR04XZpIOj5BLR6bYZi388PSwqAjtHa/pp4Lfv/JspXmncr29B8PilVMBoGQRti7b3jpfEtl9T4HVbfFGfIP/EYl+k1VsppwP0KOs8zkIf0ShI1xosaXtaWsGgQYmHe6B4n3m5EF1fc4lVCOFN51bmYg8z9skCy6ZGXTEupfd8hCfnw3iLpm2jUijQQgztwC/2DEv31L1XeU26lQZEue898KjtYpiPiKsVTX40zokBznZhaXCccRoxCs85sceCFU85RVPpscMnWuth8nkLENJWlTBQ== 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=0IcYQliG2B0EGhA7wp0AXNr347RF7BaEmrfkGwRr5AA=; b=h4Clr12cX7wxi01i14JhnGwA1ZhUWyONZyUAxufqlZNGS3zSvA5pnng017IEIYx7TC3Y6hl8CFf7pSAIZnwNo9tNiAgEbiQymBxN42dIUt+JqvRjKtC2BDFcMoJBhsRkxPyawcLxVCfy1V/z23ikJapRR4wvMmQuU/JLntsSTU4= 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 DB9PR04MB8249.eurprd04.prod.outlook.com (2603:10a6:10:25c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.16; Sat, 11 Jun 2022 14:14:03 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:14:02 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com Subject: [PATCH v9 11/14] drm/bridge: imx: Add LDB support for i.MX8qxp Date: Sat, 11 Jun 2022 22:14:18 +0800 Message-Id: <20220611141421.718743-12-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25e3208f-7394-4adb-c354-08da4bb4a2df X-MS-TrafficTypeDiagnostic: DB9PR04MB8249:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JFi8dctIEuzuXNZSoMHuZ0QR1wW7NyvxYXy6fO7qwZaEke06kuY/zzb344msZoA/h07Bbsu7zvZuu8dOnCZYOwxl0TZgErr7GGzvzii4sq9ZFtTF3erx4Et1r4VixW9TH0Oj9y1dA/DAXBefaYDaAgwX/ncdtSb6mMuGyvzrD5uql40b1u9gzl15nT4gqDgWXh4u41yYCucwD/vLifuXVH/JVHeQYOAN9tO1fJxf6MlsxwiJFGrMHiCPEwpgFXJ8mzvx+Vjl+Zv6JceR8K35sNUz675+7pnKMK/nudC5ZTENP9Q//LRKNppjbOcfBzFBsV5nIHP+56DPWyfAnvLzNegQdY+e6MhYMsY5ddiUOtf+URjGYcW/Fg923oKMDdsghnHDhryixPtNlPCl6LpiJ2LKLeNAqyO9idf7h+QCCFirLxC0j5/wTiA69QJBPS7YtkHbSJ1wOX4HrcWARazMKxiVEbZ+6f7jECagr9756rWlD6BmiAVyYfT3C1fbDo1+zvLmzGFiTlVswjNGQOjYQMPg/n1RXwZXkMpvDeg6KsTIaBcCaAuK5hpeYZ+sXp/RBfjeZ/Lccj0vQVBe8X/4JA/YPMZ5TilgCv4dpXI5es1NcACTeSMILZ4h0679Rn+/bOhNneLP2k7LWDIiEfKIQeTN3QAEudm9XlURG9ha1HwWHKliCx8YSG8tbkQE4Yzo6paG4ysuOJCC/2nz7gfSIw== 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:(13230016)(4636009)(366004)(26005)(6512007)(38100700002)(38350700002)(83380400001)(86362001)(186003)(1076003)(2616005)(8936002)(316002)(5660300002)(66946007)(66556008)(66476007)(4326008)(8676002)(36756003)(30864003)(7416002)(2906002)(508600001)(6486002)(6506007)(6666004)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QVJKlYAdJVeTEVOVMll/ETl1DeMiMlBPWlu85L9K1Nex4ZCk3CJc92IUHW9UYkSoZ4hM04m2knCIUDAkYBteDT19jAewvZ33SfGue2HodbN+yhK5OBZ5Nq/ikAT1UUD1BbPZHKPGFyDDel9Ygq+y333KxPqXvjTNqBUANVasXT1aOQ/5TBVliKovGpVdZymMw1mDaDWrplkeHWHk690WCXIRH/7FEWzMJSOtIQFD/Dd0f894Jo1aYOaPBNyF3Tyx2R/Q535JNDobhcW6qoRwcJDGrmyxyADmMi6ms+QOiQzR3Ye54yfp2fLNfZkq/LmcEZRBNleo494kzLeNtyfHCfbjF3i2EaP/2vM6cwIC/fh7XoPDFUU5QjboAFz7j93pcjh9ICIKVjdB98x9yY915yFecasazlwBgNLDpqiFXIMCMWR2je9OYdYmu5RpDhh+64I6sQACj+CBj7juFxqGnaIPHtKJdIZIqJJjtxAGjHw7LI0TNc2lPpmIiQVAVe7G1nPIXYfnL6aMmQ0IVjbUHnIxU06ge3Q+np7W4zj68LCDBkD6IXexhtYvwzjfi2hCwE6rWV5XGbXvTUoHJCMSQuo4cDuqZR6QRPHdA6g679deaZMCZsAHQpWpsGGR5ZNCRxKatz1C62dInhlcuH6Em9B/XhjL1SW3S8NkWNODKkQf3g84CESqvHiS5YCvTyjyxzlnE5Nfyurh6Mz3kIeEoYEZToVB5e3ttY8EDMakg9c1IbCywXUV7IL4VXpgIfM1o6b4tDGUzrv9o6pXMiZFwObvL6aAyrkfTOV/hFGkuc29KPrv+VrCMDmhAsAYNi482I/eicwfguSbx3GbmfZ3F8nNBM+TAUGw1bwTKYpnklTykyNn7iMjYsi7xKSylApYTfH1qB17o9BfzKPy9lpo1HgQW4hCCRGQX2JIs2nqHokFdETvloCFOHbYThh1Z81fv6vpZawZdMXQ9e+hFzU3oJRXB/fkyv6ul/kBCHqPxNucwWgBoUsjgOu45cfubrE7PlMAoGSbtdZGWrm8jlcEE+NignSofJVqIlTFwA0AN75sYopeVo4uZCMb/JVt2Wj3XAiPd9hjeFnhZxn+VIlufyGdvToMo1eUZzgO6SLWt2pi6R11cUJTuRXUw1yk+ds+tVO1hlnnI6hYa7xwpqu9AruBy1U4f/R+PXQSjKbeC9DJtOPrKzJmU1hcIzYoM7VnqL1LPzpg1FcZ5qctAUE/4FZ8YFlFfaAJT4JBOTiq8fUDG28MDD9bDELYjNs7LinRPbNR15DUTB2R36zQX8RtsW55JBdNVnmbuHvJRwIb4eYhhS+IEt0/BmhpjxODOayJ4FsUh0v7lcnJyk4yQmaO5Zo0LBg873+B9jMBIcgGf+ONDF2j1jpL42oMW0kNTBBQK2UIzWFRoTnrFeBpL5u3ZnYM66siwWiGz+dYiH3nDJm9VXFnE3g2qyXdhkKTKLVFm59sJTGLnq1YO2lDk9yKCwc6zUXmOYXUaQms+9EP/ytgRa+4rDbwf/95SpP74BnkI1JJXSRT3QVN1xw1mHWdZ37rYrGgg04Xa/651j3VjPP+D8zhzFcHtaxvoIZkDo7oSx2agQwMEc/KHvLL4TwfkwAS3O4jcCIYV+8cw4tm1ddUQSoP1kWU2E1KVZHbcNp0y/EKgntzaMKCyeE87/cBmLOzur2gdSOrfskgNai5DYrJhxD6DlOU8yr/1wijuSY4tUrKhUCh/uHf+QGH5jQAUQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25e3208f-7394-4adb-c354-08da4bb4a2df X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:14:02.7459 (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: v6IYWaIZ5pGJgYZnqyLzMelard22edBrsPoj2he1rnAfaiM5kTlzFcGc81sy6YHw0jaHTBBSb0oqR0pGnLNEJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8249 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds a drm bridge driver for i.MX8qxp LVDS display bridge(LDB) which is officially named as pixel mapper. The LDB has two channels. Each of them supports up to 24bpp parallel input color format and can map the input to VESA or JEIDA standards. The two channels cannot be used simultaneously, that is to say, the user should pick one of them to use. Two LDB channels from two LDB instances can work together in LDB split mode to support a dual link LVDS display. The channel indexes have to be different. Channel0 outputs odd pixels and channel1 outputs even pixels. This patch supports the LDB single mode and split mode. Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- Marcel, I add your T-b tag from v6, let me know if you want me to drop it, as the checkpatch fix in v7 is trivial. v8->v9: * No change. v7->v8: * No change. v6->v7: * Fix below complaints from 'checkpatch.pl --strict'. (Robert) - 'Prefer using the BIT macro' - 'Alignment should match open parenthesis' - 'Comparison to NULL could be written "!companion_port"' - 'ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP' * Add Marcel's T-b tag. * Add Robert's R-b tag. v5->v6: * No change. v4->v5: * Link with the imx-ldb-helper object. (Robert) * Correspondingly, rename 'imx8qxp-ldb.c' to 'imx8qxp-ldb-drv.c'. v3->v4: * No change. v2->v3: * No change. v1->v2: * Drop unnecessary DT validation. * Use of_graph_get_endpoint_by_regs() and of_graph_get_remote_endpoint() to get the input remote endpoint in imx8qxp_ldb_set_di_id(). * Avoid using companion_port OF node after putting it in imx8qxp_ldb_parse_dt_companion(). * Mention i.MX8qxp LDB official name 'pixel mapper' in the bridge driver and Kconfig help message. drivers/gpu/drm/bridge/imx/Kconfig | 9 + drivers/gpu/drm/bridge/imx/Makefile | 3 + drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c | 722 +++++++++++++++++++ 3 files changed, 734 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index 53001650a61a..f33d67be54dc 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -1,3 +1,12 @@ +config DRM_IMX8QXP_LDB + tristate "Freescale i.MX8QXP LVDS display bridge" + depends on OF + depends on COMMON_CLK + select DRM_KMS_HELPER + help + Choose this to enable the internal LVDS Display Bridge(LDB) found in + Freescale i.MX8qxp processor. Official name of LDB is pixel mapper. + config DRM_IMX8QXP_PIXEL_COMBINER tristate "Freescale i.MX8QM/QXP pixel combiner" depends on OF diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile index e74dd6422e95..96d5d1e9659d 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -1,3 +1,6 @@ +imx8qxp-ldb-objs := imx-ldb-helper.o imx8qxp-ldb-drv.o +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 diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c new file mode 100644 index 000000000000..1cca5fc96a4b --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c @@ -0,0 +1,722 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "imx-ldb-helper.h" + +#define LDB_CH_SEL BIT(28) + +#define SS_CTRL 0x20 +#define CH_HSYNC_M(id) BIT(0 + ((id) * 2)) +#define CH_VSYNC_M(id) BIT(1 + ((id) * 2)) +#define CH_PHSYNC(id) BIT(0 + ((id) * 2)) +#define CH_PVSYNC(id) BIT(1 + ((id) * 2)) + +#define DRIVER_NAME "imx8qxp-ldb" + +struct imx8qxp_ldb_channel { + struct ldb_channel base; + struct phy *phy; + unsigned int di_id; +}; + +struct imx8qxp_ldb { + struct ldb base; + struct device *dev; + struct imx8qxp_ldb_channel channel[MAX_LDB_CHAN_NUM]; + struct clk *clk_pixel; + struct clk *clk_bypass; + struct drm_bridge *companion; + int active_chno; +}; + +static inline struct imx8qxp_ldb_channel * +base_to_imx8qxp_ldb_channel(struct ldb_channel *base) +{ + return container_of(base, struct imx8qxp_ldb_channel, base); +} + +static inline struct imx8qxp_ldb *base_to_imx8qxp_ldb(struct ldb *base) +{ + return container_of(base, struct imx8qxp_ldb, base); +} + +static void imx8qxp_ldb_set_phy_cfg(struct imx8qxp_ldb *imx8qxp_ldb, + unsigned long di_clk, bool is_split, + struct phy_configure_opts_lvds *phy_cfg) +{ + phy_cfg->bits_per_lane_and_dclk_cycle = 7; + phy_cfg->lanes = 4; + + if (is_split) { + phy_cfg->differential_clk_rate = di_clk / 2; + phy_cfg->is_slave = !imx8qxp_ldb->companion; + } else { + phy_cfg->differential_clk_rate = di_clk; + phy_cfg->is_slave = false; + } +} + +static int +imx8qxp_ldb_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 ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + base_to_imx8qxp_ldb_channel(ldb_ch); + struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb); + struct drm_bridge *companion = imx8qxp_ldb->companion; + struct drm_display_mode *adj = &crtc_state->adjusted_mode; + unsigned long di_clk = adj->clock * 1000; + bool is_split = ldb_channel_is_split_link(ldb_ch); + union phy_configure_opts opts = { }; + struct phy_configure_opts_lvds *phy_cfg = &opts.lvds; + int ret; + + ret = ldb_bridge_atomic_check_helper(bridge, bridge_state, + crtc_state, conn_state); + if (ret) + return ret; + + imx8qxp_ldb_set_phy_cfg(imx8qxp_ldb, di_clk, is_split, phy_cfg); + ret = phy_validate(imx8qxp_ldb_ch->phy, PHY_MODE_LVDS, 0, &opts); + if (ret < 0) { + DRM_DEV_DEBUG_DRIVER(imx8qxp_ldb->dev, + "failed to validate PHY: %d\n", ret); + return ret; + } + + if (is_split && companion) { + ret = companion->funcs->atomic_check(companion, + bridge_state, crtc_state, conn_state); + if (ret) + return ret; + } + + return ret; +} + +static void +imx8qxp_ldb_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb_channel *companion_ldb_ch; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + base_to_imx8qxp_ldb_channel(ldb_ch); + struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb); + struct drm_bridge *companion = imx8qxp_ldb->companion; + struct device *dev = imx8qxp_ldb->dev; + unsigned long di_clk = adjusted_mode->clock * 1000; + bool is_split = ldb_channel_is_split_link(ldb_ch); + union phy_configure_opts opts = { }; + struct phy_configure_opts_lvds *phy_cfg = &opts.lvds; + u32 chno = ldb_ch->chno; + int ret; + + ret = pm_runtime_get_sync(dev); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to get runtime PM sync: %d\n", ret); + + ret = phy_init(imx8qxp_ldb_ch->phy); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to initialize PHY: %d\n", ret); + + ret = phy_set_mode(imx8qxp_ldb_ch->phy, PHY_MODE_LVDS); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to set PHY mode: %d\n", ret); + + if (is_split && companion) { + companion_ldb_ch = bridge_to_ldb_ch(companion); + + companion_ldb_ch->in_bus_format = ldb_ch->in_bus_format; + companion_ldb_ch->out_bus_format = ldb_ch->out_bus_format; + } + + clk_set_rate(imx8qxp_ldb->clk_bypass, di_clk); + clk_set_rate(imx8qxp_ldb->clk_pixel, di_clk); + + imx8qxp_ldb_set_phy_cfg(imx8qxp_ldb, di_clk, is_split, phy_cfg); + ret = phy_configure(imx8qxp_ldb_ch->phy, &opts); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to configure PHY: %d\n", ret); + + if (chno == 0) + ldb->ldb_ctrl &= ~LDB_CH_SEL; + else + ldb->ldb_ctrl |= LDB_CH_SEL; + + /* input VSYNC signal from pixel link is active low */ + if (imx8qxp_ldb_ch->di_id == 0) + ldb->ldb_ctrl |= LDB_DI0_VS_POL_ACT_LOW; + else + ldb->ldb_ctrl |= LDB_DI1_VS_POL_ACT_LOW; + + /* + * For split mode, settle input VSYNC signal polarity and + * channel selection down early. + */ + if (is_split) + regmap_write(ldb->regmap, ldb->ctrl_reg, ldb->ldb_ctrl); + + ldb_bridge_mode_set_helper(bridge, mode, adjusted_mode); + + if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, CH_VSYNC_M(chno), 0); + else if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, + CH_VSYNC_M(chno), CH_PVSYNC(chno)); + + if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, CH_HSYNC_M(chno), 0); + else if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, + CH_HSYNC_M(chno), CH_PHSYNC(chno)); + + if (is_split && companion) + companion->funcs->mode_set(companion, mode, adjusted_mode); +} + +static void +imx8qxp_ldb_bridge_atomic_pre_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb); + struct drm_bridge *companion = imx8qxp_ldb->companion; + bool is_split = ldb_channel_is_split_link(ldb_ch); + + clk_prepare_enable(imx8qxp_ldb->clk_pixel); + clk_prepare_enable(imx8qxp_ldb->clk_bypass); + + if (is_split && companion) + companion->funcs->atomic_pre_enable(companion, old_bridge_state); +} + +static void +imx8qxp_ldb_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + base_to_imx8qxp_ldb_channel(ldb_ch); + struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb); + struct drm_bridge *companion = imx8qxp_ldb->companion; + struct device *dev = imx8qxp_ldb->dev; + bool is_split = ldb_channel_is_split_link(ldb_ch); + int ret; + + if (ldb_ch->chno == 0 || is_split) { + ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK; + ldb->ldb_ctrl |= imx8qxp_ldb_ch->di_id == 0 ? + LDB_CH0_MODE_EN_TO_DI0 : LDB_CH0_MODE_EN_TO_DI1; + } + if (ldb_ch->chno == 1 || is_split) { + ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK; + ldb->ldb_ctrl |= imx8qxp_ldb_ch->di_id == 0 ? + LDB_CH1_MODE_EN_TO_DI0 : LDB_CH1_MODE_EN_TO_DI1; + } + + ldb_bridge_enable_helper(bridge); + + ret = phy_power_on(imx8qxp_ldb_ch->phy); + if (ret) + DRM_DEV_ERROR(dev, "failed to power on PHY: %d\n", ret); + + if (is_split && companion) + companion->funcs->atomic_enable(companion, old_bridge_state); +} + +static void +imx8qxp_ldb_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + base_to_imx8qxp_ldb_channel(ldb_ch); + struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb); + struct drm_bridge *companion = imx8qxp_ldb->companion; + struct device *dev = imx8qxp_ldb->dev; + bool is_split = ldb_channel_is_split_link(ldb_ch); + int ret; + + ret = phy_power_off(imx8qxp_ldb_ch->phy); + if (ret) + DRM_DEV_ERROR(dev, "failed to power off PHY: %d\n", ret); + + ret = phy_exit(imx8qxp_ldb_ch->phy); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to teardown PHY: %d\n", ret); + + ldb_bridge_disable_helper(bridge); + + clk_disable_unprepare(imx8qxp_ldb->clk_bypass); + clk_disable_unprepare(imx8qxp_ldb->clk_pixel); + + if (is_split && companion) + companion->funcs->atomic_disable(companion, old_bridge_state); + + ret = pm_runtime_put(dev); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret); +} + +static const u32 imx8qxp_ldb_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, + MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, + MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA, + MEDIA_BUS_FMT_FIXED, +}; + +static bool imx8qxp_ldb_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx8qxp_ldb_bus_output_fmts); i++) { + if (imx8qxp_ldb_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx8qxp_ldb_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) +{ + struct drm_display_info *di; + const struct drm_format_info *finfo; + u32 *input_fmts; + + if (!imx8qxp_ldb_bus_output_fmt_supported(output_fmt)) + return NULL; + + *num_input_fmts = 1; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_FIXED: + di = &conn_state->connector->display_info; + + /* + * Look at the first bus format to determine input format. + * Default to MEDIA_BUS_FMT_RGB888_1X24, if no match. + */ + if (di->num_bus_formats) { + finfo = drm_format_info(di->bus_formats[0]); + + input_fmts[0] = finfo->depth == 18 ? + MEDIA_BUS_FMT_RGB666_1X24_CPADHI : + MEDIA_BUS_FMT_RGB888_1X24; + } else { + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + } + break; + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: + input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X24_CPADHI; + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + break; + default: + kfree(input_fmts); + input_fmts = NULL; + break; + } + + return input_fmts; +} + +static u32 * +imx8qxp_ldb_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + unsigned int *num_output_fmts) +{ + *num_output_fmts = ARRAY_SIZE(imx8qxp_ldb_bus_output_fmts); + return kmemdup(imx8qxp_ldb_bus_output_fmts, + sizeof(imx8qxp_ldb_bus_output_fmts), GFP_KERNEL); +} + +static enum drm_mode_status +imx8qxp_ldb_bridge_mode_valid(struct drm_bridge *bridge, + const struct drm_display_info *info, + const struct drm_display_mode *mode) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + bool is_single = ldb_channel_is_single_link(ldb_ch); + + if (mode->clock > 170000) + return MODE_CLOCK_HIGH; + + if (mode->clock > 150000 && is_single) + return MODE_CLOCK_HIGH; + + return MODE_OK; +} + +static const struct drm_bridge_funcs imx8qxp_ldb_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .mode_valid = imx8qxp_ldb_bridge_mode_valid, + .attach = ldb_bridge_attach_helper, + .atomic_check = imx8qxp_ldb_bridge_atomic_check, + .mode_set = imx8qxp_ldb_bridge_mode_set, + .atomic_pre_enable = imx8qxp_ldb_bridge_atomic_pre_enable, + .atomic_enable = imx8qxp_ldb_bridge_atomic_enable, + .atomic_disable = imx8qxp_ldb_bridge_atomic_disable, + .atomic_get_input_bus_fmts = + imx8qxp_ldb_bridge_atomic_get_input_bus_fmts, + .atomic_get_output_bus_fmts = + imx8qxp_ldb_bridge_atomic_get_output_bus_fmts, +}; + +static int imx8qxp_ldb_set_di_id(struct imx8qxp_ldb *imx8qxp_ldb) +{ + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + &imx8qxp_ldb->channel[imx8qxp_ldb->active_chno]; + struct ldb_channel *ldb_ch = &imx8qxp_ldb_ch->base; + struct device_node *ep, *remote; + struct device *dev = imx8qxp_ldb->dev; + struct of_endpoint endpoint; + int ret; + + ep = of_graph_get_endpoint_by_regs(ldb_ch->np, 0, -1); + if (!ep) { + DRM_DEV_ERROR(dev, "failed to get port0 endpoint\n"); + return -EINVAL; + } + + remote = of_graph_get_remote_endpoint(ep); + of_node_put(ep); + if (!remote) { + DRM_DEV_ERROR(dev, "failed to get port0 remote endpoint\n"); + return -EINVAL; + } + + ret = of_graph_parse_endpoint(remote, &endpoint); + of_node_put(remote); + if (ret) { + DRM_DEV_ERROR(dev, "failed to parse port0 remote endpoint: %d\n", + ret); + return ret; + } + + imx8qxp_ldb_ch->di_id = endpoint.id; + + return 0; +} + +static int +imx8qxp_ldb_check_chno_and_dual_link(struct ldb_channel *ldb_ch, int link) +{ + if ((link == DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS && ldb_ch->chno != 0) || + (link == DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS && ldb_ch->chno != 1)) + return -EINVAL; + + return 0; +} + +static int imx8qxp_ldb_parse_dt_companion(struct imx8qxp_ldb *imx8qxp_ldb) +{ + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + &imx8qxp_ldb->channel[imx8qxp_ldb->active_chno]; + struct ldb_channel *ldb_ch = &imx8qxp_ldb_ch->base; + struct ldb_channel *companion_ldb_ch; + struct device_node *companion; + struct device_node *child; + struct device_node *companion_port = NULL; + struct device_node *port1, *port2; + struct device *dev = imx8qxp_ldb->dev; + const struct of_device_id *match; + u32 i; + int dual_link; + int ret; + + /* Locate the companion LDB for dual-link operation, if any. */ + companion = of_parse_phandle(dev->of_node, "fsl,companion-ldb", 0); + if (!companion) + return 0; + + if (!of_device_is_available(companion)) { + DRM_DEV_ERROR(dev, "companion LDB is not available\n"); + ret = -ENODEV; + goto out; + } + + /* + * Sanity check: the companion bridge must have the same compatible + * string. + */ + match = of_match_device(dev->driver->of_match_table, dev); + if (!of_device_is_compatible(companion, match->compatible)) { + DRM_DEV_ERROR(dev, "companion LDB is incompatible\n"); + ret = -ENXIO; + goto out; + } + + for_each_available_child_of_node(companion, child) { + ret = of_property_read_u32(child, "reg", &i); + if (ret || i > MAX_LDB_CHAN_NUM - 1) { + DRM_DEV_ERROR(dev, + "invalid channel node address: %u\n", i); + ret = -EINVAL; + of_node_put(child); + goto out; + } + + /* + * Channel numbers have to be different, because channel0 + * transmits odd pixels and channel1 transmits even pixels. + */ + if (i == (ldb_ch->chno ^ 0x1)) { + companion_port = child; + break; + } + } + + if (!companion_port) { + DRM_DEV_ERROR(dev, + "failed to find companion LDB channel port\n"); + ret = -EINVAL; + goto out; + } + + /* + * We need to work out if the sink is expecting us to function in + * dual-link mode. We do this by looking at the DT port nodes we are + * connected to. If they are marked as expecting odd pixels and + * even pixels than we need to enable LDB split mode. + */ + port1 = of_graph_get_port_by_id(ldb_ch->np, 1); + port2 = of_graph_get_port_by_id(companion_port, 1); + dual_link = drm_of_lvds_get_dual_link_pixel_order(port1, port2); + of_node_put(port1); + of_node_put(port2); + + switch (dual_link) { + case DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS: + ldb_ch->link_type = LDB_CH_DUAL_LINK_ODD_EVEN_PIXELS; + break; + case DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS: + ldb_ch->link_type = LDB_CH_DUAL_LINK_EVEN_ODD_PIXELS; + break; + default: + ret = dual_link; + DRM_DEV_ERROR(dev, + "failed to get dual link pixel order: %d\n", ret); + goto out; + } + + ret = imx8qxp_ldb_check_chno_and_dual_link(ldb_ch, dual_link); + if (ret < 0) { + DRM_DEV_ERROR(dev, + "unmatched channel number(%u) vs dual link(%d)\n", + ldb_ch->chno, dual_link); + goto out; + } + + imx8qxp_ldb->companion = of_drm_find_bridge(companion_port); + if (!imx8qxp_ldb->companion) { + ret = -EPROBE_DEFER; + DRM_DEV_DEBUG_DRIVER(dev, + "failed to find bridge for companion bridge: %d\n", + ret); + goto out; + } + + DRM_DEV_DEBUG_DRIVER(dev, + "dual-link configuration detected (companion bridge %pOF)\n", + companion); + + companion_ldb_ch = bridge_to_ldb_ch(imx8qxp_ldb->companion); + companion_ldb_ch->link_type = ldb_ch->link_type; +out: + of_node_put(companion_port); + of_node_put(companion); + return ret; +} + +static int imx8qxp_ldb_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct imx8qxp_ldb *imx8qxp_ldb; + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch; + struct ldb *ldb; + struct ldb_channel *ldb_ch; + int ret, i; + + imx8qxp_ldb = devm_kzalloc(dev, sizeof(*imx8qxp_ldb), GFP_KERNEL); + if (!imx8qxp_ldb) + return -ENOMEM; + + imx8qxp_ldb->clk_pixel = devm_clk_get(dev, "pixel"); + if (IS_ERR(imx8qxp_ldb->clk_pixel)) { + ret = PTR_ERR(imx8qxp_ldb->clk_pixel); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get pixel clock: %d\n", ret); + return ret; + } + + imx8qxp_ldb->clk_bypass = devm_clk_get(dev, "bypass"); + if (IS_ERR(imx8qxp_ldb->clk_bypass)) { + ret = PTR_ERR(imx8qxp_ldb->clk_bypass); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get bypass clock: %d\n", ret); + return ret; + } + + imx8qxp_ldb->dev = dev; + + ldb = &imx8qxp_ldb->base; + ldb->dev = dev; + ldb->ctrl_reg = 0xe0; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) + ldb->channel[i] = &imx8qxp_ldb->channel[i].base; + + ret = ldb_init_helper(ldb); + if (ret) + return ret; + + if (ldb->available_ch_cnt == 0) { + DRM_DEV_DEBUG_DRIVER(dev, "no available channel\n"); + return 0; + } else if (ldb->available_ch_cnt > 1) { + DRM_DEV_ERROR(dev, "invalid available channel number(%u)\n", + ldb->available_ch_cnt); + return -EINVAL; + } + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + imx8qxp_ldb_ch = &imx8qxp_ldb->channel[i]; + ldb_ch = &imx8qxp_ldb_ch->base; + + if (ldb_ch->is_available) { + imx8qxp_ldb->active_chno = ldb_ch->chno; + break; + } + } + + imx8qxp_ldb_ch->phy = devm_of_phy_get(dev, ldb_ch->np, "lvds_phy"); + if (IS_ERR(imx8qxp_ldb_ch->phy)) { + ret = PTR_ERR(imx8qxp_ldb_ch->phy); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get channel%d PHY: %d\n", + imx8qxp_ldb->active_chno, ret); + return ret; + } + + ret = ldb_find_next_bridge_helper(ldb); + if (ret) + return ret; + + ret = imx8qxp_ldb_set_di_id(imx8qxp_ldb); + if (ret) + return ret; + + ret = imx8qxp_ldb_parse_dt_companion(imx8qxp_ldb); + if (ret) + return ret; + + platform_set_drvdata(pdev, imx8qxp_ldb); + pm_runtime_enable(dev); + + ldb_add_bridge_helper(ldb, &imx8qxp_ldb_bridge_funcs); + + return ret; +} + +static int imx8qxp_ldb_remove(struct platform_device *pdev) +{ + struct imx8qxp_ldb *imx8qxp_ldb = platform_get_drvdata(pdev); + struct ldb *ldb = &imx8qxp_ldb->base; + + ldb_remove_bridge_helper(ldb); + + pm_runtime_disable(&pdev->dev); + + return 0; +} + +static int __maybe_unused imx8qxp_ldb_runtime_suspend(struct device *dev) +{ + return 0; +} + +static int __maybe_unused imx8qxp_ldb_runtime_resume(struct device *dev) +{ + struct imx8qxp_ldb *imx8qxp_ldb = dev_get_drvdata(dev); + struct ldb *ldb = &imx8qxp_ldb->base; + + /* disable LDB by resetting the control register to POR default */ + regmap_write(ldb->regmap, ldb->ctrl_reg, 0); + + return 0; +} + +static const struct dev_pm_ops imx8qxp_ldb_pm_ops = { + SET_RUNTIME_PM_OPS(imx8qxp_ldb_runtime_suspend, + imx8qxp_ldb_runtime_resume, NULL) +}; + +static const struct of_device_id imx8qxp_ldb_dt_ids[] = { + { .compatible = "fsl,imx8qxp-ldb" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qxp_ldb_dt_ids); + +static struct platform_driver imx8qxp_ldb_driver = { + .probe = imx8qxp_ldb_probe, + .remove = imx8qxp_ldb_remove, + .driver = { + .pm = &imx8qxp_ldb_pm_ops, + .name = DRIVER_NAME, + .of_match_table = imx8qxp_ldb_dt_ids, + }, +}; +module_platform_driver(imx8qxp_ldb_driver); + +MODULE_DESCRIPTION("i.MX8QXP LVDS Display Bridge(LDB)/Pixel Mapper bridge driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME); From patchwork Sat Jun 11 14:14:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878537 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A54FC433EF for ; Sat, 11 Jun 2022 14:14:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235287AbiFKOOo (ORCPT ); Sat, 11 Jun 2022 10:14:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235862AbiFKOOS (ORCPT ); Sat, 11 Jun 2022 10:14:18 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80082.outbound.protection.outlook.com [40.107.8.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0867165D0C; Sat, 11 Jun 2022 07:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eSoQguPjksahxvxU3xqUaIj8mpu85CG+oUK5tmcVTZJquY1vopFkblbHnPdmSH9vNmO6BgIGB5Ad653+bfbh9w/xsHJkHUU8S483A3BE//x3QuRxzATGCu5td62YoMM74E+8D8br6RQUhZY8elaFAHn0upWuZWoUBtvmLESFaGaR4pOUNuPtjsjxDM06Elm0B68e2JncsXNbN8tkBiP8FLATLk98K348+UmQf07M0rmr5SPj9CrecXCmumrXA49m+Kb17qNZSfWRpWTDp1Z6SwzxjwjtNhuVaVxkO8sOzZr04g4foGjzhWrS2Uo+TRMy5nsYDd5UWQLDHdvwmil0pw== 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=/VzrsP8vH9QSHBeUaNRq288OiG2B2c45vYqRHTqZ398=; b=QHl+peH2QacYcJ+Zyu+au3VHi0q3J4HnGHCi2uX0dVNnDWs5qt1VYxtudccXY6svGKVodtIuJcFdd39sNSUrN0FCIEE7gKiws62iEOZ0uIMOOoE0PgLhDlGcs69FqorctDTlluf3PmioLBfYrNa4pA6O7S+38m/gqAi4hKwY4aJdVgmMagkjhKRr+EcGyt+iRtzbXVNeAcEuhvb/E4PzA5Wxy79Ra09oDFZxPtkZtCKoPVdXyU2f5IKxFwCE974lfFsDoSIPTlNdPrSdTJD2ZMjfhIoJjBhOO3iHjvwuYSZ+kNy/H666J3Q2Hp4NLjjBM0Lrn+JfDAhlvW/q60U7Fg== 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=/VzrsP8vH9QSHBeUaNRq288OiG2B2c45vYqRHTqZ398=; b=BreZUfhTgRvs6VyjmmuzWMrDf1tkqx8w5kmedmEizRQA8PlZ8MLohnc13WOJ05VLDM3+uxKd9R29xEoxS0gl7xmUV5BjsnZ3GQZHA0jJZIuZmtC34V0U9Q32pNUysFlTHS9sRDV4bQaCqAkxXOezf/+PupSL5jEsBrcUjCBJvMk= 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 DB9PR04MB8249.eurprd04.prod.outlook.com (2603:10a6:10:25c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.16; Sat, 11 Jun 2022 14:14:09 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:14:09 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com Subject: [PATCH v9 12/14] drm/bridge: imx: Add LDB support for i.MX8qm Date: Sat, 11 Jun 2022 22:14:19 +0800 Message-Id: <20220611141421.718743-13-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da5f6727-ab02-4c3e-ed5a-08da4bb4a694 X-MS-TrafficTypeDiagnostic: DB9PR04MB8249:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eqqm5apIuuLQrYnWZxAbTDd7O3Js7Q8ejkOpZKP1FAE0ciUqry/32X9rpdTg1rctu9OaHW1Phq4W4jzeyPUGOogZXUXdF1jOu2b+YO0enK/sOd9hoVQFKsDFaT6eXdzODECU8R5GiAJTxqis6kkB/G8OsWhEO9L0LDfqH/4iZWDayw61PTe+WRZM/9PmFIefa3CH/9YFxWA9vKhmFbdKYtQVEFmOyHwh8ldl1Ll2eO7cban224s4+fQg+xj/EJxdYMnxbhoLM8tvqVB7xQUnuaZ6zfHv3VVEWT5VWVz3NNXho8rJbI58xT/N9l1FGgVghedF1MJyUCPIw3dm3n9zRIWmDFA0DJZKi7WsHKYIyEtMuskim4dTOjZprzZgITFE3sffIP04OripC4Ar6vJDbRFyLRPkmvDr9gd1PA8QNXORmc9G79xHfbTjjV1lkznqLj3fSRQkSvkGR5k/eXJ1Agm1zxTixAObUIgs8/Br63N8Pv5ZLqf5gUBeTAMMI6p1vEKCHxVJlug8Q+SLCczkGF6bU5lRYgew5ZNLIh+B4AOuEDOo5PTsihj2/0G5ri+fX4nfOIEt4gxzPCPOlePHxiqPjOfGK6F0bp0H9vxyGq4zkt40ZwS4vk8iI2dvnMg2eoFS0zL2SnfjiQGoYLBAXy8pRsP1XNeFw3BOTC8N/p0vE9YKdp4ktlNMXNoVNFwyJ2DMwe+VqOENl9WLGGlgFg== 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:(13230016)(4636009)(366004)(26005)(6512007)(38100700002)(38350700002)(83380400001)(86362001)(186003)(1076003)(2616005)(8936002)(316002)(5660300002)(66946007)(66556008)(66476007)(4326008)(8676002)(36756003)(30864003)(7416002)(2906002)(508600001)(6486002)(6506007)(6666004)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1QLr14SVAkTVjCrcaAuQrfDuo0YTxg3x43GyW2iLCiZsy+Jq7i1JlpejGfdd6s4mLPtlKM7hGVLfpPOZ4DCj65fzvVWi1aPM9nj7qnbiBhgKazb09nMCd6DOKfbFyzF4gsl1Ou23cy30zkouG/vHxoqsjTmEBGnbBYrUpEBbl3eGI80y3XTjDYdGU+L3CPQM3Tnn3ySCplXbxsxDHIGUCxfkePyYeZqMPcmB/pak8iJ1A/B6tN/q+g8Y0+KUgaUBKIwDtNCgovYRYsWdqos2HWrH12/qZZd2/5fXzmWn2asnbS/mER9SrHMtokxuWBsky9SrAOxXvv/x0U8Of4waU5U4HeeT7Yzb47F/iK4y1WjgeGjpx+m4JUPkSoQNGgbDtuHMrGVrHOpi4myjlGESMo7s0niBGVih3qeZLK5SmqiPcmRiwBYvs4oZberKdAbRsgNafOitSkQwdJboXgeuzEpxgPS1xmtTnezKBHVf5fEAEWeg9zXf9VfeYEB3sXl1F2uqa3S6a8DhOd3zFscBg5PHKnOz7gg4/b3u22XDLMxAew3dFN3gfex+m/TAAI7aBU5H4lR2QNhnGB5E5DdvMj+kQxg5hQm++BNSqgRuNB3qcUUE3YCgsTVKDzet7aYhsqsFdp+lANof0YDBtYS6JV5wiVJ2pgvtvDcwf/sVNDbTqN2QmoVXhPFxw+mIBko2cVSzdwpz4zpVCSlnO3/xrzQmUauxhwSB9iJlyQ7O5jP61/mRemBkOkgBfqIjbkKwYab3zL8eJfkoS8G5LPgNBJt8d4dg0ymFKxX9qYDNk53fQHx+5yQQeuhfQzIaRy3MjK8iaVX2uuYP2Fzx0ZtPLdd0ssq2qdSzrN8S8KJs0B0PhTjjDhGLkKypBJ78uKzt3Zgi7hz5xq0gIej0IAJKePnyeKebN/OQmPm+ikGgT7O9jb4JD3YrOLJ9ZZuRBZRhOtXg86TNWxhEWD0Rc8+igIWvL7xQK0jepMT5m0M2UixIyy0MG5AjDfVCI6qT6N9i6a5X+KjLB8gopTzqY9557wvqT3Hgu+y14AO6u5dAhOFSXsqjAZFxTulln1mGcyUdBZrqKoIkkjPSHe3JkzTzSXX/Wr+1NE/ip0qfrs09+0PDQOUIx5dTxZ5xTc/T+A/5yfzLJz1LjwzBT6opohLpBBV9DFG+UTjyKor3wFDgDXf7JG9TiWVjV6f08bSTNFsz5IEO+ILYxHQGlNY32RtvxXbI+KSEzqG+f1AgaWXZghb2AbCZSuQXD2D3p0Yuem4MrY8U1fXgeIF2oMzVK2B1EDdUwWH6EtgLroa2bzxEPPoFf8KiwuYNmvpAuOwJOC2exwcLZmy/xeS6+CK5NaWceVzqRsYy+++aedX9qD/XYd6zEvLXe33e69SdXm45yskqdxpvNca7JHHLhu3ilKL1ViFjvyJ7k0WQGtchiA/N60x94/Cv73rBCXwSOvZXEl2BpvmG6my+pdPlYwoEUchSaCV9GYac99R2P/NRUJXLrzKHdd+lRdPHLfaEhBtuCFtHrtRwPsQR9V54EBuIck/vqyyQ0NEt659eHS17Q/xzLaSoYQ5wJAHO1ZLwLu+Lme5MJgJ6yQrUiEcNiU5Lhao66OXR0iJW6ME9dcaE8Vre8daXjpJgUVNZl1B3xglPlY0G9gjuf3rV2fNj7jr5BGn497HFz7NLgLvDnVHkk823FWtRmmpAJYe+JcPZOZJjvBeCknkWQwc5lkNljX8V0ulWEw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: da5f6727-ab02-4c3e-ed5a-08da4bb4a694 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:14:08.9664 (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: VRYXwr7BEtMbezJXfU0FrCiw08K8NoVSiFqO8X9ABaXRtyrXNPt3hxzMlp/ceBhVnpuMQJ3wW1NkO5WWzC0EQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8249 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds a drm bridge driver for i.MX8qm LVDS display bridge(LDB) which is officially named as pixel mapper. The LDB has two channels. Each of them supports up to 30bpp parallel input color format and can map the input to VESA or JEIDA standards. The two channels can be used simultaneously, either in dual mode or split mode. In dual mode, the two channels output identical data. In split mode, channel0 outputs odd pixels and channel1 outputs even pixels. This patch supports the LDB single mode and split mode. Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- Marcel, I add your T-b tag from v6, let me know if you want me to drop it, as the checkpatch fix in v7 is trivial. v8->v9: * No change. v7->v8: * No change. v6->v7: * Fix below complaints from 'checkpatch.pl --strict'. (Robert) - 'Prefer using the BIT macro' - 'Alignment should match open parenthesis' * Add Marcel's T-b tag. * Add Robert's R-b tag. v5->v6: * No change. v4->v5: * Link with the imx-ldb-helper object. (Robert) * Correspondingly, rename 'imx8qm-ldb.c' to 'imx8qm-ldb-drv.c'. v3->v4: * No change. v2->v3: * No change. v1->v2: * Drop unnecessary check for maximum available LDB channels. * Mention i.MX8qm LDB official name 'pixel mapper' in the bridge driver and Kconfig help message. drivers/gpu/drm/bridge/imx/Kconfig | 9 + drivers/gpu/drm/bridge/imx/Makefile | 3 + drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c | 587 ++++++++++++++++++++ 3 files changed, 599 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index f33d67be54dc..212a7b0e64fd 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -1,3 +1,12 @@ +config DRM_IMX8QM_LDB + tristate "Freescale i.MX8QM LVDS display bridge" + depends on OF + depends on COMMON_CLK + select DRM_KMS_HELPER + help + Choose this to enable the internal LVDS Display Bridge(LDB) found in + Freescale i.MX8qm processor. Official name of LDB is pixel mapper. + config DRM_IMX8QXP_LDB tristate "Freescale i.MX8QXP LVDS display bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile index 96d5d1e9659d..aa90ec8d5433 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -1,3 +1,6 @@ +imx8qm-ldb-objs := imx-ldb-helper.o imx8qm-ldb-drv.o +obj-$(CONFIG_DRM_IMX8QM_LDB) += imx8qm-ldb.o + imx8qxp-ldb-objs := imx-ldb-helper.o imx8qxp-ldb-drv.o obj-$(CONFIG_DRM_IMX8QXP_LDB) += imx8qxp-ldb.o diff --git a/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c b/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c new file mode 100644 index 000000000000..29f8f36f814e --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c @@ -0,0 +1,587 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "imx-ldb-helper.h" + +#define LDB_CH0_10BIT_EN BIT(22) +#define LDB_CH1_10BIT_EN BIT(23) +#define LDB_CH0_DATA_WIDTH_24BIT BIT(24) +#define LDB_CH1_DATA_WIDTH_24BIT BIT(26) +#define LDB_CH0_DATA_WIDTH_30BIT (2 << 24) +#define LDB_CH1_DATA_WIDTH_30BIT (2 << 26) + +#define SS_CTRL 0x20 +#define CH_HSYNC_M(id) BIT(0 + ((id) * 2)) +#define CH_VSYNC_M(id) BIT(1 + ((id) * 2)) +#define CH_PHSYNC(id) BIT(0 + ((id) * 2)) +#define CH_PVSYNC(id) BIT(1 + ((id) * 2)) + +#define DRIVER_NAME "imx8qm-ldb" + +struct imx8qm_ldb_channel { + struct ldb_channel base; + struct phy *phy; +}; + +struct imx8qm_ldb { + struct ldb base; + struct device *dev; + struct imx8qm_ldb_channel channel[MAX_LDB_CHAN_NUM]; + struct clk *clk_pixel; + struct clk *clk_bypass; + int active_chno; +}; + +static inline struct imx8qm_ldb_channel * +base_to_imx8qm_ldb_channel(struct ldb_channel *base) +{ + return container_of(base, struct imx8qm_ldb_channel, base); +} + +static inline struct imx8qm_ldb *base_to_imx8qm_ldb(struct ldb *base) +{ + return container_of(base, struct imx8qm_ldb, base); +} + +static void imx8qm_ldb_set_phy_cfg(struct imx8qm_ldb *imx8qm_ldb, + unsigned long di_clk, + bool is_split, bool is_slave, + struct phy_configure_opts_lvds *phy_cfg) +{ + phy_cfg->bits_per_lane_and_dclk_cycle = 7; + phy_cfg->lanes = 4; + phy_cfg->differential_clk_rate = is_split ? di_clk / 2 : di_clk; + phy_cfg->is_slave = is_slave; +} + +static int imx8qm_ldb_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 ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qm_ldb_channel *imx8qm_ldb_ch = + base_to_imx8qm_ldb_channel(ldb_ch); + struct imx8qm_ldb *imx8qm_ldb = base_to_imx8qm_ldb(ldb); + struct drm_display_mode *adj = &crtc_state->adjusted_mode; + unsigned long di_clk = adj->clock * 1000; + bool is_split = ldb_channel_is_split_link(ldb_ch); + union phy_configure_opts opts = { }; + struct phy_configure_opts_lvds *phy_cfg = &opts.lvds; + int ret; + + ret = ldb_bridge_atomic_check_helper(bridge, bridge_state, + crtc_state, conn_state); + if (ret) + return ret; + + imx8qm_ldb_set_phy_cfg(imx8qm_ldb, di_clk, is_split, false, phy_cfg); + ret = phy_validate(imx8qm_ldb_ch->phy, PHY_MODE_LVDS, 0, &opts); + if (ret < 0) { + DRM_DEV_DEBUG_DRIVER(imx8qm_ldb->dev, + "failed to validate PHY: %d\n", ret); + return ret; + } + + if (is_split) { + imx8qm_ldb_ch = + &imx8qm_ldb->channel[imx8qm_ldb->active_chno ^ 1]; + imx8qm_ldb_set_phy_cfg(imx8qm_ldb, di_clk, is_split, true, + phy_cfg); + ret = phy_validate(imx8qm_ldb_ch->phy, PHY_MODE_LVDS, 0, &opts); + if (ret < 0) { + DRM_DEV_DEBUG_DRIVER(imx8qm_ldb->dev, + "failed to validate slave PHY: %d\n", + ret); + return ret; + } + } + + return ret; +} + +static void +imx8qm_ldb_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qm_ldb_channel *imx8qm_ldb_ch = + base_to_imx8qm_ldb_channel(ldb_ch); + struct imx8qm_ldb *imx8qm_ldb = base_to_imx8qm_ldb(ldb); + struct device *dev = imx8qm_ldb->dev; + unsigned long di_clk = adjusted_mode->clock * 1000; + bool is_split = ldb_channel_is_split_link(ldb_ch); + union phy_configure_opts opts = { }; + struct phy_configure_opts_lvds *phy_cfg = &opts.lvds; + u32 chno = ldb_ch->chno; + int ret; + + ret = pm_runtime_get_sync(dev); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to get runtime PM sync: %d\n", ret); + + ret = phy_init(imx8qm_ldb_ch->phy); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to initialize PHY: %d\n", ret); + + clk_set_rate(imx8qm_ldb->clk_bypass, di_clk); + clk_set_rate(imx8qm_ldb->clk_pixel, di_clk); + + imx8qm_ldb_set_phy_cfg(imx8qm_ldb, di_clk, is_split, false, phy_cfg); + ret = phy_configure(imx8qm_ldb_ch->phy, &opts); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to configure PHY: %d\n", ret); + + if (is_split) { + imx8qm_ldb_ch = + &imx8qm_ldb->channel[imx8qm_ldb->active_chno ^ 1]; + imx8qm_ldb_set_phy_cfg(imx8qm_ldb, di_clk, is_split, true, + phy_cfg); + ret = phy_configure(imx8qm_ldb_ch->phy, &opts); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to configure slave PHY: %d\n", + ret); + } + + /* input VSYNC signal from pixel link is active low */ + if (ldb_ch->chno == 0 || is_split) + ldb->ldb_ctrl |= LDB_DI0_VS_POL_ACT_LOW; + if (ldb_ch->chno == 1 || is_split) + ldb->ldb_ctrl |= LDB_DI1_VS_POL_ACT_LOW; + + switch (ldb_ch->out_bus_format) { + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: + if (ldb_ch->chno == 0 || is_split) + ldb->ldb_ctrl |= LDB_CH0_DATA_WIDTH_24BIT; + if (ldb_ch->chno == 1 || is_split) + ldb->ldb_ctrl |= LDB_CH1_DATA_WIDTH_24BIT; + break; + } + + ldb_bridge_mode_set_helper(bridge, mode, adjusted_mode); + + if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, CH_VSYNC_M(chno), 0); + else if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, + CH_VSYNC_M(chno), CH_PVSYNC(chno)); + + if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, CH_HSYNC_M(chno), 0); + else if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, + CH_HSYNC_M(chno), CH_PHSYNC(chno)); +} + +static void +imx8qm_ldb_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qm_ldb_channel *imx8qm_ldb_ch = + base_to_imx8qm_ldb_channel(ldb_ch); + struct imx8qm_ldb *imx8qm_ldb = base_to_imx8qm_ldb(ldb); + struct device *dev = imx8qm_ldb->dev; + bool is_split = ldb_channel_is_split_link(ldb_ch); + int ret; + + clk_prepare_enable(imx8qm_ldb->clk_pixel); + clk_prepare_enable(imx8qm_ldb->clk_bypass); + + /* both DI0 and DI1 connect with pixel link, so ok to use DI0 only */ + if (ldb_ch->chno == 0 || is_split) { + ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK; + ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI0; + } + if (ldb_ch->chno == 1 || is_split) { + ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK; + ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI0; + } + + if (is_split) { + ret = phy_power_on(imx8qm_ldb->channel[0].phy); + if (ret) + DRM_DEV_ERROR(dev, + "failed to power on channel0 PHY: %d\n", + ret); + + ret = phy_power_on(imx8qm_ldb->channel[1].phy); + if (ret) + DRM_DEV_ERROR(dev, + "failed to power on channel1 PHY: %d\n", + ret); + } else { + ret = phy_power_on(imx8qm_ldb_ch->phy); + if (ret) + DRM_DEV_ERROR(dev, "failed to power on PHY: %d\n", ret); + } + + ldb_bridge_enable_helper(bridge); +} + +static void +imx8qm_ldb_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qm_ldb_channel *imx8qm_ldb_ch = + base_to_imx8qm_ldb_channel(ldb_ch); + struct imx8qm_ldb *imx8qm_ldb = base_to_imx8qm_ldb(ldb); + struct device *dev = imx8qm_ldb->dev; + bool is_split = ldb_channel_is_split_link(ldb_ch); + int ret; + + ldb_bridge_disable_helper(bridge); + + if (is_split) { + ret = phy_power_off(imx8qm_ldb->channel[0].phy); + if (ret) + DRM_DEV_ERROR(dev, + "failed to power off channel0 PHY: %d\n", + ret); + ret = phy_power_off(imx8qm_ldb->channel[1].phy); + if (ret) + DRM_DEV_ERROR(dev, + "failed to power off channel1 PHY: %d\n", + ret); + } else { + ret = phy_power_off(imx8qm_ldb_ch->phy); + if (ret) + DRM_DEV_ERROR(dev, "failed to power off PHY: %d\n", ret); + } + + clk_disable_unprepare(imx8qm_ldb->clk_bypass); + clk_disable_unprepare(imx8qm_ldb->clk_pixel); + + ret = pm_runtime_put(dev); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret); +} + +static const u32 imx8qm_ldb_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, + MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, + MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA, + MEDIA_BUS_FMT_FIXED, +}; + +static bool imx8qm_ldb_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx8qm_ldb_bus_output_fmts); i++) { + if (imx8qm_ldb_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx8qm_ldb_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) +{ + struct drm_display_info *di; + const struct drm_format_info *finfo; + u32 *input_fmts; + + if (!imx8qm_ldb_bus_output_fmt_supported(output_fmt)) + return NULL; + + *num_input_fmts = 1; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_FIXED: + di = &conn_state->connector->display_info; + + /* + * Look at the first bus format to determine input format. + * Default to MEDIA_BUS_FMT_RGB888_1X36_CPADLO, if no match. + */ + if (di->num_bus_formats) { + finfo = drm_format_info(di->bus_formats[0]); + + input_fmts[0] = finfo->depth == 18 ? + MEDIA_BUS_FMT_RGB666_1X36_CPADLO : + MEDIA_BUS_FMT_RGB888_1X36_CPADLO; + } else { + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X36_CPADLO; + } + break; + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: + input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X36_CPADLO; + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X36_CPADLO; + break; + default: + kfree(input_fmts); + input_fmts = NULL; + break; + } + + return input_fmts; +} + +static u32 * +imx8qm_ldb_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + unsigned int *num_output_fmts) +{ + *num_output_fmts = ARRAY_SIZE(imx8qm_ldb_bus_output_fmts); + return kmemdup(imx8qm_ldb_bus_output_fmts, + sizeof(imx8qm_ldb_bus_output_fmts), GFP_KERNEL); +} + +static enum drm_mode_status +imx8qm_ldb_bridge_mode_valid(struct drm_bridge *bridge, + const struct drm_display_info *info, + const struct drm_display_mode *mode) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + bool is_single = ldb_channel_is_single_link(ldb_ch); + + if (mode->clock > 300000) + return MODE_CLOCK_HIGH; + + if (mode->clock > 150000 && is_single) + return MODE_CLOCK_HIGH; + + return MODE_OK; +} + +static const struct drm_bridge_funcs imx8qm_ldb_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .mode_valid = imx8qm_ldb_bridge_mode_valid, + .attach = ldb_bridge_attach_helper, + .atomic_check = imx8qm_ldb_bridge_atomic_check, + .mode_set = imx8qm_ldb_bridge_mode_set, + .atomic_enable = imx8qm_ldb_bridge_atomic_enable, + .atomic_disable = imx8qm_ldb_bridge_atomic_disable, + .atomic_get_input_bus_fmts = + imx8qm_ldb_bridge_atomic_get_input_bus_fmts, + .atomic_get_output_bus_fmts = + imx8qm_ldb_bridge_atomic_get_output_bus_fmts, +}; + +static int imx8qm_ldb_get_phy(struct imx8qm_ldb *imx8qm_ldb) +{ + struct imx8qm_ldb_channel *imx8qm_ldb_ch; + struct ldb_channel *ldb_ch; + struct device *dev = imx8qm_ldb->dev; + int i, ret; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + imx8qm_ldb_ch = &imx8qm_ldb->channel[i]; + ldb_ch = &imx8qm_ldb_ch->base; + + if (!ldb_ch->is_available) + continue; + + imx8qm_ldb_ch->phy = devm_of_phy_get(dev, ldb_ch->np, + "lvds_phy"); + if (IS_ERR(imx8qm_ldb_ch->phy)) { + ret = PTR_ERR(imx8qm_ldb_ch->phy); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get channel%d PHY: %d\n", + i, ret); + return ret; + } + } + + return 0; +} + +static int imx8qm_ldb_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct imx8qm_ldb *imx8qm_ldb; + struct imx8qm_ldb_channel *imx8qm_ldb_ch; + struct ldb *ldb; + struct ldb_channel *ldb_ch; + struct device_node *port1, *port2; + int pixel_order; + int ret, i; + + imx8qm_ldb = devm_kzalloc(dev, sizeof(*imx8qm_ldb), GFP_KERNEL); + if (!imx8qm_ldb) + return -ENOMEM; + + imx8qm_ldb->clk_pixel = devm_clk_get(dev, "pixel"); + if (IS_ERR(imx8qm_ldb->clk_pixel)) { + ret = PTR_ERR(imx8qm_ldb->clk_pixel); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get pixel clock: %d\n", ret); + return ret; + } + + imx8qm_ldb->clk_bypass = devm_clk_get(dev, "bypass"); + if (IS_ERR(imx8qm_ldb->clk_bypass)) { + ret = PTR_ERR(imx8qm_ldb->clk_bypass); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get bypass clock: %d\n", ret); + return ret; + } + + imx8qm_ldb->dev = dev; + + ldb = &imx8qm_ldb->base; + ldb->dev = dev; + ldb->ctrl_reg = 0xe0; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) + ldb->channel[i] = &imx8qm_ldb->channel[i].base; + + ret = ldb_init_helper(ldb); + if (ret) + return ret; + + if (ldb->available_ch_cnt == 0) { + DRM_DEV_DEBUG_DRIVER(dev, "no available channel\n"); + return 0; + } + + if (ldb->available_ch_cnt == 2) { + port1 = of_graph_get_port_by_id(ldb->channel[0]->np, 1); + port2 = of_graph_get_port_by_id(ldb->channel[1]->np, 1); + pixel_order = + drm_of_lvds_get_dual_link_pixel_order(port1, port2); + of_node_put(port1); + of_node_put(port2); + + if (pixel_order != DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS) { + DRM_DEV_ERROR(dev, "invalid dual link pixel order: %d\n", + pixel_order); + return -EINVAL; + } + + imx8qm_ldb->active_chno = 0; + imx8qm_ldb_ch = &imx8qm_ldb->channel[0]; + ldb_ch = &imx8qm_ldb_ch->base; + ldb_ch->link_type = pixel_order; + } else { + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + imx8qm_ldb_ch = &imx8qm_ldb->channel[i]; + ldb_ch = &imx8qm_ldb_ch->base; + + if (ldb_ch->is_available) { + imx8qm_ldb->active_chno = ldb_ch->chno; + break; + } + } + } + + ret = imx8qm_ldb_get_phy(imx8qm_ldb); + if (ret) + return ret; + + ret = ldb_find_next_bridge_helper(ldb); + if (ret) + return ret; + + platform_set_drvdata(pdev, imx8qm_ldb); + pm_runtime_enable(dev); + + ldb_add_bridge_helper(ldb, &imx8qm_ldb_bridge_funcs); + + return ret; +} + +static int imx8qm_ldb_remove(struct platform_device *pdev) +{ + struct imx8qm_ldb *imx8qm_ldb = platform_get_drvdata(pdev); + struct ldb *ldb = &imx8qm_ldb->base; + + ldb_remove_bridge_helper(ldb); + + pm_runtime_disable(&pdev->dev); + + return 0; +} + +static int __maybe_unused imx8qm_ldb_runtime_suspend(struct device *dev) +{ + return 0; +} + +static int __maybe_unused imx8qm_ldb_runtime_resume(struct device *dev) +{ + struct imx8qm_ldb *imx8qm_ldb = dev_get_drvdata(dev); + struct ldb *ldb = &imx8qm_ldb->base; + + /* disable LDB by resetting the control register to POR default */ + regmap_write(ldb->regmap, ldb->ctrl_reg, 0); + + return 0; +} + +static const struct dev_pm_ops imx8qm_ldb_pm_ops = { + SET_RUNTIME_PM_OPS(imx8qm_ldb_runtime_suspend, + imx8qm_ldb_runtime_resume, NULL) +}; + +static const struct of_device_id imx8qm_ldb_dt_ids[] = { + { .compatible = "fsl,imx8qm-ldb" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qm_ldb_dt_ids); + +static struct platform_driver imx8qm_ldb_driver = { + .probe = imx8qm_ldb_probe, + .remove = imx8qm_ldb_remove, + .driver = { + .pm = &imx8qm_ldb_pm_ops, + .name = DRIVER_NAME, + .of_match_table = imx8qm_ldb_dt_ids, + }, +}; +module_platform_driver(imx8qm_ldb_driver); + +MODULE_DESCRIPTION("i.MX8QM LVDS Display Bridge(LDB)/Pixel Mapper bridge driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME); From patchwork Sat Jun 11 14:14:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878538 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 611E1C43334 for ; Sat, 11 Jun 2022 14:14:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235867AbiFKOOz (ORCPT ); Sat, 11 Jun 2022 10:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235945AbiFKOO1 (ORCPT ); Sat, 11 Jun 2022 10:14:27 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80082.outbound.protection.outlook.com [40.107.8.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39A1064D32; Sat, 11 Jun 2022 07:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eZ5fyRSANwBxKptwjSFiw4rW6RSxjXrg8OD/KuVnnyi9FXj1Z6uHSnq411y406dweI7/EZh80s1PfJ+HpdvFqy2kRDjszDYBfheoOJCjlP93QFpWDUV3TfQdVlnJRXeVhyBUQxwNsDfxlxd5pjOskGgR+WLG+qgB+pZBWG0HYOuICq5z+CFnw/u60N3NflRBDEkfXQ25MaYcyPn+7hjBzsgkc/4PemUFJ6ww5l9BbFOisSxZxPe7ZxX80glrK6BzUw1wvNquPU9d4vE3hr5ew5RIegqUMRUJF1MKY5pgwtrqLuVZlEwWsWWKWgLGY0sri6SlOUheHVRRUSX5FF9mSg== 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=XtHzpvrGujaoD6LTDAFHj0YDj7pz3g+LK/+p4A6Qi+E=; b=gCseT0VYSsTxGuJITKkM7TTSCA16HziC18NIfeb16MyV4KO4JsBnjkRooygyN9egPI5/6wSjBT1HxQ8kBSu7vxpXSSjzx0wIlxmEbRXwT/Z/DDL9od89Frvb8wM9qdszDC472srsVPaDzStSM0A2/mAqiXCHccFDjcGztLvT95ryAMj40aKvNVWyH/+6Bk4rWIFqgURZdyGKHW0d4r7jM5YGg3Mz9SYu7DkGHRAe0ySfj1+Hw41BzyeUozA/L0WXT6Z0igKpffnYKfkUsuSISdheD9RXmym4LL2mgT5b/QxPQGhUeEn7zPNj8J/JvotVv7QYPmhLHAHlSW8K7AqPyw== 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=XtHzpvrGujaoD6LTDAFHj0YDj7pz3g+LK/+p4A6Qi+E=; b=PN3YfF+Xp5PUkTUE+CvSQTPV/g2fnEuJYeIr9X6omtEuQBvaMQaXU5x4joWAVtm2q2U3lDJgpoEkAe6tGnYGprLNyW8sOmTKJXqHp56lCNvVPZUDYN4SokOxrOgHKtLi2JJQZt3HtBr7O32gw3MURZn1DdSg7gYQF787ybnnrSA= 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 DB9PR04MB8249.eurprd04.prod.outlook.com (2603:10a6:10:25c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.16; Sat, 11 Jun 2022 14:14:15 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:14:15 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com, Rob Herring Subject: [PATCH v9 13/14] dt-bindings: mfd: Add i.MX8qm/qxp Control and Status Registers module binding Date: Sat, 11 Jun 2022 22:14:20 +0800 Message-Id: <20220611141421.718743-14-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6a86b0e2-3157-4b18-0272-08da4bb4aa73 X-MS-TrafficTypeDiagnostic: DB9PR04MB8249:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a5xOhdszp28kSDDqgDEkllrj9J67ins0a5/OJ4Iddq/sdMXBsoLz0dsiX18Zy+mNfODHPiINwV5aIU0xdyXhTHB9luoOG9+LXb/oFBrbTjlGCMno66bnoTZNM+Cd/rmFrwm9XiHmEo4kh8vPxl3FoVcaW1LftCHVRQWF57gPMsmqNljrWofKqHWludE7hIviV/slrs132dCQEwnHOzdxaOs6EBGj6BqBlo39YY6BYtsiNBSwjtoGupgZxq5lKIGCVMZTUBLxFN3TiaLKCm0U4tL8UJh+DGVbNcbBiuUEvt8Kov0kEhPoBjfplxyIfWvO2O1u+/RjWp3zZmUarAQnwOedZb5cx/0adQ1J+Aq2cg7SaFswPvK+IM8YHk5ZNXUAUCPY1PUYiM7rcwefwTUK0ungnTdtn0U4LmYN0Cp7k+OpLzLdERYDeUrHGdHutxCGcVEmBfdaqdb4ysZ7jOmGRQJbgC1nhSoBW82I+X+QkfFARRzyWSaoyj7EH7ubGzkQBQADevzlmAOJ/UwnrXszqGgNEJ4FdUPVrZ9fKleO2avnW+amFWthqe0nKNOfkfFXBtYminwmsw3H4YXKNtLsBpcqWJsrmHH0GY2aA+3ZEY1OlPP5XAdo9vZszfoavKLbhqNIwmv0hBSb7QNKXYgBvlHhtm4TccaUlc+ox+5STemSa5CiwPQbTFVLlioGM7jgE/eywAsaFh2RSUxCuGlJLjH6lPmZEGHJUbcgEW2w39TVLzqC9ACovZGvRj9p7dY6KI3c6XQf2DZ58IYrH226IucqjnWyLVre+3DXszX0htrifNi+0Ostu0qtx2m6XqE6 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:(13230016)(4636009)(366004)(26005)(6512007)(38100700002)(38350700002)(83380400001)(86362001)(186003)(1076003)(2616005)(8936002)(316002)(5660300002)(66946007)(66556008)(66476007)(4326008)(8676002)(36756003)(7416002)(2906002)(508600001)(6486002)(966005)(6506007)(6666004)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q2kCy9Z0mGlkxGkurBSxDOb5RvpjMSIfDrTfv8sxrQqv3r6S5N+CLy2OIPFF9Fai06LgRcDNkuJMu7OQcRloASlXWrCgl42OepA6QvVB7hlEYBW8VcWdzwr818qS8UpjgZp4hP69mv+60ZnKmHBbShEChcq2BHB10DDvu0SWcpi+ZEJvl/nzKMpTJ8nFU8NxmnMx5vAmo2I8lxQvAxAhOHEK5m8K7fRkb6tIfT60EOXe/dUme59DOgRqxncqoYBI6zs6VCt9ldvZ6X7mc+/AhS3gYkym4CEJ75nmC/IvwioDQ0a1ko/O4RSxj7u3gOIGEGBcTP7Spa3hCagjJHb5MsKxSslbR+Qzjwx0ykkXc4plplRunvISz0yf7Kdw1jCTPrK7EXrJ1B3qy9/Ty3SUNBzbl9R2Uf1rUPLGHfHZeEA8qffQ8xdbsO6M1W/MRe/DUjZnQtVp9ijmJcT32Ry8WWFbrAg1bFKmqeJskOl7CvxAOdH4Ntf4g4RU8gQmvzRzbZCw/+/lokT2RSdOflUTcE20MpEJ2EvkclcnDzcu9pAiAnmybTz4mZNF0MJsEcuUaHXEhEQ6XDvIa7E2zjMgO7z8GfAfPcXKLXiklZ62bozgk+/1lhGzGgZ69c8LkuGSBN446Wo6hzh2imn9iLPgtVwpO2HbwgMiDxLwLVSYoC9rhvvAdHX5xbLWgHUK450OOQnVLl7xkQ92+cJ9AIYCDkeYkRBEr8P0S2lOHU73i9Hsy4CHJpMf2hwlrobkXqIPaCQd+QR3HcxlD2XTCxWq85fUknjliWavrcwoQHW44zdodeAX9JIZI51kyokt4QJ63MbflxdUmJtC0xUTc7wl67TbQWhEXtVpPXui+rm2mknoirH0C02152idFUR06bYZTGuGmCKdFJyiW9hWitVgAP8qn4VhAso8Ef0F2EaeX66uQ6HXi31ec/35wFK+9eE3youpZqj0wbrh7yhmEs1ebI77V9nDx8SqH56gP2C6LeR9xG+OSHz3JwR/gYtT4mSx7+EFaDBJO4sct5+3FRHBm8IjD7/wwkFgyGzBtwKyiy2lEYXmpw1O9gC8jH3KMNfraNcnOUxwfZik9FYHmAj7wSqdJ/wGmuN4pt9gNUm5ZjReLehq47jYLmfTfoOZmAb7LTyyOJvl+ywtI4P83+2UYrELO7c7noea82Jt2zqfLFVdurnU8FDGE0iEqGGcVtbc5QhibByp7hbmlmA8gx36omyw6clS32mGdcmmne06nTtntN9RodwXB+viwTOc6eBJU0cZeQ9D6ui0e7PDJjLMMooZdVw82nmJLn9JB0Qgz4FWTcLKeL8pBO2d9cGjZoXuj228NHbn7n54cC31K2lTvgtLNFCj/3uagzxX8R+ebAZsZuHJmgF3TAgC2t7uBKR7tLK8Mf0X2fkLIWBA0aHoiErwS1KZBL1QeSTo6M5ezXfOj4jZf1N0qqbt4oWj6dHluDRi3uOzYYzWmDAg3u6rErLyp+/pGP67n6dIQHvjQy5gOyYJGgasuxx5CNL8Ju5Wqz9tEtJF8uYLAsBlZjXhs9SgTW4HGP6w29Qgwa6QeP7e4vdDEM7gprKyDObttH7ot+7ef0HVfZWQyXxMBcp+IkbyhfDKgWQFPbFlTvblET1mBUOqrv5645TBHXNx510C0bVCRbhmI33rqTBc6nNZnqAovgf2zRqvLsTvx4oa/wF0Ju1AgOkvd3+mB9GYUB0r4oAM0W3Zj1Ewl2AcOFwzXQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a86b0e2-3157-4b18-0272-08da4bb4aa73 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:14:15.3613 (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: h9qSFs9uQZvWzlmCpjxL4iz+QF4mFJLDfxVugkuGN2Kcz2iCXU6pv9cQlKK6bQZGouV0CnCMZDULP6cXt8Pobg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8249 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds bindings for i.MX8qm/qxp Control and Status Registers module. Reviewed-by: Rob Herring Signed-off-by: Liu Ying --- v8->v9: * No change. v7->v8: * No change. v6->v7: * Add Rob's R-b tag. v5->v6: * Drop 'select' schema. (Rob) v4->v5: * Newly introduced in v5. (Rob) .../bindings/mfd/fsl,imx8qxp-csr.yaml | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml diff --git a/Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml b/Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml new file mode 100644 index 000000000000..f09577105b50 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml @@ -0,0 +1,192 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/fsl,imx8qxp-csr.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qm/qxp Control and Status Registers Module Bindings + +maintainers: + - Liu Ying + +description: | + As a system controller, the Freescale i.MX8qm/qxp Control and Status + Registers(CSR) module represents a set of miscellaneous registers of a + specific subsystem. It may provide control and/or status report interfaces + to a mix of standalone hardware devices within that subsystem. One typical + use-case is for some other nodes to acquire a reference to the syscon node + by phandle, and the other typical use-case is that the operating system + should consider all subnodes of the CSR module as separate child devices. + +properties: + $nodename: + pattern: "^syscon@[0-9a-f]+$" + + compatible: + items: + - enum: + - fsl,imx8qxp-mipi-lvds-csr + - fsl,imx8qm-lvds-csr + - const: syscon + - const: simple-mfd + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + const: ipg + +patternProperties: + "^(ldb|phy|pxl2dpi)$": + type: object + description: The possible child devices of the CSR module. + +required: + - compatible + - reg + - clocks + - clock-names + +allOf: + - if: + properties: + compatible: + contains: + const: fsl,imx8qxp-mipi-lvds-csr + then: + required: + - pxl2dpi + - ldb + + - if: + properties: + compatible: + contains: + const: fsl,imx8qm-lvds-csr + then: + required: + - phy + - ldb + +additionalProperties: false + +examples: + - | + #include + #include + mipi_lvds_0_csr: syscon@56221000 { + compatible = "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-mfd"; + reg = <0x56221000 0x1000>; + clocks = <&mipi_lvds_0_di_mipi_lvds_regs_lpcg IMX_LPCG_CLK_4>; + clock-names = "ipg"; + + mipi_lvds_0_pxl2dpi: pxl2dpi { + compatible = "fsl,imx8qxp-pxl2dpi"; + fsl,sc-resource = ; + power-domains = <&pd IMX_SC_R_MIPI_0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + mipi_lvds_0_pxl2dpi_dc0_pixel_link0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dc0_pixel_link0_mipi_lvds_0_pxl2dpi>; + }; + + mipi_lvds_0_pxl2dpi_dc0_pixel_link1: endpoint@1 { + reg = <1>; + remote-endpoint = <&dc0_pixel_link1_mipi_lvds_0_pxl2dpi>; + }; + }; + + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch0: endpoint@0 { + reg = <0>; + remote-endpoint = <&mipi_lvds_0_ldb_ch0_mipi_lvds_0_pxl2dpi>; + }; + + mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch1: endpoint@1 { + reg = <1>; + remote-endpoint = <&mipi_lvds_0_ldb_ch1_mipi_lvds_0_pxl2dpi>; + }; + }; + }; + }; + + mipi_lvds_0_ldb: ldb { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,imx8qxp-ldb"; + clocks = <&clk IMX_SC_R_LVDS_0 IMX_SC_PM_CLK_MISC2>, + <&clk IMX_SC_R_LVDS_0 IMX_SC_PM_CLK_BYPASS>; + clock-names = "pixel", "bypass"; + power-domains = <&pd IMX_SC_R_LVDS_0>; + + channel@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + phys = <&mipi_lvds_0_phy>; + phy-names = "lvds_phy"; + + port@0 { + reg = <0>; + + mipi_lvds_0_ldb_ch0_mipi_lvds_0_pxl2dpi: endpoint { + remote-endpoint = <&mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch0>; + }; + }; + + port@1 { + reg = <1>; + + /* ... */ + }; + }; + + channel@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + phys = <&mipi_lvds_0_phy>; + phy-names = "lvds_phy"; + + port@0 { + reg = <0>; + + mipi_lvds_0_ldb_ch1_mipi_lvds_0_pxl2dpi: endpoint { + remote-endpoint = <&mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch1>; + }; + }; + + port@1 { + reg = <1>; + + /* ... */ + }; + }; + }; + }; + + mipi_lvds_0_phy: phy@56228300 { + compatible = "fsl,imx8qxp-mipi-dphy"; + reg = <0x56228300 0x100>; + clocks = <&clk IMX_SC_R_LVDS_0 IMX_SC_PM_CLK_PHY>; + clock-names = "phy_ref"; + #phy-cells = <0>; + fsl,syscon = <&mipi_lvds_0_csr>; + power-domains = <&pd IMX_SC_R_MIPI_0>; + }; From patchwork Sat Jun 11 14:14:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 12878541 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 429BDCCA481 for ; Sat, 11 Jun 2022 14:15:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234576AbiFKOP1 (ORCPT ); Sat, 11 Jun 2022 10:15:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232469AbiFKOOe (ORCPT ); Sat, 11 Jun 2022 10:14:34 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80082.outbound.protection.outlook.com [40.107.8.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E598663CC; Sat, 11 Jun 2022 07:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=naVHLAktfHOPpAhN1GnkMOu1vm7FNqau9XlYTjUbn0Llj3NacfRiG1b12kqkh8RQ+CDJVTAJ+LthPNj139sukUGvPhjaKl2Wt8uwttBheII/r62DO/G0rWTiSoRicfbc8JfxTOnYqkuBEnOtwvEVnxaiHlSiMaIB94Ddth1SckOQ8bFjNog0EioaaE0/SBsJkMkSdl0kZ9K2YtF/r7lkzKf0Uf/fbZ71qvrLjo4vWmHlWc6gVNCdXwfu++LedkPsvPcMAAFRkWEBleVhoioHSbpIp+Yhx5BlYEyMeJ9SNoP4/AjAf/Ge1Rh1ib+oPyKOwiqjv0+kflnAQc5p0v1hFA== 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=WtV/1O09gmCo6ebdaVoHXJHDZNvjIeOZqOMnUc4yXwU=; b=Fienni41feQGtzdQ2/EdceX+vqXfLnNdpk3vVHz0l7UQtmqoKOhO7M54OhS1tmwz1gHifcddQUZCR1Ux5L0Fv8zu7awFIzKvttJ2R4xRzsKBOO1tZ8DoMyXUs+Hmmbs7uxj0LO7fZpQjiMsXTNX7Ez62cGcyrY+H81vO6NWw9b7ZkLYqFym5GDMZz54wkeBhYhf3gK6ByeZwSX2rzUGPiEiRHGiimV3nyUm6SgE5MisEHwSWNZSiRXCTebSi/pkcjGGlDUC3AGvp5OoQYYfhH6dy62vIIUCgFcNzX8pgCJuY8cn55h/WogFyHHvYzyidsaYryajGCqBFJHrplJwhKw== 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=WtV/1O09gmCo6ebdaVoHXJHDZNvjIeOZqOMnUc4yXwU=; b=NGz4iNR3qZmFUDaLSjdzZeW/xXYeEfQ+W6VRxAiUdWDAR5FLLdC9us46HMNoSz4/mZtrOtVBLydhgftQPWTTeJF9PrecC1VoIxwvqxBEaeW1fetoWXD4B+lJSk3qPJwG6OCT+J896eE8BTRQmFTEkwr5ZRnfYaX3M6MQXSDDF5A= 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 DB9PR04MB8249.eurprd04.prod.outlook.com (2603:10a6:10:25c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.16; Sat, 11 Jun 2022 14:14:21 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::3c82:f63b:711a:502%7]) with mapi id 15.20.5332.016; Sat, 11 Jun 2022 14:14:21 +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, linux-media@vger.kernel.org Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, lee.jones@linaro.org, mchehab@kernel.org, marcel.ziswiler@toradex.com Subject: [PATCH v9 14/14] MAINTAINERS: add maintainer for DRM bridge drivers for i.MX SoCs Date: Sat, 11 Jun 2022 22:14:21 +0800 Message-Id: <20220611141421.718743-15-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220611141421.718743-1-victor.liu@nxp.com> References: <20220611141421.718743-1-victor.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0118.apcprd03.prod.outlook.com (2603:1096:4:91::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d9150547-4bcb-47fe-2102-08da4bb4ae26 X-MS-TrafficTypeDiagnostic: DB9PR04MB8249:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CF50Ud+phQMNjHnTn0+8ylRsIdzzR5Fj1QJf5KZ6t74qSgZnLH4fpjvAtquHZ9VSR7Rc62TZDuw7HCFm0FpLnwfokW6N3VXpHvUKVSqLEFdB/kYD9NK4su/kZTo4LUUXHsw/yHxQa3AnhdI27ARBQZNtzT7q0Upw8PupgEK4z0COsNOymmtgiA90Pk1mmCdQdiu0BBPb25aSn/OVguIfwIVgFuhhOdZebMOELDoK4BEFvir1raSvRLtDJTtea1e8u9WhbhWoVFUiY+NKgUorATe2hWrPL81WzP3IYcFZgxvw/F1jfufB6NZiX3bl55oTaYFVgBIbrUxTKz4tLURorRfeRqCBC1+MBVZYikgO0UXU+1ENYWvZHU9sRPK8AlFV9uD3DBFIA7/Qgb0gxhb5eAP+klHqkxTPwAWGSp6uf9D5a+iqbfKBqg6ZmuZl/JP2xv3DUDNwN6Y4CfLr6nkejEIvmkr+LuF2Tdcog9xjn7eBS0S5K0qwpCHf8oqA6Ufk+s1EQdOwEzfX9duZDw6qHatBTXslxxnuBzkCXQkGyPoiDXcBV8JuLyk+/I/Gaw4PfbblFChIZB8w9+ZCXypIa/XcZRMIAbc8TdwCPblKBq0WxaCK9vypCs6CrrvVGyJonN5xI+Q4qPuOl/41jHORM1wRCCnzAOT19/Ho9m7EGhLRMPe8ZsR8KbZA9Z8HC7nkUmf0eQm1XS0K707z1cfvxQ== 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:(13230016)(6029001)(4636009)(366004)(26005)(6512007)(38100700002)(38350700002)(86362001)(186003)(1076003)(2616005)(8936002)(316002)(5660300002)(66946007)(66556008)(66476007)(4326008)(8676002)(36756003)(7416002)(2906002)(508600001)(6486002)(6506007)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KftyKW1QiwHh75Lv4fu/vW5Ny6eRT6AWPnZom9EjAR/pgWPXbfhZBmySdz7ylo0PclYxB0MYprYn257UghmL5Wp2FKnvNE1rnzsmHJBHBTpLQRpi3LpwVsj9OzcWMVCcSbmAxBlfunZlkdCrsi5vVfMnkQ/729VOIRGJx+D4qYUbrsx6R978F72IOF5jE9ZfP+HOjKmwWGGP12CXUBa/aqGmPou3Ra0Jl9rApcfpLtpsRt7I680V7Tuu8lQTydlo/cqZxqRCbfmwCnJ/wY8Hm8innlmkXkvVSe4RWeatO2A3aAcs+3E18UDsEr/XGwpwe4Hr9ZZaQv+6AA1I69s7EWr2lcPC4WQuvCe0MNyeU7uJTXYf6UqqHmlJlpeQfnBoiLCCYBcWmJDYzUOmv+I7BhCMu8Z6kOp1MjR0xV21GqOScCRl3rPrc9bXW1PNOn1TBhRtNwqh2KT0wj9X/Rmgj7ddEvQIx45WKFsrigkn2v8pfTfwu65HOQd1C+kImkA0i9e9bK/VN2JqaeUlY1W9gehgKhZQ0NehuBF09iiamdq/UrmuOuhfK7GQIWC+Jci9aO37ZQhe5xFfPYk9p0jXITliLgY5G/WITPCd8Q1QU5AZmatz0VPkUYlB42g86JrVEJI/KYUGMTFnytfwvPYJ42rLYBIEbrT0/xtHGdZpCi9WMTFD+z9j4KXknLnCTpZWTEOQFiMxemgRZITUQfU9/LaNes+ZnPRE3DZxjC+LqQUlp+riDENoV5y6fl9TfOL8qCJ4aoMPX4WexZJRm0+fQjagMiDxbSajTe5OLTcg5gSfPzF7vvaMQpu7xfHHCJ/Y6Wd1jf+Or2suOxP3PZFxSMU5SFV7NXZQ9q6TzzddVYVcTr/oXzbbdFz3huBtR73L6Sa1lGVXAsC72MbEcol9d/RBGkL5qeMuFjGvqSmgPJMXFjJX1L55GESD0z1KPcjCXUcH+Tz50z46wIGrJ3AVrGgpgR9QwVnMbEUuYtb8SxoX6QwRkRq7P4BHYc1E9sqjl/38K5qelpSh6daFfTxMvXRuR+gDEVAICLAIKMYDD2+Oql69oAUHAY0YtwFz/JUGG2oYmrzaZNMYS4ZM4EmmH2/+3VJzw/rtaUI2QX3I7rnW/xlnm5DutJe3SQw1oFRTXH1YsrVehglwOPehRT3LVNp6l7NpT/bkSjzyhePg+pS1uIElT/hE7IiL2goTzTidMgBvgZavdjbjRhqSo7j53oB7O/4oiosvZ5r8Ag/gpFvXqk1trZdCjWCQaQKdyBdMuh9L9HKbprtXWnWgVOF8UB5XLfXiy+iPmCgjupfIWU6D1XIcDx9sOI3Wskhu3jvIX2l2iwf99dokYY631eonEa18aMGnXlf5NGYEKZ/wU0uP0dSuV4QtUdAGzVNSD2xExu1Sn/HgilWxuIcFjbZJz0gwqkje2BAKp3nMqdwmQ845xdaMs2RKyZC9DJvmL4K9K7ImQD9bKhrJy8nj9DKLsuPrkP/Lwcs+NnO1nTqGlNizwlXck90spFIuMwc64GSybXxSM/XWVuQcWJkF/kHUrhSXxIgG0RezHqGXFQQzDq/b1O0Z3VfehrI/fBS7dSSd057A//B99uB7y+mw1+aHSI1FhVa9kAmQsLTjew0pJUMigprrtLP036Ioeh9+Um9YFTXeG5Als2WcNVbldyKdO4jnfj4z/Ir9m7MoRHa4ryH2Pyu4VDypsyseO1Jrimm37s3iqDdu0cEUFmH75LsuzQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9150547-4bcb-47fe-2102-08da4bb4ae26 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 14:14:21.6933 (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: y5copZBv9C1EP+LY8IAN8mCuZlcHTvENtFz+htUatX1WmB5Au5BgnrIMWRtRiuXfXDzaN9hOYTxW5uoiWLJ8FA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8249 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add myself as the maintainer of DRM bridge drivers for i.MX SoCs. Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- v8->v9: * No change. v7->v8: * No change. v6->v7: * Add Robert's R-b tag. v5->v6: * No change. v4->v5: * No change. v3->v4: * No change. v2->v3: * No change. v1->v2: * No change. MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a6d3bd9d2a8d..033d4e8b838b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6654,6 +6654,16 @@ F: Documentation/devicetree/bindings/display/imx/ F: drivers/gpu/drm/imx/ F: drivers/gpu/ipu-v3/ +DRM DRIVERS FOR FREESCALE IMX BRIDGE +M: Liu Ying +L: dri-devel@lists.freedesktop.org +S: Maintained +F: Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-ldb.yaml +F: Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-combiner.yaml +F: Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-link.yaml +F: Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml +F: drivers/gpu/drm/bridge/imx/ + DRM DRIVERS FOR GMA500 (Poulsbo, Moorestown and derivative chipsets) M: Patrik Jakobsson L: dri-devel@lists.freedesktop.org