From patchwork Wed Mar 10 09:55:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6E37C433DB for ; Wed, 10 Mar 2021 10:10:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B258764FDF for ; Wed, 10 Mar 2021 10:10:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232456AbhCJKJj (ORCPT ); Wed, 10 Mar 2021 05:09:39 -0500 Received: from mail-eopbgr130041.outbound.protection.outlook.com ([40.107.13.41]:6211 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231492AbhCJKJH (ORCPT ); Wed, 10 Mar 2021 05:09:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QX2f2T6Dpf2CUKcpDmLNIbUJcRQY/JVv2CHNEf+8Z/ffiIEwGY9AgsrkFYBczbmEod7cnPvOTkM3nV12QFd/hXBo4d/AJvxyKGurdhp7BWc5hySepgXh9fkvWdvHzPKfsD4oRHIqm4LOk1gi/HTAyxs8EtDycTeAzy7W1yiZ8M3gb6Xxd5QDII/wVtOEl0BwCyZrMHRQXIJz7NJhy56nyaW/Kxszx7U0hMGN6nb0a8T18ehg/veDPY+gk/1FLWte08aAQ4I1NYakp6hikuJvkcRg4vnwfSi+GlYI5K4ydfwh18j3A73DGzvjQB7mWJVQb/MPW50KvNMagZs806QItQ== 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-SenderADCheck; bh=kFZmWQs9Xj1dNrWU/yWuaf3fDd+hGBXTEET+3uLnoFs=; b=jwOLgguhl5XHhLZpZSPg1FVbYx/GPEnMlj7x5gusnX40od9WO3ainp8rcc1zqRqsCXwKS3i7A66G7Pu6hLe/oOkDoUDMQRsEv/YO3dnEcNxpjnX01GFaRy4bcwieLHiIbS7w4IxItTpZGjpLgQaTeM6Zs2kAAu0CzQ1dFCsFVybZyjOobd8HIsH12/FTth9vg6HMS8qFY3C6n11+5mcHHmcNZHgsXdy+nuV80yQH8SM7ynYrCA/dQP7y6TSrm4CkPE9/jREDRqrwnNIFLt2BiqJ+7Pl+9+uiFwzfmsew1uOngh1VqRTpc5hQctTSE07VEYMro7xvzKZLPzD+ugxoiw== 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=kFZmWQs9Xj1dNrWU/yWuaf3fDd+hGBXTEET+3uLnoFs=; b=r406e5/HPzWN8PowBelwPYNzGqD22Uvf23hciEEfW23ZbeO85opbsnwbttGm5hgwdqQWeQy3xbCooaoF20ASRdKh1mvv1/IfoZ5VS0jQfl0BBCwyfa/WuoBBU/nHDrJIO1YxjOgpJGPhaL4m3jESOYpaVINTH5ielZ1SxtM6hms= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0401MB2318.eurprd04.prod.outlook.com (2603:10a6:800:27::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 10 Mar 2021 10:09:04 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:09:03 +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: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 01/14] media: uapi: Add some RGB bus formats for i.MX8qm/qxp pixel combiner Date: Wed, 10 Mar 2021 17:55:25 +0800 Message-Id: <1615370138-5673-2-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:08:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ff516364-9e51-42cf-cc91-08d8e3ac888a X-MS-TrafficTypeDiagnostic: VI1PR0401MB2318: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:326; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y2X6HJdgXGyhrksR7Tj+lhR13DJdkIKGEXbOBkcSUBaw1zgYAy0FMEBXLgQqogdGPKS6qyWbmLv781o6oftVBNDz32YkKSTIwJ5uHUPfG0T7pfVqF2AAdT8FICQufPMNpD+tlROkQ6f2y4CULilxsG9euxPpzvkP4GuOshWh/uRNWbt+Sg0ujiIhPc+UOb4Pn/Z93xzb3dNPQiZj1QgnGf74SKndAMrlzVuO3SPYwiQhFjWwVXqSqPvqz/jh4Tiucy4SkUUMHp91tEyD2F9dn6mQ59AQJGG3s0vk4WfKQ19ymt+/3925RqGOnRioY4VQaO8E4SjsF69Pa3LDH79In1MoZ0dUEV/hoTlKDyIviGu4bmV3JhMT7WeHazzdu/MSyTDqexBclC+J04CVPMM6N1tY4/J/erAm3mCD20p0bnMwN9vghWgsYic/fyeXnjAX3L0b4xBQIN9yVTCr9V/vIJxL3kdpWRmqERpgy07D/vpJIkl8y8KNj/Pbqrh4l9j7NYN3CVdL5vefAg39FybemM7rlJAQliOewXGVovslThmQ8rZ2I/fEI81MfI+zGRT5OSo63LQxSat1HPC0NngosQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(136003)(396003)(366004)(376002)(346002)(6666004)(66476007)(83380400001)(66556008)(8936002)(6512007)(2616005)(36756003)(6506007)(316002)(66946007)(69590400012)(956004)(4326008)(86362001)(16526019)(5660300002)(478600001)(8676002)(2906002)(52116002)(6486002)(186003)(7416002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: +Eg3EMAR+bJL+INfLqxaXMW0ML5rHDGW2X5qk9skv2E0Dhc1QLJfb7+OJJiU1OEMC7NRcyDdwp9LEa9nGKGuAwCTBHusAu/SpGt52TO3z0kgQEBUXuYSOEAYLQp8Wm/pGouJ74rxN2tisY+C7vnfYKOAWvPgxvTziCgqt6lhrFqWOQ5TV+ikC5G0ZYUPkXcl4gkHMpUkVuiiSmq3DXGSv5OFe9aPHlAnrCBIKBzoR6iM9ramTBZsn1BiUpZ/Vce/k4f61CmNFij4jpJ+3HW/iFicTxVMK/6za1q+g/9dXKqozgMenegBPWIHQcudaAX/e9YS0ZzH8n9Icpm/Vfpfl3VjE6juTTZbLkzaQ9ZYtyznOkOFWq12c4vLt/3CDTrjdT24Iumx+3DIbmFAIxhvS1ciD0VWpixDbJAsfAojleSwqqV0jXR+mgdUh+92xgBJQCLZJQQPVt3KVc7K7PQphJ1zfmAfOFg02wUWZmIqWGDV78SHo1UHTB2lNi0xQ6X/yXyRbjZWLuvjYqPcI9iwRVFWUr+wvx7pp9zmy4DjS7ggAP3Kh5KZkHl3lfDkq/TFhcyieMVVGQZS8lIje1gIrFqEt8fd6DkSedQALVjYadY7R4uLXfC0IV67YlnxQ8SkuTjhHlFlSTVQdxl42xqbXyyPxIPjZ+EUMYFfTwenf07kJuQuRk0Os2fc/iXxmuNLDDOkUKsaYDBlmZ7wZE1rQwBn3ZjgmHv8k9TtyjXv+41JlRvNgSCetW+PghHqyzdKtI6AsQHSbYYIAC86FNAJm2rYZ2Gg/eOvSy4xxEWEZLva3nc409pIpXT9pVGaxh3380kelf4cncCqyhREjZ3FaZLjACG0tAQ0XwmiYgaXk5CvJjvyR5leGhIRf0DbNrV9t8QUIfgBJ4JOggH3lO/0UHsKvxxEiGRW/s8wzfh4febmlGQOt9EuKLw+/czuWdAP6/w4kvQbdfwQNU8asuihqyZDepRrccevy3gdLN2Yd+bmXLPtOxX8XLZo4SiTCDtYJbwVRstSvXBgqZSEDANm+PP1xFJ5ED2cSl21qn/NMVw68Z5RavoAKwv4wxwo5w+PKZ9u1dwZzth+3eL8ac8ZWWG/c2WEoWi6mUY2466aX72o0mSq54a4HdHkWwkfGyL7OAc0zeuTep3anPj8fgIFaU/r+UtG6sOdxOgx0VU86goMoF1IfF/TWwvuppX0nFsQZlzTVumlauO360COm/+80nqG3IWaOeTFNeJMEBgVr7QuqdwISUoljxHpSlRgITFohomO2uwxBM/N+wn9ryzIHEK4qQ8rEsd3cImksirMebwjrEdVtpB9oIx/mAKK+X+Y X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff516364-9e51-42cf-cc91-08d8e3ac888a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:09:03.9611 (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: NvZMmm+WkRA77kr6vI7Dxudvbj4IGh4i0AyJKtMsrhsOkbPI+csG1QsVNoGGhtM6kGbQcxArwzmdjKSZCNepqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2318 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 Signed-off-by: Liu Ying Reviewed-by: Laurent Pinchart --- 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 0dfc11e..ec3323d 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 Wed Mar 10 09:55:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127525 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6945C4332E for ; Wed, 10 Mar 2021 10:10:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EA7865004 for ; Wed, 10 Mar 2021 10:10:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbhCJKJk (ORCPT ); Wed, 10 Mar 2021 05:09:40 -0500 Received: from mail-eopbgr130054.outbound.protection.outlook.com ([40.107.13.54]:23781 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229609AbhCJKJO (ORCPT ); Wed, 10 Mar 2021 05:09:14 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=etL6pI5u9dqP4MK6RQx4xFmkgBu4iDRCDL7aaJeDmME7r5xDTnzWqlSoy9JRvB/edtTKBGkFwOXz4bETdWyV7/haocxApAvghHaEdMqDI6XGDxwnP3t0wglluqs5UjwP+AifGmjFEPnPMfE7cDzhSV+9ntHyge9t2H+Tzx253Ls2CspToH6FwRiEtmGfmpLxdDhDclmgttZBHYJIZuqGVaN+OQUFs+FXJav7S0RWkPrj4jub0X3ViVFXDawaWGETEIMvK/BUBBRdN+PArNqM+NNwvr5s0r6bKAm4e4aTGon+JqVGoVWgEi9/r6soz644uGJITK+bW+nOKV7Jkqh9/A== 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-SenderADCheck; bh=lGjn0W3wUOt6y0dvsYlaJYJ1PMZyQiTucziOQrgohLU=; b=Jh0ZSTthfokfGV68iACuIbPQiKXugJwSd/97vM0cscP+C2Zf+kE9jkRx4xXA8rKXKZFjO2pH7OYwBZlq9Bf8HKbVvDZxDH8Ipg6D6U+IfbDkECcCArDzPhFJYEK0rZI3D48BVZeGKkv+6+MacI8uT7ek1bYGHVBNnhOJgd6mFGQRgl9Oz/GUC71FE16dYLmsPvYZZpUvXKpzhhXT8eCrOjrqcqbCIgJsF2fW1ZfIPJH6ApdhIjBc3yERcRqxKP4CnzPouzcWnprGXeFY5b4oUp3g4NCkZDs5OxHa9zX+DcohRTygpxLiqhXG8PsEqYYyfRktrAMrCZW4ULbnmp9vDA== 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=lGjn0W3wUOt6y0dvsYlaJYJ1PMZyQiTucziOQrgohLU=; b=Q1CQ0gLyMFJl5cHmcKYRhxZVvdYYMPXz/PZ/VXZz/DTgNwfZrlqftpqK2ZA6w0DnXyrSLdHOUsUPs9IN/QuapYm+RBmMqvKiJtR7Lgs5xbF/Ma847DbWKnE4Eg4LnVxHmI+UkC/6Oc2ZdRkYOx59xIPa3kndlFH+TVZdmLVTQL0= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0401MB2318.eurprd04.prod.outlook.com (2603:10a6:800:27::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 10 Mar 2021 10:09:10 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:09: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: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 02/14] media: docs: Add some RGB bus formats for i.MX8qm/qxp pixel combiner Date: Wed, 10 Mar 2021 17:55:26 +0800 Message-Id: <1615370138-5673-3-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:09:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c63e1a8c-267a-4514-6a31-08d8e3ac8c49 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2318: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +phHwmGOeSYtlBInHvvM3OW3eu0pfQltIMkeg2PPCzbFUIyu4F94RFTKZfCIpr0yz6HEtv6JFMzyS9Vtuuu4NDJcCZXvb8ICheQYohvgeMUqPfNHUTi6p3HtrUmvTPvWuLCcISjlH3uM8RIzUFqoBrVX9Q0ExbcyONwjDD9FCbUHZ/k+B5Nj6f24CPYDWumJkptq6wfo+sPP7P3TlfSK+0S+0POCF1TN6kZbLGMUWAHNRJ0E0xoKhkrYZI+pXFr4VP5Q/2Yhf1SApHzlklfgOxNZIF44tww84Nf+hpgHpxc/s39TQgFTk1BmXNQcYnehWuAc8UDFakPFjj9z/Gzw3YHHbWDxU7xfp3xWpp63EqkPcRyujQVsxSP+TNyOXT5voSS+X8OuKBmJzF5dsahYNsj52kHrzmu6m2AMhQUcj/9jrNFRpiV5mIsLh80iJLRoTq8TIepuSE+dO8jUc6/VRF/ONjrQHnA8wVWMmGuFCE/vb66SjKGcNF0u1aYSiPz1+vaQTx0trWH/j8ruoNLQkVv0zaRLdYGdEqT0ObobwTtupUaE6QdaFQkiIsPVfZcFZRTHDTafdTy7GJ4XJ3iHqw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(136003)(396003)(366004)(376002)(346002)(6666004)(66476007)(66556008)(8936002)(6512007)(2616005)(36756003)(6506007)(316002)(66946007)(69590400012)(956004)(4326008)(86362001)(16526019)(5660300002)(478600001)(8676002)(2906002)(52116002)(6486002)(186003)(7416002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: pp5y/8YiVz2AXQg4xtTx3jzFb/fJa316LsYBibQ5Z/Ot9iF89LSh0QnQMWhyUxP5nibLOPcXusT5EaZES+VsFvkpX1LGV6WESFrN8+GtaA1wzYA8ueIsmripRxHlOWK/yvC4e/7yz0VSjGTmJQGsBwIHPtGooeTdEAT7kJx+L5GHyQXNFOJBI5gJyKgzmLGONyqsXBfgkfL22Knc3Q6Fa9lNTjRez0qUSgIEXHVmFDMuiRUhqdBTnGr3D49spkx5uXYp3LozgI6rrQWUPQviKkqOphtbpn/C9lWkiTZ4p8ChIA0qzv+ohpzLNehVQSLi6B9TM9a+ZDe4PRcqLJ//CVauWEYv0M50YUy0CvTcEjSUlPKFBy9vgEqYRFYOfTT8bVQfEucJvbEEac8ORAEhmKqBxikL97ay5eaxuBZTDNzVaK92WxsLFdUCV+r0TLKJ9doylv+Cib7cVcX+LB9PohwHjAtA639wDno8j7dThFHxO1g+g675deViI0aj86SgQG8mZI2E3+cY7KrnmFMHFOJmCQLUf/gCdQJVdVCf8B1ekS7jvld2Bbc8NeOte40kSywYFcHGDIkkId4r92CanlW6xDf/6I5BnfYcfMySAzuh9CJrSTWkVcnsClDMzlCogWRS6/ze6tY4nouNXZ0PMeb1qj4VAbS+qD0xloC2pzOi4AwialCHvP0HDgbMgoaEZsD8owBzXSthK6HWdZ9LsldW0yD6jOX5J0G0KzHylWEO25ZN7Zi9yqbmUfvMERhHsBu9wjszpXGKlZaFujr7Ckrt0PfpW89SeFyIzifn4C1BAlSOzXkZVy1x0WFTJz6bX/szNjJtNiNWYYcJMWkvb+v37RM5KODthgYQqTR3eakRMKZeZ5LDvpp+2MG+LUekOxpkA6sqnp27kny1wQdhlE+i7+jfUL5cGzlycNpKCn+Mi8QXUn0JMJ4Hxt2hZzXZjxmrB0eAVOjXhYhAY8V6KSggEbBUbWE9GSjMWvyQHeA4uDRMNs77fneuepeBx/CZaYgXBKNpJUBNekNtNRn2tnTq/y1QbeE7UUmSSFopaZ8AwHejcyKFZj4eW5fceysTwMutik8TgdRsriOo2bNMWx40IipegWND4igUU/0B1Lo3XMz7TrxO7F2ME1QVcqcvMSRCFLwfNlTIfCplHTf3p/grgYUEi2huj5OVvwHZXA5Tm8H9Oq7rU+BlOzf48SsNFLGK/KgDL+FeL2YGVRR3aQILPdNwKBp+SD2Q32gqr2ECkvMCMa52YCJDYVhaEXiZtWEMztVkkvg8pIthpJjyViCpI1ZWtyou8ShyDsjvotrR9LFLJ45z0D3tSZNBXheE X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c63e1a8c-267a-4514-6a31-08d8e3ac8c49 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:09:10.4364 (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: HBwrz3UHjSoRLoIfof3Z+onW/9E9OFz1NXJ20/6uW0kKqdObJ/wciIjheuKkziL5whK5iQ2sYHJ2mN2sZRinZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2318 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 Signed-off-by: Liu Ying Reviewed-by: Laurent Pinchart --- v4->v5: * Add Robert's R-b tag. v3->v4: * No change. v2->v3: * No change. v1->v2: * No change. .../userspace-api/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 7f16cbe..201c16d 100644 --- a/Documentation/userspace-api/media/v4l/subdev-formats.rst +++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst @@ -1488,6 +1488,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 + - + - 0 + - 0 + - 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 + - + - 0 + - 0 + - 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 @@ -1665,6 +1739,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 Wed Mar 10 09:55:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2FB8C43331 for ; Wed, 10 Mar 2021 10:10:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D228764FE5 for ; Wed, 10 Mar 2021 10:10:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231492AbhCJKJm (ORCPT ); Wed, 10 Mar 2021 05:09:42 -0500 Received: from mail-eopbgr130071.outbound.protection.outlook.com ([40.107.13.71]:36838 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230147AbhCJKJT (ORCPT ); Wed, 10 Mar 2021 05:09:19 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X42GzjE58OoyTYH0szTyEBjgAPRlke95X7s/w+BlUSDaTq3apyG9ePtu5eQdmzvjTfoyse/UH1tj1elQsDMTqA13tmqphDmROXUAgtzrO+dm/t7Nl25e0JEjctiu3uO3r5V0dc+DafMW0iiRWJoDj2ySJAIZrWj41piy1hdptah64DpNFfmycDen2RlwgPoT81MQ//J5ORQ6k9+1GJH2J2BJesT+r+vIWcCadWMScrzfaQLqbZbfZTZS8MOCDWKACXodyJPvWuG2r3vjr/xKM4B7U1g63HJyjCrhdEsW8WH6/O180FdCkOgL9LcBPDxKKhuNUXlYLhTd5z5uYZOfgQ== 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-SenderADCheck; bh=w+WoWrawYNO606CHrWsy47dmY2u9l90FztGd4axjIGQ=; b=BcYAgxS95BaIYkIBoP6SP/zfIWRb2rELJ7BMeAyNdD+B3Q5y6XEpivTNxruC4jHpBAs6wdob3cae5PkyA1i3G+JwCQXPzZ3W1nYmMLcVE5n8aqQedPzWUybdYhGLv5vzPm5Y+FzXbDlHb3nJ0MG6IuBJHRJRvCiQhThIiG2x5CjmPt7S4/DkMzNNlWU17mPrrERcYbul+GucYCO3K7P7M6n/jT0hVL8gPUvNqCYtJfyBKJy94CKhmeUuBpP/pPdx91AU8VOX2Kv4+pplYg59YGKyYyeavuZvP2oATvawq1DjE1iZnZJ2ikAzQ1cAmvLYAic1hZ862tMfzKZMk/BM2g== 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=w+WoWrawYNO606CHrWsy47dmY2u9l90FztGd4axjIGQ=; b=Jp4mT31IOBPuwsXPqMSlFHr+gbjw8BMXz6BQDjqQir7jA7dc4vR58E60mSauEFLeC1XayH+7K9m6XPdAzQzHiCCLgbXDsBVA7q/qR6AKxTnwS3xqcENmYCJ46QnrQLRv3/swEHcIokZbELBQOFLv4MJNRos12XdYhmyzP6ezOFY= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0401MB2318.eurprd04.prod.outlook.com (2603:10a6:800:27::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 10 Mar 2021 10:09:16 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:09:16 +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: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 03/14] dt-bindings: display: bridge: Add i.MX8qm/qxp pixel combiner binding Date: Wed, 10 Mar 2021 17:55:27 +0800 Message-Id: <1615370138-5673-4-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:09:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 27756c52-ca43-4127-c48d-08d8e3ac9025 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2318: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rjBPTj1B8yeC9GM3LFAvswg2ZrC0OmHiQRXs6kGUApvYMt1NBOmR/+zk8VcXFGwhVEF1ZneWhzcrif59q8Uw9l9il73QAixAXb6kILwhijDNTwHOAVJngQUVMMFcH6SSxB0nIYgV+kP4tvzBgKEOnKI9njX3rf1a/iXhBz4gtLISAN9KtGPQgG9j3Bccd8jfe+RalfekIA+p0k8IxYa3FcIHUGlCv6kUVSllqrPe8TMlQnYu1igX50Mj72LhYeJF8mKHPktgy1guVCm2tjb9MeFK1NdYspa3dOSDrhB5HmAxGTioHtBNciP492Ej4qKV+FIs5gQfusbbilJN01byIXD2ZUp3dEQTbM8HhjDQwyPELB6gYReLXsOSwkPOOc/KRa7sU1NzqLc/ZxH7wHSASciOoj5vkXcjO10giPo32iuP4XJ74eQgEAkaUq/KlfMvVXcFV99IlgzXhahuAzf+YfAykjAYKJTZIHg/k5aXq9JfII9IwjKlbe1lljm/wYuLuHd0xIMwPj4Twt/+SlID+FrH70ylAH1ddr1Od5qM13muArg0A008F/ERFUFm5Q3JgIjfewJ+RCochd/ZnlNXyHRet3H6YrzcSVX0TShNoVp8Sm1ZT5ArVLp2DWKdkHDW+o33+TwMZ/OoN+ZGp5Dm4Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(136003)(396003)(366004)(376002)(346002)(6666004)(66476007)(83380400001)(66556008)(8936002)(6512007)(966005)(2616005)(36756003)(6506007)(316002)(66946007)(69590400012)(956004)(4326008)(86362001)(16526019)(5660300002)(478600001)(8676002)(2906002)(52116002)(6486002)(186003)(7416002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: omUmDVwc1sKDAXEHKImeyWBxpt/GvgPDqX/CxkwV/6n5r/Bg8eZIJQz8UxFL/MGRoEvhI7/9TPx5z8BJv3AOoNxIqTvdpIouRiayDi/dnnkzCaxaSlZ25hziiDO8reMlmh47almGAgwczPTOX1v1xr3xTTjzdd2HZun+nAo7vPR6NZlW/jrul1wUuyaUdL2tNK7QvkUC8drF48Dg4t2oku8crTYwMbaIUdh/+ztAdgADApBHisgLHKdrZwqYCQTLq78G3n8H50GrDBh9vcZaZEn/jGC6gH3jlJxizzpAm3+P4yXqQJO230Fdde7EM+St7xEgCqQ0ksmAOsyGdA3DzDd45DnMMsGWHbb8JVUiQoni3oToGyb7bC6nXu970U2+46eEl28roLO2zrQktqpzHmb+0FBZrH2pulcFE7jE9t7R1UFy8wFrT3PgpVYkz0lSjiELZPz+hrTMSwXA1HM0CxPIwCai5ZcEcOg4ETyPOSCZjJoPgYKo0AkZJbANLjb+zZoMDgblLPWM9GWXD0UzGhOKT4VLoEGRmahPmu6OI4QHrPPPZvlhuyTzZvQdJwti5Zd6IyIEAn3ysvUZnEEWd0GfP3b75QQ2bCTXVBU++gLxMNyAciVtXmnDvVUq5/rvmck8rcMfZM6TBPV1As+sO62QAwmp9YSuuAhgSvddAqnwLsUaDQBQ+ZDGlM8GqJYy4AzlDMVfG0gUq+sLEQpgLRaOOSjWNDyDszKH1D/6r5cAdfk6tk4bFUAdNFbtEXkuWFXg0DTJpiruKd4HAFAJKPXHTtI7DPDaTMs0+gtazd0MNP+VfJ3Ou0ARls+8Jw/i4KxmVpBc/xM7JUHGcQ3Llh8iPIIUj55AxANM2GTpIrU5kL5O4mDbzUQopb6wQ/h8HvNd0bVAXRShEmMvrm3vdzTUwzzBWQK7rYqmP+b/jxnlyiA0rRlYJf/j2X7m85Lj/GurRdFaO3kefHGCHjfIK5cX66nOZI31sRc3eXkmOHZwABZF2jx1y3swStUkJuw+903+mQudMaZuSbJyWAN/BxXLZ3UuzFejPSiehiurxBF61afxc1yzIJhpdge8DbcQ/47aKvZcY0Lw/KH1/pyhtyJZ3gxtOtOaEAApdhblPe7W1gW0QF5p2wdB+PPzfvXREtwB4J4xlyDd118qQ/9HBo6a6RoltvEKAgyCmLZN6RKdKgGOTCddJxmn78j33clp51Cl4MvGGeGSlG0O8DT8Mk6TiIMGYr5MooCYjlKXgFlF5ZmdUQnd+6lZA7U1KRG+yal8XLxH82kpGFU0cqJhHr4WakPniFd474Qbs9+vRqzdOJMuKvJJHpBlaFZv9kIk X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27756c52-ca43-4127-c48d-08d8e3ac9025 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:09:16.8017 (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: Pyg1lNR/sDOTRyOVeL92hINo+RRMq0rg5UYPSzXR0dqfVHF1yze1HZxxhA09cQycYbBw+QvkKVsJ52q7QZw+ow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2318 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 --- 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) .../display/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 00000000..50bae21 --- /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 Wed Mar 10 09:55:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65645C43603 for ; Wed, 10 Mar 2021 10:10:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C57B64FFD for ; Wed, 10 Mar 2021 10:10:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232528AbhCJKJn (ORCPT ); Wed, 10 Mar 2021 05:09:43 -0500 Received: from mail-eopbgr130083.outbound.protection.outlook.com ([40.107.13.83]:10656 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231622AbhCJKJ0 (ORCPT ); Wed, 10 Mar 2021 05:09:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kBE1+SH/bRnj0bp1VTSrWQzm2AAP0BQluK8CPDMjNCwS0VfNHjK86Ao7VcKmVkQ7Ey47/3ielhTsz3sAYCvWuEUTNXLNbd7VX7gTdvKk1MfG/vIqUWubIGmcHlgmnJIv7XtM1yVC3iEGxXzEJzDTRuO0mSefPR3TaOYH4E/wE2G9ANlN5elPsjEQZS0I1BerQ+75m9Vh6ACDmwsGf7Y8Kl44gH1cWVeMYQV3U1dpuYkJF/nF5+3rzVkWasPA/0gVEcAb1baSRrzmllH7GrWwYAidXYzcAhxDCA/bXjw1UzWo7NfSNRVPxS4Ymm8khneeiegWEMWdPe2rT/NA5XIuBA== 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-SenderADCheck; bh=LCMhNQ0WiHy9NhbKTWRosyCcw4ip+lLITkw9ToQwYhI=; b=fV1usAT7jHQsiCBS4dAkfHrtuqijUxya3oQWSXJ3oF53dcRkH20MJ0QsV5thdxkH+B60ANa0Ni5mL3yaGLamxWeZG9zeG7rfRMPBUFPlwYfJVWspAFh45nDu4nhPExqGKe2rL5Uu8WRqQ5U7+9xmsTPbcz+UHr/dF4KLdaoNmqrcq8Rewc8HeZ14i61luWB7wd5s8DBCdaSZIJCVcC6dF9d7ce/mD8rCP5JFJgyd+OG4o/y7VwIWfa/EayJAm4zK7gGKqbgC9fUlFlge6N4LPRw6Cul+jDnj89ArlAX5J4/NMBPt4AMcXtdi5dQb3RwtrefuiqtAAwu7E3LpVubAEA== 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=LCMhNQ0WiHy9NhbKTWRosyCcw4ip+lLITkw9ToQwYhI=; b=B9GodvQJU+Dl0LmrCoKqmVCzTUIPqs5vy/AvJyAYeNU9yr11rgn8Bt90d7R6h3r+dkReDZMfJH+9EcKLUShn73g7yA5Zkqaq3oh0o2jAZR/axhM0qDJUu1fvXUJ5nQpwlkoA+8GHX4vziypgg6udIaIWQZTosrlzyHF2/UJRX4w= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0401MB2318.eurprd04.prod.outlook.com (2603:10a6:800:27::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 10 Mar 2021 10:09:23 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:09:23 +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: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 04/14] drm/bridge: imx: Add i.MX8qm/qxp pixel combiner support Date: Wed, 10 Mar 2021 17:55:28 +0800 Message-Id: <1615370138-5673-5-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:09:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 53c19fab-bae9-4512-8bc3-08d8e3ac93fd X-MS-TrafficTypeDiagnostic: VI1PR0401MB2318: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:133; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QswQxn5EoJEW/dmanu5mj/PZ2NMMOej0s58lcXmDM9GGdQWiMu+EmMm47dieZvQ2h4OcN2hXpsxdJTScc9CnBOb2ubdUuVS49/YeRf6gMw+orWIyVqFU3JX1QnNFcVN4dYofodHIYyaFEQb61/V2Y1f3t+MkQYZvapKb7XfuFYLM+TCR3jv6Gph0UzuE2aoGI3AW9JsEiOyHeNxRl7stOW1CBHpd75UjaRHeMNpB2P7SenF3/OihPvV5rQz+DxgyqBbIn+OC2lPAD1DYRaOcsxNGdWbTHFjtfYHwMuRTZlfJryKb3paxIqp4Zy5PhgQIaLHMfHmd0iOEWNh4Yu+mXoLvV58myxjY+LRkgQv87LASjUrGOcrjGCjtoXmKRdTibxyKnSQTVRLLW11iQuXowY9NfMbPvExtUS3yOgNNx+HnLSQ7IAoH8rGv+LL0TUX2I7XPSZYWlxV9NyfjNHmJizJ0SIm8Ruk8u6yElu6CqkDJ736WEuQSVwbChvBSYc87LAxDpr6YfqrSA+/qY5GcFtAfR9LwEdQVi5JAWC+ZhEPbAGoVJfvbZ+mtgFXTjxt/lG48Ju4O6Kjk8/fgCk3jwQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(136003)(396003)(366004)(376002)(346002)(6666004)(66476007)(83380400001)(66556008)(8936002)(30864003)(6512007)(2616005)(36756003)(6506007)(316002)(66946007)(69590400012)(956004)(4326008)(86362001)(16526019)(5660300002)(478600001)(8676002)(2906002)(52116002)(6486002)(186003)(7416002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: brdbWFbyERpCZfMdLRU4xTz9qg+FELIbePaiN0N5hqXofuKjMb4Bo91m24SbZGgz2SZjWFtuLTzABzbWEHssgMdF6YXOOR+Iss/08uiziY/iFJKkHUthGBHPOwrNM3O6JXewNPFP7UTxSymuxgwfIEKMgdFvbX0cqMWE+6z6fAbX5Z4UuK53Zkuz4zpm33RHUah+qbRoWeJqAaNgrTwUwR7IWwJWZTd9+w31dzGbTqN97nsIm13YWwjEIFiBlvE7wt4xpDFUmcjhMZrASNPrshvE2EIqywFJP+gUbg5qGw6ErFm86HMpRtqEeUI//oLSaMiOwhDSgVNKz520HyrCDRLQi5THZvB51BtHo/DdODlD+L/MxF/Nlwly+L6i/aqyuk2D0wFXLDKJLQ7VT9AVllDvh+t6nWnXzsgcf8nRzRrzangZbgUZ7T5IUAWj5iAjqHdbdD+l7LwO3s43UVMPAOV+/F/5+2cQxzTBA5ltHP1230q8BOKWMxmdIfKxWGnYNxH3XkGnBWAGFkoxBe80i/Ott+PMA0n3pr5DnBaxcL+zrFe51wg6Gpw1U99tfiHdI35QBg2rAua0NQUw3AVQn3f6oBou0pgXKilqmQdFXEjesC9G98u8xqOcStHRFiWsPhGWik0/SOh1sJx4KUnBPlZslCFH5Qa7qLiR7IBdVG/pX3FqEgm9qAvP5hD07U5gnFpx1Sk8YjzO5DuYAT3RjDCoVUMPA24Drag0KzVhAz2Fao1HKTR0BdfnlsaAUDULfT717JEab82EVqI2ML09VlpmhltSzwfD66NwJvNWi7VvLiogxIBakTzcpQ0/3BA0C+evzgGNMhrm9/jW2q/w3fw6BkqYN6mfqRQrg0bDXj3T+/IZO6uOm/w1SRwxrOL8AsNpf276QpS4sCoUK+3v6ebN7H2lpvBYE78U1XLksGVfuTEFM6edoBMBy0d8d377qQG1+UqUSbnFWa1ac7GnWtXsg4JLHKxV+yjpi4nNlcp1saLK7vMfcDFjSXiONbJpJpJWdTpf6G5EWSR/S099z6KQgn/IVoq6eYxfGo1G9at/OFwm7QPuYGfT1FZqL20oOs2zWxICPKz9ZQXw22H9oNZe3izBqrMAkcaym2QNWotsCLmOS+19vWifUksebW3KDYGd2wUKWJSrXs+q41+ToMMHtzEuslsfezXgW6U6QZbLjCae8yZC75aGSfLmCw//1Dc3B++yP21+FlGNa4fJBegPb98etWbg+NpH9ijxysVnOteTha/LxYZ/cGkZ0aHJ2R0jFggIXQnVKGj0d7tZR68K5WH9xgUItrHFqSdDO4XZcliX9tRUXbyHODLxMJJy X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53c19fab-bae9-4512-8bc3-08d8e3ac93fd X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:09:23.5209 (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: CKntyJkbpC0IXDlqlqSjDuVkasy8Rj2lF1U+l/zhBViA0W4egA0g/URpLohQW7Aw3wXMhjhnNPBDesg33wVkSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2318 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 Signed-off-by: Liu Ying --- 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 + .../gpu/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 e4110d6c..84944e0 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -256,6 +256,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 86e7acc..bc80cae 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -27,4 +27,5 @@ obj-$(CONFIG_DRM_NWL_MIPI_DSI) += nwl-dsi.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 00000000..f1c91b6 --- /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 00000000..7d7c8d6 --- /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 00000000..0b9403a --- /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 Wed Mar 10 09:55:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60734C432C3 for ; Wed, 10 Mar 2021 10:10:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1EE4D6500E for ; Wed, 10 Mar 2021 10:10:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229609AbhCJKJn (ORCPT ); Wed, 10 Mar 2021 05:09:43 -0500 Received: from mail-eopbgr130042.outbound.protection.outlook.com ([40.107.13.42]:27270 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230046AbhCJKJe (ORCPT ); Wed, 10 Mar 2021 05:09:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DzNDNSqVvuQo21wxShIFtcNJVYJ1nwdnoZdPZ6esCfmCmvJi4LzUNTPtC4ZsjTMdEeh3oFatcNaCe/FijsQmtJZAtPzJEkcLwo3JT9jpXVCyyOvNqS8CuMbhan7yptdHx4Gw41n8NwVz7foMlNoTV6XKKUcR/pyTk+j4+91aJLEaEBlHKT03XgHJ7gVngSYqenZNMhK75l6/tXA+K0U5kD5rqDUpHbxQr/ER6TGQF0cfQMfnIRmbPREVMtWfphNa+ktaQVyCV66cGlcMM1HoYbY2EKzY0BAGZVvvwokRK2Yf24OJn1FngwIdMDB1AlgNuUw0VlckQIh3ZeGq2oDtfw== 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-SenderADCheck; bh=K/q7PlZULgvJu7I/uCGFPoHPqerd5X/flwMZ3r7GdiI=; b=kw53f88bIZ8ztnwAVGYFW1fqVAom0i5mXrGWnvsxWDQ3TX01g5MUweWmepBJI2oZhuOKxaL+PuRILujC1b6EzDxEuSeZRb5hOQ/mTAb/T8LcVjE/lyxkvyBQgWKpgL3wMKxpiLur6BRt+VzKJDGpNGfQ4Yi7AhDd/0nC7xvEQ73MqWeylRTUqEXE5xwYOfsd9Zd5rmGYYa6ycyrck5HJf8umZTTV+eEoYrE/mh6roJiN6U2/iaUbquNyPPQBS5SN208hZAWGmW18QSf/aXee9BwML/ew8EJg5uEH1DUxvciHynGnVSXs2Xr+woFVtQ14Txb+S0zArjagHHHtEKFe2A== 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=K/q7PlZULgvJu7I/uCGFPoHPqerd5X/flwMZ3r7GdiI=; b=dYazTsl+a+dawXsaIdAuQfr6rqTvwWD/ehBbcL9ZUuyAosI6S/2A6MwmewXfaVKjtwFnQBmR4NUYv3KG4fEOsOaQPOBgaLkISIkdcQaeppSNkHieouqezjn93/Mnj5dMdGkxGfZ1DRsEyUGR5bvJHtAb1ltCPNFkDePEIuccATY= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0401MB2318.eurprd04.prod.outlook.com (2603:10a6:800:27::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 10 Mar 2021 10:09:30 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:09:30 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 05/14] dt-bindings: display: bridge: Add i.MX8qm/qxp display pixel link binding Date: Wed, 10 Mar 2021 17:55:29 +0800 Message-Id: <1615370138-5673-6-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:09:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5ce7d3ae-ced3-4d71-68b9-08d8e3ac9811 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2318: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1775; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mM1GhfXgFvLVW2Brb5jCMt27m2oCQIsHvhyfrzLMLdWVQaa0Ev1c5rQVbu25t9JrVBCZbSFrhVIJ3u0azSc81Jz8nrUxm9vprGQkPKdjrTZMmgQDj+doDYUGi0ucLk+kz6UoZy8nD7Dog68ExC8knXH73WOlxBEEncLhiItAKbmn+4hlDLYULhijqt+48VtC2hebRXc+Ql5sNBnugsm+EJmclAIyLaoQGVfwg1JkK4VP8cKKvh7k/tPYpQUodx4mUjB1t/nq1NpCiPuTESB7rtcNFkL0h8s+v+ONV41aLa4rjslCSJmRepyOLdZfybMSAac2R2cYqjQAOQwQlZjysZI01M44yRXjB4qKQGtS2k7xSLyGaYkgsc4k5bjWnzCWgxSz+sk7iWgsPmTmPOS8MaVTuFvacFkTvPjDXt/XHJLJqGtKn9IfKjoxmAVIaUOC/PTyYXSidztNa/nlcf7BzgfdflYiNe3o9R97hulHIqMPpR8PV7QPlVUSv8Hku3VRTkG5wyV/wkfHZbvqvEllNanAlB0Zc4LFPAmAGfSFB7C8AKvJcO2R1nuRpNNGqY3ARrD/bn+lLI+t6btY52r/R/hKhPkoJfGamqIRf9TxD9jU4tO8yJfKFayXHMvNBRdooTBRvLHQ8csCNXmYh04QXw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(136003)(396003)(366004)(376002)(346002)(66476007)(83380400001)(66556008)(8936002)(6512007)(966005)(2616005)(36756003)(6506007)(316002)(66946007)(69590400012)(956004)(4326008)(86362001)(16526019)(5660300002)(478600001)(8676002)(2906002)(52116002)(6486002)(186003)(7416002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Qb8wHxTIDL/3SQmwqa7+gYu3Hriw/u7IMMu9Nh76TQnUqs0FThNwGKnzv+8ODgyOz+1Cug1jzdY0BitHqFYOE5rgAwK5GLCYj4fCKRvrImact5v7ypcy7MCXyRxlvASJvux0aHk0wWtLf/zMqT6Eecbf9ET5QLAb0uGicSuL9Df059NOBJM0STI6Moop5G4i8R3Dttj1G43na3K1kYTccOu+Yupe4I0bNcwEO2miKwLatnkU9AF57yqShBRso4JbVVgdXydiXPywi4teqM2SLGIFj4f6nBBj8QIM0yltqn62QuZ9lBgQzlYDbor0bNyVTzNg7b72Lnr9kDmhSWv16tUEcUDrpdeH5FgBElYKJjhKdgdcW2zbhDSE9yVBAm8DJO/HJbJPHsHjwkNydcwsF5ToSGlNnNGOh0WxUzaepDK3Z43/cRHvTa6S+Z6uYJixmzIzMw7vC1l/YTqvilo1o1BMT7xgy0KMvuWU5Q1CA8b6/rfq8e3v4fegZCgG8xpmYVckfasiNCXC2szHCYSmocOyiijP2DezIcuB982jKC4TrHEsm6IYGZ4/MyOOSgGd4RQ0s9b0KbN729cGpaKt85G41m65GiPPZNoLv2VOhWqLHZQVbHKn/7m4x4AnPuSm9P3/iC5y36aC5faDZyhQDGRbgTTPZ08LH8m1ZuTbPtsKBsA5xwasn8Lb7LeC4LbtMFfbyoCOPOS+jG2KH0iIH10WAml+XzqzGGxX7Pfg3DR0KnFIml04fRgJItFHy5uH7M0o/8DtDdvzqPjuYE8X1bzRuGZ2tWrzHkqdVFr79+8xftHtjAjAJfBMCZ2LMuuOp5QNi/LnODyDj6fl08Qm6J3vWUevuKzuCuNp5xc4+PVAJBY1wT60fUeg5I1DoxVElbraGpZ6pxXoQzpXYas6oaZaxrixAoN6GyoJQKKVGB77nHbML8Ox3hGgtnWkckkPU2bloErkebH47WVoJNRYbFsnpbW72e4p0goAD7hYa1tikl7NYs9N8Xarj/sXXq0eH50M/CNU4I5dQHm9wSfIUxIdivR1tcTUEBw/tLbwF4xK/2TCJway600kliDVNy9rncByEIsWAQ3CMp47+5aXYFim9MEysBQ8Dap2do+J5pRt+BJoh4Naz3KMIe+WaLY8pVnp4W0VY2J/4+MZBvC2TvFwqIQlRrIQaPs2RZtxpK3MHJuUajdKhsOK+A77Aet1RhCqRTMT7ABVA0x6BpeCmpw7YJqnne28M6rzbkBvSMLqAbTAQk/WkxwLgDLTn9N/t/lfzw5lv3T6gCPVs5741n0/b6WC0iGV+tUHyfwPg6PBG2ppawEewzURm76KYMyV X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ce7d3ae-ced3-4d71-68b9-08d8e3ac9811 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:09:30.0791 (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: UryfB0XQDVctWyw7KPbkmBB2YLaIqGwPzjDDS5knv0nFCbv+0H+qSjj1nyWLKcN9PoCw4EhEaYxje55OodBdSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2318 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 --- 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) .../display/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 00000000..3af67cc --- /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 Wed Mar 10 09:55:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 430DCC433DB for ; Wed, 10 Mar 2021 10:10:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DE3E64FE1 for ; Wed, 10 Mar 2021 10:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232621AbhCJKKL (ORCPT ); Wed, 10 Mar 2021 05:10:11 -0500 Received: from mail-eopbgr130075.outbound.protection.outlook.com ([40.107.13.75]:34691 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232420AbhCJKJk (ORCPT ); Wed, 10 Mar 2021 05:09:40 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=buHU3n3Lo6uGjwl6mZQjhU0ok1NHcEPYewUYlYvktPgOKTIFc3cBY4J3pmJ8cqv1LEk1QzCP1oL5gy95iT95NZUfZs+zjLRREe3GLAgwit/ThkXWpHtoNo8XINQOGkn8D6cHiMJtKCXgs/p3jmJKoDudWwBBdt/wSi0XHhFYx7Ikn76F4VesGK/LgDE219zsO0MPvZVQNry9uF7/S5MdHmUGtDLRpAOIdvIqZbbcbSEhPZTMYjO7NpnLDnluSin8Bc+PZHRwrGi3wF57Q7Soe2ADCuAY69JjDSydlYf/u0U6BhCb54BGvy/XyTJvE75aCWt0ICDK/DcKXzNKzXjJjQ== 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-SenderADCheck; bh=46UgzkVnwpzfZGZ5iSOIB2PzEXgN4ntcGflpXKGp77w=; b=PpsM8ALL+a+ikGoqQRENRLY60dAdo1RPxjqA4kRESV8vT0xI4wlUAmkGotTFOt6/y3jBOygSSxk/x/xUq1cYrZjyB+6cgmQ7yKIAA7+UYZ+hPAOYwZ/zUMlwzXoYj53tQvi2yDk64YV9rprmvemFnnv1P8tsoDE9XdYyBvd/sPPd/3UmLIIIergY5t5ljh5hGFczXp1RyeVmvZkN93oDfGDAx+w2l7QhAFEveuG2OJFB/BXCKL4j2QwMzpHR0pykVtZMHWdUYdi7bG3mdSwIXQUUPDBl4Uq1aiYc52VCCaV0z1H1l0wtRdyl7Y3qCxYqOjhif7FTrSZem9oWhJRS2w== 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=46UgzkVnwpzfZGZ5iSOIB2PzEXgN4ntcGflpXKGp77w=; b=sreWkFejhHgXtB3ds/ZCx3rrzuoGLFMZtslyUe2yDHllrBENtRvh8xs4lMa11Q8aOMJbzmnngGXfG2JrFi+9TfhXY0lss++w2bCqZN+i7vUx4pb+q5RPw5pFjvvpuKEgoRz20s6j3YZ7DsQKmWDksMLfPBcox4op6nx4CGKjLSc= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0401MB2318.eurprd04.prod.outlook.com (2603:10a6:800:27::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 10 Mar 2021 10:09:36 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:09:36 +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: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 06/14] drm/bridge: imx: Add i.MX8qm/qxp display pixel link support Date: Wed, 10 Mar 2021 17:55:30 +0800 Message-Id: <1615370138-5673-7-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:09:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 696be50a-b0bb-4e17-da22-08d8e3ac9bda X-MS-TrafficTypeDiagnostic: VI1PR0401MB2318: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UC9gjmGWoPdVysbldtkm8SyNqpn2OHh0qdCoVjcgnokljdOHtIqs1TL4kSTxKP7GOA0JNLNVKlosGIlxEEGo33Koc6tbLf/b3FF3jLv5Q/4UWfqe5pbVAO8wK67HZ95+kRepxS/AaA4GXWjmw9osOsY8qgY8ung/rhGRN0dTZWdg2d5+MdehcslxoMBfHAUty0oxf4e3wJVYTwGDPIG+lJt/6gX0RuhwgnXOj5RkPuS2Cv2kZEM/UHxJtH9BO7szfXk2kfxufh6hefbkVIz2kIHzjPPDnyHkr/u4kHhqP7ewjCS1JNQEAQubBR3Z+WaKzJm07Or8Tic1VZHmO1tdon7i5F3h4EwhmHYVMCafST16F496Sy9MbxcDr+k29GKVFe+IraylhEbXH0Y5nwcDV10wMF75YZztrkz/+QBj6MmhtuvsUMTkHItirI7h68ypWoL0OURh/LnR4PXyi0vS9+TXZX5caOqly7tTmRmzP4MrtNsgGOsg2U9WOUDZsnEUbcS5krO0nvXcI4OX2WbrTHkf/KQQbD6J7W3il6zMr5VKPsShCxQS0nOpjvwYH+oJ3WdwMk290lhejEPZ3kcFBw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(136003)(396003)(366004)(376002)(346002)(66476007)(66556008)(8936002)(30864003)(6512007)(2616005)(36756003)(6506007)(316002)(66946007)(69590400012)(956004)(4326008)(86362001)(16526019)(5660300002)(478600001)(8676002)(2906002)(52116002)(6486002)(186003)(7416002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: PYkKw39Q//LvJZhUz3RR3szcHU7Y5SX+Yh24PyHPAbZN6SQajiZpLD7dscRTW4rC7Ym/jWbHraOSuZ75o5oXw0c+xjdSVhZ30nMgeY0+3oAEzB79VP8MYyyDbayuTFRp1Zload4bppoqw/o/FewEjwSbgVtzTLmt4iQPEFOptNQmgXh9pNkcMVmbm17SPziANf8gHdOsUAx0Ln0CPd/EyYd3WVtGt5+4BR9kNqCgggFcfWPJJAuDzF6/1C9cbDYKont6yHEO5WQNP8UMGSmAITEhiH6aKNtCXCLfTkfK9S9DxPORUHQUT6DtfUwcTdphJSVVl9YieW7WQYPfyGCZyy3Cq/Ak1XbogGvePujBEIBHMAS3ImIe+ua1GwuDOYX4EHPiPfFHcZCE4hftRyvS1VT1xycU9uS3ObgUNR5KZBGgiVjkBXA/VkdQxV3qP3Y/F4eR4jPEBfzLjvolAe1IFpfOWpbWtjjnLN+G4NsD30t0rOa16I64TTzarDHJT/ZXCC7WsSqhmY3QDoyM4aZ/Ef9H+S72p2eH7HuGA9oFyrgh7YEznL5LTlCFyeRvs9glmsXqfLU2nMZpqQ/Iorg1ytJmRPgoy4gPoADP7WfAxUujY5o3DWgIrZTzzfG3oPHBjbomawgS2avz0VP3dQAbp9oKoF0B7SZyVFxyMq1m6L86zt3IQQ8CKZS4X5XstsKNoO51qzdz1RCNe7vXAmAduKoKsailvTUB3Ppljt4SRK8kJDEYP6nwZPkeapJcLGOSmkxJfZXy6qoJ0dxEJ40tnyIUDBbC8w5XuysFYKn/cC3ID3wMox5HLFwWulCl7DzQLMadBHBig85V3Lkn2WuPioSiN0a6M/RM4PjZZ62WCIipmApYD0cwGPXBiepZdGXpN8UQcpO9WBNjMZRpaKIdr2MP4gYnyEp7dj015B4iULK90M86lBo+jTQXXtMC71MibD9lr6inzXLo8K7ltOcCTfqbW7mVSEW7GzMgabNufcdvbC01qLd1BWdl5mQsgf7wSF8/opEQ5Lw0cZjaqtri8IL1VTAwsSpWF82yd4PcNdEKl5IquW+wtQX+0TCP73+Tf41lXc6a2b7SlvL4zlcWI6e3aW8QDbNF5MuodKvZTG8oXaOwilqf/IpNR8oJXfaf9hRe/hFgHmEM06FISFhCrdKRWkY8EqPAnkXneoWkJKWreSuvD9rgnmO4oYXebm27F/iAB18Fk1173kgAVFSfNPeyhaexA/AYujkNY+j1JhuNhw0RO+mEfqXzmBoqBzi4RFT356S6GDOnexVp4XZFhtA57PxRw0FARKzEtAsNEs+iiJShSVc5jNOOokJ64KKG X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 696be50a-b0bb-4e17-da22-08d8e3ac9bda X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:09:36.5504 (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: Oj5axFWPF1omkj1tlwqbO3pnhTAM9x8wjA7NdTbFkC6XBC3QWENFUNV+wAZ2mpuGY2wrl2w2N/vfGCXee9zNRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2318 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 Signed-off-by: Liu Ying --- 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 + drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 427 ++++++++++++++++++++++++ 3 files changed, 436 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 f1c91b6..4d1f027 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 7d7c8d6..c15469f 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 00000000..a549624 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -0,0 +1,427 @@ +// 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 Wed Mar 10 09:55:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B137C433E6 for ; Wed, 10 Mar 2021 10:10:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D60D64FC8 for ; Wed, 10 Mar 2021 10:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232566AbhCJKKN (ORCPT ); Wed, 10 Mar 2021 05:10:13 -0500 Received: from mail-eopbgr30071.outbound.protection.outlook.com ([40.107.3.71]:28370 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232568AbhCJKJq (ORCPT ); Wed, 10 Mar 2021 05:09:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vwka3FKQGlPWZ1pUKAVBA07/0Qv4rlm+EOiGvsGqyGEGUziAZ5v7ra5tpNKbGHeIMd3uV/o+QCV8rG1PztPpKQOyUfRUTv898gwlp8EgFSIGNgJgpCR4+bcYDzwzNcSZXYqQq+JttkKRDT8Hr2jmoO73UFCssVl3/NkFgigK9LrlfG1lgRa6I94RJMb6RdD5ipCH/jBYoHQy5pMQayW8eqSDCHiZabKkegxK+1EBv9oYp1O2cVB9Yfs4BPGwPtQsuQdhPQdXal1/irqqQWMD7tQjnu4KuzgEER2r7PVtUIzoHI2GTW6zx8CDkCDSk9zO0kpYEAi4vMemZLJDPK5f7g== 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-SenderADCheck; bh=rnWpmM0X/4Y/yLtRyLpcQ1d8AJTqEF6dyg8o70HruRc=; b=F4NpiPZ0BGMV1uqKST0o1037NSvFsbq/hHC9ALAnPSZ7YZTs3Gh/y9+QUwAh/lKRmwAbexBG5wTs2EXQDy1eoh56SK4DzQ/LnP398auJaiMlbjxHhn37+P1zlH6CAzCCMgP8NpifllHRHxZ4OOn6BC3bKqbsscxh1CWrQwMvrlyeYOtcdWYRFB8mXG7NSgNuqOtDwEuRSk+7ZwGZA9pb6PB1P6q1HYuOjpTeaWdjDG+j8q/Vqhr6b8Oxg/hBTmZw5l+mns3uABDtmBUdZ/6avj1ydWkFhDAaCN1FoiiZ9BH08Sh2zRiJpA8ur7MjDPaucYQ1KYjl83uxibY38Ea5wA== 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=rnWpmM0X/4Y/yLtRyLpcQ1d8AJTqEF6dyg8o70HruRc=; b=XHq0nN0WrPk2rPntaUD3IBawh8BbswFkohLA1pWAApSb/jykmKqFXWZnhRLHpYI47LZG70/DSsDwaa83G3W5jk3zaWWawodu78ELo8KK0cWtwvHgZK2XO16ITIDDuF0qmgjRlQ2Rnh2apHnbjsmbAMUaFw7IfGmzTTLau9A0BuI= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB2813.eurprd04.prod.outlook.com (2603:10a6:800:b1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Wed, 10 Mar 2021 10:09:43 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:09:43 +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: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 07/14] dt-bindings: mfd: Add i.MX8qm/qxp Control and Status Registers module binding Date: Wed, 10 Mar 2021 17:55:31 +0800 Message-Id: <1615370138-5673-8-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:09:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a1464fa2-9da9-4fea-0494-08d8e3ac9fbb X-MS-TrafficTypeDiagnostic: VI1PR0402MB2813: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AK/CM1vB8J48M95ZotgVhNEBB7Avl6zXbd6RK8vBvboy3/jWpa22H2RbTli36uaDHQkFq2FqWIyrUcZov2lWUyRE/MVppBoGZ7fovpk+U6iZ98Vquh5HV2BQiL8178d06xS8YIzgSBe5+2MqzTiQTHtEXciU1SQINujldv0FJgba2Q6jejsBF8rhuXdONUO3MyarYS9TxKzBQF+coQLGXF85EKiKtP8vH/FhGVseiG89QOAI5mMIJ+vBNeUs0tgENVEkHBoJbExuERAUFcmO1Ds5EJsaXKU4RYproNo2WOoD9S+qk3QQuwWf4pfSMF64WmodvoTUD8dydRxdAO+1qF+74mORl+nCa5BEjQPH9/d7IV4zON1FdYSCUciHfSwQpb4tUtwqXvLnO3re1iydGeWE6BuggHnSPmuSOFRkHy/Teu/A06t1NnoDeyglCxZXnqheftDlFyRPjU45Xz/J/G+k5GD7SD12DoSKKnd5iNPyaWU9MOv7pbwxowbMo5JewVhGansPi7A3XnBeZRhl5gYB8BrrXbAU+XckaC9B4hKZgugy1fnIcLOFJQodezjXq9LxAVZ07N7zc7dPnnzTFEjZkNi0X7PPfKNNbo3Cf8WMFhuJTvTwDCA9j45WT/wICIBJrTfDBCysw5z6wPweVw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(346002)(39860400002)(396003)(136003)(8936002)(69590400012)(6512007)(6666004)(26005)(36756003)(6506007)(956004)(83380400001)(8676002)(2616005)(5660300002)(52116002)(6486002)(316002)(7416002)(478600001)(966005)(186003)(66946007)(2906002)(66476007)(66556008)(16526019)(86362001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: dOT9XY+EcMRBWOf0DsfNQQfWdA/b4PBR9OPooktLfK1wsXrhUBNs0YpGL1Yfx3DU61wxdsiBv/fpTt6uciWb/2R7ZRfvDfb1dYpD5q2sbl+Tc90rnq4atpDaEJIM5MbUuRrkAwOrVm26QGyE4qQzxrEnXc6Zti5R4Hsdb1Houxs3ZaDncZ83Jdx0zNKlez6WMLn1oF7TsnSbF0UDn1UnUO8EVNzOsbgbVia1tpBwQY62qbuH0Ob0/TyZ1W21i7hQNpURTWx6Bd+KGsLEkMypUs3lxrjUesjva20HmbWpvg4uZRRUN089nFqqyHIvOYjBOHyy2ppvS7bBQFFlPoVaERgbMQQl674lTk8GqxkoUOpOoUl27/SnKOgYh5oV/ZKZnGDhj+npeLeWCCbT8z8jbS0JAuvYXlytonsRFJheDWvAFy+817TO0QvOrOcVg7lOcwDOfpHWEHmxCabI6jpYSWPFQAggVY8cF6FcaRApUcX9aOaek6PLULANTOFK2nhQucfCMUhzzDQEXcoV5hNl6jhBUM4jZpb/S09yqAGgEXcETcXgULjdkVSjn1nk6Xrc3/lCYDSz6LhCXMgWbiHImYaEll7FQFeESh0F4G7LTNYR1GRQQaesiCAMNfG+LhiQvOyUwTj1lQnroVpD0sS/+9dJf2BGw2ue+h2v/rK9iI/0orjj5ThkYzFpUK+erptGTj8J8U7TXYdDb9KXkz1yqPGRQTrAhxhcACPnhnKB2itkjU57hYDr5mYEe2xgYQyXyTKnmtdDI1Q3W2L14QC/Ilv+2yhSH9vRBRWcZTB/wuDe9rXNLkFKmOL/9z0q+jq2n0vrpWSE6nYuKKXyFzeoQEsnbUhRIi1jLp5bUwhmUNsKJN6kq5fuUqf+AsnhQby7phZ7ao4KUFjUCak08w/WBa8/GcdknOEjyEJANiibTzjJuoPAqUMUxtzSONYCn8/CVZkylkInUFg0csgI2wC4rPp/wdTSLedU7PPrP1HFSXBwJhPUGZxIOU4DF9Yl0igwxAACKqmVIzST72/veLusH3xzIB1FY7WlW029PJ9dQM6msr5KOWJThjr8A3ulKrT9TxlhHNd2VszXZAEvxXJmOqMFUaCmC3BFMXcm4+x0J2vVAnbDT3uhx2NAz1yEkjZApolX6Mc9aVZWMHqPTJtVnkIryLrr4SfXbRWEaKyYncv/82Z/PMqKiyM1rHXBGQNB7aHb3JbYXD8NHZ6bariSQ8V15LaDXrCZ+S9zf2DTpryAKi2UJIRZltZKSNMhvv4S6GLJ4ryPwD8XzYpApuMnIAFKEZBm+sk7aeRBjj32Dbi/V0T1jP/nHz0ACGXEtQoY X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1464fa2-9da9-4fea-0494-08d8e3ac9fbb X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:09:43.0626 (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: SQf8GCOjxovPh5xkcofDqbo3itxDOE4OvJDq4OGamk5SyLqOL9C2zhQSAlyhYeNRuk5zfKZYh1oSh3Ce0zHHrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2813 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. Signed-off-by: Liu Ying --- v4->v5: * Newly introduced in v5. (Rob) .../devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml | 202 +++++++++++++++++++++ 1 file changed, 202 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 00000000..0e724d9 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml @@ -0,0 +1,202 @@ +# 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. + +select: + properties: + compatible: + contains: + enum: + - fsl,imx8qxp-mipi-lvds-csr + - fsl,imx8qm-lvds-csr + required: + - compatible + +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 Wed Mar 10 09:55:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127539 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0236C43333 for ; Wed, 10 Mar 2021 10:10:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 694E76500E for ; Wed, 10 Mar 2021 10:10:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232632AbhCJKKP (ORCPT ); Wed, 10 Mar 2021 05:10:15 -0500 Received: from mail-eopbgr30063.outbound.protection.outlook.com ([40.107.3.63]:14054 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232611AbhCJKJw (ORCPT ); Wed, 10 Mar 2021 05:09:52 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U1BkNUsJHgy360PU8luNxuZUbMZFU9puSIYz1CgMOPdPZG9HyefQbjdDHK+ZXZhQjYGPpqjidoiXVRTvK8pgswXXll08iPco7hk1mZPu1OfFub9TBRi4hSZl0spiS0gd2AWMI1XS9zaInu6cJx9WG9EFgOW9atk+/8DFh9kuk6jbyMelsDi0rooeUDXh2pB2hLPnAaAQZRg95jbemVQm1rifpWU2Q81DPhiJFNxuHqQqoHyMsDeGds7qIate+pFyVYiHNzrHc3nfbQ+OMKecm5pVfjkovkC7DOMiL10XJdyQQ9l8f7sSzI0RpyECdqi995e0OD2eSbhOe9WIcfd8og== 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-SenderADCheck; bh=UdKhDbmlg5Za0j6h1Gnm33l4N/AIyHSMNJq5P72b+jo=; b=kR2uqAZs92/1L+d9ABwwBeZQnqqve1R1ElXIWhSwY0nw82alMxxNBDxRkM6Qaa3uJXBXVyfZQyLxH/gYj3kRwJuCNiJAerDJlwrsmcthvZ2wM86pn8GWWYRcbG0DIIwbJ9x/Pa5TpFN5dBXdIPP0WW8P7O6M3HxIknHVcR62YADfchWFNghmQ/aLbIHP2IrgJocjspy7kUEhURChDcM4IioUJxmXVpzZvcnQmdld+zMa7FF7esyedR7PJaCthfyPKSFQuCxMx0sLZ3DYd3dN4saHNKm9c2NZB/EbPoxUoiecw5Q7rE3+kOpX6jgJkh8gDfB7+8MfXdquoHsaSR515Q== 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=UdKhDbmlg5Za0j6h1Gnm33l4N/AIyHSMNJq5P72b+jo=; b=iFP8D2k0iHt2BVu63QpCDep2V7dQmeTAeQjxTseqtAdXBbc9Ni3+UeNnt1HKyjmD5usWU/n5pqBwDDxYGAec/MiDmz/1vUGHOsnKed8ay0hj/Hj4oqxSAWbqlcsu25UQd4SCKzlUzTiSCW3b94dPKPeYKO9O2fDIGIpxpqwGql8= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB2813.eurprd04.prod.outlook.com (2603:10a6:800:b1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Wed, 10 Mar 2021 10:09:49 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:09:49 +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: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 08/14] dt-bindings: display: bridge: Add i.MX8qxp pixel link to DPI binding Date: Wed, 10 Mar 2021 17:55:32 +0800 Message-Id: <1615370138-5673-9-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:09:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5e19c7a1-646f-467d-6e4f-08d8e3aca3b3 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2813: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5fX+QTWDAthLxY9Zk8HxACuRx148niDOVy3CJIHY4gvnr+3j9hkbiyQB9bRkUWW+NW0j5p/VvObCgzxAXKA3S7uw4e5XGCO/b4XR/11/STfyQpDOnKRpA+bZUiDqsTNGTpr8bWM8frZPvXVgA554d2wpqhx7dO7IOB/WvwEI2EWdNW2FqDL05Ru+hhNmN11l9mrFgI8pjnM5W6LGPaXLz9iXrPmcE/bR7GW/UX7We1WrBbn4QVPIvkfz358LrbtoROkCZEMWDC9frXNepVioEiObZugFY/243vz8Xv6qETxleJmOU5WMmC+djG+UXsEXCufqJHDudBc7w+ieDUogZqVW0Ji+F8g5SsIf0tsNQm4BaHlnB0MzcR9RAwZ/gPMU2v9lKh+fkRAMEbuNGZ3L8Pl8h0aX8m0LCQiES30XvSYYYsvVQTdl4fKYjyuD0GM4eC6ZG1L6liC9zSYrR8P97AdgTzymkt5xUGREYBHt0J6j+R5Mfb429/JMyqOTARirc+wwxStfQfZ77NQWwlWvwL4Stm7kRu6J60QxUF9f493B6N4wY+i8iDd25cIxQMEZcV5YIAU9SQwtHh27M25zRA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(346002)(39860400002)(396003)(136003)(8936002)(6512007)(6666004)(26005)(36756003)(6506007)(956004)(8676002)(2616005)(5660300002)(52116002)(6486002)(316002)(7416002)(478600001)(966005)(186003)(66946007)(2906002)(66476007)(66556008)(16526019)(86362001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?Kz1p8aWkXkMiauE3EN9KXF9Zff/700?= =?utf-8?q?HK8Rowwr9RRXe85jRJQmawXc1jmJRz4yv0viChCT+u9CgRXuFBP9JW4D9jrxcMfEz?= =?utf-8?q?efeuUmTQi7x+K+ttT6B8Dz5FbODeh+n5L0OjWQkr6UZk+ux3iwjLPOOaw2UVNopfA?= =?utf-8?q?3BcgLGAovRAU3Uu4dv524ZNdP5JqQ+rUmS4pWVHKMmNebTbOa35zTNB5+s2NNa7fK?= =?utf-8?q?leiH23dOJ1F7rY/IzrgJipRkmLmuB0rsq9e16qZDDtxc9aJZ1V5jEeDvt+HfXVJaH?= =?utf-8?q?Xgh1y2UQ7zjr/yFPGbhN+8ZqGO8g/KJNBMhrAwzwr71cRvUoO98VnswPNZ8bRb3h2?= =?utf-8?q?/+qPkLw4IBJH5fKalhj2wKo5sZmH2L286mv/vemcj475ChSepwSn4HLNAhF9g+JxG?= =?utf-8?q?wVuh/lSr4ImMAR3fUFL7BNbEZjECT5172CDmprqiLK8/mU2mJq62REoq7Y+P9cSZL?= =?utf-8?q?WBQQ6bOQY1lfXf7p5f1l1rwnowJK3YX38X5HbxElB522CYN121vS4pj7xkDuOtUXj?= =?utf-8?q?hetPN/bdKYLCMabpzKvFhdymq0sLm+KUFFzltEjjkitQAHcSLmx3qhd+LoJGCZxkf?= =?utf-8?q?YM7E68SmBfdC4RKPysxo1TKb2jy483g2aqylBj9+xfiyBqlFlD9nMrGCYg41fcwV2?= =?utf-8?q?uyet6vKdr1/CPNO5JorFdvDi60r83ZgGeYQG6y0i56xgm5GpvThNbcYll0kZckUnK?= =?utf-8?q?yjjdaXNQSddoTKTokJZO1dfpmSkga1c0Lq56nTLhVqlkkJHwIFHBTHRremKwCNTwR?= =?utf-8?q?8XynO6Eh16kL3F6sjOUgbTXOjnPTdFFxU9Cs+TFRuifCZR41jo5+MrG2Cg+K5xzX4?= =?utf-8?q?5nYhOCyatZjn8HR+oYexrDK+nOAV7XSG/vcWQ4wDXIAO+6HgXg8J78MWr8a5D00Ag?= =?utf-8?q?uSNwQF8K1/WrxYA268iV1O0EikGJYx4JfFo/GI2pWl81UptefgYA2DZn0z+12/K5D?= =?utf-8?q?XwmYbMoXDLBYze54GaAOGlM599+mpqcGyR5Vwtv6gG56eX0LInIJJaAtzoYlYgPM3?= =?utf-8?q?9TXqXwDjkXPJemVa+Tfq+a5omJbHv1xsKcmmakShDekAQR19n0bURpE6+eDOguuTP?= =?utf-8?q?gFIwYamxE06SboTRoKiGyYbz6F9JjFEVUDxdFmEajAiPE/YHEA9VqEHLD5iC1IXMl?= =?utf-8?q?icbkUyLKEsDWSwt+/vqZifQ1Gdzegvx0Xfe4gvQ36IwYdRHY520nY5mdUbZPrfYBR?= =?utf-8?q?nlcG84iWqtFeV6ebV8lmhr5eMNLlSglyMtE8HmID5v1qwuCk49fzASxzOowR2c2mM?= =?utf-8?q?n7skQah4YeQFkc?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e19c7a1-646f-467d-6e4f-08d8e3aca3b3 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:09:49.5909 (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: iVZ+ESb6F/tG2Wtl5Eb2Naqjl5+N3xgrhQiLsSJazq+Jq6/b3csYAKTV1kKCDuCSmGl5eRjLDDWRFPqb7pHeVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2813 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds bindings for i.MX8qxp pixel link to DPI(PXL2DPI). Signed-off-by: Liu Ying Reviewed-by: Rob Herring --- 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 00000000..e4e77fa --- /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 Wed Mar 10 09:55:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60A80C43331 for ; Wed, 10 Mar 2021 10:10:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27C6764FF2 for ; Wed, 10 Mar 2021 10:10:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232633AbhCJKKR (ORCPT ); Wed, 10 Mar 2021 05:10:17 -0500 Received: from mail-eopbgr30054.outbound.protection.outlook.com ([40.107.3.54]:57230 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231908AbhCJKKB (ORCPT ); Wed, 10 Mar 2021 05:10:01 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T8JQwnDACW8/7SCWiGJXNN0kgVeDFIkKmtfsKHeZNXZEy04QJIcFKOyp0yqd4P/qpaaGNoQvltq445EfxPc0OFY5Sd0liOvcth3n6rskUmThkSxUeyDIRoKQe3hXW5aRTx8Lm+hL1hzDUKUo2p5QAyaNXAPUHey5e9Jn1Ourp7t7nZgP+vs2VYMlf5MYc6ru9unW48YxtC+a3GRO/098vS4rJ2fMqnjsQEIRDK9OZqedLntA0PAmhcya+EROF715WeOSNTxmpUMywVDeVR0ME/xTWnYRrS8aSt5W9FSmr7zQ9KvFW4QJrz4hvFOW3D+v2xloKFVuO2JVZeTohP6xdw== 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-SenderADCheck; bh=OOdbNl8Q3/9eong8LMlu769IEyT7I+G4D0T40NkHEIQ=; b=RbwV6vU47SiQx5FRTuXseRq3BiJ637sJM9atyAgWcIXBno6gPqrgiQX0/5l7WgW489I5prw/8ZNy9EQZJnj8Lh/ZqFFCF6TaC0bPu3JCygOu/KUU6b2UNna4WrrEaDyd9Xr1f57qRPH7w7SZOkoqazUoWyjbxUeKRByQ4WEjn8KMwf4U5oKodOnUAB0RNGotUL8mJugSGvhu4ylhYa5GOGBQ//kvYl3Dc5rV4kxxH/uEkJaEocyh5En6UhwOWYnHEPzFNYfr6SIEVTqhJVsSEpqX2TZkgpWKdy0OWdKIWlJcTIjrwfnJ5dw83gbVH9Nhyd48ZT4NIzfdBO9Rflia0g== 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=OOdbNl8Q3/9eong8LMlu769IEyT7I+G4D0T40NkHEIQ=; b=mCWKnkXhXiAjr08P+pyQDNCqDrPUk7AxFTiyWbGiFaLJGHVJ2V7A2MhSGiWTraWF7ukCebw/jt7Wymb7Kt0ltyA04UgXTxUfHIZ3IYL4ZSXVAtn4y/6BrZHpI1I47TzsNrHk1uUoUJBTGRlsJ2hApP8h9pDHDJFIJNeBIH4FzO0= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB2813.eurprd04.prod.outlook.com (2603:10a6:800:b1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Wed, 10 Mar 2021 10:09:56 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:09:56 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 09/14] drm/bridge: imx: Add i.MX8qxp pixel link to DPI support Date: Wed, 10 Mar 2021 17:55:33 +0800 Message-Id: <1615370138-5673-10-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:09:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0573ebf2-2493-495f-46ca-08d8e3aca78c X-MS-TrafficTypeDiagnostic: VI1PR0402MB2813: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Mt9sKs5JnaTbgMJ/0pYDNnhJFt3G3wJZiCafCtAVe5EGnM+k+Bi3M135qSrBS+hkO9kgxXMnC5yoUSl29rp7ehfeq++jQeBSP4Ha0UhK1Z3OFKxXN/9A9ufbnJP29nJ4oM+I1HvDlemTpxNT1qzM/KquM+Dkiql/+GhAgdLKMZz+AzT2aVGn0ENWTMTEquKLcmyTL8g5yPEwbteBRl6+Ipc6rksaDDbNV1jCkucl1fvQaHxLmtpEybNq6mQxe6O72hGOa5hYIN+rxCvKaZ46sZsWSztAH/furo916rNfwJUtJKjTbSb2miHYekiq3VOM9u9PrfVIMR7vAIqRpuTbJOJsR3rC+C3RSChOZmpO7rLPUk0eUDAEOZM9s3wj+cxAVg/yr8KeKWqTEZxbsWsTLx2DT7mggzt5zn9a1PpzXefP9XC5NWIUT3FJYMmob04xg66JL0u/a7IHr++ZeeE/OIJtyBTOtVyQwXG715pKkNyHf3yskWnklcXQLqfBFqcD3Ih5111cGYRzvA7TEccGUw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(346002)(39860400002)(396003)(136003)(8936002)(6512007)(6666004)(26005)(30864003)(36756003)(6506007)(956004)(83380400001)(8676002)(2616005)(5660300002)(52116002)(6486002)(316002)(7416002)(478600001)(186003)(66946007)(2906002)(66476007)(66556008)(16526019)(86362001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?dGfZSUjx9hbrdwtMx7nnhLtcLeybsd?= =?utf-8?q?eW/YXOkwXETbguAeyA2NRtW8HSRWJknIiapuuuopCsxU3FFIXnNvBFKKDI0mz2Lfh?= =?utf-8?q?c3SXqnqEbEvc+M8dqLQd+TxAvmUPPU+cKIuUCCbTd72BbuctiFAEeynz3X50vb76b?= =?utf-8?q?Rlu1N4aZEnE5CZr+2W9KdlhFS6GsuBSWh8nza1kOt3gq0bjKfs4CBjCvqeBmO53O/?= =?utf-8?q?c/BYWqxCvYiyIGs0MH4ggKj2xWVH16D5IKPxqSFR+VlpkzseEbxbsOJHPvCLTt4Z6?= =?utf-8?q?7LwDA2C/SYErAtN30nltFvsYtw/UXf/EOSf6XLFfwiUiOnXmi6qZu5KaP5g4D+rst?= =?utf-8?q?FJ817uWdI2rSYtILM382RLv2HCiT9pT4r+BldnY4wNP28v8/5AHMbHxL1o8zr6G4N?= =?utf-8?q?PjpI9e4MLtmPg9TOtqF8ekXZvHLLxlfGq40UJrG9RYoCTLEVlYCH2n16mXRfJ7g85?= =?utf-8?q?5+Xeom9EbvRlyUctT04g7ce5xrhe8QOcGPZ91y3ZSMylED6U3CZbOHkMdUb8AuuXq?= =?utf-8?q?CDvsTxE7ydDGWDI/RfvB4c1/ft1fBNPOcUiW3b5OGRkBzVj1/DI0971gbcaLOmuyb?= =?utf-8?q?3hjUDy7oBNvGSj+wS9gxwJiiKQsifzlngclyX4OyT2NQy7QQYfMk5K3afLVU+cOUs?= =?utf-8?q?ULGFdte5QjRy/9LERBpOynaTe7Ew9EPYp79yNBXwyK4TVhxIjuBZDwh2YD8fgdgVJ?= =?utf-8?q?ckQVmB9KcKNuaxxn9Qvjdk5lPYLayZxxlNiSBMSOCqFDjJ+OxIOzEsQkwCBUWQtft?= =?utf-8?q?1nuA2oqtDkdgYvAORWdUpNHFkL/k7jeFswteg+v4eEA9PTbZrKdyzTdlss9j6MhDW?= =?utf-8?q?38PuH6w0R9gboiOpI5CzHCwu8hsF57V4ID/3B6bOHh/UZDNEKefokwsHuIrzjIBpf?= =?utf-8?q?/gMkKGprwYIMJPRlqeMv0vnq9wLsY2hLNozcKG+g7U9VpsZi752JmNpMb2Syk0rNC?= =?utf-8?q?w/LuirSOMGfNze25Hg3EMJ/5ANJ5KhGFwCzpqoGTgEjgXXKGvQqb8NjWfEZLeyPHl?= =?utf-8?q?9Pm26UoLhGxVNAD8oGKHoCgafat7/z6avH3Ub9yBUGbu+yBL0Im+6nMf0ZZScuhi+?= =?utf-8?q?RmYOEMOguJRT+U9efgKIYZOziFRF26em7gX2p7AaOCMBWg6skKfKaQYWt1blJtw2r?= =?utf-8?q?7XLNWp+D7cDGKSCJfeufoGvIU2E148Ir5N48IsND+kxdZyeZ9PynmuUrsLw/i/5/w?= =?utf-8?q?SKJnN4iZUGCxKnUic3zyu1YVqfEzLd6V+B3xZ6y60NgvqK39ehA+zQjx3aCgV9TSO?= =?utf-8?q?MHWtU/wI927dH3?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0573ebf2-2493-495f-46ca-08d8e3aca78c X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:09:56.0122 (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: ooSELmXQPJBxT58iXuoDsfn7UaI06EZVIvgZrVFhVkXwSrt+4k2vSpPn/EqWu+EbOtcbY+oJ9vr52A+OdpXpnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2813 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. Signed-off-by: Liu Ying --- 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 | 485 +++++++++++++++++++++++++++ 3 files changed, 494 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 4d1f027..1ea1ce7 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 c15469f..e74dd64 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 00000000..6696855 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c @@ -0,0 +1,485 @@ +// 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(-ENOTSUPP); + 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 Wed Mar 10 09:55:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127541 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AEECC4332E for ; Wed, 10 Mar 2021 10:10:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E428F64FC8 for ; Wed, 10 Mar 2021 10:10:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232659AbhCJKKS (ORCPT ); Wed, 10 Mar 2021 05:10:18 -0500 Received: from mail-eopbgr140070.outbound.protection.outlook.com ([40.107.14.70]:19331 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232614AbhCJKKJ (ORCPT ); Wed, 10 Mar 2021 05:10:09 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FgsaUJwa94SyKykpxnDE9SrhXNNXham1oVSAA5AmQZt1PMSINc4gqq5voGgz/ONwQDgIBJqsVUg0bMzIhSSDO7SCUvQad/VegvAZtA8th3KpSJl/AtJdiOrFJns5lMJ6xP6vGgwO7db38WcryQzmrD06ZgdRt8IEiMzZOsoRubv38/yNQCC3aIwn6Bk2IhGsYW9BUrSdrESpHk5ZVYUkjG+UnjfYAZ4KyB5FWcVfcFVBaIPf3ovCksGwZcl2nhegwDkFhKPOIDipfeEr7yG6yRfC4SsQ7POX+OvOyyBIvwF/+mBgpy20mPJR2MKsWAABRlcl3IlfjlRLXWnRTSkZhQ== 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-SenderADCheck; bh=VTRXMvqw8snGm/v9NKDTqWoYR/aaV7v7hHSjtr0IxxY=; b=AN/BUOX24DXsxXjnxpmRc1Mk9SUtZRhh56g2GFmHT2IexFokitzOm12Bacg7fJdvyMOUs+ZAUFnsqgBFoZpNNDvj37qiscHC9ZLmmn+oXGIx+3e82Of2f7/1RFUwrSXgc6pLO2agFvxZjTPJ0V4d2iuhZqa2BWbtJ990mlJiEkyywgBAyTBWfQw9wJGmXTsNJezlYO3cAgmjWcUoNRKoWK5n3aivZQVuU4sGTHRXnL9vZb91gg7S/fVkR2J8XX/cW2DjyGYJir4lBhYNCbrOGlccJnIG7qUWJyUyzdWo051UAM6iDMbRJJKWkSl/yQS3erasz5azWWtPnmpknoBf7g== 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=VTRXMvqw8snGm/v9NKDTqWoYR/aaV7v7hHSjtr0IxxY=; b=m7cY+oQ2sfvScdeqj+YtxWlWYbqBqSTXXY3ukwVM3ELU1UWjgnETkyFZJoCeglRDm2nnGC0rGzpmT+r48WACY8Qai1bYQbqsL4GjGQmQFlJK+TJteBQmXIYtE3lYmV5xo1q+F/zHm3tnzG2F/yZNQajb1SIlg6x2mjPIG+U5fb8= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB3952.eurprd04.prod.outlook.com (2603:10a6:803:1c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 10 Mar 2021 10:10:02 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:10:02 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 10/14] drm/bridge: imx: Add LDB driver helper support Date: Wed, 10 Mar 2021 17:55:34 +0800 Message-Id: <1615370138-5673-11-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:09:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0a66e8b1-5a35-4ca1-3e96-08d8e3acab57 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3952: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x16ocmeFU5h/W/vkeuSfw0kmbKbfJlMcGnJmtEQ5u5qYSnr2NfUJFdxjFnDLgYezL5qYyGNVyfUqn0X24XxRbr7PI+hF67sD4rO9OPgQCAwx8wAp1lfXxQ8bJIB5odm2UTiSCSTkRlleacB0rwI9wk3wzVtNN8t73aG2YFZ36aaoK4x3tSuJIk6XdySNO0K4g9h4N+8Vvo11AVOeRqMBjkO8WYB6zPkl0kA8Bk8V6Nz0BPNkd0sOmC4ET4Qf7uZQYPIHDqLUKP/Hnj/KDGdZCx7BN3bq6q1PX6HiYUbxIPwY7WzHMZNLqgAvXVfibu/jKMj23MkZWJ+yLYwL4pRgTdmxMQRzjLP118a2PhDTqrM0Iay+T4ofVVYDhg0f9SBmX1TNSsdLNdRmLlMMcPJYqGe240kac+WSQCPbTBWrcCXl+idJNCyQpBAlZDhvKQ+4v0EhRf5HZng/DgzLNV7JF5DQhfpKMntk5jYm8L94vNKFZIRbhSNmKtKr9vfu5/hbgBzPDBGbf9wNTPVSuMPiV9sIfov5cXCLpu1odgbW95aAyEH5D5/QNhh1frH1QdyqwHpQ40td1UMW3MRwgAmZOg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(346002)(39860400002)(376002)(396003)(136003)(478600001)(6666004)(2906002)(66476007)(66946007)(66556008)(956004)(7416002)(16526019)(2616005)(316002)(8936002)(5660300002)(26005)(6486002)(52116002)(6512007)(36756003)(86362001)(186003)(69590400012)(6506007)(8676002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: jRJrQya36G8qF7D3XYjTMoCiQPcilmMY5ghsafNQPk1nmS2a5lrJaqJVcsA2yjzufqMq3atAV1cvBFrU7nMSur04UCRixbPxy6tUg1kiqOOQN6AUfh/VIwlxX1pqJGW+rBlKr7DKpHxhpIEfFpHv/B+bju4nDZyb8CgqavWP0COvMaKa0CZfwt7b3LNU2Kip2hWLbWlgoPBLkyZDIIw+Px5G+eFxUtoBQmwpjSQ/0MbN6uO3hcM5/XFKY4VZn6x3EoZHO+MZuIyL2CoWSQfGSgmGr3fyozmfV/MUC2AaqKCI4pllnBIjPZu9HlA8if1ZfOuxazWD9JEgjrtTGq1igygRX5SN6lnqveFTsdlt/H9XGgrue6LJpe/Uj+WVK//aSuiqh0UgHaq0FvXv0nJwIqJSAWmKJ5YgFyLtukOcRLklNC9qhseNE/EL0haAhrl9mRiEfIT3SXg8MKZpIUTml1vgJhqV+8ypj+HNThYxx6R3/rqmHz/KG9Ud/28gRL0mYkSiWsHiKEsxB8M6/AeAbJoIYrg44hrhzmoi2cdrtRm/I8b0BUCjMpMEdKyaXnR2TbVeUZhWGqNBJE8FivIvQhr3bao7mGFBdKJ/x8E+F2uXCvX11tsxjj3LyrCmSXYbW3I6MZuaD7y/abVnsQeepeN118DPUVm4qMg+MYbup7S1slUIubXLhK7c5ubMn9+8lhAG2ex6s6SR210DpIUPAUdPps8Q6WH5vNpw7ZgLwomqRj9RwhJAWQqcRE74uW4tKszyc2PsU/Qe5hII20yBRsRUD1egfQ5DCimWnMJi8cBjRKMFH4u/C/7uY0Ado+gMm8gPT0xSvwIXNaLf+aXsdkXMXz0tWsDoNBolBnWYpPPfrjsy+ZepicmMVqXjpdfM+8/1KDCIV80k+ayPY1oa2YIHDP8B7jmEtVRDVpxltBoDlBtDEz1Svaa6XeftlNpAmK7Rsc/gzbGHJRH5IV7VwvsF+B/4EY8bIz4yqVavnfc1Wp0LvjhAE9zryCaR7mQTZheTVOIdA/Fi1xy3/njW0lCIjCmNssu9vwAm4uEKS+m3LzNwpEvkdD6ptJniDBwzPVNF5Q2ThliM7cGnO3MCtElkmOfPmZtBnySRS1Vj1TyMM+u6BhahDghkywE4xTFwmXzzXOejpk1MgzZBX3h++PiJfcu/tN5tbvEMLH6/MAi1/Lcul9BUmrD+Uj2+hk0378t7brGbY7IaTyETliVgRePDeWlNBoLujfY7zxSKVcItVnmSGS9a+sI62toNKVaWZlyzBdgmUBdD3VVY/XJSwuJdNBMWeLcJGR0FvmUJtuGavpIZfxu3xGDYYa3YTMQl X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a66e8b1-5a35-4ca1-3e96-08d8e3acab57 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:10:02.3555 (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: wlCILLFrLRImKwc05wKeCK4C/sLSNE7O9XdAGl0kHmenWeYv9kMp1lDV74yadteUe6grPZJKBEU/VpG9CXMz6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3952 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. Signed-off-by: Liu Ying --- 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 | 232 ++++++++++++++++++++++++++++ drivers/gpu/drm/bridge/imx/imx-ldb-helper.h | 98 ++++++++++++ 2 files changed, 330 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 00000000..d01c4ff9 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c @@ -0,0 +1,232 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2012 Sascha Hauer, Pengutronix + * Copyright 2019,2020 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; + + ret = drm_of_find_panel_or_bridge(ldb_ch->np, 1, 0, + &ldb_ch->panel, + &ldb_ch->next_bridge); + if (ret) { + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to find panel or bridge: %d\n", + ret); + return ret; + } + + if (ldb_ch->panel) { + ldb_ch->next_bridge = devm_drm_panel_bridge_add(dev, + ldb_ch->panel); + if (IS_ERR(ldb_ch->next_bridge)) { + ret = PTR_ERR(ldb_ch->next_bridge); + DRM_DEV_ERROR(dev, + "failed to add panel 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 00000000..748c378 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.h @@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +/* + * Copyright 2019,2020 NXP + */ + +#ifndef __IMX_LDB_HELPER__ +#define __IMX_LDB_HELPER__ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#define LDB_CH0_MODE_EN_TO_DI0 (1 << 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 (1 << 2) +#define LDB_CH1_MODE_EN_TO_DI1 (3 << 2) +#define LDB_CH1_MODE_EN_MASK (3 << 2) +#define LDB_SPLIT_MODE_EN (1 << 4) +#define LDB_DATA_WIDTH_CH0_24 (1 << 5) +#define LDB_BIT_MAP_CH0_JEIDA (1 << 6) +#define LDB_DATA_WIDTH_CH1_24 (1 << 7) +#define LDB_BIT_MAP_CH1_JEIDA (1 << 8) +#define LDB_DI0_VS_POL_ACT_LOW (1 << 9) +#define LDB_DI1_VS_POL_ACT_LOW (1 << 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_panel *panel; + 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 Wed Mar 10 09:55:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127545 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4C4DC433E9 for ; Wed, 10 Mar 2021 10:11:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60DFA64FE1 for ; Wed, 10 Mar 2021 10:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232730AbhCJKKn (ORCPT ); Wed, 10 Mar 2021 05:10:43 -0500 Received: from mail-eopbgr140058.outbound.protection.outlook.com ([40.107.14.58]:42116 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232579AbhCJKKO (ORCPT ); Wed, 10 Mar 2021 05:10:14 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BE0bxrtHPesx95teEj4Khsu9mSj3XzG55VUY3hgrbKBXs0gvO21vzbyXVbMIwXiylNQDf9f3Tav7yna7voyJrXxgbdTxUD/rugjZAHdY3RTgtmo8bJ39h/MJSkBHvruzQfkatDxTQeh/Gen93bUqPeGlkBYCVIuyGYapuAE+iRvSTzsVEt7qffT2XZTLHTe2XTbXa9+tYo1xJXNdsZmrpAZ3rab504j2oHB0qetUzaV3iX5vbl2n0jGpYM/QfhaPASajCg2pBBvqPGlzvW3FyHwCw4KEHHjQP2PA4agcZiWqLg1qXJhSYhp/B0T5xCrPGXk2L6fn9a6cHm2BmXjdTw== 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-SenderADCheck; bh=cPaF5b8X7N45kdAHMx4gPk/1keyfewyj7WPwY3+3sHM=; b=nYOGBD3GEfP6ELqHwI4pBLckbwJNco0uykEOTLYYt5FL9YtkIvuDpNlVkGBi6FvQ33hQo0q5KEbJxEg5O8rtRjCxky8ZNldyXJQTnKBCgIzV0kw1bkjy2s3iFEsq6VAcy/ZUQgSrSyXLYh3fLcbx3PJLVP65WqgqnRMXnnUx7dGlWuGeRIN+RJ8DyRaG90xaAvnDIz17KM5tWqB60dnLotQEU0ymvlf7rAjJ/aytwmLkQIUCnkOGuuoanoouwYgs0GY61SVrafk98Y529kvgWYYFMIprnwzEDcje1vVBJ7Tbx3YoBh4qQlVKOizlL1hxA50bAAZsNZMXPXXJ3nFiVA== 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=cPaF5b8X7N45kdAHMx4gPk/1keyfewyj7WPwY3+3sHM=; b=Gef5CbAOzIgLxFYY7zdAHmE3PLNZvjVq5nw5NFBVJj0njBkbSY20JMcBJ9ArdMtVwHLciIkLxA0scHSZlZMvO+cMXCkF6AmodYxSqu85AH1cvncihhBqsmTa04XlAvRQ54/oCQTIfVwIHV79yJBhRBiDyL907I5nTS925ouN29s= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB3952.eurprd04.prod.outlook.com (2603:10a6:803:1c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 10 Mar 2021 10:10:08 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:10:08 +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: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 11/14] dt-bindings: display: bridge: Add i.MX8qm/qxp LVDS display bridge binding Date: Wed, 10 Mar 2021 17:55:35 +0800 Message-Id: <1615370138-5673-12-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:10:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 33cc9f4a-c804-4bbf-61f6-08d8e3acaf20 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3952: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h6DGt9VNjaJxLQfVPqrNo40beSQyo4F504p8Gm1PsZeLut9xjoko/gly21NcOmZHYCiMu2ocBQTe+HsnhMuw5O3PO0BrsbXlP7/fJpGGIIn6+iktEMz+gPED38ptOOB3Iam+zEYJ4/ByDzvPNyjzh5CS+cGNdvyWJHNUbPfT7makny8Xhzfjcx2GffQ821xJNk6U1/KD+Xf/MbXOSckUBZnlhYUiGI8YHc306i+fDYk2tX1AlPCynN6Lu6Gg9O6eYcVZPou30IDnWoBhAifrlLJwI6T49uArdN3LbcmzrRfUj0wzTzvItaYG4yPXgxAkUDKzDnI8Wsp0UcDcX7OVz0XYajbES+ifZJkQavTQFP/s2G9njk8WWv6lcq+xL5NGv02xfWhabBtGo2+jju4C3J37BAyi1Uh+9BqIgXaz6AKTGofd1f/gUrgMH5N98pYPJ52l+ZkDURpivOGgnkZNHlVz2PnM3SN20EJBtRoSdtgBBK9AI6q7zxBr1qMYGIEqa/S3qyPs76DOdQoWjhuySGZ/DzIH7Dc3BL+b5REwyN2sGpXecGQ0IvEHQpOJwal/ksfbOecp1ydfhwaRLVUTYh+ADJwIqLAxbNzeGLdLpGBGWVxjoD+QirYGMUlVQabdgXxu7ZmnP4byA+9KSRQGuA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(346002)(39860400002)(376002)(396003)(136003)(478600001)(6666004)(2906002)(66476007)(966005)(66946007)(66556008)(956004)(7416002)(16526019)(2616005)(83380400001)(316002)(8936002)(5660300002)(26005)(6486002)(52116002)(6512007)(36756003)(86362001)(186003)(69590400012)(6506007)(8676002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: olYcVkrJktIG9q9o99I0X27lYWhVlVjNMsnaFi/Xmpc5Ehse9SzN3gDXok8JxED7AHUWJXA6kv67nHOVWLlow9wY085BkY2OYACrF2emiS09v/e/OVfixo/bEYsIOisrhjWU3ov28Gjk74gvGSU3nytrfsq042vRhpaY1S9ChJM/+zjNlv8agCzM2HdZbt8asKl+/EpGaavQPz6w/fw0G84lUPg9E9yb/jWitJoVgTCk0O44PzhGY0TEkxE2eCxRZEa2HE4eOBOyiq2CmhBJj/0II3p6FYEeTUSbTKwFVDko87VDwgaIdh3k5In1/I8AL9q3ljZqtyddA5philBqs0Vz0hfuqr6fpSyhmI1qqXgb5Yun6dS3Axrl+8VEeRKNhGLKEf9kvGbX9jh8Ai+QoTmOv4HcL4TnPJcQFR2eKCwfYbh6ik3Uxv88Qw3Jnbx09w4VJn9SNRV5rnGA+VXcI6goNO5F6m52IO1llHa4yT2x2p13o7YwVxU/aDgqQWLj8/rRnYb5UfefZkqpvCQ6i8Jx6YkyQoGw+2svFRcEeYE+wUX87IT3oi3/xgcMJoagqBQlpBqfxVJoDinUEl6vqHUzxKMu0+xk/yO3wyDI7JeMsWXDgWVBlV1U96RdCyDOtMKQEj7Rlz2JxS+9eG1C02lVTyUCAUqazMH/4cH2SZBJ4yxnZiBP/qPQk5ZgqaeuqEfk5zxvcy2YB9p+aoClWCxIxlRMxX/kbQzwA3Dm4hsGYu4K2HDucK5aP2jyqBi4kUXqm7P26yY54Y3Y4DANfAiDoWTcqek/aKrS/l5s0I0pPjYLFyLBT9z6mTSuleRM5oDlOehAqDwRlTW8jaXJ0yIltGrMQDF5m7SHYcUK8bT9FJf0Fiy8rxZs3GBqkmEcvZaGK/Hv9tQROXA1EvUsEbIOEBPxgY4L63c60xThMT0B4hysPyrC5LUShNS4EFpoUKcnC4TB8/+8gTEL6VbOwrfX3BQ5D4a0anPMu/aZOPw5/IA00jcPg9d2+kHl6VlQd86VL7VH03ZY2/cqnr8Kg6W/BFHokq+GOCIGyIo8AtPuU08xj+SkaUfFHZKmESW6+pj/KGyBupXMh9kJGu9qXzOBzkBlWNAPq7Lnyf2c0EUJbM5le85hkYjGrCM+ztvRtrBK5QSWdXD4SglLSb5Ogx/owAkFRwRpqETvE4XMqOjL5bJp4sa0/4g0saRBnhY50gYTMOI1XuHT08ryBnOHaWduo5OcItxwLsgSZaytAm0cWNS8zvilJ0nCF5IBZ2ZAIsZ7XnP8voF0W9So3Ehi0GPVQKhBshicx1NkQSMiR+cRIJgBSYYufLI9dCjubKKo X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33cc9f4a-c804-4bbf-61f6-08d8e3acaf20 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:10:08.6799 (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: POb8TErakqYjE1ZobnubdXsJJwmwjRqM0jtWG6j6W7Bb3v/ieUsUaLMR+rPpyC/xK0kshpKtJwv6UzqOy+tk2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3952 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 --- 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) .../bindings/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 00000000..9454300 --- /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 Wed Mar 10 09:55:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127543 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A400C433E6 for ; Wed, 10 Mar 2021 10:11:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08C7C64FE5 for ; Wed, 10 Mar 2021 10:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232635AbhCJKKp (ORCPT ); Wed, 10 Mar 2021 05:10:45 -0500 Received: from mail-eopbgr30044.outbound.protection.outlook.com ([40.107.3.44]:4225 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232650AbhCJKKS (ORCPT ); Wed, 10 Mar 2021 05:10:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LdXTiriqa0fzyWo59msDuPCM5eG7PhhPUN4qtiuWPifLUK6KiaaTrbRGfNyX1e1LYUapfv8LWpzh4BEQHIt5a9PmYRX2mma4gvPv8J3cnshYxNBRi2tyy7sjB4jhh3tTnjwHywXjV8fO4Hd2J5Vn4sWysRSIS35PMAd3iYmnrVG/ewOtQ9frvl3zT6P/2s+Tf2IQok43wjltT5/DkE8SjadoPtBB5cg6JmRZWTZ3cVSeBGrK9W/QwYGaW5KR9fFaxjF9k4XHR0BVKRx5a1oeSiYioatqkbDA2IF9AUj0ftWjUZUQuqcNGN/gHJYUN6CXJkI51Bx2DP9HXsndzemPEw== 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-SenderADCheck; bh=hBu27cjZwly+SblQcqFl8oc8OxlT8oNoUlwwIV9MuK4=; b=CVLx5XHpMDEv5WU+i1J79TS0UFC1T9Oll58ayL/66XLu+9f9pmxJgh0BP467OXLJ6apK/EI7mnCTokkPKl9rGfeQ1L/FYr1AsD8/l+hpUWTj5yEhcngXcPER2aiMzxbP9XnyiPs1gNtFHvi2xD+EJLluc/9vwC0AJl1foijxvs6+cViEptPUUi/UmgS9VSSuRY60x/bjsrMoctGBaIqLxGlcdolvelft4cx6kSlDyFyjYLjsgo9lzMNp0z6LnKbRHWVcLDQNf0hQBxWwu87dCW5Xlk4XEHBz5wqfAutVlzHSdBlZqUMW91HeQqRcpB2U45kdCApQ3fvxMSYZq8aPWw== 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=hBu27cjZwly+SblQcqFl8oc8OxlT8oNoUlwwIV9MuK4=; b=KjN5Wq2btHulAR7PH2oKxXS1Ll9rraXxvwoK3JrDs2gEnUbfABVoLqCu1yxYMcaej9OCwzxyDgY31KwntS6xhcfVzQijM47jPwxnhipzTymV3lCj2rmP6rhdXubfEG7iARKmpx9bGe5pF886wZ01Cjk1bsMBSCtCzxNlcKOsO0U= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB2813.eurprd04.prod.outlook.com (2603:10a6:800:b1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Wed, 10 Mar 2021 10:10:15 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:10:15 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 12/14] drm/bridge: imx: Add LDB support for i.MX8qxp Date: Wed, 10 Mar 2021 17:55:36 +0800 Message-Id: <1615370138-5673-13-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:10:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c267bac6-69ca-4e22-a739-08d8e3acb331 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2813: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OUoFo/R3YlMrumFrMSCPxFOqd8udjiNdMqNdbqkP/R8FyXNWunnBifyEsqtktaNQRYxRcmpR4yg1lRj0kNcm4dL3WYG/AYn//10LdrAhNuIDOWGbbFOcVLpJK2m0vcaGssUcLG7oOZRzKdK7g8gXQzQjLpu2ZKc6QTtXJZkAHkuZy9Pq0KDTnUa3ME2JG0uvcqCq9n7+DiCdli1HNF3C4z3OG6w3F9GK4krSk1T2v9AhtL9sgE+53w0OT9zw3NeNilAC2oxi5MeiK3difDq5YcbysdMOkDXrwiowy7Qx5OGbkpnN5ScZ3M3vEAClGN2rw2yLGt0iZzuRX5/nSPvTrjrCD8Uq2ynCjhu0MPcU3qClXJ65JrzVsxCAC2kKis+6kx4fBgFpd43aDc7PQ3QjQL+nMGL4TlJeHj652k28hxgvVz+YpmORBBuyNFcCXEi2MnwODZAJSUB3Hgj0jISCTfdnodCJbdNV3hsKpdbvZW2Glko2ybTL0IuVn6HY6ecIIe6ZCosJ2XvhpM7tXnoMF6fRFXhBuiEZUT7zCETzLzGBKuV5+3q22GoerJiy1iUruqCwEvIJXhG57WkO8k3O70tLgUSrKr+T5QpWB1oO8Rka8dx/b/K7KWkB6ZGR4vHfDkBJ3ikZ3Egidvq3oNpWrgt3drhyrnqm+YMgEz6nfsc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(346002)(39860400002)(396003)(136003)(8936002)(69590400012)(6512007)(6666004)(26005)(30864003)(36756003)(6506007)(956004)(83380400001)(8676002)(2616005)(5660300002)(52116002)(6486002)(316002)(7416002)(478600001)(966005)(186003)(66946007)(2906002)(66476007)(66556008)(16526019)(86362001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: K7Nk39WEWO28y98q/+hx5gHn9O695e4Mwxo/rX+tAEmzF+k6I35eBnJ96cZ7rIa2AT0w1mgepiPb0MnXkJ25r59M0/3nUzuK6OjoMHgmdlC1M+IdLFhTz4G6vCJI7xczR87JFgWRGs24jYmd4H3j3kY5jfPXVf/BhPN1hxeQu+VjIJCW/yVe9xgqJM+MsQjai/CJupo/dk5GJJi3z6+V+WbedrniUUPc7umFCecjTEREvqd+pNjhXwWX8OKJdTtX4RaThuMHVlyw1IDL++Oenua3frzSe0A5jrOEhWx6hduSAebDls9cvUfVS5sK1WeV5iM+cvE9qzv+4yZc2m2XtKnHJZg4boYfDLuH4hnzRlSuYk4kTpl3m0PYBsrOejlSnyrnHGuSirbZbq11p6XKZ2f2DTbPCpH+vEh3FTCKEaGqj4e+Lfp/3Ze0rybB6jWh3oB+mbitEqLYUOPyLEMGbvirlasdCLPZSktgER8D1eZQl8gjixrk8aNMF1gFK6wYMliocommKL7YjVUf1WuYI2FKkx33YWH/ncqQ4P8V3L1+UJ+8J09g4Tf4p7kbHSqCnOnYuB222OwRjZyUOMn7wZIqTJLRHl+wpm3l83YZX/vfJ0AVMhs65rGIqNaAZtzWkoM5myJbp6fWE7F0QYEQXt2bWjcWDRks2mpJ5wg3Qa+pYhjTDOCG42GXCPY3citKKRaBY8FL+7p42NIidLyRrHN9MIojqmphXVGcgrxCm5dYZqgw8o8POLB2xqq/sxSETpn5t98xkhTML8c2pVjW3/46M8DpNUn5G0QjS5HhneTKS2MvyjoL5WgHlatus7+ZjT3ifIHrdbqTWhx3zc3dx+Y03/Qy5cDq/6jsskkyHwoqlwH4zgxS77FZpFnW6JuARwtax2GQG8AnIXgZ8J1oGNk7qjq8k6CVuThn5NuPqlKAaxJJ9nRQZ/CzAt1lY3C24CLaBC+yn9gFV0OdSdUMidypcgKYHHU43hPtHfcfLDUZ1vsql2bqKDdgfo1DOw1nvLlZLl3P5Rx0TmNHRU747chQbIzIjHhGLuzCAg8kFb6rsiL31yBQuz3Rj9mRY4AqVdiwdaM2GZoo+zhblXpTKZKZJEdiX43sdDSpRuzpZgP/VtDWWilJXPCrR4cIZPNcK0wEl5XZ1T/id6eFvX/CAVQPkDsMlgNbw5LnddhCzb1gdZu8hS8OgucN0bcrLVP4lMiyqGcSy+eq9sT8VWVTfMowe6DuowKAcdhfxDppwhdp6toONRBTbVdHB3ee07o6E5JOu5aSea97Nld0/m4CUGRipG85pn9c8fNkR/yFUknyVvy5Nq54Sjl49tzi9FSk X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c267bac6-69ca-4e22-a739-08d8e3acb331 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:10:15.6079 (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: d5eKHUsvvMtPfiSKbxhUsHTDa7BQs1BE3+9jAE0ReYDgEYAbY3sUNRrRkBzDm+2MlCcpf0oAfLJYg3AO4BSsMw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2813 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. Signed-off-by: Liu Ying Reported-by: kernel test robot Reported-by: kernel test robot --- Note that this patch depends on the patch 'phy: Add LVDS configuration options', which has already been sent with the following series to add Mixel combo PHY found in i.MX8qxp: https://www.spinics.net/lists/arm-kernel/msg879957.html 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 | 720 +++++++++++++++++++++++++++ 3 files changed, 732 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 1ea1ce7..94f8db4d 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 e74dd64..96d5d1e 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 00000000..d7f59c1 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c @@ -0,0 +1,720 @@ +// 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 (1 << 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 == NULL) { + 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 -ENOTSUPP; + } + + 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 Wed Mar 10 09:55:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B302C4332B for ; Wed, 10 Mar 2021 10:11:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0ACEA64FE1 for ; Wed, 10 Mar 2021 10:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232428AbhCJKKq (ORCPT ); Wed, 10 Mar 2021 05:10:46 -0500 Received: from mail-eopbgr30081.outbound.protection.outlook.com ([40.107.3.81]:61248 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232698AbhCJKKZ (ORCPT ); Wed, 10 Mar 2021 05:10:25 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hktqF9SU426tflfhQ4Fc02ydfvNXb1OTTBXzccvAiCTLiNXqklJtLwftvHLv/EhHzRRNXpsWYRhYhKTXOVjO9BgA35ykX3xUY3FB9JqB68QbGd4Nxsw6j5qARKAshN2IkFPzu6lSRyfa7In3CBD1iH2bN8WFCN0jKY1zebcQ5FVEM7IVShnQRQdfJaguLAieS58fPxFMiv30XS2h2vZtVcsjZNM4f2wS9xQadSmoAy6Wo8lZ11LY6g1ua2Sydn4oimx2LT68r9qauUl+/Mqi8/mGzXw4BL8+QqHAOPbyg/9YmqC/VU4q/LWpgixbkWZRhCvmGk422yRtRdeTWOfZ+w== 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-SenderADCheck; bh=MGNXSCDwRxK/7S4esO5X/3MftlAwVTbAVbd0g+NS8lk=; b=X8exps/BdGBOyLEUs+HwNErVzO2qfiqRrU6RAInSnWvoOt/TULlpPGLPzHzdVfdiOQdMHu3WBQtv1ZKw9/xvzJK3MmQq4ePp2eQAHPfydVUy+MudVqt1ze3JWmwCyzu0AFbNKXFtAlUJoAaFTsKFqwgFmnrwd5t6gJxFhHV9eY2Ao/8z6TH5y6ZGI+whqmwTh3O+wzvON/5lO4UbSTJISMlSpRtEfgvOFWm63RnOoUchBbTkEpCz0G4adX61FYeUrXIBM58jIBM2ophLl1YjQ5SuUChVBkELkXbQpLcC+UqFcO5X3yoL+9vN9k71GckIIwb30JPtKUMgSCCOWNFWBg== 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=MGNXSCDwRxK/7S4esO5X/3MftlAwVTbAVbd0g+NS8lk=; b=NO3SZa0nweWB9EoVYMwZke9bYk/59yHJMhQaPzqFSl9dat8wH1cpkFZe5Mz8hixhnYVNxkfch9foZ0zalNYT8yOBOhC+xst6ZKRPA4B/oJKfWzmg6I58buEQHPCctb6XBkGm1f4L6+HJBp9zurWD0hDALcyaRoe783TquKf8Vq4= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB2813.eurprd04.prod.outlook.com (2603:10a6:800:b1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Wed, 10 Mar 2021 10:10:22 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:10:22 +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: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 13/14] drm/bridge: imx: Add LDB support for i.MX8qm Date: Wed, 10 Mar 2021 17:55:37 +0800 Message-Id: <1615370138-5673-14-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:10:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 928f459c-17c6-46e8-ce71-08d8e3acb701 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2813: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EBRYA6cDdFQjhfx186stOVgwmIJ56xDgBKQkOmn4m/Q8qSAiJ22CzMHgtmkdQGv9I7voXlAn0D/hVIk2cqofvC8PimKwsT5hSqmwLZPKiABZpVQgaI7kVnfkmO3/++DvHA7ytEWlZ5+NUzHKiDYZRxBit1DLFJjBh84QitoBMb0utxYR/bDYFRcevskLaI9wqbaPL2sd3TAZEOiguisTZjlfeMmf7Y2nVxBHkH2zL/Z7nr75dV8AOr7kxjw7fyFoSQNmv1jAdWI9u8d39TxCn33tUTyI0RH2J745yVIZ7nfZB4g+PRAffh34wTJ2Xr2fbU3swVQZRTbxvoxOTwNSMRnfJy8pObmXWf/77V67OLzQpsK4h83ejgWIjii875832JMjTsr9t5/66aUTe7ya7kwwZIFCoULMQWHL7W0mU5qQJA0VUR0QSA4yiGV0nAWZSg0NMVO1bCCAlwtDLYEabvUG2JHknyCG//qHQlz/aRl7G3DdXVIJTZ7RsUhQVjJ7l7/Fay24IZMKeZnkQx8pEOTTKzonASV+u5wdKUgtBCcnByCmBmhdOXMsRWkl7RqY3Vlf3dpeTNxBzCQRfPtFiQvJJuQB1F4AJrDNQ9MGBQPb10whUUJk42IyGf1O2LCQYnoj+Diu9OZsZu6QSGSchR79mDyCjxEicUP6YPlaCBA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(346002)(39860400002)(396003)(136003)(8936002)(69590400012)(6512007)(6666004)(26005)(30864003)(36756003)(6506007)(956004)(83380400001)(8676002)(2616005)(5660300002)(52116002)(6486002)(316002)(7416002)(478600001)(966005)(186003)(66946007)(2906002)(66476007)(66556008)(16526019)(86362001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3jJyqqdjU4D1fjV4aCRfK4XQHN6Bolsov6eZWSWXxMAdFYEl97dkIjM8a4eKkTJA4LRqFzE6cAq6PwbMGkLiBk8OzoAcFpm1EDeOaT/pOsFj2UnytDBGK62HfyePNIfvAlxhy3r6uw4c/7J2AkNnHYVml5ntJlGuiR20BikVQHU5KcZspeiGCLtA1Bv4BdT5mWLSQEOUPwx2aU7beGla98Qt3j6adn/jsN7W9cy9TZaMLPgwQP2+eqTVIe5Ijlv5OKsas+3tp+KcjaKzIJr4lJsxdobmmYVBfYztDZcBaC0PrHHZkp6CxbhDOT+JNxYvPcU/cxubWX6Pq9jJDL7/QQasGwC8xun20KveafyqqTM8OlzxIPBKTJmOP7O67zXJvA1FIqJg5H20wy6hJFRD1Ts8RG4U5LSF24Kg71UaWBGQFmLb01FRgbyBsFmHhZ4CmRm1LiQO4SU6+QvnYFMhwQzppDtQHXUpcfl4f80+XHUPCpOYMQI0nCKGjtwiCmXKPIUJ734nUBFOc0pIALcqLicsAB7koDC+Cw9Eb3QT8+AAbvWtjRzuVJ8WmwDsYVlQL+dDMxP20mnBA6SPHfQ5Cqkwn5wskrVtSPRKJxBwerlj/zH3+j7gamkv53TT8cJXusTVUKdwaDIKf0ht4iEm7AK0730kBV4qLzhs+6YMvfHthKS2jUeKBvmfWHkxcyFMSJrijsaQD/Le4gv6ZZTFndwhd+k/UC/B6VgggyVUONmPTynhm/2YV2mmkrg/d0v845Go7aVVLvJfw6e+2qVmqix9G7xF8yJ1X2MTIz5CPL4hwKzFkxNU7WbuekVawMyJNOBlK/wgmR+Ej2l8hQJ2j8hKEsmSHvK5O7I5Ll/XfmXBVeWJ08aTdzb9D61RGh4223xia5uE300RtdDKkFtcbOnIbfDXHWaZsJRt+O6mflOkX9Dg28IYUv4VnlY+RUqviyG+BPxi+Koc2PCBdwrcL9tRhDtoDJ2jgSnFlOD2nZHyBAxvHbr/BrVyAnSvMOCCai1I7PyJcg/glaOi+IJ32IYC8Z6BoJoLgwqnwWxrwGC7DiVZkxZpe4OjmbmFMRdBNLcZnI5Pj++hYDsF5/xrb0VI0GvA/nHb5L6dT44XhzhyIkWQCroZTgkt4E3F0QyIj+ScJa53PL8JL+f7nsusCR/ULWrlK1Jo69k8eDj44U/cQQZF2cE2gcbD4elRMkaV1afJq4GBqC3l1Pa5JTx8diSumeF5VJZbK5Y+yT+DdzWf/TES/gpTmzfil5EeVJbxtTOt+QJmDwPD6BIcwL2KYhP93n763vFAH6KSF8XHpifw2RYOCxQrf8X5iNEEuw8D X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 928f459c-17c6-46e8-ce71-08d8e3acb701 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:10:22.0112 (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: G8vwjv6FBvIAjCE6PGo2kpu2nvZs+uFrFNJLB5Hx2rhx5dXm3AIIov6e+VHdep1SFVuyqoaMaC52gqpmqybh3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2813 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. Signed-off-by: Liu Ying Reported-by: kernel test robot --- Note that this patch depends on the patch 'phy: Add LVDS configuration options', which has already been sent with the following series to add Mixel combo PHY found in i.MX8qxp: https://www.spinics.net/lists/arm-kernel/msg879957.html 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 | 586 ++++++++++++++++++++++++++++ 3 files changed, 598 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 94f8db4d..3a8683f 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 96d5d1e..aa90ec8 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 00000000..6c92636 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c @@ -0,0 +1,586 @@ +// 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 (1 << 22) +#define LDB_CH1_10BIT_EN (1 << 23) +#define LDB_CH0_DATA_WIDTH_24BIT (1 << 24) +#define LDB_CH1_DATA_WIDTH_24BIT (1 << 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 Wed Mar 10 09:55:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12127547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42A5DC43331 for ; Wed, 10 Mar 2021 10:11:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2797564FE5 for ; Wed, 10 Mar 2021 10:11:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232663AbhCJKKr (ORCPT ); Wed, 10 Mar 2021 05:10:47 -0500 Received: from mail-eopbgr30065.outbound.protection.outlook.com ([40.107.3.65]:58254 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232721AbhCJKKb (ORCPT ); Wed, 10 Mar 2021 05:10:31 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U5XS3g7/uj1xc8I5G7HYxC8tP+Q0ASEhdZXHJ6RPfTFb9oGWA8TFAbVde4gNC4YOvdH4ODqd9gJkr9zCrraEV6UWYALODPDZ96qjA3+H4851PT+eHaNMs+yrOQN3hfIqrPlEK4IvPbYqp+C8hDoZh+roH1bCqUtWGZGLVNZVI8atSj95BeMTI65Rnv79cWrpHbeHAILdAECbNvQGselUmGVH2jy3HKwOntolaBuTNPEHQQBFP8AZy6QQ2Plszu3jPitlZdEF19w8XYiEDKYXX+f9lL/asJqq8AObtS74oFgPUpR4qOri15cd0bMCZIt62bROR0ToTHgJsFx4SwPm5A== 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-SenderADCheck; bh=wJpv4IpLCJWZkLeE9ajiDZtJ3wgjf3vjSypVj5Am2so=; b=DuQosVlvznvdmK2NbdMm0yAHhJU8hvA8LdoPsYmxnjcdB8LO7SzbiTHapXSSNPOdoexa526qGQ9fjs4W8KfYJUkLI8Y7ENglmAU6v+m2mPUdypDQw4DZjm6pehS+Hxb1fb85g8poW7XkiWL7Yyhg+1H4bK5FtQfTIxJqh7N+S1nwpTzcQ5XmY1nkSF+uqwKI2Jc8ldLyKJ/+74Lj8ijPToCHcFp/0644Lmyt+SpeI0aVLnXRy7qe3+s4L2Mv6tXtnG9sO8zXKfLWaaNTXsaKMg66ID2Gl7B5nrqnqwbU9n64lN//Qi/VpmqN2gEokQsXaufagmfgEgTagUu9h++T5Q== 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=wJpv4IpLCJWZkLeE9ajiDZtJ3wgjf3vjSypVj5Am2so=; b=gElM3s9VPTMS+48qR+QIVyYiKsLzEuQXugdc8l+9mhkujneMr//tgz08PRuTLJC6AxqZOLefcBmY+yQga574zZ9pqqbIZpfNx9EA9lSB3A5mdEJeOphofH/Z8eXP2GgiKNaz1CKiaZvKHQ+Fr1XGBRp5u7BKqCFC+DeyBVv4gzs= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB2813.eurprd04.prod.outlook.com (2603:10a6:800:b1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Wed, 10 Mar 2021 10:10:28 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.028; Wed, 10 Mar 2021 10:10:28 +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: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, mchehab@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, kishon@ti.com, vkoul@kernel.org, robert.foss@linaro.org, lee.jones@linaro.org Subject: [PATCH v5 14/14] MAINTAINERS: add maintainer for DRM bridge drivers for i.MX SoCs Date: Wed, 10 Mar 2021 17:55:38 +0800 Message-Id: <1615370138-5673-15-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> References: <1615370138-5673-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2PR06CA0010.apcprd06.prod.outlook.com (2603:1096:202:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 10:10:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c10d86b5-6dfb-47fc-ce99-08d8e3acbad1 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2813: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fCds7/w7RjgSJ8xJw5iuDOYVL0diGHOn/TtOg5G04WWGEznfuutiTjBE9oNwXgbof+Tq8xjcKF9IfDjPnOT6is4wU+BdUGpoj8WFlcHiG9CrJVYOB8DUzrK6w1rOdWRl5YEe0USTOnKfhTReba7Wy6Qvg1t5KPG4WHcuC1iVpAPHZeET7JGP+2NsDhIOw8T9VSR1bsFwWnYIXJvRMfmIEpnf96A7hlmDPtACwcwLSqSeLVPOlDuKlPsilpERAqpptOdg8VrrCKf3vb2YVwfkiglbCQPTjLHe2+aIwcFPTsl6DXH0nePsa8KC2f+AmApnTDQydJX55JiQLFiqNOnQaIZbUNWvlMaiCThc9W4bQrC5BrvQnYCtRPi/c9dSui5HLECMRoJSyTL61QkzLDehPSKB6dj9lvbYoOPPfrJZ08qm2EdlnmSlREmtdUWecYYy0kewOBRm2fuo8M5Ua3YTcx5MVxk+iwpXv273Aqp1GfyyTXlXOvvPaEnln69jW28qLROuno40nDUu7TZFPfaPQLZgUXSaqEyd7fWLK/0diEj5DojgNlyc6TPhhpG97pGbdxpPGLTgJB8/iUtl4yC5Ag== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(4636009)(366004)(376002)(346002)(39860400002)(396003)(136003)(8936002)(69590400012)(6512007)(6666004)(26005)(36756003)(6506007)(956004)(8676002)(2616005)(5660300002)(52116002)(6486002)(316002)(7416002)(478600001)(186003)(66946007)(2906002)(66476007)(66556008)(16526019)(86362001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: N8KDUxznc3J1NaMWifqhSje9eyclkZt7yYsH1rTj4DZmTlB7YSkmGM6NrjKorr+QD/XbFR2pvbtEu3AFhcwyUtaSh/h++b2EBHz2MyKowu8fXFm5vjNYia7gG6Nbd2Xg+9+2ShdqgsKUetFWwFgKOPVpTGnsPujOoVOGrYBdXpq6dsKda+W5K7R0iF4Rc5NL71baLbnhDsCohKiV1H7uUTJsA8Rozbp6QvB3WLNWS3fx0qAWEl1jtl7GgZo9+r687YcfoaXE73W1z1jWi2aQ206OGuZNtrHDG6heyIRpHsMKtHNVgFp/3cQAgF1PO0b2KFEHlXOOFdd2dQCBdTcRNSgG1C2/WBDsgFss+kT6HpJatjQqLwSpUQmmj2ut3qmxrJAPAV9mrktNBQi2W2pVVUlvlAYq3zy1T2HBcLAQosNsXcGUKKnbfPm5IHNlsMN+GOU6Ts7oF0zwpbhmvT4cRJjIDAmL2R9x2TtFtUQa1AwbPu3HV8xI5f6SbWt8CXld+HhGkk0kUAFHNnzfgy7bfUjOVTzbGzdELCqFroajEM8XVOtTqNYQbce4xfrA3qXC1BajUDihAib4McLGxxtn4hvsgAGbL/1jA17MXEqRxouhH2p6upI91/BKMSbLY2zfkqvKW7KYumjxhVnjuuVpXeKWkvn5j4qVXJt2rxsgDjjBD5Iuf5FnvjK1Uady/RcnafjEHycfNJCj7QrZSt1l7uwewN728FKuBr76Si06+wQ6xUASLnEoSG5C952B7RMMVJgUnzu9cA6OtYuohBGsfnCMV2SRkZZkTWqu03al/r7Et+JjzDRw0xo/wqvc8FjrujR63qpURypRqYiJt974My2+cnOX7gS4Jz259JX5L9Yao1J0OQrEluiOKBukHojnz8ojqnhqj0O3mQIEQUbQ60/AeUH8TwDHuvJCy3xtvJTwc0Z/qYh0+bFtFhC1L2vLrOTFM/SbpTA6Jed2wK0bk/TgUB5+T2ayY3BtBs9OP7V/vEMrVsXINxqPj1tPGhgAQqGPe7GKkq8uKryDbdNgLNIKeBG/XfsRe/WVGq+MoAXmNWK21qYhAGojetpg4zw5PSDQmxvim8f5eRPNjDinhz8BtQb4leD6jkucsK2OHYPgshzv6MGYDvzXFhnxgj4uZwF31SzTOwhy+avSxSn+gjTJXdBOTEFbfYtbxay9UMq2aDkVTvxi3NzITv3DxMZ46HuBjnmknzObjIDrUwzet11FxfhmU/5979LyMOEeFnhOiBQgf55c5+kIO2fac6pLtOep5PnSnaQH7qfeFO9ezC7naszEDLIqrjS+1QZmGSlH+M1f+4KAP/WGrjZHz53T X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c10d86b5-6dfb-47fc-ce99-08d8e3acbad1 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 10:10:28.6924 (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: fz4S/lbTqk1FBfyZO75bavekr5lxWuM2jD33yOylBbkS8T6SUZiw8dIs/aYUvE9TW7TxmB5RU+oVVIRZWjVsqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2813 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. Signed-off-by: Liu Ying --- 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 63bd69c..6e0c019 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5892,6 +5892,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