From patchwork Thu Jun 9 06:49:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874865 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 23FE9CCA473 for ; Thu, 9 Jun 2022 06:48:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237278AbiFIGsU (ORCPT ); Thu, 9 Jun 2022 02:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239213AbiFIGsR (ORCPT ); Thu, 9 Jun 2022 02:48:17 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50051.outbound.protection.outlook.com [40.107.5.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EA044B401; Wed, 8 Jun 2022 23:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cwOxPFB1WqZBk+g0nqRScO0aJEsiUkmMbh4WZNmgJR4qJya4oLuHaMW0g4L5cVgFvRw9HzKUY5lpwB/u4OC3KIIGlgnZ07IB2NC54kE2gmMaxbym0zUY/UxeCQfh7jWpJV7k0k9uSU/fX/qqJDU+pU1YgMc0nWFA3v1SC90XxMsGzxo3YNMbEB1Hzt5FqqqEab3ObibuhvkgENmrX6YJpBWxmDWSE8nNty/9XWB+OTtq4FY7OeLA79r3AOco3/FzIZvp2V5UlomMn6Qy8Q7qtm7GW1Mgklu+iDN2bmHSOFWllUce1p0ychpiF/oWkVsPVShXtwpK4bFjxaumquxGtA== 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=PGMCFkE5UKzvfv/uX2zuCd//zUK1ZgRhdIRETpeS6yA=; b=fdTpnr3q9f6xTk4Y93u1ZXsWwaMenpFtHcxqj5du2NNTZIWUGaetYvdFoBh1m4KCicN5Y6ty1JRCyNCney+MOzxjGpkoTMceC+ZLCWaPXf9u/Srl+DKgqcO6EI6kYn4lYgsUUi0SHH2j3Q/3GH9gQO/JUsnVXqj/ivBKwBSb+ry5bapYJtQEtJFWKf8zwtDnv+9MWBY0wAN80hj2VDuiySZemRgoL+ulQvPQAGTHKCICojG1dzFEr5C+PBwAQ/l+ZFEMOtU6RaQTL+6DKWDEi1CIzK5mK40875RKi5C9Xgt5Y55oOYRr30s02eWdqZ8RpNU6ZvsHn83+XS77IpMgJg== 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=PGMCFkE5UKzvfv/uX2zuCd//zUK1ZgRhdIRETpeS6yA=; b=NZIskhGtBQd+OKuQJDoLUEAnRkpyLOD7A+0zjv8zLoeL0jZM+5ljWAwYAT+VAT5hJtgbSxGLZIJl7D6RPbubTQiGGBf1x80W9fJpOkFvlp5KxByoNH+AFBlPd5BdaSrWDdVJAwdgIQTy/GQuxdji/MKz4YMLwoxb0QEVep75+wA= 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 VI1PR04MB5280.eurprd04.prod.outlook.com (2603:10a6:803:5f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:48:11 +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.013; Thu, 9 Jun 2022 06:48:10 +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 v8 01/14] media: uapi: Add some RGB bus formats for i.MX8qm/qxp pixel combiner Date: Thu, 9 Jun 2022 14:49:18 +0800 Message-Id: <20220609064931.3068601-2-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: 1cc8759b-a47a-4283-b9f2-08da49e404ad X-MS-TrafficTypeDiagnostic: VI1PR04MB5280: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: aAy8HmCaLfIccdExDroJDY5TQ5WI14LX6R+qcHnB6l3gfUl/yiamdTJ6jKf4nbWX5mTnOX2dP4fFbqtrCx3w56SN39zGlipxjr0ZxrPPO6r2fuNqxOm0ua9nejLDKhedDst5P/cj8ULBt59bkY7Q8s12xLkIg5U3WGpmewKdONH6QFXZhSDFJvhrZQ0fLP2b+PoeanENJTqh8jGxUmOzqQEm0NBxGRbWiLBBnyhi2wXez8BCK16NiqbCDG5PZ/lhsrqPoNIooEv7rQ5NrVUDMzjCpQtjno85JW94m6ccLzJ3VJX5PxH1LMMzS/yXch5yl6qyET5tx/fHnTnGo4q7wtUwrjaVKugUzez5yQ9p4YzLpCt1YqAfRulScNTenl7MZwZe1ETDJMDUiOEACBSuqVE1NvVi1Z63jrFTcrLyeEoDclsJk554fRi21DVUnmwcs7K2FDrOZYYPFEZmHo4jRr0jH45WdPIFajzAFOcDnmUlk60A/K9wLGgsZD6Ap0wtNRsRPUETrCswDsWnPFO3KcBliCxqhcGHp/JPjUw7L0XpABU4NYM/nQZvXmXJ+Ix3EJiCzh6G+06tTOJE0+EsGhl3mE/oR0inpCpPwVy9bnD2cgR7ybRIP1KvtMXLZennQUFkI6drUNSsl8wM4N8RpvTX9M1eoU0gKN1nD5uOQZYSCK/Fe4rVs+CMzJopF1b73BGlPYsZe7ax8TIQQSUsNg== 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:(13230001)(4636009)(366004)(1076003)(186003)(83380400001)(38350700002)(38100700002)(6506007)(36756003)(2906002)(52116002)(316002)(6512007)(508600001)(66946007)(6486002)(2616005)(66476007)(66556008)(8676002)(4326008)(7416002)(5660300002)(8936002)(86362001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: F303XoTCpfXJ4SFFzJWBqMorokBmVlFEmQGEcPd4BVjMB9fq64pOzAd2BtPlsm4jKBhUMtVPEwpoU/blV5dvNOWEu5p8MsAITHlN7za407zjxcI0SFnOVSV1EmnuCj+JPJxw68HwH4YVsBfF6qOuLwDzB1ZCcGt1/5Ajc0Ru13opMV1QAaUeGxm2HjMbDyYlv4UBuexFFsK+zTyvEO2OG6ovGmSGCiijXzBeduUXkfFts6GNcEs0Zh4JgJXmg/PdWl2VqGbCmfMksI9uk5ZLAsKHrVqg0kxMlUyQHc/2Q+4k5zDKZTOq5bV73JF7HhqCSSWs1W48PL1bsHVQ/JtJnoEY4cs2SDNdfUNgC7qKe9MNJCfIpRm8XYGW0dgZp85aiMUZczf5NsaOxhWrYlK8k7OY5ZEQzIEtrE0PhzS8rcXnpyymXCVpHuRRmgksVrkoerE2QjUzePrUxOsAG6OKi4vcg+1bGQWEkfrHmdwIFs7w8tdCsrCyBHVQp/z2rXLzit9k0cpJW6XyREja0tQrzVFduWXiY3VOHxEZDvUHZUtULKgEc46gn6WY0MqT8Hy4xLUAMyx4AGeBARs+RDaMbfpumGAi3RUYe7kaSE/efvdO9RNnIoklVIsvFqUHqXpN3oh5nuqIEB47rqwwjXuGl3WTD6fL7f4yL2jWH3BLQiPtwO8V9SdmYulbUi3ykKlb/LqsHS+eLinJ/VB/mI9vSftTFfQAFFtHkMGmYywiOmB4e+/9fvOlGhsGvpfRmX8yqRtWTaRDf0b592T2cZRisBgozobATjFaRSW8Gzy6dOHhpBk01PYNrR1sDkw3s/YfCFq5MarXWITvRCuYQD20x5S/zqm9WtqyyPUgZkPzvQyog0cH0J4te5fYejzBjXVBu7CunuMioPbDlX33qs3raP7Jks2Si07VWDbBoWFGcd+gnCXSNtpPuD7FMTm9HPz0yoQZLe18wNZN86kOlAymgVoBR5GBd9w6EXY4lw8bG/aYsxUx5dg286miLW5j7tWx3VqlJNCWJlkF2En2POyVI7oDV5RSs9RhB6bXKCm1chKLkgW/O7IzIp5+/A9wfA6LfHsogADrVtGTIXq4HqkL+v9OHfS6+A2hQIGXFuH66OS/kczRbDjcE4AidespEKlfQ+JWJ7K83J0Tthvi8qF9MNMFLoWfpKT257vZ73kIHzOz3N7+FZ2qAdJEb7hV/3ln0lcoRreh5KCngLRFL/uJk2DLkvvddaoQqhhD4Ewd0oIf+g5XvQFxE4HR9U4Vd/uBpvKu3i6HqGf9pqAFcah5MN+M4OAx2iXBtwagFbTZnWMR/Cz2zKn59QvDOWkWFVwFFBz/RzisfYXpUGfhDPk7ksecFHgBpt4TiWShYnfvXFZ1qaqGF9qDcgMpzd/XlUQpx9apJwierw+L0gajq2jaVzfWrbHStVTqcpl6OiWGLVhj2BPJldiQmEazsiEftMqB/Lwiwfz0i/Jn2nrEr8Gp7vlI/fBjHKJMM/4uXQs0d9qzkGKg4Am8Ox1jQic3XHf/BwTc9BucFeQZAVPu/3gOUve93FiV5233I8iMRHY2SifO9gyUsAcBiiFpDCwGHCSH8HLWoNQRCXQ8pzccRr0IcuqWl9xoxCs22wPjikdIqefB28gl4X4yUWS7s95ENwtClbz7Cu/CTMiOaM4Izln36qVpzd/oA86QmA5uJwwojDMQB7ZcRZ7dtzCQJfAwfi07CxhWAZkQ9LZAHpAip9SuFw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cc8759b-a47a-4283-b9f2-08da49e404ad X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:48:10.8711 (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: mdiOHjGOqTcojznuYaYeTLJzy45JsEs93apyX71SZmWFtZpG4lzTm8n/I/yrdKohk7AeGB9hnLn119SctWhJ9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5280 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 --- 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 Thu Jun 9 06:49:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874866 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 702FDC43334 for ; Thu, 9 Jun 2022 06:48:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239268AbiFIGsa (ORCPT ); Thu, 9 Jun 2022 02:48:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239297AbiFIGsY (ORCPT ); Thu, 9 Jun 2022 02:48:24 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2067.outbound.protection.outlook.com [40.107.104.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69456326F7; Wed, 8 Jun 2022 23:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fy7i3bHHWAXBRoG8+0mPxZBEhMSyuCFtbZ9jZft7MUZWBR+R6RoODRdped91leCGzg1no8fNzP0FJjCs2z58Hn2xZ6RVACqaM+Y64p7U9E+HYjESK+TzOhSKuJfHaHZNPMkje9nRTemLTqQl+a2WcY5v9zXWwt3Nu+GYD7ysdg0cRiS7lIchkR3OwAUCZMYgCr33YCbcr1Py5sPCQdPjRSmJhMTuQpTUpdbH+F1bwIkoDDEGcQbfzTqZxtijKqVfvfrckuUUUYjIb7rDqm5QFI0AMP9LPdu0Qx8UKQJkE13R1t+K/JwxlF6o+xI4i7+oHtVSIPmgYFnPiR7vJLcAaQ== 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=7rNVAC+RYQlN7zRVQrTTkR1w7THm94t34elr5qvTutA=; b=cIt5bYNBR0/uuEIXcadMzhzdCr4yHzNxO83I4pmsfk4esKOpRlw4h3KzOKs9ud7Dhz5wz36x32IKJPMngaUVFY2VlRgodJwhNWdfYI5mYREIFIMe7MYfooETl1O+VLz7+qOHjlVVk9kpZaqIiBz0UQQKcKGZKvIoC959yZ3pptJ1qhHvnByP9/kg9NVBE/VhsjM6BZBGQjj25DqdWYbv44W/ZLjpW1AIju4hbxFnviH2Imn2FE09Sd2glnS91PltXIe4aCAI45wpeJ8NvYWB67mGsiTSvU0ht6FwHAMaZng8eGKhqfmQDW+IRoYDWganpCJBE5OQktHeu5Hc+3MKvQ== 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=7rNVAC+RYQlN7zRVQrTTkR1w7THm94t34elr5qvTutA=; b=LNjIu74HkzxR0mOEV/5AlBROL8mrHTQzePkmlTV7hUGaopRVx4h/y9E9U3Ikg7Brj39WjlYSv8DlYGazvLk7zboM5NTKGmBfFbpp0O/ecEdNRuhMQ0CKF5kTo1jJhs+fH/1pFMhhocH7eyzSFQy24EDQLhvnFV/Fkl6W0FEREyI= 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 VI1PR0402MB3518.eurprd04.prod.outlook.com (2603:10a6:803:4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:48: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.013; Thu, 9 Jun 2022 06:48: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, Laurent Pinchart Subject: [PATCH v8 02/14] media: docs: Add some RGB bus formats for i.MX8qm/qxp pixel combiner Date: Thu, 9 Jun 2022 14:49:19 +0800 Message-Id: <20220609064931.3068601-3-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: 63bb2775-e7e9-4312-8fd3-08da49e408dc X-MS-TrafficTypeDiagnostic: VI1PR0402MB3518: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: FNrYVyBjyIB7evAtzoVluoV2Bf6k90fZYBHzcL2sH6Ow6JJUe+YqEPMB4iMENHVekjX9ycfUXZ7g52A6jE9V3kDeCG27Kuk+k7DVj+804rUPn1+nBa8iunvzSJfS2vPBEsy3OnwW0W/e4B2QF6ZW++NAc2l8UTmbHJ3NbmCse5bucclzRtcsPCB1vnHQx+VorQ1iW6gCY339PDIF8rde8xS5Y5qg8UyBjieFLD0mEhd6GFqk0fZPNH2Nden5b9t2116yKDdYNptMq8FWzwTQU2q35K6ckFsxnHOx4vxBHgwBEj+eqVH97SvJr7sAusK6LGhpawD7j+CaSy9+uKRpLjod/ihRa7NoMMNnbamyStl6vw4kk2KhVzPHKOdz8JzPghdt9QeRK1T+h7lYesuuPUulPNvD/9KKQDO16s8DX7+rhXz9VmyLtVwZ60f5dU0Wq+waNH1TnsS2LfhL3cxydPO+M1Sue34fm/Dh7kAtdF9JV0AnLfzlxLmZgyMqL+50QIiBj5hSdEbA7hAoEEAlyvVaeEB6D4Jlrsv8xTl6PK2K4614lIGooes+/vEGDFSGrRA9zFnTE+07BRAt6fbKSaC+28BexBW7lZh4pVELO9HpCCXYY3omHl9jz34yGEdnxt1RHTpT0I8WlwbGAr5L5u5BgQGgTmcyu5ekhUW34UCuq9k224qLGDclTh/F/hyI8mmdP1hFRHePKf4ffH5W+A== 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:(13230001)(4636009)(366004)(4326008)(66476007)(508600001)(86362001)(5660300002)(8936002)(66946007)(7416002)(8676002)(52116002)(6506007)(66556008)(2906002)(186003)(26005)(38100700002)(38350700002)(2616005)(316002)(36756003)(1076003)(6512007)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: x2yE4gm9O7Q2V7MWd8vIVSXAXP/JKDIZW1w1IVAm3DqTKKx029978FxLT84BCdxlbCK0l2Xeufyh5pOGNIyG7DK9a3NNPENyZhKBfxYQua0/g6y+YV+/CNmOs0Y7HCDSg89kH0Z0Az3MCO5OEU8QRLCHnhAnfj2YihpIqDnvhZFZQkvfFTd+hYmsntsmBZgAIwaRkzRlsjREEPPcBCQLVYaA9GMzeY55rlVUHSGmeIwygYeL6Iojkk0SLApLYkkFrVmDiL5yzzYYvm4vona1LjjFHcE73FD5pSQhjbsIZu8o3nUwl2p/29+ojjoHPS76u5Xe+fArln0CKZVeuElLL+9bJcf2IbHU4J1/+nEwiLfr69ArR00R9QLy72KVAlXnkn0sxeNm3kvQXIcU2440nsfFa0NqwexSXqyJG5nGltZLfRe+7i3lo/loNuMhYXfV3h9jBz5BJVqbLD3prPYT/5qSvAYC7Jk0fKA+qWBZPk9+CI52jhDOZmtlejbRa4fPXDjYRw48qNoB8/8TwkIZlXPpoDuQX2jy/0HmO9LXa2ViJF+zCRfvKKlPAFlTG1CbVEGjoD9katMJoh2nHLdSsurXpK/PiKqDsyouhEee26FcHRPKBl+wJOey5jT4zTCeitMdkqGqtn8YYOF7IGm5iX8kzY3tuI3vWxLipEb2ufhzJxt6/fq7Tdg0Op9D1ZSGVISFYN+2ElMKHlXJ+QjYNLtjsBR1doJd7Twpnk9f4JsmwsjDIM4Kkrv9TUYUZzTIvFVZUG0Hk93DNPSlWnX4X7a7ssLMK9UzFKWiM3XktzNbnxQuwkfyTtKmzXDVnZ0VJhAUKUNpkeZi+sfeb0Kk0SkmPC3/LRM/FppiszAifK4OhsRpzYK/j0O2W7tYiH/At9+tBbzcm+yiRVAsCZv2D9+i4Fe3ThLbbgtTzpT2D7FgKGnzBGn99v75iCZ8N2faFl5wPW0OGm0xrqOaUZgIRdC63TS4hiVHvXRhJM2XbWtSbA6CWjcXlnyNRCm7MwnVme05wN6zduegjY9w4CBGHb/TJYLXqfrLtxSvnFt3WDfY8UTqQvIusWOsoHFuBxBku1+koJwBq8qj73R0WQIbaq5/EjOSpldWWkJekpeHBvzsCidHbKChcHeMDhNq2ZT824JmGiU2OyTmaGpcZJTBVzUVgBqOOoTkX6QIuY3HOLPtH9EFrJGFSfiotSLNKfUfdwB67BNz5DSwONc6lOQDJHIzUDZZP7N4QMtlJUcXYIh+x3puiUvaBawhwcl5b50VY8uyiAfhjt0UbEL1G68T0xa+gZEpK+cNnNjiWhwql4V+g7Fkp4q1niOAO6MqGiKb19f4BSPGUdvhmepBKbkr8IYYgOUA7qbKfVEQPlpK2cCU1+7yd8IGjQgYTHLR9IsX8XeDRWcpiR3ywY69fz852Hk0wxA8Cn6rRDVufUxNm+6W+UqIlsxWt5c3Orc5V00tDbCRPse42bcV+ir3IgEvVp6YET5myRoyHAIQPmSdZnTFXB48FcgZyKy8ezrlhrNxvTMdsL6N81ZLl/0SA4ARR1HaPZSZU//m8n2DS4qTIDR31IDMc6rgAyt/PqS+nQ0xr3UhJXrglWCFcTALl5kyAD8ZonNorEhTwP01EWW/Jv+zDjRHsYapQ9nl4AjsKZIIng3E/gCbVVRN4UcRtcaur5tlfFPVHbdrNFu6NbXSGTZV0dQ+r/HyAaaGeveQPr9zNlBdN+yd1vnqhK0wXdKW1Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63bb2775-e7e9-4312-8fd3-08da49e408dc X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:48:17.9826 (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: +xCVYknOQaDl2sAn4JJ28nIw5kUjkfTWjOGopy2cb1CW/EmC/xqcp8qEy1E0hBCEU9TfUPTo7xjO3crThp6H/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3518 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. 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 Thu Jun 9 06:49:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874867 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 78D64CCA47D for ; Thu, 9 Jun 2022 06:48:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239337AbiFIGsk (ORCPT ); Thu, 9 Jun 2022 02:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239251AbiFIGs3 (ORCPT ); Thu, 9 Jun 2022 02:48:29 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2089.outbound.protection.outlook.com [40.107.104.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A397D31926; Wed, 8 Jun 2022 23:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nx+DOBqIMWHPOOnFFFvhuxhKwZQM2GS93OL0pdlOUm9IxI1lYKwWqW2LvFKBeyo51LVthnHOJV4TK8sTm6tErofU2JmlS11VW2hBNbV/IsUuc5ttC+zL3m0kxbBixkrJOzPjF55f54rzhVqgRCJnmFs3Lhe325Hvyp4AqresPjhcyR2yyFHCuh47JIy8G95yYllgmkX1W5/umI8q35YUmPaA9qOBAPam4FPPqiT+jIGtPnRrnOxgVKMHY+X3ZeXXMwbxROlmJuMMbILcBLVVZU0HjCMDS28UJG7g8c+5Sqbxz4PzbgT2I2t8rxEjEny06n5Za08Qk9GclnVZA2waOA== 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=UrTNgj5phonT7Nomc4yB72k4kK6HzUGQNz+O9z91N5U=; b=KJ6CPfVWZIz6btzPft1zpN7ZXFEf7DPYSXp627X1pcf0nvD+MqL4EhRaBsrPn7fR7zjqFtNfplVzZqQNIkwy0bbablfXAOw25sT56pI7EHk7KuwCPu48Xw1ODCcTrasw/cg5s3ii63YfO94/cprazqFHaRrx3wY88ZGDCDZmmkq0GpdiSnDwUTmAvhW+H7lXtIUy6AQGVtAEl3jqugGsLO24NFtLmV2AF8mxwfFssSG/PtPyEy0M8CaC5XRKAF01C+ZcegsL0Q6jlTQGe8akk5H9a5CNjAU2MCJeBDSLx7nppklhC2MFjoQo3YKDBB19Ep6r2V3H9w3O/YSmZ9xRqg== 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=UrTNgj5phonT7Nomc4yB72k4kK6HzUGQNz+O9z91N5U=; b=ectPYDo9aSWKbzxlb7BLtOipAfD1bx/z2+aGFaOMO0pvnMMsJ5Yrh4eAtvpegkWMov8inzOuXYmORx25FvdZTWQef63pxqeUhnICGRREYzN8bIlWsnv8lmVGm5MwD5xh4pIKrUbcAR8GIuvBmvP6ipLDXb9VeaKaS6pHBBvIxs0= 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 VI1PR0402MB3518.eurprd04.prod.outlook.com (2603:10a6:803:4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:48:25 +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.013; Thu, 9 Jun 2022 06:48:25 +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 v8 03/14] dt-bindings: display: bridge: Add i.MX8qm/qxp pixel combiner binding Date: Thu, 9 Jun 2022 14:49:20 +0800 Message-Id: <20220609064931.3068601-4-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: dee1d790-f178-424c-68ed-08da49e40d19 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3518: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: BQRp4Dmb1rmVnUlLRJmirvCDRY0AVZ0WBKqKbkD11SbY0vXm3vXPlNgfksMXVSBlUE6BZgBTWgsbKYVwS31qdwXnLdGwCN0fNoqD+akMTkZAeXPnMyCA+pOEa9cpQz+jnmodeYQzWnLsZkvq/cOsQcJHuNJJVKmdChOYxlMjsPO+T7Zp0pAOaYbA8qdvjGr1Rf++C8qx5hFMCumdReZc9Fc6E1Wm9NTdcokU1UMF1lX2v6dSIOEATJyDhZdBwK0nCKobdouge/vSHUkZ6GLr2oIK4f+3mzvNL46ZFJKm4jGYTAbIQgZQ0xv9/bUUWCd9f3HATM+VnYah7jilfvvB1ahmkIjqrsi7NU/shjLLnu/l99a71Uazix4yX9G82cC5ru7f/Qa2weLyXPCw9LyenPh9WwrLZ2LQ1efRNTlpEvFk6xBcrCOv4S+oo7IBJmv3sPGc0lRssz78HJ2D10FCWBDOiTiDerkoT8xEu0xlWiJGH3XeoTVaZ8IOH4Fpf3b6whZ2AsW8YcWoHSaI+Kk2YDMLY4VEKa+iHUiV0Afw+XMhj9iUFLXHu87N+xjrb5INs5yBn4ArGe9fqE9OGdkMGyjeP4DdPNnsTE5x/hZDlkQzlIsJzm3E3PXUyC09JuVVowEg+SG7KZMFwKY53E2U8z0FHqDcBp+P2fbCaTCXRqdo8n1LR4MyYon74iCh+5nwXnFtvuPDfDhSTjOKsfbMpr8/86P8jr0AFS4mFRRcrqciFHi6IgCkiw8d906uDYwQYnxWCoAl6RrLmBU8LH4CbcXAM0k/FCa3oISbpDuWg7Nepa770JZ70UaufELv5Owo1eiyz0EVdA9OmQqTU+1Hzw== 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:(13230001)(4636009)(366004)(4326008)(66476007)(508600001)(86362001)(5660300002)(8936002)(66946007)(7416002)(8676002)(52116002)(6506007)(66556008)(2906002)(6666004)(186003)(26005)(38100700002)(966005)(38350700002)(2616005)(316002)(36756003)(1076003)(6512007)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QpGcd9h+RG2OAvdiO/tkG1HElduOEyOL3YmtfW87d9Ln83J/AovgB+TdEeOgxy9tOZNaSYBbrZ9h07geAl6yCA4k9x9pv94pkZ7cauteP5ShmLJvcPFze6zEZZ+re2blmQjI8lsPKpEr9sx61JjFGghUAeSjbkH+It0TawcXu6NRXmxGKCFR5tlZHJjFw1zY5lFwLoChho+I7tjlGJXEsvOizg/YFTg4/3hVoP/0wZYQ4C0T+pZK7NPc6fP9YAhG1mAvxFB/pbjKgRVTBtnT3bs42C4C4SQiha3gC3QYjyP2UC+68dIZV5IR0M2JUas550V1P/2JOj8Hhc/jmiNQ6AcSejVaMKhYV49iSQ35cWwTn9v8sIphx9YkoRMkEhy91B6EhFBvwdghQTlbgVuGJR4LdFf7z0bhRVgqSe49kNcefjdodi7HKEJr8L/vzr4hJoo3XCedqsZsoXFiQ9q0wRVGHOMCLeuGP2rKYyRxPeMnIasUzG1KZt62pPzobBxIUcjbh1RmwhqmE0qzuHTYok9lY6P95THyj/WatZkMwNmyYv+oY6WL97GJGxuJ1xQConwJfvBioh08e1o8ubctQVkrH0x3CoCvcZEU/ImAa6PiuF/SEuwzeNgdIGeET/VChlVhft6F3lyzUXZsDGXvOrlMZVtzENXxTupYXZKsB8fiC+zKccfLf9HGIXChfAbD0MsCaeHdIWcrrYFWP65HJ4p4R3t6eDPxY8RR+dp48XJ6nDqsJVcNBjlwEdsZXxRjzXqD81qMWPDNCwzQjI2z3tWyivEqyfGdMcDxGBauH3duNGZpzck8Vhh3GxEWP0Q5uy0yqlul+TCWY07udwcS2ff39CURMGCU/S4dNbGftxW4ollQAQRVY9Z0MfqgQC272PSc3Is7hpHOcn0Yv+1jQ5ZHT8LXxwL9uzOvXejswf040fTRYVIm8M2lEMdZN1eqni5GgoS8mQnwtQIdD6PkknaLwuKQMWIa+6PS356bjBc46/NzIMdWqCwZxFqDPcsaF91cTItiu33X02hwqsuArVY2jk4czTTBKcdOuoDJZkSACXpfEr+FaPA3d2eWM8ESV/2tnb1VmtvzepdaGqrPFAx/sOpeBFrzmTpP5x46mz2FXAFKfXAp/MWGTWH4aygxJD9KgGnPAutUmf2Izlgh/9efPBfRbXhdq35uMPFsupq/mNRadCDW859h9iIjr8SdT10Fk5ZDfd6wfqDBg/6/5cQtFXQB5uxugr2UItnTX8YHYTh5JTqaBCJQuIxbm9mwwq6fsdMTl0SuwJaK27Lh5I/56UCULjAl40qLNY+XUBp+cQtqTqyCB5AFsrDTnvuq1VgCxoNXyNTulhxoOaWcsYOn4zTEfNb1MuXGFyCOhCfUB2Nv1YKpPw3igEMzKFntCl7cQVXzCX8OeC4t9aU4oD0zCClbluPl86HhOYd+df4c7bhOo9bXy881mDiPAoSYgh8QPH3/OAUF10if1ZrAStagC+bCCCdGvPUSnLLVmSbYUMXlWZmcp7O6y5IZlNvSPJcnnWQBFUN1UrRKmbf6t79LlXIgRpl8I8QuEiFbKFrhvzUVVEBxMAFN8P40xOb50WK4vTYhs5PYIHNMQIWVrR4vbRDBR0tgF6LtYsGqem/K8ScWmjrHeq5wPx9OHuR4AYll1+P1UymksCZBHWdO/SZStfCcgu3UGwcO6p6mbbxxeYxvBuQA6I3OEJnI0ILc+MZ98zWu9TGUcCijzd4vXA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dee1d790-f178-424c-68ed-08da49e40d19 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:48:24.9673 (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: zoFg3yWInpqzcXwVvF1NEdETQIgbNaIN0b8mRTGl5TP0+XFnGwCjzFsnxyNFG8eLAZM58FpBcmzJsQjOZxn4pw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3518 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 --- 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 Thu Jun 9 06:49:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874868 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 10F4DC43334 for ; Thu, 9 Jun 2022 06:48:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239344AbiFIGsl (ORCPT ); Thu, 9 Jun 2022 02:48:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239311AbiFIGsh (ORCPT ); Thu, 9 Jun 2022 02:48:37 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2052.outbound.protection.outlook.com [40.107.104.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656384BFEF; Wed, 8 Jun 2022 23:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PlWLXqcw82cxvwf54BWaEg4mf751A8ugNq7jr/Fqd9pVsYqw0iTGmkvdROPv2OTo7xSax6WnalIXcfU/M5QvCC0iuXnJUUYNVBEzGKeRVImfGTkWqKAvogPzDHFoGKgB1+B18LXmo5hR/r/CZojXrFdpq0ZUXRlrFY+jGCOq+e9TGmd1FBK1k4CYgQKLDIXPzv0gHNaFyU8RuoUodipZHcEXbusCwdd6ml9wErb8DCaGL0MH8Xe1Qj9h3D35voeT9NdPizuHkvc1WvtiVHEMGYBDgTp9zJh33LbCmrAlyh+F5BsR+2g/RCWhMQRl9DZUo56FDqmPHcFuQuWK507fKg== 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=sST6rOtMof2ywClcZRbZ7JZQUKw7w+aYBtRRGn3IC/k=; b=N5E6wDq/9ULzdVvXaLHShv0hkU6ScAvpI26wfWMxbqCAGWTmLMDVHJ8AVaNy6YPuMSwbzvRa7gMTG7yMxU/nvRXFkwMiTg60Qt9l4ob6XhpiVrUAYUn6sPmm6ObsJeLb4wLezDZU1KI2UUBbw2vnW9stue1b0Whb1j3gg1vC08deV+5jQvJKX9NGPZ1ZvfGFb7IDR+LqvZSp6wz3/3uKJHBCEHr2B4Pw45Zs13sXt4PPfBMqFbbmDiaKu2/LpfLkrP507njGvRrXJxtLXbSIeS8377+s6hOS7RcQbjjSxnvvTg9j9m3wYdjV1yFHBdzZ/sG8sO/pGAChvr0PvScFRQ== 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=sST6rOtMof2ywClcZRbZ7JZQUKw7w+aYBtRRGn3IC/k=; b=lzoH4gh2ERTUzFSJ0oz591sFz0pgd5cHcfM1exvFPR7i4xvwjisNWGUxSg3aG68DOjn3JPBSGebDAWthONLrF4ULNZUqD6wUPxkNZyTxo2K5G2GNQqhqGzqDCmdqvlgM8Upu22j6LSfjFiylYbx+kQy2Z5f570uaUhpFOspEHg0= 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 VI1PR0402MB3518.eurprd04.prod.outlook.com (2603:10a6:803:4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:48:32 +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.013; Thu, 9 Jun 2022 06:48:31 +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 v8 04/14] drm/bridge: imx: Add i.MX8qm/qxp pixel combiner support Date: Thu, 9 Jun 2022 14:49:21 +0800 Message-Id: <20220609064931.3068601-5-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: e81bfd99-e8a1-4195-a311-08da49e410f1 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3518: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: nOSGK+QEC8Z+F4j1JZVXuQhMLHFo14GEi7Yah92NEVV1o750ulZ8Jawd52fMn1AGcuDCbngJZ32UmJ1RLvql9UtROn4k2NcnDMb34XhBFQRkWE6SGSTgWM78/RFdgjik+5oKmsLi+r/HrqxilQvpf7WLNjq6qsLKUUBrc/fhCtjxGEYvflM5k5Mc0ZGBNmZORo8HjE2I/Ih8RMrhmZZKalr2oPt5tvIeSp1LQmIIPYuMJc25fhcxUOezsgaevJEt7qJctLvGr7EpfE7pzyJMMczgP0KvNcuBhiEGw1qjPCZcDEdqLK4oMtovWGgG6IekEMeo8fshXeQp310xZnnU/nZyRFjko6StL65LpUM8a+fbRmtXVLqlBuUmFf/eNFS2QcKwW1WwiQkDvygkybu+7EKBAbvp52zNfCOIxGDs0TkS8z9b+N9cWWhB2bKRLo8iJc2E0Ep0OxADt/Uveq0xtAS8FRnPJDLD8hTtf56SiA3zetzbVRiWhXmXDtEJnEr0ZwgpFdZnod9dBO0f8QcH3NUn4tjU2n39ptA5p/LxotXrPhXSjEhGkRrCRjDQsiMJ96ZnnBzhX6KUIxrgk9JfMTclMLxiu0KcsqSHFSDzJcNJVawQp+JKJN2zPLfjrvSsOS958/pGCD/9dRwVyr788XvCqhYdwKNOn+hEIDYjO0i8kStS3LQITaGWIeo/LZG9z3844iO2JHMNIlXwy3eyzw== 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:(13230001)(4636009)(366004)(4326008)(66476007)(508600001)(86362001)(5660300002)(30864003)(8936002)(66946007)(7416002)(8676002)(52116002)(6506007)(66556008)(2906002)(6666004)(186003)(26005)(38100700002)(38350700002)(2616005)(316002)(36756003)(1076003)(6512007)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3d7I1a5opNLFmQmWCbp216ZuRVtkct5oWHax9h5FxQgz9p+CbxvjsOWawC2ipPDjjP+vQNmUpY7KnFbG0n3LZ1VVb9guvnaiwkDyW6UwmtBs0TjEm24PrPwIfKOZlEDM35qkKRZ2PlHbiSnHuQjv1MaLX3zU4AZal4069BcHgDBCao7MSZWb+3TkqGHztH+sHZ8GGX94WLaMMk/8Xpk/mr0A/jbcykgjhsJScPt2sxedzVZDR/xsxarPWTqfrQshy1XocZGD0aIiDTHPu0hoe82uj87qq1dmfB5X0BwiLaYc63XWUCa3PcL5r/TBoR8uOXUmAgFcpAGmnZ+RCZAphLmUWl/sih3kntHew6DDenBzvu3za/kaSNY1bToZ0QTlDDTeeygKbMu1r/unqSOcZnCSRjP54QmDOOx8QHgyC8s8J29lZbb6fHG3YbUQNpweMan7Vs+LxYUqq5bimqHQr1rv+n/OXiC6kZ9nzmw1VepTT+fV1puHSR0zCtdecZcPFFr50ZOiMfWYEJo1xLrOaPDul1dt13TZVajhutIHi2izWkdpSU6PP3Z42XTmkKno8w7J9gkXg1XX760O+FyeZ5bJvblcRTK30HEF+lAK4k0bmYeqHkyR1dW966QgkVJrRKgCIY7KzvyvGbRHbNz+B9EOz5bpBLZJkW4V+NCusVOOjBPCBv/HKy+64ircznXERWHz3iaRDVWwBEPVkgmJDUugUXd1WiFtU00O5uOxZaGE9TMxLZTvKXIh1xJWiCK1YgY7Eqpfqrw9pQtuyYEkRdSsoWI58cXYXTcnM6UwHY4vBh//V7mPPITCCF+2ZoXMAfTym85a/pVPIbSboBsM5pG9qEWgF6+Qnao8Y8iJRURsAZTIC1zCRrB7EFLCLDKXKm33LBzZsGbcm5dR3BxPK3grrdWZ7PpfPLvnubfX/s5fHrPqowE3ZhCx4usw9h2eRmZdd2LVJ4PA6cEgnYBlxMsZBCP0HBCqJpV5MAPXVMQ32RnAE406fwlglyV+ik0WKBIs4nWv5Gvwt3pre3a0dx8fVffVbK8x+ZoOTtkwfUxnk1B3gwhPm6+DLRytfoqHGp0OYU6Y4Qlv0z5JR217Al/ouxZSWDuhjUJSrsdSp6hUwGpHynvtcRPMRBNVGvX8HohQR99yuHd7y1ujTbeGnRMOB+0Edu9x5AqA4GEAPDYehTEx9j+aubFU1XMA/g17w8Jt8NUAQWOEKHzbuoAqYiX1FLus9sYYrIBc5XWBD46mTT97AXLJkxmb8K+EPhyo88J+9qI1mwgfcf7xSK3h5/RWzrD470ClKrIVok3sZLowKvrDwEekuH3xDYGze977hg1yvYhXkR1MyTV99Qct0A1MbpRtoOeyYLo/FdV2VvswBNTpgoLgT7QYvAydGr71Fj33VagotABUWrz7YQq2b+tdBEJmUIkFPAM9LEf5vpWMzdGx4sCUDrkJO/r9k/JHkulTRUYapRH3C+B2NvlXRhqgeY6Hd7KTQ93ckagLa55lYHdYJzH8uuOqHBiaDSwySuGdB/oOQ5QVkqc/FZVSKOZSecQiHwGc2s+Rf5syeEPXnoRktEFDFXA2liwO2CPZPbw4Q2RB7Y0rbRLKlKkonGdYGfiYI3+BVPKOfDzVI/rEzdWZktLCd+vIWe8Hg+WQghKtnH1JOkn7dtBkUbKU8W+ODdbDuvXBv+0nfQ5Hcw+z/IovClaZBoutgvYR7Y5pvZT8NgiNP5TSWbG1yftx5w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e81bfd99-e8a1-4195-a311-08da49e410f1 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:48:31.7156 (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: aoLBwK8qN/9UVV15sycoDcjYl1otWMQY/NJ2RGjKDc7HzS7K7Xvn9y+aacU+Dr6fV3yWQIxCbxtYGkA85qPP2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3518 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. 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 Thu Jun 9 06:49:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874869 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 257C9C43334 for ; Thu, 9 Jun 2022 06:48:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236993AbiFIGsr (ORCPT ); Thu, 9 Jun 2022 02:48:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239347AbiFIGsm (ORCPT ); Thu, 9 Jun 2022 02:48:42 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2075.outbound.protection.outlook.com [40.107.104.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 366BB4B414; Wed, 8 Jun 2022 23:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XOTJ1f3T3YG3EifuL3caI1LPmq0+TCExB0mrMN95pJkgtAynW1xEXnAPxq57CehPMBCFF6LswXLzl1ktMUXHpGsi/5GwUYB3cwKkYi3gDFl8hCU1WwBWE6Nq2rUkS2IeGo5m2rt9mhxWqnPhBpr1375Zfd38wYaGS+SJhQt7IgniyqeqSbVf789ro4UVyWDtdLHKylhwdqnATsoEBBb/3YvZyZLGC/SXU1319EVwGXarvkWtgAu9vyWy60MBbeaiM+B+BKtM0WEjI1yTTAwa0Z08fg0Bt8ICjLIwFi4knm3Sb1IrWNbp2/NDLdDlNXDdCHg4WXhKZmy+VcYMOhrSjA== 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=6DjxV3N7Bt0o3J/KT/FGQPU6HbG721E6s9o0CyqixvQ=; b=RSoUbNZe7hivqWWKkEZmtqzEV7nyZ0cdJPa8YQzbHjRJrebCKta3+DXVNsT3WVhW6E8d2dn68vARVbreEEeGTgWjtAMt3Pu1mCIK2gq2wPREepD7yqxnNjd+bUOjWng30xPgMmAjcCUpeqH53VtpKWrCJIgxYBguomyXipl1hk35Z2K4WnyGmqCHd5g+619+cbBEpzFceR+m0sLliCA6hhP6rm73HyPByORPLM7vz4tfuCbBgugxNPArTD1ciCTwNGlXISGiKnBPciHOdmQmC2q+QPs95e3El7Nj5+JAkBPR6m6c/oe1GP6qUuCS6GvYl6LKoMzMYe8d2nfnM7gj2w== 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=6DjxV3N7Bt0o3J/KT/FGQPU6HbG721E6s9o0CyqixvQ=; b=I7mOS4HPLq56kfgyLPxMj9M9a7dnauWi1PM5qHAYhPqmK2HMVQP0BbVRpn6vwUEApCueCmemMv2hbc3UXB1aZizCIKw2fKjrmnmf0Pxk5hkoD6t0T9+EGo9vJUGeDp8NGqcpSXt/asbjF07fMUyp3xxFdR3wGsHjOLM6/tADBl0= 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 VI1PR0402MB3518.eurprd04.prod.outlook.com (2603:10a6:803:4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:48:38 +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.013; Thu, 9 Jun 2022 06:48:38 +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 v8 05/14] dt-bindings: display: bridge: Add i.MX8qm/qxp display pixel link binding Date: Thu, 9 Jun 2022 14:49:22 +0800 Message-Id: <20220609064931.3068601-6-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: 301c3304-93c3-46ed-06c8-08da49e41510 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3518: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: YmwBWc3cAWEIBinG2vAAv14OIiibv+Jg8E4FdTR1PuyNSl3bVPhPtIFDrgN2x0rUKNTCWehxwQlm4612pvYlCkXA18XdDRAx29A0iAbvP8EJQKZKA4vqGWa5bjeFLXRMmsvhI6crAt76io4Aaz0u8BhNCFO8Qif0RU7Kz4pq8Bedk4jlzLsuw++LMmSMDAsMS0KCei3Pzlbag9kUSjs/TjBPhdU5J9v5rXRGgCJXwqdsmccoaD/JYm8wMjK2BiDDNNrOKYXuSbtCnMqk/PB+HxmXU3CNepOLLxN0fwRskZq8c4dVhfKovoBbDTb27M45d83eLGAptZgsNWhnfvfq7lxMGa1v17VFx7acpGQ9feVkrwMz2r+9yIo/R6SLgDYvT/C4yz3QNXrKcBe0q4svfr76lh7EImChBNyKxBJiUr1/hhMmy+iYzxmxxcvhnYI/QLTPeXPnc5LckeLicFhqd1U2uuF1+9OUM/SwYQrcJXZoSICMJ47mLTqaoEC62f0l2y6mqk+iKUyRG8RA5rEHkAv9xo9cdJra+NBpZRd/abkrvQ39vf4cLnsQ/OX9WGbuOGFP5yt//+RUDvAc2j1xqx/uSV+NZ/8iLYm8R5YsJ5FiOr7NagL73pZ0XJgt/AScPjka5k9rj133mIRmoA7aQAbBr9Hv1i0VvzctiIEdbo76csNGMEZnBOUp0csclphv1drlL/4B+8Ic+I7Eguh9t4/iC1/I8+fFXQnP4UZe3hNQHovo6BXOq3fsU7rhHJ6oJ9uPQgZLHZc0dhqCIDWqtpciE0bEttQJ2KkCxeMbV1qy8ZQByrBY6P79emOT2TLlFQq5j8FcEHocCx6uFZMZJA== 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:(13230001)(4636009)(366004)(966005)(2616005)(38350700002)(186003)(26005)(38100700002)(6512007)(6486002)(83380400001)(36756003)(316002)(1076003)(7416002)(66946007)(8676002)(8936002)(66556008)(52116002)(6506007)(66476007)(4326008)(86362001)(5660300002)(508600001)(6666004)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: no6+aKu4kxu+hG4o/OJhM1vhitFYAN7iXnYhEsrwCv+3ztlMno/b/eoq3K7ADXG79MGDFO9aVPOdLcGMqVQIktxp+4nmOIcjc7kWL4HHI1jmlM29PINwbmcXAMe2AT/syN1lJky4cW6zZ9DH44p98hecj1UrTYHvLKm8S+ia6PYIZ/IY6JYcIrOx8CnTlWtBJvR3WbZMyMoUTiFzKrXzhaiDmDIwERWxjHaelWBgt7IHyo5vZzoljLS8BbzYtIFEfn6FW2JDsdLOEEiGh62nSKNkAtz6t+YCw9T4GNGceGlgIpxGd7yzE+B/oNTdJ73xDIuHPI0cHiNvqnbbcTLQO8QF2H8SOrj5bN5me2O3Ms2ZP3kTrrqlqrILRpAiOCT92Z5FkhafDL/f8h/rQWRSBWgyD+TKsWjJPvFO4wmoSXR5y4qSyQ/LHny4ZYWtbPp0Ke60A6TTBNns6xWigAQbCCTaU2LXwiBIIXEA7Y6+pTDAyauU2M0eLM7H9lpxpEknn3EoNi7wCvpdDYQ8ovCTxj9BRm2YHWGw0OO2A2DiAAIHlvfIyp9nGs8jvtp9tsFen2k34PUIy//SohfwRyIYpN09NluAp0U3QZo5kQAjM3f8pCJzZVpRLBGYuMUIp6Pq+wf6JAxgrHJQN7IpRtGGLZm+tkwyI2Y9zh//NZRVEt1RjPlkLmEzeNbvdqEznOG+YdCgN/Hvm9XfzT6MLijkdr5CpcMl2ISbd2KuuKtt8eKwJzLlAeIPVQwuwomWbdPWC1tBcVrOSlAvg5z/dHYCPuWZfFns5qhTnLUS5yseIONgyddsPZTHy6NupLrjHq6r2Im1y2xxVnVBc4w95LucS176ZLdBeJCdvzn2mYzvjNfU1u/8vEXlleVGqRM3N+MfUnVO4946gfPExMy9lVNIPQqs20wl6/ems9zuP+D7WGDDzpHqdyKf63NiIibI8Hz+p8U+bCtA8hrtrYiuBrRjxBU57KUrleteg14xQkH+J74yUk8TfsLKAYIRbMqImcSEIDytgoEbfJeMzyzSypvgYZpPLUXBlTFWn5MS5j+/7aLXgn7dv0kSnt477ElKEBFIREmvtSScCwDFmPuhTr8iuN3qFaKycLBpvT6s6EXeAtgpicoD1wzAhWxN5Q0Jnwn6pXFKvfnKnJVNKp+/hhqRY3UJRn8OB4HxVstUiOnYy9uagBny1aIiNJYCVzv3xns+xXHVycr+4+gWzwmwIeYfadaSjlTqBPhi4/rP2R4Vf/M0wrbW5L5k225m74D20GyLfUKWxTHIFiv15LMDMcVI8CZh78xiT/oB/1WTwKcBQRGld27R6IUlxS0gil+pE3PlPwU5GfBVhJsgPHshYQJJbQAESWCEX1MwfjNLH+DNBaPSnntOg+FixM8eBns89pjsrBtWFf+woYwFjmJm9Mhjybn3NN8Tgjh0tpju9dhbRYFd+nXpUVlWVJjE9OLeHclqyw8lzUS32eVPs/3LGUkPTR5qEtD4EsG2d06ZzlqrridmH/GgiK9AxoTVOtiqHCxEHHqXewQJeQr/9I4kVvwM8KZ72LXbIAaBe5Yzcsi40/bmonFAqVRJT3HJTxsyv5ifHnVKoq/ERKitWeP6JaohuZTnZ9/OU4jv4OSMMmuN4/tWNk3CmoC/L4V659RVfPDLsAf9JTT9+OFEsGDiOLxak8cM5OZ3Z4to/WAXN/p1h7bazf3BMmDjFNz0PB6A8w6D+OfSYU96FE20nUDklVPsPA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 301c3304-93c3-46ed-06c8-08da49e41510 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:48:38.4526 (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: CsczIer9RZhlZWqlYmNbpDMd4NAssyaZ2Whk+zPnjNqlt6qQVao6dqIt4+Ib8nvVpd2IqzJGjnqdus3lmim0tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3518 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds bindings for i.MX8qm/qxp display pixel link. Reviewed-by: Rob Herring Signed-off-by: Liu Ying --- 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 | 106 ++++++++++++++++++ 1 file changed, 106 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..3af67ccf8db1 --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-link.yaml @@ -0,0 +1,106 @@ +# 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 + + 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 + +required: + - compatible + - ports + +additionalProperties: false + +examples: + - | + dc0-pixel-link0 { + compatible = "fsl,imx8qxp-dc-pixel-link"; + + 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 Thu Jun 9 06:49:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874870 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 58562CCA47D for ; Thu, 9 Jun 2022 06:49:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239425AbiFIGtE (ORCPT ); Thu, 9 Jun 2022 02:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239357AbiFIGtC (ORCPT ); Thu, 9 Jun 2022 02:49:02 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2081.outbound.protection.outlook.com [40.107.104.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBD924B409; Wed, 8 Jun 2022 23:48:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AaTNZxRbirbHITANruZcK7dAIPmrXLwEVq8L+/GWt95xjv0HEnTRAe0OhRw3Adn7YG/L2svGMVO5kl/oG9CXV7iY1+u0z/apBNtqP8uoe+9kXFI/zo9SWfvsqih3NOa/Zp/e1RC3nycrhsIEhjhRL+T4OPHqgmW5Md+ntRQM9Zxm4uThPc8s6SCAyyeOBHFys5DP6VpaTO6BV4iQe95ErFhihrgWY96aQLMsA43uvcAqTLYq/H3qRMzY06+VTjNqMdiF9UH5NUMj+uB3E0PktPNusCOaZP96ZqD3fjHPyur2rgwQ+sZEifyE3PUGGjuhbQr6Y03PxrvXNSuKFqNpMA== 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=j2vHkVkRKBkFo6/ZJ0eVx72OJCJ94Xld6WEnVOgNN2Y=; b=GO2zu33JumbwyvXz3Qxh48hYaUZSMATgRqoqm/2HTQIn9oX5f0aONGfzAm0jRTYyDKZznuOhKKoHIMmu4HFPl1h5aTogrjFVxnBZpboDVCiHFDJiYAlmYdsVqOqdegjzemgm3gqwhbNbW68HAq7niuZFRQu84mpkCkOWwvph3k+CeV3nAnfqodBqf5R2BCO986R0Nq2eLfX5dekMZLoG7TGfHac8npSb9K0A1aryZItndaur3V5ZXXS8xPrcnubch606sCZP529lBKVRpInQQwnHuyfEASej7wTU0B4ULw8YTVVobjrgzm+O9bV6YaphxidQKBQn11e/yC5TWFSHmA== 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=j2vHkVkRKBkFo6/ZJ0eVx72OJCJ94Xld6WEnVOgNN2Y=; b=n0Koo5yN1ZshzJGKP1d5bo3Ee2c0eSmcrPv99qwV0Tx6EojrdWOegI+o/RtgBNs9XtBLcY4JQzItJ40kADfm2CAclk2iNBG8qnF90VszFeoyRRNN13j3ACZZi/T3LIc91A45lG9fmcxEaIKLwHRwabKao/0PmaR0M7wnyDjyOTI= 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 VI1PR0402MB3518.eurprd04.prod.outlook.com (2603:10a6:803:4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:48:45 +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.013; Thu, 9 Jun 2022 06:48:45 +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 v8 06/14] drm/bridge: imx: Add i.MX8qm/qxp display pixel link support Date: Thu, 9 Jun 2022 14:49:23 +0800 Message-Id: <20220609064931.3068601-7-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: f66a0723-73a7-4c07-59a6-08da49e41905 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3518: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: aEsU6hXf5pWhuVX0+QV0T+gcghvV0adMnE0CCu3yCT+vw5JmJd6B/li84cqE0FfHisgy8+C6wLQNuyG1nnJxz9eY9fTK/GJMgbb9x6uNV+m5mjwoO/DZVXGBmVo+uEhCtghRDyD08XwUmWbAYH6oqWBlGcGicye1vQGJbahIi535A2hY+G/livMzqH4uY78eB25gRBAhCI5+XyOiKg5req+T2Qbs+YjsHKAoy9felsL82TpdSDi/aXeo9ShFYyJ44DoM/m4pLS1oywKkq4X0L3AtJERhr6RjLgyJiHYq3C5TsUed6FG9GzrNBX3Oj0KvoV6xuFH53rDq3OQnAfGjvU6Pkdc3F7RoTAb8eSNs3INcUDsiK47eiM1Rd+gAqBMwtwN4DONDksarymeaXXwHdyg6LTl/joMS5EI8a039PfOhXIR4BV6EclHKi8Orf6aBTPJNfd75qVPYvbuHzQav+hAdDEHfcerYH5iGFua0VZlMHdISPAQQEOS08unbsH8C74ym9bE35gulvrZ1rkKIFjEAuAHEjC3ol0uNYKhoaC8VgFDSKSgFtG+nPoXvruYp1m88wY470f3Y1lJzMG+8vmnUbgAwCx3OiYxxRs2UnP+bsIpVinpoHS6Lnr0/8Ikax1p2ag+Ec/+dievnFxHUmUlHPtuaZ3/Ju8X+FlIlE+oIorJ2xs5glo5POjN+GG4X4a3sPctRu4LjI1zFiF7jFQ== 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:(13230001)(4636009)(366004)(2616005)(38350700002)(186003)(26005)(38100700002)(6512007)(6486002)(36756003)(316002)(1076003)(7416002)(66946007)(8676002)(8936002)(66556008)(52116002)(6506007)(66476007)(4326008)(86362001)(5660300002)(30864003)(508600001)(6666004)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WqnfMUT8rS7l6rteYjm7yCVA4BRGzClka9A9AycLh2FyJpiHkUehgprrSyziPh977V3NhuAq5PINv4RlQXgjX63segPGSdrbrVGIqXHM0yOf2JxRsp8ULfP8WIaN4XbhsACCPErQMkMiy28Q0BvlGXJwSAS+yne/T238UU1ssglAJYZwpGW6x6fEnyQ5kESoKgxlPJd/gqi+aMRDKOJL4HMG/k7HXVRB61092implt8a9lzyUCnhLu9qlEic+VIA2YWCs8qoSiLIqoIPXZP0odgQ4dN+OQ+cAkHQk1k0j/jff13ycr+9MNOaNCqH1DdvjQU7UO+rdllhnp2ypnf8lZ6S4LLRtT/AbfhiRwuSXy3IJBSoGfdwB1L0KYKyswL2gSJWvnzQFouTA0AWTfvgxJbx+F5RhI8gOSnAJA0v8n6da4H7Y7hdK6G1fHKPsOh1N1B1y93a07ZpdYIZ1FnQk2Qbb6pZtQF++lMwugPZDw1KzUcw38KLr7Iskq0/ycyEYCOCOYMIJ+259+k5u5gEB3bA8gvZ6s2pee1HYMXqJfPqsNtWlSya6rcgNRx9AAeAHq/2LUL635LyIc1cwI+AiiV8/zkz/s4V/qCzxrMdadm9qHAd2HDp1r0GAfGdON0IfeaTQbYesB6w7Lrx739jNoI77pQFEPctOsJhj54qroZqiAjVXdm6bHNBAE07dUeXyYlJIT7s4fsMkjzXmWRAs1H0Nz6GblLPyACJvrg7HdE8fVhZNAZiVROWkfcAsZYHRIhuyaq7ryTXi3fMCmAOdflfwQZRYBpmbJqVSTGt7iUdTcjrwpPNxBqo0xAa/VncpQVWLy/12HLg2vqhCkiERObQ0MqaLbadOpAemuVoPfiBZ5jLIfBQR28qQjlMU0zzWJvBxY0xBFDUuvTPOVkoq4XN3yN3/omi3nq1RwADqAQi9wPAoHNd/fdGHt/4KmRgvrmO6nFpVv8diJIEQSfMw3SnX3oWoAP0UiPvmLkHDOpGY8dMmyhoke5S7pA6qbjJY6lc9MgzEzrdzAvxxpaaLBL7L++W2WG4zxPX/aWFJ/rduK84jWKy5L39wa1FFICr58cTA+ELHWJDzbBCTuFFx2YnsI9TJFR5NT6BX2mdPD5lNfO2DfrfIJgpg/CYN4U+YYycZtH9c1wQoEiyeGeTLbX8aGipt1kIby0taHr2JP4VtaTG8uNc+E6nEwQYY0rm28U7mK8bQPvjCGeSHvmTDrbsMVs50XmOBwUancawLJSVxPTaazsYuyziSCX2QLXOpGaFBdYJ+x+dCqC3qB6vILnueqRDghqcrqFVu/EFA70jHOSNj+cd5CzEfFuUL0XyZ0074xxXDfs08YkwBzyg80sG+Y2/i1EZp01Eq51KZs2gjU9P5JaN9c5d/KwmrzLSaRCBYHTAL9ngPDZsMMEgOPng4UdQ1pINXv0NaK93iBUEbYJJcukp3u0DxEH5q0ObzwnA2wqecNfvKRyl/MF6JCPal6yf896mB3T686D0zAziEfeMWkKxH1eLnEu8yRp+elIgrwC5KfZE0cLdDJ9a2WSSC/R/QI12VPsG5YvsTIFN2hSudhYSA7oRD89YI6YvUIAcEQ6AwC0HiY7LH+QKvJph8BBWHrjUyoh/uyTiIRm0+6NqaCToJLto1+KCBXRSgsNOkr9CEFy0oCK6QF3GqC5gE8+qZTsgLkF50/C09pM0gymPtaV9EZZpaigsTRdoAvjbM2nsxwUUyJXYbo9Uyw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f66a0723-73a7-4c07-59a6-08da49e41905 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:48:45.1404 (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: dDaX/gCi+yxP4DX12ysQJUgXILmB6mf7xFpfAq86Erv78OIciatq1DWywFb+LVwxpJsGjLvB91lSJBqpG24sFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3518 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. Marcel, as the fix is trivial, I add your T-b tag. Let me know if you want me to drop it. 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 | 8 + drivers/gpu/drm/bridge/imx/Makefile | 1 + .../gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 429 ++++++++++++++++++ 3 files changed, 438 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..4d1f027d07f8 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -6,3 +6,11 @@ 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 + 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..52b9b96549e1 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -0,0 +1,429 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020 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; + int id; + int stream_id; + int 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%d stream%d 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%d stream%d 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%d stream%d 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%d stream%d 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%d stream%d 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%d stream%d 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%d stream%d 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; + } + + pl->id = of_alias_get_id(np, "dc_pl"); + if (pl->id < 0) { + DRM_DEV_ERROR(dev, + "failed to get pixel link node alias id: %d\n", + pl->id); + return pl->id; + } + + pl->dev = dev; + + pl->dc_id = pl->id / 2; + pl->stream_id = pl->id % 2; + + 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 Thu Jun 9 06:49:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874873 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 84F5AC433EF for ; Thu, 9 Jun 2022 06:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239451AbiFIGt3 (ORCPT ); Thu, 9 Jun 2022 02:49:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239354AbiFIGtL (ORCPT ); Thu, 9 Jun 2022 02:49:11 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2048.outbound.protection.outlook.com [40.107.104.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 473BC53C45; Wed, 8 Jun 2022 23:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kQicI+gJt2WE/t+SQO/H9GOvbrAvrdfHD2mCGJ/g8Bobld1Nmi44vkUjLs/w7ram0BG7szGGUCqG9/fcKRQZVsSY1F+zlp8ubDsvLwvuMzhHzlXZbFjK9JHHpY6DVbql5oShy8XYDbWo00DMoe8TCl8YJD+wzY7Z6HkvBlYXPIx9WIJWwDgFMhA1wBZ+UWXagMJN8BjnpzAVaOBBuZsGUWKPcdtGjP5mWAKmC4ukp6MVZc7YfSsdr6n43WLx0re+iUystIWJajzCvcQ+4/UOFao1Q5riHZnenSuhcwC8VpgE7WWfJtmEXFjmUmLEgYfm2n0Ayta0UbxJRbC+YWfY4Q== 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=3MFuqQgIeOIsb8c7f6wQQKF9i4OT0TOnV7McXEvV8t8=; b=hBSNSaL4f6CFTML/YsShVj5O+m43C1QQyX6wg+AjJqF5kOmDFz4UrJSTzCfPd2JOcOLgK1GMjZiHvFZaWk80nGSKewsVxy6IjYnRpgqYdVzktYn7PnkDRFPNdsEVw/SK8eKIGwBjWA44qSEeF3gj4Zw2HYmO9FlKcQ5lIj7IM79MCYLZVykhl9TbSTjlrpA8veqlWkFfcAsUtGyo2dd2NUHK4g639OvERm6kGBfBJP47RJmCraS2S4sIPCJF5ghrYDApUjPXWQEWRG+6OoVLvgNbokAX8fCNm5oKvZwyTNRYey8o74mhpC1mAQRHloqe6jj3abygGYR0z9qpQhQetA== 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=3MFuqQgIeOIsb8c7f6wQQKF9i4OT0TOnV7McXEvV8t8=; b=D2phlbzPfjj3F8iXpiaRWDd0ojh00InNxUvXokkCjp2zh5RNh/Ja0brzB3W/QqCwkLl2hP+znAN4QiI3Patpne+Im7s2VzXvt5jabul050riFr4uND1J6eX/s0rNe3n3Oc0AabCB/4s6U/Eh054aMmrOCL8gM7tVUoi1JulS8bg= 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 VI1PR0402MB3518.eurprd04.prod.outlook.com (2603:10a6:803:4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:48:52 +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.013; Thu, 9 Jun 2022 06:48:52 +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 v8 07/14] dt-bindings: display: bridge: Add i.MX8qxp pixel link to DPI binding Date: Thu, 9 Jun 2022 14:49:24 +0800 Message-Id: <20220609064931.3068601-8-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: c9dc30f7-594a-4605-34e7-08da49e41d26 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3518: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: uQ/wLYIDm+D+ybX8ZSbdsvC8Isd4OxfkUlOi0ClNCuGSyghH1ExZBjbzn/mhCg+mHWodkI41pODzSwYaACePPFe2g93WIHUCCExophrxfieRRvUD7Ak27YqNemCvnlS8E8qDtV0EqPC/C0dNOg7EFR/W2YbYD2XyWT+XVKwUDzQq95qkEER8c8u9mI3cP4YIdCxskM9V8ATYB/W88JgBaVMB3cUJApEu1Ep8996KtxDeeUwNSrKaPpM54993tztydr9Rq6rtBC7AFS/4u1PAA1/O7cp+reTXPdBbarHKcnXQENvp3bNgEr5WePm1EWV+bFSIyrUB+E+NqMvar1dL4vW4kUIElhtvMVSGKrSF7SsDyOF/EvTUq/cnyWjHzicgkWvKzp7Lkq1ZqGCM/Ek7YIEG4u673T52kP+g+N+DCAdakll7av1shwoph/LWZkhMc3xWWMtz0imIWpUDYmBPjS87OMf179r4EzL9ZCqrjpoeal/IVD4+8BN/6iN0W7lluY85K/XqEcpAYmFv1BfPstOvZMFkZm5vnlpmDISX2DFLYHb3yvkt6DK21gLYnmZLDQOmTu1P0miB6qH3UQSZNhrqNu6fQ0bJYmTFHdnhcRZ7hKgOwWe6k5o+tSPHWdYWcaxaQTBI+sRZvJA43dDZk96vvDuxez2yFGrir6H+nOZ0rPTQ9Z9rnbU0ya4Viaansz5lNqho8+s6NXNpcdAsTQh4/ZW+hplJe7jOMuXYDrSqdba7vCOA+XnXcQr6kbImKbCD0m5rfc62793/UvbBzdFWuC3TeRehFAiI8EzsJ/bwIB85WXyD4giZuK9H00tJOqAQhxVHczKrsiJ+FFNbPw== 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:(13230001)(4636009)(366004)(966005)(2616005)(38350700002)(186003)(26005)(38100700002)(6512007)(6486002)(36756003)(316002)(1076003)(7416002)(66946007)(8676002)(8936002)(66556008)(52116002)(6506007)(66476007)(4326008)(86362001)(5660300002)(508600001)(6666004)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?GwcYtMj6mRaGOgiHQcgAJPVLonb0?= =?utf-8?q?rwtGLWk9Fu5mdebfY4Z7aw4vJUSWRlTS2HNvY7f3eeJU6tGThvpqfQqToT/N0shOe?= =?utf-8?q?59z7yso88E7gygkMSuE5MYJg9zh3aZh6qoqSc47tw0YrAdk2y7tAw/o/pdDBlSWvg?= =?utf-8?q?40fq0GAQY+NKu1YfREBQffnZerxxoDiC/o5WcBm5WP9hMJZ6GehuMY1jTpkHDgPuz?= =?utf-8?q?esvY64TM9+XV83YjZQO06L0WgtUkRuGrdMPADmlhY5KyrGRKoQGOU1pAXwoJrjqrs?= =?utf-8?q?ovo800l+IjCoHLIUuoqDcrnRbfbj5+kpLULKg18f14VTbBwBKzgytRuVPTZ8oEiLH?= =?utf-8?q?e9zb78rBqxlJ72r93iyKcns4lp4HZ6kcP1iu32PUCZNsQ+2KHE5TL93EUSB5JYYa+?= =?utf-8?q?p61N5pdW3Znv4/3YguU6waEBtHn4xobBLqoUgh37FMgVWCgcw9XGdUzbs4+yyrkmX?= =?utf-8?q?E7e04ZnXtFKDJZTj+9v/xloppHxgE2IzLAinY2iICZvIiZELT+z4i72PLAzSMYnbi?= =?utf-8?q?PLdTJZZKiwUQQ90/Oi6EnwTieLmJ1M6NPynqGIGq4HDE6fuj+TbeaTME/g63Ey/2K?= =?utf-8?q?TOhcIxccH3aCqr1DRguDg+16hEJT80SV90CGHAjBx5WrVWXKNwnG+j7IoESQ5GGeF?= =?utf-8?q?jLu2FZNcIrWku6ZIARWLdSOPmqpUccwmzgv0LCO/xnQ20WilsIXp7c80iDAlXCbEw?= =?utf-8?q?J9W1w04zEUTm2+imYeTkHHwryno7q9spqzRmb62i38nUKctN8UX7yJLvJFvF9Trhu?= =?utf-8?q?ochp2In5JHVynLkMrRsZweswq5UEyPwBWqQItLkJPMIs8FBDB2oa52lX4IcIyZUvB?= =?utf-8?q?OPiv+pvIHmbWya8ud4hR9Y2CMzP4SrqpfF6eWXZ3xdL4sOMeUMla5aDvmfqzRTdYd?= =?utf-8?q?jdBq+nFaHjTR/cii3qRg4piAtC2+675IO3IWoUa18/q3kStGO/GrQ+u+olJ/nPAbY?= =?utf-8?q?IqiH60ijxTD67zruP+V//RlJn6AW73LEDdvdLJZq87asEIZdLcfc8QI/NUawmVsRG?= =?utf-8?q?SpPtMZ5ZyotAesfbKtXHuJLn0PZi6iMjGMfpGDY0k38TLJN8spW8oczzAVe4qof7E?= =?utf-8?q?SBmLuImp/SxfRMPKT1okFS1Cc+Z9eJJT+MAIIhagzTPEHmdKeHc/iG4wuPf3RGENH?= =?utf-8?q?d3Aynuootau/EFl5BKQpAcJGWyqqRiRp5nO/dLK2ALnyNqMMBNpE1JqXZQkww+P+Z?= =?utf-8?q?fMssEWSx3kxuITboanrU90ORc5sQ1sD+mZwh/e3wtJW39TfmTc2y7eCyYVOsqF/J6?= =?utf-8?q?7xXO+yffop40VYUUuRYWO0E16rp0/euC4e69tTMtE4D8AkvCjkRfs9EAm39AVtbcq?= =?utf-8?q?pChheff/sI5mWcdDuwYoRCqCS9L4+Q5LNIIHfdrHksd2uBPSLJdiy0cM7BesI0kYU?= =?utf-8?q?3jnFq4oE3/gjpGk/kvaCyqYkqF3dR64QUQ+FCqKlkg2oiRkJZnUGXjWhiAkI534aC?= =?utf-8?q?NXxHGnLfOzUBQBTw5MNtZRTOUzr2qA4v0A0yTkN8Vn3//5ii9zDKW1faatZamQcEz?= =?utf-8?q?b7CiEZ9nzZtP1uRI9fpAYgwPwFLGNsu4TuARRc3AaQWNYP0hTNLKDqGpajIfSaIdt?= =?utf-8?q?YfoWXIICtLHb5iNQ9cooBkMKrrnkSJ1Cp6fQvqnazYWkoZlml9LwKw8JLAzlu0hSM?= =?utf-8?q?RFcGNfCtDhj5WY6a+fBXtQSIW6KeiTQw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9dc30f7-594a-4605-34e7-08da49e41d26 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:48:51.9260 (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: b4Oo5eDNi2Ooxc0EY0ptjROOLeBrwpMZ1F/xQP3RnHCIcow1ryyzd8HFS5LsRaHoQmTPhf867qqM30/lA6XR+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3518 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 --- 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 Thu Jun 9 06:49:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874871 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 B58B5C433EF for ; Thu, 9 Jun 2022 06:49:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239324AbiFIGtX (ORCPT ); Thu, 9 Jun 2022 02:49:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239652AbiFIGtQ (ORCPT ); Thu, 9 Jun 2022 02:49:16 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60083.outbound.protection.outlook.com [40.107.6.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E012C53C41; Wed, 8 Jun 2022 23:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nsNHKqn9g29DUwO/+nMsiNKwp8nKR520pjczIZEi7dZOtfrh1JiGCfZAorcVsN/mLTnNPC1neNmrZloAHpsdj6ZSFkcdb7D6J19r8kRgk/Ul3JSgVKuv4uAlHghGdEsUqgo8/hQ6561ShaTaZkcL5W/HW3DxJBPdyb6z54exR4RcErzivUVia3Vwtb3ZsJgJ7pA1UqNVxF3Zxq6Zbf2bFhNDKGzsBwAFDKhKuWMOtyTyJndrECnmzHGd1qBWXeLschrNTno6z6fTdz/afYxgyPoduiRRgW4q3PQSjN9C66GXS5In9V5Lo8RWn3DaxrZKI7+3p5f9GHmr1PkPB6Xz4A== 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=tENMvbt86pZa0vQCJzznIcRmYA/F6nNny2aT1juRyj8=; b=hlC8reXnHoWmmSY/idLAjbA8Bs7dfulULgQfSNxMHAsB4B9z4B8LM9gkDvcFXrHpYaaHZgZ1iZwrIqzHV2xFRV3tJ88zTVH9O1APSdQ6T5UTt9Qdf5vOiU9I2STe3Uf6YXF6ANRVuzvJwdCAV4ld/oO4Bj2iom5U+9xjRPW+MFV3On3K4uo0oL/Tow4ZS4Mv80gUzIs8zuGWwov4Oj6Av1/TPFjMDTq8Y0TYHrMDrmkFZ5/caIlJcVaJuasjmMesnq229sZo5HROVenuOcFeB/sMpZZIKGiTIaaxu8v/qy3kujAjRj8gV36fF49zgGY2uR1C/TZN0FYS3AxN3a4CUQ== 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=tENMvbt86pZa0vQCJzznIcRmYA/F6nNny2aT1juRyj8=; b=L5C3y/exlQKdhOnFHKZSbMVFGtZhGZYh2TQB1p8mXVpyrpyxFEwpb3Z73knfl58BZe6XBFNIngNGPAv82SmveL/n22cHCVtOssy1WpVtNibme+/dhDkCf3rNI/THtn0Tqzf9UidKiePgd2KUKFIjYrd94JUJhQC3odZiW1H1iRw= 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 VI1PR04MB5280.eurprd04.prod.outlook.com (2603:10a6:803:5f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:48:58 +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.013; Thu, 9 Jun 2022 06:48:58 +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 v8 08/14] drm/bridge: imx: Add i.MX8qxp pixel link to DPI support Date: Thu, 9 Jun 2022 14:49:25 +0800 Message-Id: <20220609064931.3068601-9-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: cf3b40ea-68a7-4a28-2f02-08da49e4212a X-MS-TrafficTypeDiagnostic: VI1PR04MB5280: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: KtgUGa5feWSa1QOKK7wtpySkeieQ5SGOe2tiE1UYrpVy75FFc1vb0HHxFXv8RLpFOUmMDkcnDAvgqroa34xiHApNg6KkUaP2VGS0uP3SPKzk7ntTMzP8NZU8DDbeU1L9ch8rg984IET+NxHZjmicGa9sFFs0lMbKOyDmlZnhVRAj5Gc9RIBCfipQ0WhADIz5ZRqYGO3W1h7M9N4Z8zXWeOjLxjf1KtoDaD0Oux8YoXVCbrAuy2BWn4HIz9Fv/Y+IuYt/euq7rlOI5GsruBL+1t6s+Q6SlZxdpdFMecsnl43sX+mq+xH/GFZJB+5Vae7T+o93LUCH3xF+5o/sRhWAeNaAFYg17qTpTolZtuy/4vuaKA0jcySNERFOXc6MVWLB17HseF9Lom3LSale/GhxJxg4lLhive//2b4DxuEI3//maMhldBOzRMjY7mIHJY46cGQeAaFD9JkJmEe9qlobIGVy5TyNB1B1VOSMqLGiTgP9VPsOfdF9bUeMHLmqnOLKKycpc2THCz36Uc/ido6kwFphB5ePP4bU4qDzdKM3ufvEc4ff4JD3CtON0y5nNNvvBM28io6HMkBcfZDZ2xI5cKEplGVpW2NmVOD875lksfATqusVTz/6rWJbE4Q/DYK4VECVwNun3zKtYAFRTc3y4ACabJixjKECErlWZl6Thc0tw2ShKAseQ9U+HUdntBh6tjsoII6ldwjigqPfcvUUoQ== 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:(13230001)(4636009)(366004)(1076003)(186003)(83380400001)(38350700002)(38100700002)(6506007)(6666004)(36756003)(30864003)(2906002)(52116002)(316002)(6512007)(508600001)(66946007)(6486002)(2616005)(66476007)(66556008)(8676002)(4326008)(7416002)(5660300002)(8936002)(86362001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?xK7JsGjBgMzt1dnLc1fbVNjpAUHI?= =?utf-8?q?ZyevkTg7n8nrcBHRIzWmAYRsr08ghhxzvVeCBB6OhvU8GA+T6RCpWoLvrVxqROLns?= =?utf-8?q?9hEEUuH5sMrtPDRqoivtiCe1y98dKoy0umBL9+xeMZAKY00BWGyGXCuz6Buc6SYaZ?= =?utf-8?q?jOrQMBZ+LYnEpyFMG0k6S/RkcI4uxp2VkVWnAZy0cE4i6Lr0HCKh3xT7fOJ9c4xvz?= =?utf-8?q?m+xqsk0f9iP9SnE9kMyuS4ow2FqkPLH4Sf6vqj6PDukXNk6FomlJ8VK/ukSG2TKlx?= =?utf-8?q?eSTijQ9jBrLrEbJ/foT3w215PHxYHvugwUy+JhVdXFB2jR8Xeuda5BqqDBu0M5ibQ?= =?utf-8?q?BH1JCxD8j4joh4DA/T/magyhcW7WGq3KGiFzNTOifr9ZmNxJMBiYaPfbxeM3xmQ81?= =?utf-8?q?ZfylSwZdHckDtf22jq8sArYwuDDGZz/IkUklNr60AxHVd30A6YutbuAr42ZHkousk?= =?utf-8?q?aNJ2MXSGFS1eZ7SOe98YlWsVp8M58mGBlv4h3xqG5l1clL2Y80oavtL63/MishMhW?= =?utf-8?q?ztV5XQd4vn8Lkmf0Dh/Z1OW5ypLxD4ZUVJoy73beu5y6+K9hnx8/GnwgiZhGilJWp?= =?utf-8?q?7Z/1VXAjr069WejiFzaSrFO90KkQAft0dm6yC4t3bLggsTyqrUja+7P9Ysx2OR1h2?= =?utf-8?q?67eHIfGAkitLrzMWosScuiGuXm7Atib2pyMus87HK8HzVCsKlKhs4jqSXo6aUkLoP?= =?utf-8?q?hcOM5Ur959nx3iaDhYYS3KjSJyu8ivOfQ6gKdx5HjWpalOZ6SDX6mbwm1lzmPsuAN?= =?utf-8?q?JhMjdHABLbeyCcEAn0XNY+4qOc7SYnYPaqPfmdeX4G3Ugw1cEG/tdTRjE1SrYJItx?= =?utf-8?q?9c/cZE3zS08D5x475NuDb4H51QsCZbghHtSmpOBg5yN/niQaAudKb0FXMQL7efF8s?= =?utf-8?q?vhWXnUJhpdkOxB/Dc1UFWFqVtvOmc67Pu8UkJix1HWv6JhIjx0A2aaSfH8bSXR6JU?= =?utf-8?q?KdsCgzJfAs2tdNg38wqRfJUMmC4ny4OIOfUm7b+hkX3a2qlOPG2I8B5uS7O/ye0XO?= =?utf-8?q?Xm+CbNCJTFjn5a62CMc1fyXrZUzQKbCS7UrUP8OgSfCP6271wt9s8FdleYLwFYq/9?= =?utf-8?q?Gd5F8zg0dTn4uwcoE6VtP82ovI2fPbg6F+L+gzyCSsrNJQiUCYK4sC1xz4DUY4l+E?= =?utf-8?q?wZ2I12s/ST2rPIpl/9QKm3Z2PYI4hhalEJ2D2mL21/hsizWsjYeY/y4GwIK/KAY28?= =?utf-8?q?6uvOUY10MDVukMa/wFw7YjLd/ohQmE12FSAHrZOBzAbVcwhdZsZfvr5TIVHEe/9ec?= =?utf-8?q?zrI0Ybk8PnryvIPLSHWaXJs8MH5ecG5OnpRU8nWpkLGFWhQ5Iv5z7qBUQL/XWeKVe?= =?utf-8?q?eRtkG2vy14uhEzMo4WXheSQJVJULyz4vIJXoTZz2Goj2e3TbWjtnYs94RZdtnNfQ9?= =?utf-8?q?IW5qAJTLEmjdFI1m2mgQQS+nFxBnx4FD0By3qa5eb/LIvxVz2H6hxI2vSrJL1OaLz?= =?utf-8?q?efiznHRSkzo8//TnwjkdD2ObRb6ryWXUGP8ztR5ZWBCdmiadsZH+YfdNSHa6QfQ2X?= =?utf-8?q?fzthGqNRIOfLFhRa89zo9Bmj88z05cWncx4phL+WQbvM95tRXMMTZj+wn20sZ/Lqa?= =?utf-8?q?8s0rvzJrdhCR6dSutopGkTdjBTy0T/4VhWyWa2fqTj1QcdkDVKZA8V8uW1qje08RW?= =?utf-8?q?uIdNQdHeb/ZRG1iVgFhUp7yJqR5WW87g=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf3b40ea-68a7-4a28-2f02-08da49e4212a X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:48:58.6161 (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: w9eT5U2k4DAGacPlv+bhCQxxPJppbv8Zu1AngBVlQBzD/ymfwznsiSQVyUkbqq1PSrb94eNeMmWeevhq5yq7HQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5280 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. 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 4d1f027d07f8..1ea1ce7f558c 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -14,3 +14,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 Thu Jun 9 06:49:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874872 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 8AB43CCA47D for ; Thu, 9 Jun 2022 06:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239318AbiFIGt0 (ORCPT ); Thu, 9 Jun 2022 02:49:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239288AbiFIGtY (ORCPT ); Thu, 9 Jun 2022 02:49:24 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50079.outbound.protection.outlook.com [40.107.5.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53C4E517FA; Wed, 8 Jun 2022 23:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=brrT30xhjQwMhsurwZhx5CKyu/5L2IcKNQcK1Rj9MZ2NR+pe67sXFqkyq1g0ooFTMS/n6Ls3s+03ecVGCgxf6TqngJQgtTukWRLZVTtwJeTV8wNpIV2LlbA/MtQqu24LU0djKaSpFjx6aysKob9HGDhztpC8zcSNFfPtL7SP7y4kYQRm50fSxOuiAukmjIboRp0Uq8ETDMNHofO4+JVtYz6xwLgyXeRK7v1/sobvf4LVaqeYbNLz4du2znS/mLldlYRYiKxqaTpALpZYr243JjNIf/HnHHjqPsGv5JCh/zRvm8J5YuNyEMee/DrIHLoFKqdLk0zfcKCH9BQic/sE8w== 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=35q5gNTRD4hbS3U87IquhQw8LuCT97T3pSkO05MznYc=; b=VRyzkWJSAzYMlArh2/aHSxNeX5UsgwDbri/bkI6/LXGjBOeWO5WHNlhcn1Ex49GyGAxJ9rXYDFSuNDrx3LyJ3K9eb2ixcvfFKek1kJwpeY2nuBtYTyML4wKJEDJiNN2ZVc/7DuGpDqBcTTNu17kR82J+knpaC6KcGSnqCOSaIcYTfhWDJJ7yQo3e9fNub1b3syeI1Hu+klagmfTfEUVRnQpInETZU8QtYCo2Fy9yNChZyUrfGPV8yBsRXtPxWsk+u2NXjdQkLcgUVI8Wc6FS9SIRcZBh/byzRUvVc3dwgmtFNROm0NpZCqd44DeYStPC2leGKPs5mURiTSFkAGW0EQ== 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=35q5gNTRD4hbS3U87IquhQw8LuCT97T3pSkO05MznYc=; b=Mdin6aGo4eRfyYdeKRVdCr9dqWTQoDNs9iwAvBYp5lir6vlO4cgkmF5ZcUW6goHBF8YHg2EMASVe8r4Y3xcqb6wYOKCpkn/IBI7ycJmjhTDyD2wnwqM1yvuNsxsBpbfjLb9wXVpT4VwM+HDi4JVxzB5N+Qb4c+7Ko9ozBlQwLjE= 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 VI1PR04MB5280.eurprd04.prod.outlook.com (2603:10a6:803:5f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:49:05 +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.013; Thu, 9 Jun 2022 06:49:05 +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 v8 09/14] drm/bridge: imx: Add LDB driver helper support Date: Thu, 9 Jun 2022 14:49:26 +0800 Message-Id: <20220609064931.3068601-10-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: ab956d99-5c4e-43da-2f40-08da49e4251d X-MS-TrafficTypeDiagnostic: VI1PR04MB5280: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: wRU9OeGzzCbOAN8qegDARYfjF9Coh3eUX+Ca/l2JSbRhBYomeLWSZ2XfhNVh3bxMrR8OYvLtBQFXvAoKU7TcTrCdQw5qKKe3GD0SeBL31M42BqPH9UgA1/MMNG2IdWiQTCQFjfCNTUtTmTVi+8C5cf+edNJaC5aZEpQGGffgH00E8N3b3lbw65l+9+mdCRamZo1fq/e1iIvqLszSH7njjzDrrniX3/TYV6RwlRVHh61RYkUd/TtQWnEOJxLLQjsjU748rRwFnw5HXHFPZ+klEMFmyTfNlN8iOqLmfyI7aIc/+AqFv4Lh1fQQb8aL+2gLAmd7QnhU7Lw8GyUzV2C0lhSoELUSE6CwAYtue29oBaKLRjdwZvArhrfXSI/sbz4Vwuui2EgiOMsa1sjSoYxude27rkMMm4gFGuOKCUKOabKQ6kF6uJJH3LT55RyByTCwfEby18CdWZ/eRmjgb4DGkWHcNoVH0E5qBGZKCtk7Uqr+Uqa9ecK4VuhObdKymdC4bqJRCCnWPHgOJkBDkzzfFl1daEIPAjCzbDBGUcPHZ/o+uhxNIEIVfFyoAf+cT6LJcT0karlUdM3wbYnsR0zn6/3YjelaG7FZIL/7Pf8WXmFg4OZyrLq3PQCkZRY3SLeEufpc+mrJxHZexyVlPN1yn4QHHVPK9rF8Tr6dNcngFWHojYzXBe7UsXOXz5bQdg5YambjhLsywbDvE6k2/KCg+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:(13230001)(4636009)(366004)(1076003)(186003)(38350700002)(38100700002)(6506007)(6666004)(36756003)(2906002)(52116002)(316002)(6512007)(508600001)(66946007)(6486002)(2616005)(66476007)(66556008)(8676002)(4326008)(7416002)(5660300002)(8936002)(86362001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ih9LDAnRI2fBpJkvOVCoidIc3+axi8Rwed4GqYIW9GJydeWOKuUVB0s4YZJgThRWKWRs2+PUgW0wSUEOGBFGmGD0XOpGML9FJxvdokVLj9ZvGWNJtx0Kraup8XNwCYm5QOtjq9czIb06YhASA4QUnsk0XCCIzSuJihKn6wW4AArU1nxodWpijz/Zsm+1CoX56vs0nOvrwqVGjaR3Si9e4ueQrdUB51TCqWLnaEwifgY74c2iUBTfXI/3daPsTaWJn6rP2kUOM6aeUoQhQkuCChJoxo6dAd388eY/3uqAQVtx1oz/u2ajkQU9tCLmLCdFoSxyc8aijlhM48y4mleb59NxBQ3in4HQs8Y0biexDnGYbNwPD6f3eRCr30Qao75bmXjIwnnaeNSIsst8wgdy0Br8UqU0wqhspUfkDp9mPF2tRaIKywqXAZANyKw9Gp4hDrNvZUvhrJaD2SPofYOyil0knZliaZmrYtqyy1ks993/VAjqw2f6kyQRYIBOxDbn/RSFQbWxmt3wvoNA9PZtl0imeCMyqe0PAx5V9xAZg9zmQ4pKZUhYRQzpLcVynnegr0z9GTwVOcTVspp/z2SpD9E3opx6dUYTat4y4Q3DtawuLpt2qu0BWVSgXUyjIA+dwFlKLxcZBHh415sk4pRxSpoMhf1TaNeg8hPKw4enZ6nAOtpDgduGyVB8ac5yMVm99FAnIfOZCoAQb/RcBY/0haTcZ3V+743JZCJRXCWVvAQEmFdCFiq88f3Kg3DFHRlPXVIUgSxUJ3goNVq8HfYFyY/Y3Pl60dqGb7mf6x/ileiWSE5pZWDm9fEFsdNaCQ/rzMQqZpOgMEjHS1Uh25sF1sswkrU9zP+0Vfn66tp1D94PtRC67zM46cN3yahcs0zRkhcG0wOyayC+gym8EDf5bB+6M/31kFbueJQfIMCDIOa7KYs4b3xrUQzLYenFav+Tm1lmbjf++cvJpaC1AklCqtX+uxUMz3J5CpLNqiu46V5qajpJ/glUbsPGtayLM+Wzn2+xvffWRNvF7xnSO2bOh8cHXEYRmmn1lUpkTJ3OrUkQ9+wkT7xqe/2P0fLoiENF0KDHGX+RXlCjsAVXVn6yRfyNZ9vrJUfHhe9dYdAGHJroBdZK9+MZNJgeiSWIyXND4RYRY+RXhtb1HBZg0WcR+iJPOwkXhZWqIIC8DKFS+LHTQrxKMwDcLalcupgj9GscbF0qvQ4KUoye4KXeGstTemMYLVUbG1SjDh0FgLZqmZ6MnN9oXl48j8DkD6lrlIBw5NYscAxftS1xTDP9ZijjPkztaMb1OYdi9g0r2RZFIB16zFCoGvcU4GQgHudXdqwzPOJWL0VlMUKooFAa6C5Q+LYI8fkR6F11MsZTzzBv/N5Mt8Lb9Opdy0OwF3FAW7z/BgjsfjwzREk/XMS1nif7kKU5ly2YqaDIMD15mroWszxg3NGj7FE9o094dh5yByuMeIW/DxJUZvnxM/C7f+3rQGdOCGgJ+8IrozuwRZX8WpY9YyManh4uHwVfgmc2TAIlGy6V2FzPuohFHOrG9E20MDFWcTMbGR3nL+e9SQHMIvKYn5jgNWflxpwS7pdSNkm4dD57QopmHPNp5AkzHtws/vgNle2I54EDU2uRjj+VIP5pB2SocvOXGe3XYyvC2Tc/1G0Jm4BiYtjNu0rwf6OWrpzVW4p1AoHaJqwmGBeJx18jmPwC0eg7/75VtJlFleQ9aBIzxr2ou+QXw/azr+ItwQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab956d99-5c4e-43da-2f40-08da49e4251d X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:49:05.2886 (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: ivXvOJ0ikEKQ0LsDg3VJPBY16IiS+jZf+nfpGE87uC8LfftoNVFCDemhKFD40E/ZhvdOMGEOK0sPhOP4yEJo5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5280 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. 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 Thu Jun 9 06:49:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874874 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 8BF7CC433EF for ; Thu, 9 Jun 2022 06:49:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239512AbiFIGtr (ORCPT ); Thu, 9 Jun 2022 02:49:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239320AbiFIGt1 (ORCPT ); Thu, 9 Jun 2022 02:49:27 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2045.outbound.protection.outlook.com [40.107.104.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C358E5158F; Wed, 8 Jun 2022 23:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j7u6jc+SyvTzEildZTw5vxVtxLcG9P0TGb5ZmNc9bRxpGxC+vpvzbxCZfRelgcK3Xww2ZxgQlAnWagxDgWP937fcvBNJ5PL5Ur1em0rByvhCQF695DgzMkxVoXzmR6jbU8X7Fhl0oEDbCb5E5MrlDnP/3NcicX+Eef2yLTJgwD40uYjlpPo2RgxlwqRPLeXumq19UIhYCLxvStKQMrFmMo6fQad8/j+0FNRxx5eJMouCWoKgMFxpWeJTuLtRqroJ5j25rB+IP51vxEix/Z1erB2+sYaJVWzdcatX480ctC9fXVPKf/AwqM7t+Zo+74IG7k2yzpF+Puxfzrl1pLWFwQ== 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=h9lZxfh7Kx0EClppGsByNGol639KodSHlmwoFOq+kpw=; b=fRQrzlggZBndQnaG43ibWgQjvXVPnvwhZmkFEDJkVjlwe33+Gbf3zcKapep40XX+6t2q//6y/AU7yg0USSj0cyYBI12MgAYJzVssVfbUGd1Iz+0HLYgvvS0A65PJM1aVcOXRnxaI5+baGohGovkctygvtu33qcChlSW+Lx/ESXSOvaZLN0Nr0WEF13qGdT0Pa/B8HhnQYoQLihX1lo4S7kKtzlwiuxNd7S+SnG+KkjvEMdAYCgfHMSajQQCoAu6sENpsw9Q8DX8szzqEID86Wy/UmYXcjT1K774tMdjrAKQxu6/9yuYoBlZ6OO5D9B8RkAvDMwnrqdkNUx5s0qf7pg== 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=h9lZxfh7Kx0EClppGsByNGol639KodSHlmwoFOq+kpw=; b=II1YW59mdg3f4XuWi6oo3Zy+JbmRNU1Lrx9bP0VDOCN4st0naeLFpzLawABBocmxtWhDKGqn5ju7UmJyxcusWxqnhhaT7WfX5ewQ5FsbYkZExHSD/lGJxnySGYXZdmgYIneKGm+TGbb06cO3WHnq4Ng4q+bls/mLc9M2LVWc6uU= 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 VI1PR0402MB3518.eurprd04.prod.outlook.com (2603:10a6:803:4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:49: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.013; Thu, 9 Jun 2022 06:49: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 v8 10/14] dt-bindings: display: bridge: Add i.MX8qm/qxp LVDS display bridge binding Date: Thu, 9 Jun 2022 14:49:27 +0800 Message-Id: <20220609064931.3068601-11-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: a797404f-8f91-4c21-0451-08da49e42918 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3518: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: 4EzefD39V7XI+iGRACbf4yQpfLjXvK67Lt3GBBdp6MFkWiIV9Gd8NSaMvV1Ccc1BMzPum/zDkIMfo+wlXftZNSUGHEnomhmzdWf9MsgbMF3voMyIuhqdavqEIweUxTw12tMgvxSDv0hWyYMc0jqj9+rJggpW3ofB4OIrAWqfP19kU932wRktxBtmjC9kB0NqIlAIzbzSvaQgO/H+uBt4Ljb9HyQgWS7uO2Dt2A8g/9+ColMMeEZT7NAlmvfvJ/hlcGHVDuR9uF2t92EHRpW5qTOMj+fmu3y3XMRyDohob3xm2xbgQj7AWqUq1V2XXQFEN52Jr8o3W4BhCpSC/ViRP30h/8+CfThZwVuaT+h4AaAQJ6CkCye66A4qniieaELI5nWEczMP+ajwieHEGyMqkEgSw1ZU98f1vFSPIyl40g1TxfpeQ6R2CTlkiOPpjom5LC9WHPKZpXqSyibEItVWQ94iuDpVCPFDWCwCc1wd23tgaybITALRRuySThRlnHmTVtgOeU0/c8kv76pvLkZmGlvKeYnW4L2CQ72byAqWZWHH7ldqk0HhYGnULCZmdO29EWN3aW5xX0numeo2MPRirwA/Ry73nRrnFhlGMANuZlNC8ha+ObvZevi584Ibcz/+0KGrCUw7APxIxU1HRyeoIHUL/+ZwRZjw33taTWqBC81QYMRLEf60KpxplwEFvV4azpYxygSCxv6XfrS8n99hIpGe+PuAbPwZ3bX2FUtH3v//qSsX3kaB9rVXC2ouf5vLXhA5x8Asb+8H9PvkkZPJZ2KGlbqoijAALwGnGUFLuhpexGDEaNX5ZQKBzljcVtbxoYPEg3D6N7+JE2hhPVWNkQ== 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:(13230001)(4636009)(366004)(966005)(2616005)(38350700002)(186003)(26005)(38100700002)(6512007)(6486002)(83380400001)(36756003)(316002)(1076003)(7416002)(66946007)(8676002)(8936002)(66556008)(52116002)(6506007)(66476007)(4326008)(86362001)(5660300002)(508600001)(6666004)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: y8hR9tgXc7R551putStP4uFygGTgKbsVlPZy6j2b08/cvQOWq1sh9jtsZyAFcCTJttr9sUzksUTLGFqoMZEPYYjFaUfzOSc8ovxKG4k5Fvp61rfKdciET1WBZEQoYOwuk/Jv++C6vWPZppuYL+85XMiSJxXs9pOhcMJ4EyBr7P1b3JGBNJB+YDhcv0SiDy/OYnOSfGsYqTpdBgN/wnXvouiX6FnpmuK2ut01g6bGdnMNYstmzR/PCvUvO7PXMehq8nPFgQxWpG+8GJ6LR8UgsCatLi2BBOqRfuYneyQEpS76VZAdUHjaIV5rTVUwowlArgilSP0wHdVpVF6ccBxXg7uPxfPpmuJu/DdkjIbMnJlgZVwMIs8NG0uRyzR1sODcAW3RqrS1iVoGj76Bzrb/kgHi7cOsH8b34PiVxebo9ywG2uA6463SavFZxWPPhWzS/mWIvYxfSnLmnmqBodOuzaGLVglM6Nr7fjODOnCzowRmUoWB84hWe5vwmy5vZhfDFcm5pWrbLHRq6Vc0hPwc1R77uRgW5BpG/rJZIKdMruW3vjGVAJuOWGAdqK6grQ2VT05gfeq1Wv4/OQQsRIlxIzKZFlsO6calNaQgpszM1FmVPJgE2Yk3k+Hl6MicUIu/eSUPGzAU42ByW7/U64KaZTE7HG+B0AGvmsSRqwdwu42Z9RGr98eS0x/NlRlg6vZVl4k0+rqc8alfR8YvFB1ysJFS80pqegxs9sr28IeLybKso5a/l3dCq0j3X5k2CXtBTikGFRYrAfqrA/SIynRQ1j81mu7O65olYJNeUgQCQOOx9VizdTJRkOB6srffEarK4RLtqyURZEPu+e+nz7b0fuqoL7LQJORTNKDi1fBFygV4XF3SYKphL2sJf7qOsswEXDAVk4M8pYNqxIFXTP8MH3BKiv5s2OkJjaxpwqjL/U9iW1zFW6lshmlRurU7iLCSoe/iqaU4Tje9BrXGvpSLIBYTrFGZpF3A1YPhQe4IUw4rbZA10jO2NJ3SleU+WznsOykfZDUSeXH6uiumKltlh5VgYUXfRRxvYg9ZtjhQVeVx3+5+6NnOfJcf2CkXvOP7ay2rwHtk2MF6EqSP6G/du4SN0fDsFd8tMSeEAZ9j5DzGEKP0aboX1hGKjYXk+rPICNW/ANJ1X1ChY7a+0KUrVvFETiRPt0HpQ1F6G+Ql1ir1xETfXSd3299WpbZ5qDReG4LqE/nzc2ycDORWVaSXZidjmyhRqy9zFLWTZa908WIeeogNIivbHoe6GFg8ohChQatBxnAURnD/vZr7O6FfJ3AKfQzDz9ApYXoeaqWCxWZstPiPY/JQkoSkmw9oml1CBfVfM/kbuqNouJApKQhOlj/4+td02nKbH/KlYPQucB8uDmceKel7ScK7u8FaxvO1CZwhvaIDvVRsKD5h0fbSXx/r1uHdW818Gpgf704rKN77xi6OQEHSdhv88Ufctgs1JDtDwxQgq4ww1q0iubQc4Q2oHtqsJp9LzeGsj3hQFEnZhsiOtUhB7i3OLlkWp57ATAiSbzn0xrxTO/qbFJfHs6RDzIX/qOQG19NLZKn1iuAYMItGZeKZGNFC94Epld4s914NzS0BTjpTpcsYfGYa+y/UCWwPF8RMUZyUCx75o/C7z2fzijKQ3JG/aw4soA/5mXb2U4A4HYThh7/zS+OKWaKL1oXCXGuQxm/xS1p43EBqsgSirqrNaaYTBV+Jx6R7PgdiDQprTtDUjPABbvkn+Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a797404f-8f91-4c21-0451-08da49e42918 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:49:11.9344 (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: 7K8KQ6RIbTExrW+ohMOV+oNn131Fl+zcA28hO9NsACAeXZptVkFoFse9xsXUOPXzpAKx7NYgqtfkW5CmY2SBcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3518 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 --- 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 Thu Jun 9 06:49:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874875 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 B2AAAC433EF for ; Thu, 9 Jun 2022 06:50:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239470AbiFIGt6 (ORCPT ); Thu, 9 Jun 2022 02:49:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239697AbiFIGtw (ORCPT ); Thu, 9 Jun 2022 02:49:52 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50079.outbound.protection.outlook.com [40.107.5.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C2774E396; Wed, 8 Jun 2022 23:49:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VjuceHgIPsFCLoqmrddLzy/IuINLXU4EmY651KtgJr8xKhqrUovk2x5s2fZbbZ8m8n8i2ecmqCxcpLqcwxhwLduPjMpJEXgYxPG3NyGdxgDsln4elRziLcBwSvGsQlVDYHgNAgJX20khABzdU+x2zBnHDFE0KK3R8eBRXgx75Satf+BYOX+hOGX+uFHkGvfBZ5J+h0MdMXBBQ1IBUIiXgq0JU3kMpJQJ/zsnzF2UNGs53jFPxDWgmqy+1S7rhMBtKly4jMcoCe46yjQanGsz5b6wpItNYqctFMFOleCrUo4WxVmqZ3lj8aRNHUmMEbLnY8tua7zCHeJFTk6oH5mHrg== 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=5lSo1utlvCtoVmV/P7Trq3pr36eWfkeAbAvDGWn2AGY=; b=fKC0C7wJe6euFUVHGA9vUvgBbq8yGboWfD7TduzRKznNJNlRqtkvZENTUV8GQtpMrLiUpBd2szUAZCBxM5ceiWpCF5HIswmuuDWowMweBHA0WM/VI8+tKNWUQeVQcVpGR3XZmQh+45jLAZNsVAHgWsqMxeKc/k62Z0tTvYFpu5xkA1P17BNeWoXK+9az18ZRrVipTn7m6semAVFWzS01UFszzIdeB1rDdBTp6ZHX1/GU3kZciplHohGclAH6ewlMmEr4OTA4/sZicSRmDLgUADWdmUBRSE9u4VwQXcwoACpx2jhptrYSYAJrIoBwbd23U9qcmnU8UnSG8+bstTMhOA== 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=5lSo1utlvCtoVmV/P7Trq3pr36eWfkeAbAvDGWn2AGY=; b=WQOknAwKCG/pD3ZecViNEnIdBluSrf4K5t6Vyy3hfGRlkSoUPnUuHi4OP+RTWN5iSry5Oz33w173aOUYsFSybmBuL+4AZk6xgCSc7eoj1fcLRmT/LfsOIPkSB7+BYoeF+eA7xrGxANvkzYgUjb3gOqJ6p8d4zOs37OMvOcSgfO4= 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 VI1PR04MB5280.eurprd04.prod.outlook.com (2603:10a6:803:5f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:49: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.013; Thu, 9 Jun 2022 06:49: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 v8 11/14] drm/bridge: imx: Add LDB support for i.MX8qxp Date: Thu, 9 Jun 2022 14:49:28 +0800 Message-Id: <20220609064931.3068601-12-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: 2c9e13d8-4e26-42da-6d6f-08da49e42cff X-MS-TrafficTypeDiagnostic: VI1PR04MB5280: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: 2VRW9qSDNRnp8WNy/obalBo+yWIMrK+VMIMAAHoOd9TxeChX/9ef7ST9I7VoJKfzEYDlHZvQlSb+BOaCRjUmmPZ+04KbAzzBF7xk+V8d8TBnOjn8ydjFOgC5eFsN7kngArsvhwDz0AeUkZY4FVv9bko2SvX8a1AV3XSsSVX2sO6vDLXoyRZ4xoViW74CyEWDmz+Qd1OulAPC0wS/T9iEbEmG1Qh+1kK1AnpRHv+BV6Eg2dWyRYiqCc8w/HUcJJhIcZEbNkreAdfjj7YjZQosuS0HfVcBo49Y3p2sb7tEkl5VxBrmF0iCoeivio/P/0ngfXkWMJGpbX0/KQw/ZDLDfswMFCoJ7vxMFR+KrkV7pLDjdoot9RAO5VEqmIGvsx+bGcLqw1/b1S+tsshZQvrM1xtSHh1D4bYDibf/3IIL/j1g+8QwVRWUo+uUOJ8rYUcW+MN3wJ1+1FruOqLOBk/hGWJc1c1711aba7loN3RZc1GtAfrHv8qdjSdcM67ozcIPca/aOGOT4i7ONvL7kFyElon2F0fqsygVo8u6skNeXMIjUQ47L3xg0wtm1axSwGBnGmPKeV9I5n3RsiWVBKNuOewmhNyZMF8fCY17rbxzj4E/IZYeQx0+Vi9Lys7xYQwIJL+MaG2WQ2/Go0qaSAiU1P/KXcwUAVuvmmv3pOFh/FxH6/+EjiFl/vunlePeWp+65V6RTIqBflkNmqNuPjCMLA== 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:(13230001)(4636009)(366004)(1076003)(186003)(83380400001)(38350700002)(38100700002)(6506007)(6666004)(36756003)(30864003)(2906002)(52116002)(316002)(6512007)(508600001)(66946007)(6486002)(2616005)(66476007)(66556008)(8676002)(4326008)(7416002)(5660300002)(8936002)(86362001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /piz7UaAMuxcQHohE/Mpm5aoqXfR8q2bIueLj8YBWFnRd0mPtT7R6rRvVsGaj5OWmlWbtgRFI/OMFxhKnk2KA7OFKEBpoZcmq6PlxUGZGgOs6cZ4zW/Dez+YevzTEGKIBd2Re3cI4zwwHOIzUrMRxF6/q3HoOl05h/EZB2Jbh5f3i5HVh1v2QidaNVpHSlNnSpJCF/V2gpJob6HXHR3GXyMtodVmw6W3oR0ct/4fxKXRE7CQplpTyz9qgVbG3RCyg6pJjviOLq9AsOfowxVacYtHlHmJ4fWUl8Dgw1wei34hy4Fgcr7w03Moklyap5FHPI6nKLrMuXUTj/CPcbr6wZX1xdIiIpIDaASOe9tW+t5T96IQzGVAMWl+TjFFJkOO1omeiqkvs9bvP38pvvtxEZFjP0LZ2RQuk9bdGvu6jzJXfAqHw1iLitpfHbGPop1CVk8TonMvOcD0NpiXyucvfLDR8rEj8cBjDErOZ6HMcaR+q4bNguGvO3zqgmV7essoTSXn3B0sixmAOhJlQiv2DjvXSOlgwOL+Huu/wwyf8OzGLylgSyVi2+79+vaDh42Cuc8S85iNSqsZKKWaMBXb4ywxDOvd2UL4uk5sWPJ5BIUHu4wKiPBxHch4FiPeUnrxTJOjgsBxBo+iOHReJ7EWsgN2HzYEqZeyBOdf4zxcvai8Z8mYIu7eoySraN61bMZ9cTXVxsiix12InWc77dhZ/vOthAgJSBVWEtPn+uo9AY4KIrfl6UyKgT3VP++SBkR5Agdg+B/lESRKdzcXCYcR3irwir2kSzEWia0ScixsPmqJSBVgpweKhOJ4IBMKWMj/LgBIKWKswAkSk0WunCmNb0+VLg8FHPk1bvr730bIOHGCjXu+BuiLlRTGmOh5dGlm1EZiUCMc6exaAj3dOtyfxArD4AybBcqiyde6+SJPKxGHrYdI6g95NWxaDuJuQKiVvWx+zydl3fMTD3DFvZKY/V9+eDQe/nX93UoKt70TFRBL4lQyT9ghNYrXOgRj5F3MhPwhYsdAPUfl9pkrh1ICR5GLkvxOKAP6gGGEOcf0sLjp89gC3YWFEPGiZOFwJStE1umPOLWTOGbTj0PAoAXrT5eXhtZ3SjSGkJ25P5IyK9WBdLOMMBlMFSai5xM33rK3LSMPYq3iSBJ8Jw+ai54b9gNWVhfG7zGoGtrRj6e6kQB9m5DhcBfAL/KmDw47n0urSnSXKbAEdEldvGKhLBnCQI5x6efHp22sO+zUaG/YC6srocfa40w6tjaTLguVyz4BbgaBlJJzvk4ccbKdd/WFUFjKHOIIgbL0GRXwdHjNZD0ol+SE/qwhLXHqiloGgI4G+qkK9de3zb/JNtR24hVYJA5lWsfqThzqKB1qw2hc+hN+7xzaMygn1mYqmd5v61b2T0RD8dc7Jk5U90hhJUbERjVcjFRsRNJuYeXgb+hQvDQ18JGMoze27g5ng+gQOyQn2CxBiQidKHL+y90jNKRYip1lWB98wh9pK1rGFO0Xg8N2dKoOS0i3SdTPMPv5Le5NdQSBc5wunGF7vL9xW4rso9GxYwBeVpX74JVKcvqsNaEW2/ckoJkf2j2bg3UsQm6rGUkViWcz86raI1O5pIs+N08rESaDlmyS7twjlI+0ch8M9vbjWvUCoxthQY8LCoyiC2Dv9ePdTQJb5lr8gDHUOZ87VMD47SN81h6q/RaIBMXEPIh6GvMw8osPPTbwgWteNqHNGKGa6Y/p2rYWFp7S5A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c9e13d8-4e26-42da-6d6f-08da49e42cff X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:49:18.6404 (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: D8lJlbIeklIaUG+PFNOKu61fZPQ+IdfAVtvUTsUK+0RijNz6SimK1I+6tol9Zr1wo6dodSDbh9TuZ+bU0T85ig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5280 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. 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 1ea1ce7f558c..94f8db4d7e21 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 Thu Jun 9 06:49:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874877 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 8B9D1C43334 for ; Thu, 9 Jun 2022 06:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239971AbiFIGuT (ORCPT ); Thu, 9 Jun 2022 02:50:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239865AbiFIGty (ORCPT ); Thu, 9 Jun 2022 02:49:54 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50079.outbound.protection.outlook.com [40.107.5.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 732BC5641D; Wed, 8 Jun 2022 23:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VYW/ihJrP7HysT67kDatW8KrrgRXx1O1/GKkNAdgOZNuRIRtwV4KkmZrkIZ8gwSWqUd0qB1Ak6dlxFXO1foN5JAnxNdbs3oGBJXj3/BG7m+77jVv8bgkjLggsgb2MIZFHZbOgfpS5EKdgdOPfdpcErB3i48+hLnGOlaU6YRKEgTE91K9Ei8qOOuGq+y3maPbG40lbvYFuRyJsqxEKwfmD6vMXu3kS3Jhgw33rJmNrspDcuZQvVgzXkDwmQXWimPHI/pmgNmdaKTa9q9kKcFBlZSlB4BMqrdLh10iE5AFq6r0mgxFyNq1KLJ+hRp5rnX55XkipzKbudWul3RKEM/Hbw== 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=FZlKVqrBS3nEyEfo1QO4u2HAoxltQKJ8GkbaXUdLcsg=; b=S5FJ87nxe3aDR1yvEE661QniR3eRs48dqpbPmhr4IbrY4e5gZPpPTc5U8SQi9YIfRcb0vQN2v1H1WlCbp6ImhPjRst5nIN23PAGE7hBSwtY24o0/UGMRxwn154udrGnxdnuLQCntMqwJB+cS0NMTrJqqV+0AjCaMEdLRz1MCfPQW+zihrxdrk1e7Fat3J+7V/azySM3+4HyO/pzV9fv2XugqWuK5f/dHavvwnN8Asv1JgtQiZtQIa9I4n6aMPwyZtkGiKRv3JzP0qCZNLu9ND7cYGlHh/OzxFS5vTffzJ3+3ArJ0Imsa2ipYCmXlLu//f3twzwLhf26TgY9dfnZrqA== 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=FZlKVqrBS3nEyEfo1QO4u2HAoxltQKJ8GkbaXUdLcsg=; b=kFLuquX4WnZIaAEUGPXY41Ial/shgw7UUYnKnrYC6r6wyE1zlRjWvS90XwZtHPZH20nDW/fsb8TtKpApn+Jp635LZL9/eLOZWcEjRF/na61gx9LpCQos7nkgVCWjvu9h5koBN7KVZeWsDv5P+fcjdT/R/BEcJjKAhOXapsbTRhM= 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 VI1PR04MB5280.eurprd04.prod.outlook.com (2603:10a6:803:5f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:49:26 +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.013; Thu, 9 Jun 2022 06:49:26 +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 v8 12/14] drm/bridge: imx: Add LDB support for i.MX8qm Date: Thu, 9 Jun 2022 14:49:29 +0800 Message-Id: <20220609064931.3068601-13-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: 66709de2-0373-4584-3e5c-08da49e430fe X-MS-TrafficTypeDiagnostic: VI1PR04MB5280: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: eVqQn+3GmyO+yBMJ2uYBFrMfK+Dw+pbI3wqTW2lxmVZvNkCybu9GcVn/pkyK5bVAoMQMyftHPB/2fKn5+pzo93QVGPv4MSxOQ9ve2mxtAYAbawsXHCZ8PqMHJquNle2JeajctERsywElDjT8GPH0FwYfPIM58OP0g6f37zPluPl7rozbxYhBLT6H4ezGT/UPll8RHsIL6pWljhCyx06OuWJ6K1ukCeVUl164CR7guUEjYPBKcI+rhrFij+ibEVQqO5FGPCI3eK5vGUS0N2rCnOKzq9HfAJcZl5d3ZuM0Z/zuHC1Wisq0GiMn6VjDjJn12HctPQxu++JAQswPyJGsV/Fm918SNMKmzzxawf/7TAyp7h2w267KiLVx3YQVgwtTDGdW8B7YR6SAk+4/SaJ4U4wngS4pqr00uuhFmJK5+z9+/Yxs5he+j7COz92Gi+Mcx98N2ErToVGbnEIWXn0x2bx1Ev+v2Hj9U0sLv7TgnMamn65JzvIHkA+ZEp9pvq2P3KmOw1Pde2hPK1dc+WwMc17op/67MWKzCvSZ4oe475Qp0J8PUaTldelTvqKnrxIR5lB0D4dgX/wK8Cufxksb8hriciP4kzOVMyvVmT5dj4pQG+U8vao+vkudCldJfN8SYVhKgYzWuwgdPUAqjqW+2GYAnqMGfiwB9ue+jz4OK2Y7rvIY7nxiMOyfwZ8ijGC7JKhVbWHYnX2pXnhYV8aNUQ== 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:(13230001)(4636009)(366004)(1076003)(186003)(83380400001)(38350700002)(38100700002)(6506007)(36756003)(30864003)(2906002)(52116002)(316002)(6512007)(508600001)(66946007)(6486002)(2616005)(66476007)(66556008)(8676002)(4326008)(7416002)(5660300002)(8936002)(86362001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ah6bu2O1SUrP0C/goVuLbkA6UmzfuIPRD9cU7eePhRfSuyRDXg0DmnduNhoYyUIO3NFse0VLOd4/9F+6D+D1Mgqw1ZtrXMvi/NiqbcGkQboV4hh3SDZXDMwddlO67ShY+E+/n+4uLS/QrhnZrh4Iqo2NsrjQnhy7Asi2jCmZKYSwd9hxb9Y093sKwCYoypt0eExyoCUqU2tYjgXrcFAOqC9evg1Z6vNSBBUzx3bh5x5liUrQ8xfMKa0JTcjskaevLnwzFDaRnMmFi+kJAE+smvWrP7+CPJu17xdskMI6l0FiM1+jkXnh0lxqVAUMuBYiph1tdajZlUiB/LerYUT01ntSYaz/XdO6V/4hcxmRd7SiL0JDZrvtPZ3IPgA5vc6h0fEJycB3twBAq8yLq1QiJ9eGUvBv/IztmTm11Kllh/gHX2qYerQe6SBvWEnpL8INlAG/HPKXJRIL0j9HQyngt4KplfCxzk5KzKc34iV7+ztT2l+HXdgdbdrbh/Lekj+jBURuN5qZ69BfoNYHA+GFoqMFPrkl128JiKHVxG0fyKzUJkUOaqkjOPyVAfxSPP4niY9YWFm9p1mp4x3Ez0UJVVz43Uc8kNQ3FA5XlvI6+e2ZB5avjgbdJPVc+W6vDh3MsCCd2CMHK0BNqk2PbWKrsJFS9NyNKw/HhQWZHuZK/OotyDJqtKsGpXxc8iHHPMIcCyvSpxR2d5N7ZiGGr2JWLFexbNKP6IXDMTCdNasBQJ4RXsGTVPTvgqQBhx5ZEMKcLayYU91yD5lYbSp6yXlHD5/Bv2d/8wwT6f8gxNT2Jn5xTWVIwUfs5emx7Jg6gq9tZJgBCvgSe8zdkZ5xOjuBqeGcbLMQC7lOnk2SUzJQnMXaSLf8l63soUmSy4yA+Rq0Ba1deBgl0m1gk+yI8kD0IGvQ9bOAb8TcRDgDYNNj4qXSskPhPrUF0CdlgOesdPShrdPh4p80HqUe+fbw4wyu149pfD4ysDW1RSE06CGxKdt1moTXyYB1LbGy9N/NnOzH7xqL9Ty7UEHMM/nIVE7tlnG0u4t0ZuBBHkJM8cFyJLHIYLFSZIxwhMABBwQODItdkLRheOjyUIbXJEgInGpILxyz8cmyg/S2N39KNMjSRvTTUKqbMI6AJQ77t4EgbkmGc5gm2hAohU0x5jfEZqzEWIDzzeNK7uhTCfQMtUFjA4rWmKV0iY7jnhBNvz0AldyQPjnDFHwUT5Zqtt4Loc7HxiAB4tO5ACpUJ5Z/Wl+srqO8tN/AABSZbGuEbA0pQOHKrraG80vo1QJy6q1thLkDhxZbPTBNdwzY2W0tiwXsbc0AL6/z5ScEpYXKmagM5ZLngOefxbe2dFtm7+1j6zSoS33jN6+pjo5SJkQeM0USkJ18eDuqpAnWjOw7qlH6sCHDUDUjygVNV4CVCu4MmD0lVZSBUOOrPNrX9eCTrQTnoSAfQlthMajcx3NUyHmpKc+6asP5hplZVR4XnIt2jvwzjHUOhU+gVtvAdB0TkvBZX0ajsHWTR7YQU0lTqDNGiShctu7FRQigU9XTUDegyTD5qzNMqe5o2ZhcxNS/MfphZEcqyA0icRKkRl6XKG+CHC4MEqJC2UIi59Y+NGQuu6oqjeusAp26QoxPoCk2VTFitomeYZYpP8xo0A65Gt1x6WROjiLqFCjaJKPMaM6YYGVyPx7Ebirxxbp6bgDi2neREFmshhoxPO0fZmnDiageeSElkFGa4+EhYViUOLmQBP8aDg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66709de2-0373-4584-3e5c-08da49e430fe X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:49:26.4851 (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: lqeWq6uWVabVxg/zSVdPrh+8LH0VZfRRftOXNeqcROaG+X+5Hp4CTsxR7PFxjE2YZdaYTccodoTFEjLiVzd2oA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5280 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. 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 94f8db4d7e21..3a8683fb7412 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 Thu Jun 9 06:49:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874876 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 9E1A8CCA47D for ; Thu, 9 Jun 2022 06:50:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239884AbiFIGuQ (ORCPT ); Thu, 9 Jun 2022 02:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239863AbiFIGty (ORCPT ); Thu, 9 Jun 2022 02:49:54 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50079.outbound.protection.outlook.com [40.107.5.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 925775D1A2; Wed, 8 Jun 2022 23:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Py6W+qx+HhLzGY6WUOu/yyLoQA39SYQg7wS1OjrO39+oACf6sOfRSSsxNMY+j89ZWtIrVAB9PBg7tdsvy2NskeMQIjpqb5WZ7oc1vsmWC+Q0jinl8HVtnxW25r0yX8et3tla0U/zUEV2OTJQZ+WBqPMtTMcJ6dRi3RQWBsq+r7A3Fy9zPpSgh2LTCye23tyi6hZNaMdEFygNszXdiIAnZT0yqHXRyU7aflwOlV4uPHuotb6wGVK1Bh2N6lBZBfuszTIUl0hxT1VZZqT+Li9jOHreIVwCoeOLSCIQ1qNncC+4GYjZPRU4jyyLx49C2lLM6tdEWLpNiTNBI42TQtUTtw== 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=2kFGAuMfeqghlzlehk4cpF0tsCIDCVbzlolp64+HsIo=; b=a8oBkeU94m5W1v4RMV/BthEUPxpATA2jMaoj0LhKmwzaChzhF9skZAND9N8OiXr2ItEiiJITXB6okPGcVrMTBnhwqwc6gdHWAYv54te+ue6XshiDHlPSPwAPsIAyniGiq4U40+cTVXGsjdfA5GHNCwYvSDxTqBUaVPwqpTMPcaoDAkMcgWzVOMVxmIhn8qZ8LODoInROx6Zyy1zNuuRFD3oXXxYa8y2dPd0gdhTxgR0BqVg0ddHzkc65DraX9t3F5vWD2TM094OiaupeBw36PX8ZmlvQOKv/SRfGE1wkONoUIuWpp9XcUM4gImNIzzwgNwBuGXKGwONwqdp60pmjzw== 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=2kFGAuMfeqghlzlehk4cpF0tsCIDCVbzlolp64+HsIo=; b=I+sURJsHX0t0w/Ajb6Vf8LrUS7bLPp841gAvjuqoEM8COGAyoAZwxpiCIEoFCivOaZaMrUW+x4AvT6mseLJ0mZwv+MpqaGIB2X5Lu49jaiGSwBFW/iycRTEm2Bw8EGrm/h1VxeTvknTsI+oEz8FnrmILHP5Q2RqMK1ymZO6yTTY= 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 VI1PR04MB5280.eurprd04.prod.outlook.com (2603:10a6:803:5f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:49:33 +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.013; Thu, 9 Jun 2022 06:49:33 +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 v8 13/14] dt-bindings: mfd: Add i.MX8qm/qxp Control and Status Registers module binding Date: Thu, 9 Jun 2022 14:49:30 +0800 Message-Id: <20220609064931.3068601-14-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: cac97f16-9920-465c-829d-08da49e435fa X-MS-TrafficTypeDiagnostic: VI1PR04MB5280: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: otSWNK3JxdsRe/nNVqPqXXbBqPjOJ6PPuBTiq2gpEGx7bCNBhE99NAdcvPW7WHS0BKLUubFGTfLEL92dbo3Uozrg2CtmCniEF132b7ynjFdiUWQk4fI/bb2u8QlSG8cU0A3m4PGZIO1Sd3Z4pTl/hZe8TMnRFr3gGvX8H52seIeXmo6a1Djge6tu4uxoeXoDPhg9mXb1+QkhH9dPp5KflL1D7j7HJ/rqkcDGd34Xi3Ts5WX4jF1raK79bPDQXegdIIJKC/s3u5jTH3IcOaGoOAiZWEznPPMn7KdVnZn+H18ZuJl/ppri5jiX/jtigFWM6I9MzCX+jPemMF2I/l760ui1pCR0y6h2ojjarEpPDK5hTP+Ab25pL5A+dA1DYY8BhwynSXWVL3LDghB7cwgL/Dq8fLjjqjelqgiXntEVouCN8eC7TxjggLNrlgkA5fII1LtRh01lQ6I750uBfcXZjgUnwK5lIM0yBdt0WpX+rkFFBskCv/sH2/zkk+O4y81xH+F31rPY+mqsxd2nQtceP+OSnu93VxjlfzaCLyValt4qZTFGaQDDZ2b7lBs8eufsh3aWUPSy9RhoQEBotIqvmEW5wChepCJ7qHZM+BTgOFw8t74ZqULTmP/htvmacSBvxrreqUzXUPjFzlWHGo53Mnx3nbhXBMYfa8J10gHAUmeaGMJj3mBh18S0iBNhhA6uwH4P4PH0A+bNt36ubJDcWNqqVDNhHnbtQBIYM1QuM29+3HlXoPKjy4R4/mSFRF51y55hTJ152azTM3QLeRNEUZVXpAmZbZKQ7UH0fIF9bhMy+YeLi2//3+lv2iEbCemD 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:(13230001)(4636009)(366004)(1076003)(186003)(83380400001)(38350700002)(38100700002)(6506007)(36756003)(966005)(2906002)(52116002)(316002)(6512007)(508600001)(66946007)(6486002)(2616005)(66476007)(66556008)(8676002)(4326008)(7416002)(5660300002)(8936002)(86362001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: X6xoMVqqdCzpv5vfCAL428VR/YmWmDk/byCY59MYMGbEoNSPYJUik+F9vhRy8nd0GWYzViq5sP4RPs63QrXMvXIVryZg2NPT71aKl789moD7tkNog6bttmPThB/96jAcb6/xlKBNtN2DQzOC1GrBR83/nepR691h0DSCikblhbAdie4KDb/7L9ztqw052P+CQeVnNA0wZ6TdEg7Sm3bTuCCgKBVSYoDMxtGAao/3EP4mxFzSZbz+n/yBMsCh46uuWrM88OxBt8muy0g80zsmfqSdH05CzLOQaT9f6or/dHF3W/YCa3ri4J+2PKLjP6NgBhfRdqLemx1Je45WXi4ub+pb50xQd+l7ESKXer1dsNv5lvdJnzav/Oue6Dku2Uox3dASYmt4JRJXlCf8goXOrfbUfLiQxIG7f0qPTAkpXSGRV5q3ffyvlCRkmvwgq0wf6vZn9JBgyww0/uPDYtiYOeF3nX27BDBRfJBEqALzohQkNdHfDjSnpWEtXUz94ZQ24TsxwxUYNzwcZJaFcGpbHt5xCOPdcy3RUCxENpqvlWiZfSnKNP7Mboc/IkolF7Ed/znOHFxpJZvi3AZaTZBvP0z0JEGGdHZn+4qWeXRwuNTWQx/vihlhhlrVWIhZhtlnJLozAVIQIZ67/neS2L4C+8SQot7Om7Ekw956wbol71RIm8EgCSQhF/tplt0bfBMWZWk1zk+mOryeXKeYQhvmaDJXoE340YfwU6yX0Hu5AzKlBcQ5HqMp2z97o3i98Vt/lgC57iCEofiOExAPOFYotmUJ+h0ulH4vHDZ0d3taa+UZOwMdyo13r2wm5b3INjHlsgG3zDEQ4gshhpHzYbis3yRlgDChWdz0V/eJ3pFwYnB78gUlkVjjjqLrg8xmh6vVBp2U94ic7iqo0Gj4A6nc7jOruTCUUWlSBKR3XiqAKgLd4t+k0rBeQOX6Y/cuSDR1XUMV7rSj6m/8cqBewtJdx24hNBdLq6pSltRKOPIkObCNleW1omtVjGhb9PAJR44TXVZpgrReY9l2mty2YbgjZfZJyqIFR42JX0k+6J0eGe9uxUKIpA32bks6VZbIQC+cA+F1wdtzPkyoVVvg4yJ03EdPvr/3UiK1L4id/EGlWh0qHuTWPH1UB5Z1Y0tRkM26yrJqLZioNX339xehKAkDkgUs4DwxO88P9f+aNTF555bt/CvgGaELBHI13peFh8xjT+2PPiLiFCiVy9Zs1a+pu6cfh5qV3Ah/vBFKmPM2gh137gVH6cmpx9coQ5NNGllhyMQLTrIxSAKCnoBwCGnw7hJKgKe1nhXhCktuSZCPsK0QkoGNxyQpFH1jG+UGBBBUf4PA6PALWUGDhXRRqme/8btSn0vzB/yqGdbUj/iTCaPjvhnjX4Cfuj55bPaBGbvfT+cz0BC1Rcir6h7Oyr6QjfcOSe9Yq9574S5SKCMk2fPJxcWZz4H9qhDJyhAkml4MgaiyxWZQj3m/tiX4X+gFFddgmtRph7DJz6HThR9VQSWTt34rzwsZuba+59tfyNa3SD6UB4Ro5qjrYCL21S6NPwFxXoYFwyFxnJB0RxUfoiagi0K8szYCCo9ThGf8/X8EDJ9dzcnuAYf+kC2ZD3SuBQ1IUPp/P33PCYKUK1LktFemyjuhEf5K63RFsUr52U+TxfTcS75PwXK7V98wqcjvdhmP7fZ2x5N26almKHsNYe7fqaEhNq8lUwInK9t7hhUOVUAUaY9FMcITSBAJtE/l/g== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cac97f16-9920-465c-829d-08da49e435fa X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:49:33.5983 (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: bYnwGkkh1poHi9VzIuZLqZcBWNiIYtvZlutdG4QpEGGNhB1ULx30NSxubmJjQp1rVOxIaT2W+uN9wLdmDrDGdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5280 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 --- 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 Thu Jun 9 06:49:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12874878 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 A04D5CCA47D for ; Thu, 9 Jun 2022 06:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239610AbiFIGuW (ORCPT ); Thu, 9 Jun 2022 02:50:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238164AbiFIGuA (ORCPT ); Thu, 9 Jun 2022 02:50:00 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50079.outbound.protection.outlook.com [40.107.5.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 043B55EBEE; Wed, 8 Jun 2022 23:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kwchLStUN8FgCegQKk/5c+Kj7qeOXwvIeiZS8M+YYU94yBC4Ggotx9f9byP5Do2kFkOn2CXaph86wKu2lQYvNNXPrqFAAe2+RH6oA8Q4aommjNhZfyshAGlxnzCONMCEmTwGSNEytdw72SOTQ2NQ81/pZeqfK7HTzYhnbHc7GpQSuzTXQu6I5kbP3KE2EXPqK7RzsN0zOhk2H+pp8/H2qMLSTe/ck3dsvXrGHHd46ldQfY1QhxeFlVTKtpJR9glkIbaEJXaQmt+dEJmAQJ32jGYyCxFyQYSL3JnM2BY4D2oVdPeUcmM3Ooq7q9A4kEYjjPmMQFRWbATLalVz/pmzEQ== 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=LVxre4AWA+IrSerFD3kYGHhiFn0XUGSgjF2pv/MAWhU=; b=cYhRGIF3wSXVmNoYfTxhE7+ExhoyBsFdk8NLfr1Zyg1GOGOMVZ5xxx1kcRV7whtfCWq5nFIcGDEhicFHikbwZdceJnmA0eBSTA1B0YqJvI/lnhnwQVcdEZUULv0u6GI4P52M/lsWOhhZi71B/SYxU+OTrW3Q3I3zm0D7YTZ7X0R228bk60cuhrbNeQPEEJwO7PjJHDZ4kybUCbqE4mB8Gwk2RNGcPRHCFRy1ITBA8JcQ6Zc1Rbl130Y6mbGYv5ZyP7s46s8YJrLHfiR0cBGQtST0YQYRa2yHwVnKLqM6NDnvUFOw0g/i067Fd4JZ2JPZWD2CSSe3r9UTV84nUovpNg== 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=LVxre4AWA+IrSerFD3kYGHhiFn0XUGSgjF2pv/MAWhU=; b=J/FJORQQubFJ793Cbd7QrlydttDYi1DvNCmP9smnOrbA3HHe1VD4JAzSw0XXZPI3Um+QvvMYd29Kt7WbGmF0uYrKtUj11gu5CXpmF/RFzUvSV1+RpIdj3XPVZL6ERgBdLs3ELCjXCpgf8vVZscJD+EOiX1yRONInsejv1Be+3dg= 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 VI1PR04MB5280.eurprd04.prod.outlook.com (2603:10a6:803:5f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 06:49:40 +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.013; Thu, 9 Jun 2022 06:49:40 +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 v8 14/14] MAINTAINERS: add maintainer for DRM bridge drivers for i.MX SoCs Date: Thu, 9 Jun 2022 14:49:31 +0800 Message-Id: <20220609064931.3068601-15-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609064931.3068601-1-victor.liu@nxp.com> References: <20220609064931.3068601-1-victor.liu@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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: 4ea5f6af-5fd9-4598-b888-08da49e439d3 X-MS-TrafficTypeDiagnostic: VI1PR04MB5280: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: zDP8EJuHywL+QZS+72jailp2KMBofJcW+DdMa18azomBSl/R/tfAkUEJ5o+Y8nt32zCVbtzACvMIm+fXBaYz64UcY2b9ycQDJ22OlSqCPWTMrL7yFlNPtitgkJHkzy4d8Ew4TqOHqNZ46n8BIMxA0kXRDvIIPMmBjeoXFz2MvSfbUKBeQ1cDY70+vaJOOwD0plR8Xdz/+2GC4P9PH47mpdXYYa0aOh23M3h8Xts9kR+ZWiJQcMMlQcq0bikDkahBTI+zKUnnzTNfmvOg3kuzbkfs/+HDwlYDgngMMvBdnbPR7EQ3QIyDNO8tPH/cyj4kHhGwZIjNJdFF/d/B0fDMtkL+okoxi2ZMMZr00aU++rFdamaFdCMOny/rRDIB893HeMHn6BRPKmiZA+gXzSrq+7MVphsb4h++Cv1YjlWmHzcAqxXRYOqNduIwfPAaU5+tmW6COdgH5idHHgrFJlZeX6/vQcUTwwVCHkmRcnexu6HchhWMS5zHxWhqmdpTDJeCO+E/PYlZUMi+5Sw/l6N5luzVoip/nJFy3wP+HPw9EOu/eek0noKvOFN3PJuYJqa9dZOSUdtipUm4GUXwpvl6lyIqUHbobri5oJQb5oogtt8UHlJZqxT+TlUpw15uFslQb+8K18OD26n16wkNe8i5SVMax5RTtsk7+FMFZlMdGLyNKFXXDJ1FbG/CaBlxo4uRQyW0pcht3eycytWjz+5Cow== 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:(13230001)(6029001)(4636009)(366004)(1076003)(186003)(38350700002)(38100700002)(6506007)(6666004)(36756003)(2906002)(52116002)(316002)(6512007)(508600001)(66946007)(6486002)(2616005)(66476007)(66556008)(8676002)(4326008)(7416002)(5660300002)(8936002)(86362001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0adZu0KPYLEw4ky4osbI5L/WYtuu7OfAH4T5yIGJD7lratTJ3nFrBgQFIuaf4Uz1huOMf270Cam6GOzVtmDqUK4AvxSt7SvSGlMX4Ey4ejr/F0Rtgpb9Z9VcLqZl5rdOvqz8jWlM/wYEJd8E1CTh7VBAMailY/mOltmQ0o2E7DdfPzBVxuhDTmUHX7Ekx8NkScqtgkEpHRxyKT4h37YlidTWQsGHkwaGPl4tvRF83aeoCDqmmyGFl6F5rW98SG7f34KXW3tF8m6ZApfJeOyo52kRoXIZXXWyUgO201avbPhK4qyn1LsXNs4gKzLFcB9TZbCxRanHUmBGUh2cKnZAUQ+7H+Ybgp56nP7yM7V4e2mcbE5Wk7s1hBiYW2CgjE5+zzfdXRfqY13jOwLrurXWtt/lyEiDdToau9yKMxWaie+Ps0LCGy9F2MFIP0DgDB65iDDRft22180I5LwOi3xlAQwoy7OPTP8yxzDQh6cSju7HpnMAyeDGX88QMwEcRZ1WIYHKAmbwf6Gqd3ahkR0mSx0tQ8t86kF5+09gDrVBPQQAP3l1xUtfP5Z0l/H4DxveDT70mfVUNljr7iIa8KwkYufXvB+8KexXcd0BPFO59W2M/Hq+Qh1grH+XJmiV+cBzknZKJuicaK+riVegF8yNxT1Q1BJFO8D03wHC9/WcVhPT4RjlAbdqPkSj/vfPv9hEnGW0zPwtX1Snh8Ot8D/1zFhdx5rXwmY5JfNqCtdrF6qKeTR1CYVPiDkDiO4xhwKjqCVUgTa0rabDoMx+T8OMLms5E8a7FIyrVmFMdGtIq1TpvD+lbMtYEtySi49UBnmGBVdu7CpmcNlTZMFhpzT2gVQ/ivDB5XIk+NXmjETE2UspomJ45dBlaMZ6qs5fJQ1rS4uYo66RyQV4vwUFyzTJZYcsYucq+3N9jXrp5I7mhxS6zjRcf5/mwvs74xNzu4wGPzv95fk6D3cvToPE6Lgl8IHSVbdo365fZF5LGKrU7Arq96YXc7LWIdOFdK4iqM9hK2gisSewjXFZAh5gufRmUMQWBBqwAUGTUKHrmzCB6lvAikICKrAF9/bHw5/dFhb66dQMSksjgPumUydF89UqZ90ZO25M8SIN/R90yqvN1TSV60hYuHsHRBl8XPDCDARs8Iqh9FnDz+IDcZoWrJg58pANE/ltZky+KrD8ztDspL5HkwgGc35+T/kGZxVN4iVutRUYiMi+c961D4E5wCNBgqiNv9oU0OO/yLnpTz/hmtyQs0p5nXjEc9nNUHgeQdo2x7LSME1V3VwourYOYjrWHJz7+OYCpYeDZPesQ8wCJN95zoU8UMAAgf0fxN91KPyRGooKWH4CFE0HhgsHy5mgEYfHT1zjxHLbTCVwxZcgYQFElOMPLK42/fa0XjKajny6D9N2ImLrm0zOBj16yDeWdo0L6bw2Ja30VspbeC8PRZeI7fde6QIIW4NYF9Quv9xjd5EAdTqOhDD5V8CEeTFp4mWdOA2s9dpmEvVTQLVaw/JFRR3YbBNjY2xh+vWsx6yHqRAZduyuJZFKP8kozAkcbBAaquARj6UrJ+sDC78figyj3X0qmGPHjSjIsEBu8nlwYbRqnI/x5lgnKVaQ2u+q9gAfRYZ7n4fe7rcozTzdifOwEDJliH7lfmWZC1ogvitZagTmup9tL1zagUDeQnZLO/0s9Pva37kRy8Z6UqnjN90+5OfK+xAdPkpzFn4kWMSGGot0UmSZ3xRKH1rBIDM55A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ea5f6af-5fd9-4598-b888-08da49e439d3 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 06:49:40.1956 (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: pr5YZtpm0J66xLdOn/LRkxlZQneUP1nKvo3M0BOURbRF0F2D7bz4hTiqSS9MxYvzwmxYMdrWhSTOwXKfMcMT/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5280 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 --- 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