From patchwork Wed Mar 31 06:33:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 413208 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.8 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, 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 38664C433E2 for ; Wed, 31 Mar 2021 06:49:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 00C4C619D6 for ; Wed, 31 Mar 2021 06:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233844AbhCaGs7 (ORCPT ); Wed, 31 Mar 2021 02:48:59 -0400 Received: from mail-vi1eur05on2047.outbound.protection.outlook.com ([40.107.21.47]:46945 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233831AbhCaGsg (ORCPT ); Wed, 31 Mar 2021 02:48:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FRvPtnHqI8mxbbtYFz8yR0b9x+A5auRa0NSGNfOavdsxemIlX0s01K3Yjg7XkRAOObygyel1ebsUPwR8aBpBZ2oHee6xRMfur4OjGVQJpSKtLQR0f86dLYf5Wpk3l1Eyte5UMbDX590CAk/1qSJeWkFt2Dr4GL9Iw2bayAYRU/MrdKgr5REt2TXcxiG4kxHjK1bFGU7XYisnXDhPlsq9gWowwu63n/sf6JslhA/zcs3cNPPieGuCENFcKkoDaPLKshPsp+5eACa+mekaSSHyzfFFEz8DEReXmqbJA5cF5bm1OElcH6uPKlqJ1fdnmnp9Pq3zcAVt3QQA2mEktG1Trw== 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=9bGkJWV6xCvtperfmZT8t5blnzN8BHYwX4xkycRkLkI=; b=Y2N1NO2Y9l7BybSz07b2Phw2ZRYGQQKcZbu6RPL4A9v0igoynKFJv3Ca1rqfq+lb1f6LygoSUVZ0oDAo3DfCkK+xQ7+Npzh+540w8eOiyd0bbqd2+uJxLYEW9aWjU2YLeEuh1KDSWaf60999t1E1LAGbfBQ4V7g0/f9LTufso+Wuns5DanCiuDIX7rgXKXjAk1Ig0/zQB+pQUkY3kOWVhfXBqBeV9s6xvm7Mkogm17+nn8ZDXsYgxdPxPubBVCwknyZo+k1IFfdXPVxODzzZhWUyfUsuR2iQDk6Cjxr83mm5DQwsUOjDu/ICJptif/J5ipqPFK4QpQj0mt1UXsa8JQ== 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=9bGkJWV6xCvtperfmZT8t5blnzN8BHYwX4xkycRkLkI=; b=m5rU1aLZSmG5+2l4HNe5T/dmxnkAW9jjVwJ6a3rKuthnLk+QFGWos4T/NPaaKHgPyd+REO/Ly+0NL8cB5im6+Sv5aaNONUKungNxQ8hbQfo/70WVdNYobJ5jF7lKG16jT4yg8CgfPAgkWB9SatCclHxm+dyRuiuWaJ6F2LIT57M= 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 VE1PR04MB6349.eurprd04.prod.outlook.com (2603:10a6:803:126::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Wed, 31 Mar 2021 06:48:32 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c%5]) with mapi id 15.20.3977.033; Wed, 31 Mar 2021 06:48:32 +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, marcel.ziswiler@toradex.com Subject: [PATCH v7 01/14] media: uapi: Add some RGB bus formats for i.MX8qm/qxp pixel combiner Date: Wed, 31 Mar 2021 14:33:12 +0800 Message-Id: <1617172405-12962-2-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> References: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) 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 MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.26 via Frontend Transport; Wed, 31 Mar 2021 06:48:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 59c737ec-5e82-4f28-e418-08d8f410ff99 X-MS-TrafficTypeDiagnostic: VE1PR04MB6349: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: kqPNZNiJRcxudBYVbh0cdoyqzJfSILgEQuuy7Srheww1zb/tYKFnZHOP+eZVEQBFkUII8ifRXcRIRruhjTtD401uRiU38nHD1AFJ+1n3lLknweW6kk6K5P8rJkg83YQ4as3KHg2eSY/yQmhi3Ewx2Asbzmf92w1g4D+p3/Wudus/+PUBm/zBSElgdtGbD6WpNmnY+ejW8HisORh25CKtqHlKvOAa8DXz387eGpclYTsb0Jk68YpZWpYREH49i+d7koOO/V9uqlKfoJkrjxFWV1XAzngW7+UPmzifvQPb4EudHnA+lE/NTCs4QC5nIgkCG+mtSMoed/SOchuLKtUdKuDuTlTZ92qrZBTMQEynYJ2hFEGStAEDYy41x+f4p2MFG9PxrqKtHoxklX/eiqiKe+CMpmzMrfeCp5zAPAOcvRbXZyK6yUEPEWTDyZ9UZb/oX0fdwuu1nMZ8ue3B10y1mPisk9kX475YhcRZmtLqZ8LppuhEMuNkgSxgDWnF8w0aIgmtDt4sfdRWnjv0couuxLbyoysRm1EfhUDjnvuMUxdtOWyYZ1gWuwYP93EX5+ckkpa9YnsttPJ0KdOKFcPIOJV31cdhsXDIvB/sddVymdEBjjOkeiic0MA5CwHE9kaNJ4fmH/IargMkr7vMETpKmKrSoRXWYG7+yiGqn8ax4jMgk2lXx2Wt8HTw4Nju4yfA 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)(16526019)(7416002)(52116002)(86362001)(6512007)(8676002)(6506007)(69590400012)(186003)(66556008)(5660300002)(26005)(498600001)(66476007)(38100700001)(4326008)(2616005)(956004)(83380400001)(36756003)(2906002)(6666004)(8936002)(6486002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: qL8/EwbUBej0CFws6YyDDkaG/g+YmBwCBILJ6voZraV0zY/e0kGP9BtKNnplyH3X5mfg2VfYL5SYat5kYtumypNiGQOQFKTGnlh5DEZiHz0k1I0B5ytplt5fPUjRYh0a9KJ1sQTgKEgJuKTLLz3AbJUrshbIPI7jud+GS4Ddn5t576Kiz92LPp3KGIUMNMr1KksTaJs9ty+OohkywizwGnpECNLSlBZPzdQWEFjG4ghmuVmjlNeipKyWuLhhjtLpkQlg3LlLAsjrFnNVKDm/vlASvwZps+/vX+O0TMZCTToojhJxFfYNW8Lkl4U4nP+GMiZbzluJe5i/kOc5mHfpervAV/nfU96ek7wt06UWZi4MA+wdhr336e6VYUaMo7NZihyzlXJYZ4WicYfdpDkar9pwhIZKoTV+PTOYQC4IP8J+ooXjw1/HR4u8l1ZkgSla4PAS7/B/kp5yprmdP/1sMMD0HN6QSoVSXIV0TLIn3FUiIstr963vCJsbd74929xgZf2WO3CsyZ8XPWS8UH7uh8Vf1Be8ysWRulsYmWnV/R9j6LW/2doNQX717UCp1PaaSeUK5qR8K3zgkTYd9EWXDr/va39/cn1oSByiwAixYocmXUmKQKUI+jlVDEYb475fCYsARrSaY/Z3Ojnn4jp0zBzEccfcV+F3EA4PLVZIcbESktsAai5/OwP4mhRHhTcxjx7Y9hnaPvhaw9nOvAEy9OMZHVlzHPOsCcKxFwdhzy/JDXYM1wWNc9iXpnEQ1biO4nadUrSyxE8kStN5rLEWgEDNLgns5CiOyBBTVVdaQpM8TwGbcy9mr3lJehgXNGHFwIrCwF4TOAqWSEvovU55ko8cNMIu0D1y4Ytjhno5eokg6r5+ASkfmG8bm2NaE6UHDjPx8mAKJHa5Pm8ORSfA/fxqzQKrPV5JAOOjrCuaLdIa2UShcWWYmXXn55O/7m3Gf2nhSDNmzZr0ZsnJKb+NR+tDMmAvG/KJXIGJ3jDq79CYZ3nT+IFlxCUaxWw3pYk/nTZJCTUHsmy/sUJeIxCj9fCIHkXTe9a2Rbi7YNgBGygQiPBwXeAaPM/R6ux1FvYh3qF8NI00A40p9xaUIcdnH/wEdmIEhGvem9BOBmx2fTnWzVvi33Yi7eyq8iofJRPrBj1f9i0Dj/GKFzJp7H0v0+ejCYGEcAd+QKNAJXcepmOa8fOLzS79L8Um1i5x95c9maqHu+BGpKIwkH5tOuczD8mYtZqkb0s3z0hg/p5KMhs0oOGeDWNEyCmKT6GdhhwFBayXoaRlkkgZMZWIRmRtrclVicN258Z1qyyC6b1nuBJlRcaEArR6u8o3gRCxAT6U X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59c737ec-5e82-4f28-e418-08d8f410ff99 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2021 06:48:32.0413 (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: TvctNh4D1bXdaNRyhVkGSQ3kc+syil9v2OEERORhqVhPeuTF/fgSmCq/yc+ljiqCIvi0K2oaOjzhF6fBDP5xLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6349 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds RGB666_1X30_CPADLO, RGB888_1X30_CPADLO, RGB666_1X36_CPADLO and RGB888_1X36_CPADLO bus formats used by i.MX8qm/qxp pixel combiner. The RGB pixels with padding low per component are transmitted on a 30-bit input bus(10-bit per component) from a display controller or a 36-bit output bus(12-bit per component) to a pixel link. Reviewed-by: Robert Foss Reviewed-by: Laurent Pinchart Signed-off-by: Liu Ying --- v6->v7: * No change. v5->v6: * Add Laurent's R-b tag. v4->v5: * Add Robert's R-b tag. v3->v4: * No change. v2->v3: * No change. v1->v2: * No change. include/uapi/linux/media-bus-format.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h index 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 31 06:33:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 413207 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.8 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, 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 C07F0C433E8 for ; Wed, 31 Mar 2021 06:49:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9BF04619D3 for ; Wed, 31 Mar 2021 06:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233858AbhCaGtB (ORCPT ); Wed, 31 Mar 2021 02:49:01 -0400 Received: from mail-vi1eur05on2054.outbound.protection.outlook.com ([40.107.21.54]:30848 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233833AbhCaGsv (ORCPT ); Wed, 31 Mar 2021 02:48:51 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V8ZoJW9xx0p72yRLDMhHYdpVSD0ulN9sh/WEG6gIEv5Ycbd3Fdh2J/2KZV6g7RBEwj838IYGxUD6KA2KnmNKYv23VwMMia5YIh1Tnfn1DuV8cLc+YpRiW6HIyF1/BJwyfqmbZCaEWJfRasWavTKQX+88NJoqHFNzFrgXZ1qyLm3jsgB3fnaYqzzywAFpTEF18nrjrvti20HaeeqUixxTnpgCOHtP3FGHd09l7kc4wRtKpjBpPB4RgBtjkmsKFzS/HaCrNUKg/koAfW7KRApDJkKFDs6tGlSCY8Wtqos0XHGy691ReaQyi3cQ3ZP47xnLxg6gQRF8fNoHbp/dc2cRsg== 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=Bz5Yugx7o08tzY0Nv7fpd9Zu+HT9pCTpWdkg4DSzQTE=; b=RmQ1tUfbCD6FQkPEHeyJe8dKlcoZmBN0Wpiy7JGO977GBOTcSmuMYyIIbH1RVw4t7gdp2jmKgfTAXGQRQ436LaafuhN+NodXQEs53Yc86zXajDDvMuQJin0qgd67R+qnJSnm/PjaEYZF/TOi3ljFjamdTMxMJAs7Zv1pFPVtrt7Ah3m5MfsbU9DqCmQBtThkaVJtpRQKhHJ1rE5EzR3VYKKbnignG/b1PLWjm8bjGva2FoIVCTJELs0CyhnzOpvR0+Yxsypg200NwNzTDQlvpC7ZeXhFqprCMIydB0eokUCiGu7A5EhKpRUKvK92YYundqEWNeqMvn+zzX/mo/+tyg== 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=Bz5Yugx7o08tzY0Nv7fpd9Zu+HT9pCTpWdkg4DSzQTE=; b=lrKE25/m8HRyImuEvNV/wB/ktqnCfgW2mGZOIx37RDnRhrfktuCbRMeG9hS0Uw5XvEZ4Kp9bfsB3tchYAXH/vC3RYRuA1WGjSSUTk5C16lnoDxVmUTeGcLYr3vwEgFZpNTmv0y3JV1DbG+F6s06UvDYip/PTVrEmXtuTN8sHy38= 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 VE1PR04MB6349.eurprd04.prod.outlook.com (2603:10a6:803:126::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Wed, 31 Mar 2021 06:48:46 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c%5]) with mapi id 15.20.3977.033; Wed, 31 Mar 2021 06:48:46 +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, marcel.ziswiler@toradex.com Subject: [PATCH v7 03/14] dt-bindings: display: bridge: Add i.MX8qm/qxp pixel combiner binding Date: Wed, 31 Mar 2021 14:33:14 +0800 Message-Id: <1617172405-12962-4-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> References: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) 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 MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.26 via Frontend Transport; Wed, 31 Mar 2021 06:48:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3ff97e55-6eab-41f6-f6fd-08d8f4110859 X-MS-TrafficTypeDiagnostic: VE1PR04MB6349: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: extLq0lM/sGUw1Nxko6Y9UAluMJcecaMg8Ji1bFrii9AlwVgL5VaRxjBxK3IWehDgBUh7q/DJN9144YLNAAemyDlspiIJDlfk/mTh/yzvUdtmTsqForfRC+5FOVEZjpdwtFhLmm+N9lPqoJ39iq6/a1vW+nxXDDxAwMfKwSzeMyCAXa2TcOP264iLsoUjpxS0fTQppztkViEEj7M7XVqOLlXoI/Q+OxZhtgnjyTJbb9WGrHo+C/JnkzotYvuZp27B0mPjEJHX5s+XVXNRhOcYa7/mrcr8lmrenhZqCcBc8L4ASonliEyptSCxsnCswRTeEQ+r1XQZjjG7llQShr5YLOIYJ0CQCsfU9rQzJboPRhZ8cKtkSlBl0zJDOaTwu8d6aSjgHHDhgCNsw72AD/LMxzN+/k7dZb59mWApkKbLR1vn6r18BDXLtJooqdrB5fqPfLSaK/JDlFFtJ7jw6p+YA9DFBTuTW56VhntvsZaatznaPz4lXd9zaHoJgwFI7on539FKbPFMVcuL4k+fwMAq8xE6dS3eEVbedEkdevmy81Y+GHKqldtcJ4LUYfvu0BTFyu/AJ1JXiBmcj08SFu+CEDIxj434F2/I3qmnyntFBpqSmWUcRU4mPL8OUw2RZFP26qI6/mUzdz5WUWFz+h/4GlSGzNdaTGZTD1dkSXp1zhmWdRVCHSzS38RmcMNN3SMqgFZWUEZkrwU4uCQ24QI2HuztUuyRPvOwQ8nBEmEpubFJHHGrOI0lmdBmD0Bk+GT 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)(16526019)(7416002)(52116002)(966005)(86362001)(6512007)(8676002)(6506007)(69590400012)(186003)(66556008)(5660300002)(26005)(498600001)(66476007)(38100700001)(4326008)(2616005)(956004)(83380400001)(36756003)(2906002)(6666004)(8936002)(6486002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CSKXEL7S7xlOZ1XzMm1/pQfCDBVdqMbwngsN3LStAMx3T3ieNVF8E0AtKoRuErrC+fa168nY97vDWA3dI5rpohRMGbQtnu7yxJCgc0ci4B8rZ5DO0VrlD0MumYz1ABgwH+wS4MR1Sj0+WjEQ9TM5UMJNon+Honyt3k4Wz0Oy5UY9xbRLV9SZnOyu0MM8cNi4W2h6gwtgQij3rAM37LH6y8TK4APaj/onCWIktEzKnO0Es13/L/+d5OQ7roWCEkZIEpE3MlcphJywwBQk+rQTVliSDXSXslFZ9Q+0Z6mlvF0NJVsdpBjdC+/YqMcjLJ7s1gVuMUIXI5MVtb+3kFE8yVbFApGLEXpXfQJUuUAxY+oHxpmL3kCQKtLXHKIKi+WqGDdoa5gaZ9Xe3W6qXlnofXyBytpJ/ivLPeXo34aby5oTDT+fOFPHXyTAkEbGL8vMEE8BPaxSZ7sWfahdkeIoC7A/Vqfl9UIO2Wp/Oj4jVOM1ZhQe+ZARsRj47/GKKQSwCyJ8VijBUXkrhSfkR01DXtkP0qPSSUmrFh3XAlhWWdLbKUNOYAwuEuTEat6uwcWW7GZ82R8ByQcA3ridjqSunDoASlI9jJGUJyzGMN9VFA/vopi/MzHcanHMsV5I+J5SSGd3dpkHMOOzIPqXnnyBDsj7w7GCM6EAMrzY7JXc3keoD5n2v/jbRVEMn3H0h1nPQ3gCowVHKXRZBXhafRjUUOEiShAINDy4gFZgsS55lg+ArJefs2mQ0/gzUfAUlx7AGUzy3sxzi3lImHnEihCPTyPK9D67sBoiILncpNFQnzWtXkleDHtPN4Ry4XTAytjS08miEwrN0L5iCBBuiK3Qoew9MUTk6rloebHfK3xDAgoqsBrggFjg3laHs0Dgs6XV1hqT5fvcWrWmBhSKR8Rl7E8UptqVCu76U1i+WZC3nXcOqj+Y+KJjpJzcJi4PhC9J6sdZ/Bqp4f2BMk1a9N/JR5j5ZLpx8g8LRHiMM7ERLgjGz8pesyMThFI4xJ0ngjLTn0Wgq2o32IUtE5AIihK+W/LD39H8PUHez/lfHKFUfGLnGCJmC0FMufNI6nS19YCR5mmdCXFjRkCKPWEuTg+AaomtJIQpliCcWWUxs/rmxUuwyRrx4ZLHMurXiKdlVOxqa9oVUDn3tI4DryozaVfB9Yzno4fHiLM70KyVT0xxlg8Tg6FNDDZBlbSWYi3gneddLzDkKLtlIUxNfNaKRwGFVgK9d4QCQYlVbtKckUlLC00e2b6TiO3EVI4s/2BgAszPEEXepXqUNHMx4EEyW9UNtVrSP089PMRYWUF6wiNl3r+3qgCPsaKHOify0HtrI1Yo X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ff97e55-6eab-41f6-f6fd-08d8f4110859 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2021 06:48:46.7328 (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: XBQkaWTnG72ll/96CDP3tqbAfwdu1iK+xPGhLQoNBeu/V7GEh9mBlzjdSC+v/3Uv0ypg06aTkqYpF6gZbHBIvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6349 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 --- v6->v7: * No change. v5->v6: * No change. v4->v5: * No change. v3->v4: * No change. v2->v3: * Add Rob's R-b tag. v1->v2: * Use graph schema. (Laurent) * Use enum instead of oneOf + const for the reg property of pixel combiner channels. (Rob) .../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 31 06:33:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 413206 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.8 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, 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 15263C433E4 for ; Wed, 31 Mar 2021 06:50:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D93FB619D3 for ; Wed, 31 Mar 2021 06:50:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233906AbhCaGte (ORCPT ); Wed, 31 Mar 2021 02:49:34 -0400 Received: from mail-vi1eur05on2060.outbound.protection.outlook.com ([40.107.21.60]:3105 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233878AbhCaGtG (ORCPT ); Wed, 31 Mar 2021 02:49:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SROMjfOvfCnugBwTbx/19xI9a7iCC0Q1IR3dcV9B/r3HfO0GTkNQfrujEB0VdAvylPv+JtiVVg6IlVj8Fv/jN8p3d1h1vQebj0dSmo5q4N23nSC1WroVetcatRhp5avKCrbjdTVS7Ub1Nvs8BIPQmMwqlsNhaQjkNavn1KDEenzisGxl+AxSctN+eCUQwLLcDccFNXPRDE/sB6jLEh4gtArthmSu9Ilu3x6+liKJCvTEt7GM9YF41qJg7E0udJkW2rAb7fn/d1x4emhsx7kB1VXe7U6DnuuXgQSRrxi60ExQs/+81DQHdkx4HCH6WMuSCUxqZ85aXY/V5/mso4Pm9Q== 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=VkAWrg4KI3AOwkoNrBZL362aSby4CAgzJ48egcIHNqQ=; b=RokxJjLgpfEC45kf1yexOK6hFxk/0hvjR562ugnVD4uU5XYs1olfPlYthswLK9LZIjRUR1tSbzcdiWUMyerDze+HVa9Mf91Iyt7dsZzOLqaXY5QNt4O8c198TOOX1Lv3nRY+oh5I+Mvz0y5lBNaSEg7hxICUNMAHFXDfcAH4n9YJijIqdEo1VA1mnwwV7VzIyxlBM7xdHOKPc90HNn03k0oQw6Ja//L9mFY1r9X2APVjRepivLtOd3UTlqZODMo8eBodOHSXBqvJiX6wVJxP3Plrmhsty1LGv/JeAbuVO254FzO99lF+tI3Kah1jv1bIaQSFd6E8nCiHiDEDfmh7jw== 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=VkAWrg4KI3AOwkoNrBZL362aSby4CAgzJ48egcIHNqQ=; b=hywxOEnE337uUkIxLp5xt35dxDb1tdKJjslBwmCuD7YnnUv7vfBEYaPmHjp/VaEDQuPIzCdgp90X4tPR4wok5Ddm5eKvyuaucP0leaaD3T9ECwj79/9B8typzeqSWDk8RuuOhdR+42OmA4UggAlVB4+g7Wqe+0unZtC9f6O+HOo= 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 VE1PR04MB6349.eurprd04.prod.outlook.com (2603:10a6:803:126::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Wed, 31 Mar 2021 06:49:01 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c%5]) with mapi id 15.20.3977.033; Wed, 31 Mar 2021 06:49:01 +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, marcel.ziswiler@toradex.com Subject: [PATCH v7 05/14] dt-bindings: display: bridge: Add i.MX8qm/qxp display pixel link binding Date: Wed, 31 Mar 2021 14:33:16 +0800 Message-Id: <1617172405-12962-6-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> References: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) 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 MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.26 via Frontend Transport; Wed, 31 Mar 2021 06:48:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ee6b21e0-a9d8-458f-eb1b-08d8f41110e1 X-MS-TrafficTypeDiagnostic: VE1PR04MB6349: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: k0QjxKN6WyCdkVxu4mC7kNj4183VsAe+0H1MrL7Bd4rYg0JuJ075lSt+4MRxMsKcrorRghYPPbN+NbivySLjsPlehC2LJttIyGuN8heSsNXhEvQ6X+2vzNaQ+Rk4GQ2BiPlgSLoNVXL8vck/bx4Ex8N7mY/ySJHwR0ioOUiqp9WJVoaMVgSwYnRMdQbkOp7oEn74wEpN9IgstuCn6VFy8YfnfN5kaesEdvYmQ9AwmHfnGeYB+Z4RHIixtSEIvyXC7T77HaF99iP7v1ESyosAOCQGEgBCnd3jJWrBjWvAslemdRnpieoMjV6/6axY7vTGLm51LzgthT9w1X/SxuyJoSEls7hQputl+Wvjhwof02E6jFnSfJ5brH94N8TQsmzerBjXwgacAf04+cTjwrUS4YuJ4yMVLt3Nk32F/OjJ9X+15pNJuLxXAlR0KZulOvt7bAnSIMScs9xP2rFw6S9StBcCpbjXNqPeAtt1kKPwJrgLbXBBUFdD5CZcwCEZSksCVaEIMnJbc8sFFtgk2BPPH4y952LteEFNeUElnASgGaJYth6upsfKEFqtalV+NUOD/3LBwn4QYE27wPH4JpT6uf2iNJ0/7GVXXMw5K4atpaTwwtK+0tu5Ey/8Xs9aUxof7fsMZPoB1LAD8F/IN7sKR/rFpeFGQ+RPpdS5Doy+p5n9M36tnkhHgvbQZVLsf86klQOJtDDs6BWq6/aOI/DgbCU7xLFoOx4V6Wnr6uUsMLv6krfNILug/u00pHz8pC40 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)(16526019)(7416002)(52116002)(966005)(86362001)(6512007)(8676002)(6506007)(69590400012)(186003)(66556008)(5660300002)(26005)(498600001)(66476007)(38100700001)(4326008)(2616005)(956004)(83380400001)(36756003)(2906002)(6666004)(8936002)(6486002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Rdb+ce4OSgMGbVd9kqGaKQbo/5Du3eucZE6hcS+pFZ5Ygx4YWc1De7PJ0h9teNPNtG2H2YXoxq/bN+A05LXIyxdR1b4WOXHGt1n1Hzqj97J6UMbsMxVJoRrxkN5qSK17Igjdkeh60G+6bhFZO+fsdjfnGU6EQ2nUiYCiwO6Th4fiKPPG/KQv8BIOq1dXcelSW3X+g5S06ncwr22iIqmrADLnaWhLrHyEyqqaBlqog9ULqRGuUxwc9sTrO+n0gadbZwM6PwgjUJw645Xoexs307t4rQXAhG2g8/Qb1DtmOJlnlEmnWmsFvgCyj00ibNeBYZOve63D7eCEQby/HJb05jAtk/pnWsZ2gXChMV04FRR4z/uUWJH7KXIMFnZFgKm0I48nmtyu+scJOxAB1SJTM0fkk+2YVmJqQD+wWK2zOdJ49azLZMDdLb1k3Qd3jGA6Qxrs4QbhQofppEvbGMnVcxB9gCYaN1jXSqRWRCh9+V11DkLfGvVumtCGaZvFFLTqnjER0MjPnwVFhycDaRT1FJgNjYViw0XaSjzE1bLmZR3dUEz0Vr5ldW9PA66+vKe6m+bCuB2lHeayp1cdHf4yo7zhauaMUSG53pRfpKQm7INu3KwqTilc5JCqbhrVS2oTVArG8zFtVK0f+zuGUz90H6H2LUttHmhCj69KE2i7cFmhs4cKC2UMhHa1+Df6IYdDOs/h+smtU9AKyE6/02sFcMfCa6LvMi4fdUeTxG5xlTn+1xJ1DSa5Li1/kx+6UItjJfI3ipS8Rsj1KwV0pxj20ov/xJOL7qzFvrwNt+Vm6a6v8Ybk7C1AbL6CyhCSHKwfEBMt1ZxCbQ3wOFDrO/Suwni2ReKgIx+P+5Qkdh9Yky1Zow38RDY2rC6gDzdhlXnxbrU7D9pO3lK7DBVouGvMo0EE+fVWrlAkaZ7YCblTDL2fUK38Pt8sORB+EzNvWnwcyXLf82XKABfG1dgLdGvKxQ+cH3kSvqOSJASdo5nqTi9V8EcXpKAF4ALcabFQRpM2WfhvwGiQEugd/90P3qdJp8b74ll5AOCDwevFHSvVb3ggzI93IU5GIAIJ+j/u1F5GMOmEcc+P5BYHBtpknMHiFNtEA7IfmwwEpBYDCGh6pfACN9NtEdNGsmJn/2+tcjVpL1yXZAYEOuXTByrzODDmngiCpc7KB2NyaVUY7kqQ0azklZM/LHL6RG8bYoHGWhvrobfkqtEvXa5OAyMVfY0p2EnPG8tzNQ0QTc+TKDBGVEWN9O+4Kh4ACJa6CwCsU/hUef7OYLaWL62+MwPtWJ7LZfL9jclvm73ycNOKScU9N+vSKYGWjT89YCY7T8S2IGw8 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee6b21e0-a9d8-458f-eb1b-08d8f41110e1 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2021 06:49:01.1045 (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: e1a7y0dSL9PwHBUUq1CfC64GbQO5zNMRYt3ycqj++YngGQbM+GsKkC6BB7ZL/wV7OYo+QBvEYjcjMiUKW6LmmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6349 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 --- v6->v7: * No change. v5->v6: * No change. v4->v5: * No change. v3->v4: * No change. v2->v3: * Add Rob's R-b tag. v1->v2: * Use graph schema. (Laurent) * Require all four pixel link output ports. (Laurent) * Mention pixel link is accessed via SCU firmware. (Rob) .../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 31 06:33:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 413205 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.8 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, 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 BDE15C433EA for ; Wed, 31 Mar 2021 06:50:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7D3E619D8 for ; Wed, 31 Mar 2021 06:50:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233928AbhCaGth (ORCPT ); Wed, 31 Mar 2021 02:49:37 -0400 Received: from mail-vi1eur05on2058.outbound.protection.outlook.com ([40.107.21.58]:10337 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233762AbhCaGtT (ORCPT ); Wed, 31 Mar 2021 02:49:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mm3HguuodfPb4x4w2oCFYS8U6wpiMx1Ipv02Mewn14xtq9cXeVv96MER4zX0e/qpTJMSYMCjE0Pa+b5/IcNyC1uTKTLwmzWhA+GUBdYvgxZNXuwnkvQ3QpPLDYy4XtCpAey1s0bjQuACAi3qULzsIziwEVF96dhRCFVH+iFVA0ZREnnoFTu7MP/xVUcW4dG2sPJDP7PT2W5FZnTh+LuMTrUz/fUxgxhOkVXNF489KpaC8tvpjxsV1XmhNDlp63MI6xsmMLH6ZOjr1LmOBuf8C1b/DIdgcpmy5pwy+E0oq0mtUUwN1Dg+7NC0jOF/XIz2XNHXZXI4B8ag1YUXn2Zvcg== 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=1eWm4JZlqv4rFyeApcpbnQveIqn7YBMJJvZQNJnEf38=; b=jQ44dkxZZ733MFqTglMIzXfSeD5Dxe4FmAlYP7WqTf76pXPx4CWsEioHISKT0p0cvyrzx4psAFqE87RO2qlmnlKDUM0Hcq7vCGVBFkzK8q3owHsKZ0Ud+VKv25nPT0YS+csDrp7MK/z73mtTG36P1fAUuVe7D6WUHPhKRp4xqj3A5pcgSfoVJZBXjoCl/RpOebbemTRCl0qSKKqxU3KRuzXIXr/k86DpSOoMfFcpJPF2ZNN9cV+L1v8Yh9+E7x3zxruUNc8VfSz49W84GrVtGrjAzGyf4SKLiTyuV32Z0k3IqzcWQfBSN3d+i/2wi5ovdiOgscVcLvGWhboGa1046w== 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=1eWm4JZlqv4rFyeApcpbnQveIqn7YBMJJvZQNJnEf38=; b=gR/McfiX9QzZRE6AXahPgKn7dRQQ0R15RrlnYi/v22rVlrngCxHmLZjJD8tKjupw3f4Qs5z5tZGPSrR+bZ4l9IIlMHdWbTtFMLlLwomVBZ3FxbkIxkX1+/cTRN668rgFozvhXSlekQGrEkELieu6/GWhorN4L9O27DfPFtXz1S4= 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 VE1PR04MB6349.eurprd04.prod.outlook.com (2603:10a6:803:126::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Wed, 31 Mar 2021 06:49:15 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c%5]) with mapi id 15.20.3977.033; Wed, 31 Mar 2021 06:49: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, marcel.ziswiler@toradex.com Subject: [PATCH v7 07/14] dt-bindings: mfd: Add i.MX8qm/qxp Control and Status Registers module binding Date: Wed, 31 Mar 2021 14:33:18 +0800 Message-Id: <1617172405-12962-8-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> References: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) 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 MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.26 via Frontend Transport; Wed, 31 Mar 2021 06:49:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a9030067-a03c-46f7-4796-08d8f4111967 X-MS-TrafficTypeDiagnostic: VE1PR04MB6349: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: et23n0cKrgjNG23PMqfC6WTW863TFsmRyzh9WSiBfNkiDWjtlC0KtGle6ADr5d3IYq6YgmHMgEw9UD5Gq0lz+i/f/PKb2R+T8ADnPk2ZYlP149bxAp2IBdnqXfR3bsvMDCeTj8AitErrhN3x7AQzk7gS0u+wrPCZPjGcaU8kJ2af2Cws8PaQkvbjhNL7F3nddaZkPj3qlxHOfyeJSpnfqrpM4RWIMZnXPN6kBFxFsN5obTgrKKUyQiHQQiKg6gEuR2Ztiu7mtyCGJu1ZvtSTKBfYCZPnAb30a/SNorBQ/R8+WQV8eZVoqKjg6l1kiqQKt0ynQzXqr0PTkKyP4yeHiZf1UqGTPYSuRBt6r81NuHDvTAf7zJ0qlp69hXHWLdWfmPw1kPbTGG8OSDQdXn3V28KqzmBh4tJsLjCjuYo/ZvZduHIErKcWothuF/4GNi1vgcIOcJDyfHNK1L+sZt3oyCGfNcrR/ms4UtjuQQxsmZEMAsCVpaLQcOFcdIZYy1TzdZBbGDZpe0wW9qoBscqYysZlIpY0wyAkPJoRNVkathRv100ioOmqlgxAAcxIJM4mqYFRzIp/C8FjfBnAuHwryCoCeHYdaXtMuglI0zjlpWXllHrdjkwOu5CYqIjDNSnO7cIny0z9fXwc5aUuUJCN9KHeggFX5vKLQyrl25b9RqfaPWdjac6Wtya/mFOcuUQdNlEnUbYEaJ1IgS9t40cJ0JENvuQKhngDRKKvH21+NxQ9PISFqUPURegTjbg+74CO 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)(16526019)(7416002)(52116002)(966005)(86362001)(6512007)(8676002)(6506007)(69590400012)(186003)(66556008)(5660300002)(26005)(498600001)(66476007)(38100700001)(4326008)(2616005)(956004)(83380400001)(36756003)(2906002)(6666004)(8936002)(6486002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ZAAZyaZ+sNUPB8BhUzqNWMZjXXUld283hBTG//CadEFiM+qDMoXqaRKDyS+kP3tnSkgc0RDtpi7jOcbsbA+G8CUf1/OZ657wT2zivckynG+rvm32DiLG4ROs377PkSEPuHrDqiYOeHywxntnPnkgLMVJquAPCx3l8zELR+F6erDpRFNMyX7DvmDV6Qghl8os3W5Wr5fqN4wzLnKJglxJnu/0jrMqlqkhAfRR6y+/FZaBePiij9KG/UhAnYhyn2+6K9qUR4sNd9bU8WSWFKPyiurvqVYfOQTaz1RZWhF+5q5mQEfKuzUGc5DEleeF2+hOTTfkb3cgpHYUUFmCMuDpUtWMaCw6f8QhtG6xGxGqdmwDCdc2rJBCd3pPcUAqhb+yPXcoa0uCkAS0wAxskZylgKmE7m8/zIpOTFvYOTdpcdvmcQDveqysg6UTzL53/RDzEgW1oKOIhbMo+s3cmDU3OpRuLkgijF8ARJy9hWcUcUQ2rO9LwgeQI4lrmvrwW7wDQkos6XmGyO/rvsClpOQ8zn6zJd6D36g0IlzIodU5i3+PkOggbT8/v6dgZwhQ5OQDKkqPx2+omy/Is8e7Aj8gRHKnWY4NLblWmCwPm2qxF1WLOdME8c9tWiB2AJXWgKR/bpbZ7plu1IaKdx3tpMXPjuAyYZnxYqnFFHPeOZG0Z2OTUQa7xHnBIFwP65E50iXaBte7XxqdHrDZuDPCxNoFE+TOElp/Kk76wVQb+RP2R/OM8h4r9274zapLNP3Njcen2iwdodmFCSEv4ny3q1bn74b6nDP/DBaFWtf/sCRUxyckDHOYEfMAmdL7vTAjOmltZG4W2+9YrScQKICvxyvz/9+k74Aqdeca8djiEgzrDIGyAaxGMkRTY3MQi/xvUA03oY7MdT+q4jUS6lQunogPdHLirWwLKEZ4icr51AeLbOAegqa8mZYxM5NWMiofAFgorvW0MP8IIhkaSOywPyrkrAF2dfzJuPacsbvvWDIsCVzHwUGqX3LL8y+E/QFwTCAdFpFKWPQ9fChSZ18u61olC7d2w9M7eN0jX5WAKBYHMMTIdYIIFUcILalWaDlM6gDm61pUdHzON+cZXjrzvLb1vNOlKFpVYYgFhKJhHeyprLMoN38seweVw/CdffFnxBxlf6Ydi/31K58OREjieAfhelDSXRj6eK2YghrJkVFS5uGB6sIE4Qs5i1WBGm5RZtOJ8MEpBjAQN1cxileGnz8Nq/GIfmcRu+8Yp4CoP4r9hamaxKxmx4gt6VtlYmhy8AhmZxFCqmW0MtSTHyslrz+UK0ck7akUH5go28QLZ0Ngsfr3gOIyOZmdMSlmuks2ppXC X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9030067-a03c-46f7-4796-08d8f4111967 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2021 06:49:15.3284 (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: /ein9F7T8wcGugqmkBRZSFB+tJvJfz4s6NBxiU6snc1CVix2wQy9RGZrJrmQ3ftlVqhrzotg4H5tbh3RjGcuNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6349 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds bindings for i.MX8qm/qxp Control and Status Registers module. Reviewed-by: Rob Herring Signed-off-by: Liu Ying --- v6->v7: * Add Rob's R-b tag. v5->v6: * Drop 'select' schema. (Rob) v4->v5: * Newly introduced in v5. (Rob) .../devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml | 192 +++++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml diff --git a/Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml b/Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml new file mode 100644 index 00000000..f095771 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/fsl,imx8qxp-csr.yaml @@ -0,0 +1,192 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/fsl,imx8qxp-csr.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qm/qxp Control and Status Registers Module Bindings + +maintainers: + - Liu Ying + +description: | + As a system controller, the Freescale i.MX8qm/qxp Control and Status + Registers(CSR) module represents a set of miscellaneous registers of a + specific subsystem. It may provide control and/or status report interfaces + to a mix of standalone hardware devices within that subsystem. One typical + use-case is for some other nodes to acquire a reference to the syscon node + by phandle, and the other typical use-case is that the operating system + should consider all subnodes of the CSR module as separate child devices. + +properties: + $nodename: + pattern: "^syscon@[0-9a-f]+$" + + compatible: + items: + - enum: + - fsl,imx8qxp-mipi-lvds-csr + - fsl,imx8qm-lvds-csr + - const: syscon + - const: simple-mfd + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + const: ipg + +patternProperties: + "^(ldb|phy|pxl2dpi)$": + type: object + description: The possible child devices of the CSR module. + +required: + - compatible + - reg + - clocks + - clock-names + +allOf: + - if: + properties: + compatible: + contains: + const: fsl,imx8qxp-mipi-lvds-csr + then: + required: + - pxl2dpi + - ldb + + - if: + properties: + compatible: + contains: + const: fsl,imx8qm-lvds-csr + then: + required: + - phy + - ldb + +additionalProperties: false + +examples: + - | + #include + #include + mipi_lvds_0_csr: syscon@56221000 { + compatible = "fsl,imx8qxp-mipi-lvds-csr", "syscon", "simple-mfd"; + reg = <0x56221000 0x1000>; + clocks = <&mipi_lvds_0_di_mipi_lvds_regs_lpcg IMX_LPCG_CLK_4>; + clock-names = "ipg"; + + mipi_lvds_0_pxl2dpi: pxl2dpi { + compatible = "fsl,imx8qxp-pxl2dpi"; + fsl,sc-resource = ; + power-domains = <&pd IMX_SC_R_MIPI_0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + mipi_lvds_0_pxl2dpi_dc0_pixel_link0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dc0_pixel_link0_mipi_lvds_0_pxl2dpi>; + }; + + mipi_lvds_0_pxl2dpi_dc0_pixel_link1: endpoint@1 { + reg = <1>; + remote-endpoint = <&dc0_pixel_link1_mipi_lvds_0_pxl2dpi>; + }; + }; + + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch0: endpoint@0 { + reg = <0>; + remote-endpoint = <&mipi_lvds_0_ldb_ch0_mipi_lvds_0_pxl2dpi>; + }; + + mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch1: endpoint@1 { + reg = <1>; + remote-endpoint = <&mipi_lvds_0_ldb_ch1_mipi_lvds_0_pxl2dpi>; + }; + }; + }; + }; + + mipi_lvds_0_ldb: ldb { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,imx8qxp-ldb"; + clocks = <&clk IMX_SC_R_LVDS_0 IMX_SC_PM_CLK_MISC2>, + <&clk IMX_SC_R_LVDS_0 IMX_SC_PM_CLK_BYPASS>; + clock-names = "pixel", "bypass"; + power-domains = <&pd IMX_SC_R_LVDS_0>; + + channel@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + phys = <&mipi_lvds_0_phy>; + phy-names = "lvds_phy"; + + port@0 { + reg = <0>; + + mipi_lvds_0_ldb_ch0_mipi_lvds_0_pxl2dpi: endpoint { + remote-endpoint = <&mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch0>; + }; + }; + + port@1 { + reg = <1>; + + /* ... */ + }; + }; + + channel@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + phys = <&mipi_lvds_0_phy>; + phy-names = "lvds_phy"; + + port@0 { + reg = <0>; + + mipi_lvds_0_ldb_ch1_mipi_lvds_0_pxl2dpi: endpoint { + remote-endpoint = <&mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch1>; + }; + }; + + port@1 { + reg = <1>; + + /* ... */ + }; + }; + }; + }; + + mipi_lvds_0_phy: phy@56228300 { + compatible = "fsl,imx8qxp-mipi-dphy"; + reg = <0x56228300 0x100>; + clocks = <&clk IMX_SC_R_LVDS_0 IMX_SC_PM_CLK_PHY>; + clock-names = "phy_ref"; + #phy-cells = <0>; + fsl,syscon = <&mipi_lvds_0_csr>; + power-domains = <&pd IMX_SC_R_MIPI_0>; + }; From patchwork Wed Mar 31 06:33:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 413204 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.8 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, 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 3E140C433DB for ; Wed, 31 Mar 2021 06:50:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB871619BC for ; Wed, 31 Mar 2021 06:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233981AbhCaGuD (ORCPT ); Wed, 31 Mar 2021 02:50:03 -0400 Received: from mail-vi1eur05on2066.outbound.protection.outlook.com ([40.107.21.66]:7520 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233905AbhCaGtf (ORCPT ); Wed, 31 Mar 2021 02:49:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cKgzBWDvCO4u8iaRotVddFXjo+/vo6jrYHfu11nzi78YcL8xvGryamnFnwxJ1sQCj6SMOBJf2ufbyIaTktZgpFLya0L6I+RHPKLIcoza945r/svm4XUNL+A5X6jm6mlq8qvvHeIsHeNo46DjXFfcNkDSsa/GUP3mQsVjIKo/Rfq4V/Ap/NyvmjZ5Wo8TVZzGcg6OWYxBfloLziHaJ956TSKTkBeVmSM/bOAxqHLDs9fodlz+mwy2MqXT+l/feAEkiwz+ZqucEZhewO6n0cx+6LTSGIZk5wAVC8dx0ZtPyaNnbk48kWs0bIKchRhAP8htjUqPQ90KvZc2f0itrOZj3Q== 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=6ZOAIP3PhOuVwAD2Vw7mvRNYnWj4N0TuvBGrIBVt9qc=; b=ZyXNAwU8O22EXhxbuWHmrbtwTXJNbWHNBWgDi4s9LrxD6yPRwHeTShNgB9BgdUIFfNIu4i42K7GbDHTnByQfRbgfXf6RCANn4W7wFvuS2meSAACR+wyNZMRGvclaNaT/B46PJ3QkaIjwJ7hDA2zhZFfINMD5XthHrDTzdJw9lQOYuKI827XuoQ2SXy0hxzkrCWV6KmU5nUcULM8ZGfVOOf/murNhBxBKuOZEGBSg0ByvT9B5Hn47AjPd0JPq9zlFnawqw6+POkfVBwH6m/1R6x8FRNPD88e2cdSCv/jA8BEClYzJV93X8vDfjtnsrwb7oGrnWCH5r1qens5yp9yM4Q== 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=6ZOAIP3PhOuVwAD2Vw7mvRNYnWj4N0TuvBGrIBVt9qc=; b=FHYBlZm7hsbSKhz5LZDE17151/pWagr0FiYm2T/2oNa/CVEiku4oT+6WxtZhiIb2qjxVxKDm930jB2zJh6sDMDv0ZPALmE1gNiYz42+RrBVtWKgxc/p9UwTHz/HqygjhbrHr+W5f1FC0QjFfj6HozfiOf4FUPhWLjQC7SYQjp4o= 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 VE1PR04MB6349.eurprd04.prod.outlook.com (2603:10a6:803:126::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Wed, 31 Mar 2021 06:49:29 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c%5]) with mapi id 15.20.3977.033; Wed, 31 Mar 2021 06:49:29 +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, marcel.ziswiler@toradex.com Subject: [PATCH v7 09/14] drm/bridge: imx: Add i.MX8qxp pixel link to DPI support Date: Wed, 31 Mar 2021 14:33:20 +0800 Message-Id: <1617172405-12962-10-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> References: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) 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 MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.26 via Frontend Transport; Wed, 31 Mar 2021 06:49:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fcac6f85-2ccc-47c7-cd03-08d8f41121d1 X-MS-TrafficTypeDiagnostic: VE1PR04MB6349: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: 9GX8hDmBQQBEFKkoyggPKVindwhFcHnu/LdDy3rzJsZv9QYKbRquVKwX8252GDSYTvhMX+rjNFkAm8BD0p6ch11jrVyOeMqhGsQcugqEhUHodinSBArkF//NJPWZRl5cMRNfETTrw8CKluKoPleNF+g9H1X9sJglIXlXAUP7AAgQnqpam6fv1lKwozBWD16Wl4yoVpNmGZllwR18z7Apfpf78hpmrqxuENGUp8S/txxBLX6s/wyKv5QMe2bQbFjtAIQst+wRyfU2J2fqL78Rx3xsetTH6QhJoMCFBjsqLfiZPlfJp5wyZY3hiDNGAn5MMuwKv9L3UuFjHmgStaa+EFXoK0R16jPG57tD7f+3cQ5RujmmsctglrK3oRxg0NsW9hc3edZKt4Q/n8d6T4mVcpglc4XtMPMwp0Rou4lpW+zNjuXs11DTUokPIioLZ+IvGvCmdQkw/L2T8xrzlvwVOUvuU544DGQ1Y9vcwv1Is7Sp3LE6uiOIoqdW9I3TFELJo3gsTynRKzLztT11vdtFU3WAIFCjB2uriuu4sVLzEsF5IG5tl9zoJKp4i11OVbVAa6KTNkJdtTGgsM+7GiXlmI5KTPPZ4ypjeF6TcRNW5EA9FRgbQVEgSFduEz5Zq5v9Rw42Cz4UFznXlZRdpndCMA== 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)(16526019)(7416002)(52116002)(30864003)(86362001)(6512007)(8676002)(6506007)(186003)(66556008)(5660300002)(26005)(498600001)(66476007)(38100700001)(4326008)(2616005)(956004)(83380400001)(36756003)(2906002)(8936002)(6486002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?swRKIM2r53XMQZrX0tB5P8rhWth?= =?utf-8?q?81qVDt/dI+Xjfg5LVtpnCNNwYwwvUnYZ+Oww/xdCnbv53qC8SGFZRuIw?= =?utf-8?q?5FqYjMorWzVW15Xle7pF1t7FCkgDyKFRPVn4kR32ISU75IXx3PPBaN/8?= =?utf-8?q?vcC9pvX+a4hBxYXWFGtlF0P/cpOLZWOHz2Yla70aenxE60MlwUXD5F0j?= =?utf-8?q?HJK73+P5wEIzku/ldvJXVbU9bGm/dvuUREbR/N3x3zexE3bk7mnVqxxq?= =?utf-8?q?ni6CT69gAOBZujNyWmO7lf/HUZVY111qxoAUX5jjHVNzQr4yGHijjnHB?= =?utf-8?q?2Imt8YNz7u4Gw846oUGOXQPLr0n00JTg/XncaeUlWUSk2gzzZVK+jgqZ?= =?utf-8?q?kC/hJOxTCVwgh5hvhN9UYnsXE0Etj7gwsACaySBq2+pqHruYOzDtI94+?= =?utf-8?q?ZqiY3S6r3lZ6Lp+veaXc2SH+2xYAfXatTJWDuaoJq+tZuA13FhdczMNz?= =?utf-8?q?y57rIsSnOZwUdJxdmh+bm00FedSDjfMOsNgpUo8Ryty1i6SKcC57iTVV?= =?utf-8?q?vu82cMevayTprNaEgPtqCqwNvJuZ5uzhVrGDo+fnR6vddbyQV/d7AdNp?= =?utf-8?q?x9g/HbZmOc/99ZyBBnWqryD/m84/V4RKJ7nuhVd9XE8fosxvWJKXLOd2?= =?utf-8?q?YzUDF2VLIxw/E0IFTTKtWf8HMesaBhTbfUpHtZsRAip5cTYpUdfEvhA8?= =?utf-8?q?ALMtyEdErwqycgC2EusPSTo6PuisVDeIoQIEVGUuQ205Y1J9uTCsF5bv?= =?utf-8?q?vUB4CTOhAhZAweswPyOvyj9U77lVLBU8InRDTz7RY1Qos06JpQTmZMtf?= =?utf-8?q?MrGxh1F2XgTK+VALRj/uino5nqu3ELMog2JzfuTm5Zk17hCZvik5ykdX?= =?utf-8?q?wcBfAgVR0d88JPXLjfNtk2deXqIVXq5j5131Wjx0MRWHit1jbxcv7Smh?= =?utf-8?q?9i+MyGY4ucDWg/EQ3QBWvZIFNyMFLAeoLDuYRATg8189B2dgNDjl9P45?= =?utf-8?q?S6CJeavG5YEBIGjmyQcufLwaSL4gvX8fDqj2nD626lPSR+bUwSft0BJ8?= =?utf-8?q?qRwaTPvgvZqD7a0kJi3BXCSUSgV2u2UiypVNpB+S7Mk2XGMA3An1XK8H?= =?utf-8?q?RUFbomT5vMOxHbPOQcH+JWgF/hj2tefc5zKKwq/pgWQgTq6cy7/dDOTY?= =?utf-8?q?pxhSg/eAdauAAqqlqiYG2HWvnZ8JOXZky1/KWP0wje9jPG4N3UOsyVVM?= =?utf-8?q?J9QVD2XX5tg7TAo1zrTosuBOfAgEYJLZ+aMXj4ISqKXhabLNN39OGupZ?= =?utf-8?q?WiisijIQFyU8xpqs6cfj3Yv1VW7snjcSvg17YAS0pIHf8HorjLRauVDE?= =?utf-8?q?aLNn9aDbjRK/WRES7VDZWZ9lA612G?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcac6f85-2ccc-47c7-cd03-08d8f41121d1 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2021 06:49:29.5392 (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: btGPco6coXh4VtZVcRM0CGmUmEjyRMcYy0EON3xhLweCUN4VonyQQOur9KIPozd4U0Xi+/2TcYCanEc+t8DuUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6349 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds a drm bridge driver for i.MX8qxp pixel link to display pixel interface(PXL2DPI). The PXL2DPI interfaces the pixel link 36-bit data output and the DSI controller’s MIPI-DPI 24-bit data input, and inputs of LVDS Display Bridge(LDB) module used in LVDS mode, to remap the pixel color codings between those modules. The PXL2DPI is purely combinatorial. Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- Marcel, I add your T-b tag from v6, let me know if you want me to drop it, as the checkpatch fix and indentation fix in v7 are trivial. v6->v7: * Fix below complaints from 'checkpatch.pl --strict'. (Robert) - 'Alignment should match open parenthesis' - 'ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP' * A trivial indentation fix. (Robert) * Add Marcel's T-b tag. * Add Robert's R-b tag. v5->v6: * No change. v4->v5: * No change. v3->v4: * Use 'fsl,sc-resource' DT property to get the SCU resource ID associated with the PXL2DPI instance instead of using alias ID. (Rob) v2->v3: * Call syscon_node_to_regmap() to get regmap instead of syscon_regmap_lookup_by_phandle(). v1->v2: * Drop unnecessary port availability check. drivers/gpu/drm/bridge/imx/Kconfig | 8 + drivers/gpu/drm/bridge/imx/Makefile | 1 + drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 487 +++++++++++++++++++++++++++ 3 files changed, 496 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index 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..309f47a --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c @@ -0,0 +1,487 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define PXL2DPI_CTRL 0x40 +#define CFG1_16BIT 0x0 +#define CFG2_16BIT 0x1 +#define CFG3_16BIT 0x2 +#define CFG1_18BIT 0x3 +#define CFG2_18BIT 0x4 +#define CFG_24BIT 0x5 + +#define DRIVER_NAME "imx8qxp-pxl2dpi" + +struct imx8qxp_pxl2dpi { + struct regmap *regmap; + struct drm_bridge bridge; + struct drm_bridge *next_bridge; + struct drm_bridge *companion; + struct device *dev; + struct imx_sc_ipc *ipc_handle; + u32 sc_resource; + u32 in_bus_format; + u32 out_bus_format; + u32 pl_sel; +}; + +#define bridge_to_p2d(b) container_of(b, struct imx8qxp_pxl2dpi, bridge) + +static int imx8qxp_pxl2dpi_bridge_attach(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; + + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { + DRM_DEV_ERROR(p2d->dev, + "do not support creating a drm_connector\n"); + return -EINVAL; + } + + if (!bridge->encoder) { + DRM_DEV_ERROR(p2d->dev, "missing encoder\n"); + return -ENODEV; + } + + return drm_bridge_attach(bridge->encoder, + p2d->next_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); +} + +static int +imx8qxp_pxl2dpi_bridge_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; + + p2d->in_bus_format = bridge_state->input_bus_cfg.format; + p2d->out_bus_format = bridge_state->output_bus_cfg.format; + + return 0; +} + +static void +imx8qxp_pxl2dpi_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; + struct imx8qxp_pxl2dpi *companion_p2d; + int ret; + + ret = pm_runtime_get_sync(p2d->dev); + if (ret < 0) + DRM_DEV_ERROR(p2d->dev, + "failed to get runtime PM sync: %d\n", ret); + + ret = imx_sc_misc_set_control(p2d->ipc_handle, p2d->sc_resource, + IMX_SC_C_PXL_LINK_SEL, p2d->pl_sel); + if (ret) + DRM_DEV_ERROR(p2d->dev, + "failed to set pixel link selection(%u): %d\n", + p2d->pl_sel, ret); + + switch (p2d->out_bus_format) { + case MEDIA_BUS_FMT_RGB888_1X24: + regmap_write(p2d->regmap, PXL2DPI_CTRL, CFG_24BIT); + break; + case MEDIA_BUS_FMT_RGB666_1X24_CPADHI: + regmap_write(p2d->regmap, PXL2DPI_CTRL, CFG2_18BIT); + break; + default: + DRM_DEV_ERROR(p2d->dev, + "unsupported output bus format 0x%08x\n", + p2d->out_bus_format); + } + + if (p2d->companion) { + companion_p2d = bridge_to_p2d(p2d->companion); + + companion_p2d->in_bus_format = p2d->in_bus_format; + companion_p2d->out_bus_format = p2d->out_bus_format; + + p2d->companion->funcs->mode_set(p2d->companion, mode, + adjusted_mode); + } +} + +static void +imx8qxp_pxl2dpi_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; + int ret; + + ret = pm_runtime_put(p2d->dev); + if (ret < 0) + DRM_DEV_ERROR(p2d->dev, "failed to put runtime PM: %d\n", ret); + + if (p2d->companion) + p2d->companion->funcs->atomic_disable(p2d->companion, + old_bridge_state); +} + +static const u32 imx8qxp_pxl2dpi_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB888_1X24, + MEDIA_BUS_FMT_RGB666_1X24_CPADHI, +}; + +static bool imx8qxp_pxl2dpi_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx8qxp_pxl2dpi_bus_output_fmts); i++) { + if (imx8qxp_pxl2dpi_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx8qxp_pxl2dpi_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + u32 *input_fmts; + + if (!imx8qxp_pxl2dpi_bus_output_fmt_supported(output_fmt)) + return NULL; + + *num_input_fmts = 1; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_RGB888_1X24: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X36_CPADLO; + break; + case MEDIA_BUS_FMT_RGB666_1X24_CPADHI: + input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X36_CPADLO; + break; + default: + kfree(input_fmts); + input_fmts = NULL; + break; + } + + return input_fmts; +} + +static u32 * +imx8qxp_pxl2dpi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + unsigned int *num_output_fmts) +{ + *num_output_fmts = ARRAY_SIZE(imx8qxp_pxl2dpi_bus_output_fmts); + return kmemdup(imx8qxp_pxl2dpi_bus_output_fmts, + sizeof(imx8qxp_pxl2dpi_bus_output_fmts), GFP_KERNEL); +} + +static const struct drm_bridge_funcs imx8qxp_pxl2dpi_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .attach = imx8qxp_pxl2dpi_bridge_attach, + .atomic_check = imx8qxp_pxl2dpi_bridge_atomic_check, + .mode_set = imx8qxp_pxl2dpi_bridge_mode_set, + .atomic_disable = imx8qxp_pxl2dpi_bridge_atomic_disable, + .atomic_get_input_bus_fmts = + imx8qxp_pxl2dpi_bridge_atomic_get_input_bus_fmts, + .atomic_get_output_bus_fmts = + imx8qxp_pxl2dpi_bridge_atomic_get_output_bus_fmts, +}; + +static struct device_node * +imx8qxp_pxl2dpi_get_available_ep_from_port(struct imx8qxp_pxl2dpi *p2d, + u32 port_id) +{ + struct device_node *port, *ep; + int ep_cnt; + + port = of_graph_get_port_by_id(p2d->dev->of_node, port_id); + if (!port) { + DRM_DEV_ERROR(p2d->dev, "failed to get port@%u\n", port_id); + return ERR_PTR(-ENODEV); + } + + ep_cnt = of_get_available_child_count(port); + if (ep_cnt == 0) { + DRM_DEV_ERROR(p2d->dev, "no available endpoints of port@%u\n", + port_id); + ep = ERR_PTR(-ENODEV); + goto out; + } else if (ep_cnt > 1) { + DRM_DEV_ERROR(p2d->dev, + "invalid available endpoints of port@%u\n", + port_id); + ep = ERR_PTR(-EINVAL); + goto out; + } + + ep = of_get_next_available_child(port, NULL); + if (!ep) { + DRM_DEV_ERROR(p2d->dev, + "failed to get available endpoint of port@%u\n", + port_id); + ep = ERR_PTR(-ENODEV); + goto out; + } +out: + of_node_put(port); + return ep; +} + +static struct drm_bridge * +imx8qxp_pxl2dpi_find_next_bridge(struct imx8qxp_pxl2dpi *p2d) +{ + struct device_node *ep, *remote; + struct drm_bridge *next_bridge; + int ret; + + ep = imx8qxp_pxl2dpi_get_available_ep_from_port(p2d, 1); + if (IS_ERR(ep)) { + ret = PTR_ERR(ep); + return ERR_PTR(ret); + } + + remote = of_graph_get_remote_port_parent(ep); + if (!remote || !of_device_is_available(remote)) { + DRM_DEV_ERROR(p2d->dev, "no available remote\n"); + next_bridge = ERR_PTR(-ENODEV); + goto out; + } else if (!of_device_is_available(remote->parent)) { + DRM_DEV_ERROR(p2d->dev, "remote parent is not available\n"); + next_bridge = ERR_PTR(-ENODEV); + goto out; + } + + next_bridge = of_drm_find_bridge(remote); + if (!next_bridge) { + next_bridge = ERR_PTR(-EPROBE_DEFER); + goto out; + } +out: + of_node_put(remote); + of_node_put(ep); + + return next_bridge; +} + +static int imx8qxp_pxl2dpi_set_pixel_link_sel(struct imx8qxp_pxl2dpi *p2d) +{ + struct device_node *ep; + struct of_endpoint endpoint; + int ret; + + ep = imx8qxp_pxl2dpi_get_available_ep_from_port(p2d, 0); + if (IS_ERR(ep)) + return PTR_ERR(ep); + + ret = of_graph_parse_endpoint(ep, &endpoint); + if (ret) { + DRM_DEV_ERROR(p2d->dev, + "failed to parse endpoint of port@0: %d\n", ret); + goto out; + } + + p2d->pl_sel = endpoint.id; +out: + of_node_put(ep); + + return ret; +} + +static int imx8qxp_pxl2dpi_parse_dt_companion(struct imx8qxp_pxl2dpi *p2d) +{ + struct imx8qxp_pxl2dpi *companion_p2d; + struct device *dev = p2d->dev; + struct device_node *companion; + struct device_node *port1, *port2; + const struct of_device_id *match; + int dual_link; + int ret = 0; + + /* Locate the companion PXL2DPI for dual-link operation, if any. */ + companion = of_parse_phandle(dev->of_node, "fsl,companion-pxl2dpi", 0); + if (!companion) + return 0; + + if (!of_device_is_available(companion)) { + DRM_DEV_ERROR(dev, "companion PXL2DPI is not available\n"); + ret = -ENODEV; + goto out; + } + + /* + * Sanity check: the companion bridge must have the same compatible + * string. + */ + match = of_match_device(dev->driver->of_match_table, dev); + if (!of_device_is_compatible(companion, match->compatible)) { + DRM_DEV_ERROR(dev, "companion PXL2DPI is incompatible\n"); + ret = -ENXIO; + goto out; + } + + p2d->companion = of_drm_find_bridge(companion); + if (!p2d->companion) { + ret = -EPROBE_DEFER; + DRM_DEV_DEBUG_DRIVER(p2d->dev, + "failed to find companion bridge: %d\n", + ret); + goto out; + } + + companion_p2d = bridge_to_p2d(p2d->companion); + + /* + * We need to work out if the sink is expecting us to function in + * dual-link mode. We do this by looking at the DT port nodes that + * the next bridges are connected to. If they are marked as expecting + * even pixels and odd pixels than we need to use the companion PXL2DPI. + */ + port1 = of_graph_get_port_by_id(p2d->next_bridge->of_node, 1); + port2 = of_graph_get_port_by_id(companion_p2d->next_bridge->of_node, 1); + dual_link = drm_of_lvds_get_dual_link_pixel_order(port1, port2); + of_node_put(port1); + of_node_put(port2); + + if (dual_link < 0) { + ret = dual_link; + DRM_DEV_ERROR(dev, "failed to get dual link pixel order: %d\n", + ret); + goto out; + } + + DRM_DEV_DEBUG_DRIVER(dev, + "dual-link configuration detected (companion bridge %pOF)\n", + companion); +out: + of_node_put(companion); + return ret; +} + +static int imx8qxp_pxl2dpi_bridge_probe(struct platform_device *pdev) +{ + struct imx8qxp_pxl2dpi *p2d; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + int ret; + + p2d = devm_kzalloc(dev, sizeof(*p2d), GFP_KERNEL); + if (!p2d) + return -ENOMEM; + + p2d->regmap = syscon_node_to_regmap(np->parent); + if (IS_ERR(p2d->regmap)) { + ret = PTR_ERR(p2d->regmap); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get regmap: %d\n", ret); + return ret; + } + + ret = imx_scu_get_handle(&p2d->ipc_handle); + if (ret) { + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get SCU ipc handle: %d\n", + ret); + return ret; + } + + p2d->dev = dev; + + ret = of_property_read_u32(np, "fsl,sc-resource", &p2d->sc_resource); + if (ret) { + DRM_DEV_ERROR(dev, "failed to get SC resource %d\n", ret); + return ret; + } + + p2d->next_bridge = imx8qxp_pxl2dpi_find_next_bridge(p2d); + if (IS_ERR(p2d->next_bridge)) { + ret = PTR_ERR(p2d->next_bridge); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to find next bridge: %d\n", + ret); + return ret; + } + + ret = imx8qxp_pxl2dpi_set_pixel_link_sel(p2d); + if (ret) + return ret; + + ret = imx8qxp_pxl2dpi_parse_dt_companion(p2d); + if (ret) + return ret; + + platform_set_drvdata(pdev, p2d); + pm_runtime_enable(dev); + + p2d->bridge.driver_private = p2d; + p2d->bridge.funcs = &imx8qxp_pxl2dpi_bridge_funcs; + p2d->bridge.of_node = np; + + drm_bridge_add(&p2d->bridge); + + return ret; +} + +static int imx8qxp_pxl2dpi_bridge_remove(struct platform_device *pdev) +{ + struct imx8qxp_pxl2dpi *p2d = platform_get_drvdata(pdev); + + drm_bridge_remove(&p2d->bridge); + + pm_runtime_disable(&pdev->dev); + + return 0; +} + +static const struct of_device_id imx8qxp_pxl2dpi_dt_ids[] = { + { .compatible = "fsl,imx8qxp-pxl2dpi", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qxp_pxl2dpi_dt_ids); + +static struct platform_driver imx8qxp_pxl2dpi_bridge_driver = { + .probe = imx8qxp_pxl2dpi_bridge_probe, + .remove = imx8qxp_pxl2dpi_bridge_remove, + .driver = { + .of_match_table = imx8qxp_pxl2dpi_dt_ids, + .name = DRIVER_NAME, + }, +}; +module_platform_driver(imx8qxp_pxl2dpi_bridge_driver); + +MODULE_DESCRIPTION("i.MX8QXP pixel link to DPI bridge driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME); From patchwork Wed Mar 31 06:33:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 413203 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.8 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, 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 13EB4C433E8 for ; Wed, 31 Mar 2021 06:50:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E964A619E4 for ; Wed, 31 Mar 2021 06:50:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233895AbhCaGuG (ORCPT ); Wed, 31 Mar 2021 02:50:06 -0400 Received: from mail-db8eur05on2059.outbound.protection.outlook.com ([40.107.20.59]:38880 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233973AbhCaGtq (ORCPT ); Wed, 31 Mar 2021 02:49:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E6kxA0dQrntJ7GqxUxvWT0APUlHqJlOcKhY5VtRqftnEEmafXT9um3fQu5cRR/r/lmPYNTomkX0H0CBdkSikPURHcmhkYAzrrRVcPFbbzSBiORSXRmFJRNxE3btIGws5T6Npqh1LtMW9utYuL5tRgjf7up70u4G/Vrw2czZQm+932f+j9IPXV+Av8nDHl6Nnas7RhyW58wDdKzvpVMpd43R1f3efypqL6i9EuAxF8qtN2lPJ1mTAlpxfD2nDmmjhDkud0iHCJ75AAWrcMzBaDh6/gDSMOslC0Owkl1apegX4MEGaB+Ah2Gc9ekVeoIrDq9avo2SpmG5np6dS4zdOBA== 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=620z6n1+DovQARLsjLX3MUSJuUIadFiHq/3JCn4f0ak=; b=InatgWUkFUgivZu9FeGCNll8xa1/9mZk8bvQP7obftCuQ+Y83QK3pZlZ64puMTjECAeMO+8KDRA084YQuqavRpOsuQSCwF4HwYEjB4Zd2SmYZsDIdMYg89wWcaBnK3fo6vEQUiBO4JFRhTP+J9yHThskJfBJmKadKuZj0yMkndIykDm7PTP3t5DYj80W2/Xh+PuI4BXstOCPe1DMC/2N96DH7HuBQo1rAGCqm5C+S1Ibb/dcD/RXC17864gOj4tmYGG0KyponQzqFuIds6dPLq8dKtbCC9YCvDeAR05mqwdgql74ynD4KD1UHE+uJ6mDwFWbhUwmDHeF7QV5Jw+YMw== 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=620z6n1+DovQARLsjLX3MUSJuUIadFiHq/3JCn4f0ak=; b=atNQcu84n6p8nZsECy9rwee/fpLapPZj5xUaaAgxcraEhWwBAtq/TqMSPL0g2s4SNhFpgyF2KDEhlelAoFn22ukf21yFEO/CjaUVe1uAxCEE/JXWj+ur7vZs4zffx4inHGG9SNOMZTRVrXCzLAIYKqVXXoRjwDleNlJKU95MwV8= 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.3977.25; Wed, 31 Mar 2021 06:49:43 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c%5]) with mapi id 15.20.3977.033; Wed, 31 Mar 2021 06:49: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, marcel.ziswiler@toradex.com Subject: [PATCH v7 11/14] dt-bindings: display: bridge: Add i.MX8qm/qxp LVDS display bridge binding Date: Wed, 31 Mar 2021 14:33:22 +0800 Message-Id: <1617172405-12962-12-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> References: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) 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 MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.26 via Frontend Transport; Wed, 31 Mar 2021 06:49:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 489e5b47-e35a-4f0f-3b62-08d8f4112a4f X-MS-TrafficTypeDiagnostic: VI1PR0401MB2318: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: pWdGO/+CT3BxwxR9ltfAE11OvBpFQNJSX2DqoeciudyhlDQV1XBwv8lQXoPIgHRo9iFa6Ejb6KLtWsBcFo3faTjqYHFlUwNuAJ8TRhpwU0AtQpGX6VSE1eYy2OY0/zFx9k7fCWqFmpA8ZDUc3+jOOmi8DUjp9+XLhulOx71d3Efm+YkzWqrm8ekuxSyPhmAATJDamvKilge3a4ZZW2dJPMKL/T/9sYeTXy6xsAbpxydXV7H/1juJssmOGTzReUQKGZH1RfqlS+/jGOvwW4pt0OE3xyipe4By3xWSXj5CVcA9GUJnK2ubaJQKR+0P8+rj9JoOPVmJ9avpn56zBA1mSn+4ORe6m70alUU28Hy0d5sg4/J0Uv1INJ0hZk9iXZifWwpyf1YXf97x+P5+APX0f2Hksi705QCoD89cGokxkqVeczKhpEwgWiUeewgpotsvFxwBJF8cL40QaHHK1/szuMPV7UEEYEM/CNNhNmsdnsA9Ncl3syA3zeHVde0NAARchhZcmeggZ4Bgq6lfGg8qt8uMk6N+Y0bkWRVHx0RKkkrdkHpxZuw9/SIWBsteAytwBNNzCgSBZ1XTuEAQmms/Ch8jGLB2Au+RK9wA8hVE/j1456GuoL//7zU7IEzoPHa9LZS87EfV1Mle4PEKfoO7gLwTjPxN3QkF48ZG+Bix1irDkNA+jUcSQ5fnShxtaEQiKsgKNdI6bUHrPTmOnymhilKdhJNOHdcllkj2xG9MSy7VQgmldZDMN5ia9o90I+ZM 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)(6666004)(69590400012)(966005)(36756003)(498600001)(956004)(16526019)(186003)(6486002)(26005)(6506007)(6512007)(66476007)(66946007)(66556008)(38100700001)(2616005)(4326008)(83380400001)(86362001)(5660300002)(7416002)(8676002)(2906002)(52116002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 9xS/JllNkKb5/cm18mY1jLGXw1KPrVR0CBKP4FJy7eDZe9xdm6ClkgyTGqK3komZYz2dDwf7yyOtMg5ZRVkf7Fu/WNrciSCr1Uk3YQMewQCoWVpGJZYSI6xmJKIgeCj1o1dmjsRcuUzbd6hnocByrgZB5vAVG6ye7YK5vBFuT7m014q656PVNa8YLGpS+wIaDHcr0kJCnwi+ffop/eLgFYAuRcQcpJ7lrmFw9UB0cEdZzCUdE+1YMa9dYdkqXvs9ASpVucFqP2daOgZprYoxXmYlzec8yWOGXZpecg/SiucbsNxGl5aOShhkjhtiiUHZv63EkaLhlR2OOfjyT5j4aZW8RQ9SUp6hxLQs2sItP8eIJMBIX5w/wInhMW+OfmO6+eXBw1qTm+O+U8tfLSAOv4vLSwIk75Uv1BvvgfC6AfJh8q1qfN8/NO0I4sgdA4BA6lE2IPgYQuYZil2lh2R98jJWUlpQRb/aZ4FcGDm1fz+FQkktW2OccByOTcaCJ/2FupsNCjqQmnYOpl8XMcse7VqX11B2agjYZdBvK3ovybps0aL2kGxEMwD0p6AUiGT8pRepm1nG2HWE+QCogtpZ3hfZ6iA7fJUBsyhRONh+egwRfrM7xX9ipvK25EqjFyIyvaFg74S93vxjgCG5kh9/1eVkVhXSdOEf9/XIH2vXV7R+JVj5O5iZXc3i40VLhipFw1ZDa7jUwt2QjT3sNZka/4reEC4hvILF6tbrpSxN5kf/UPCK7RaUoQwt+3DXZoRniRQWzs9oAUF+HXDoOiKvC+mVrjCUHMoMPPfNnxoAi1FaEnnp/qta2FkXzRBJpK2vYeTbpmk9Yp6NREJ7PYn3sNAGAePq7AS4sF/FQsMjT+R7ZrMOeh/Re+AeyTO34gcd91EBtp/EfB6XnCV00FfWL+R8BHnhTGVzRC1s9XaBNHwMYuQETeqwO+fUD6Gnt8QWTLeRETMbh7mGuYsMmFtZynHo12MAR0w8LIyGl2fuGDYl/elH5Twp1XDxf74xgK0eUwXXbluqbShlMGaL66tWaN8V+JXCcF8BrVPmh+aMA/qO+0tqtHmBzzMKdVIcyLSO2+auRMMhWvDXfAdou5Cz06tehlAlJLoWTqpHOk4v5DuDzS/G48Gzkz4FVvt7EtTAZunTgEx0qFP6XrhvJHtvg6Hswt6JouTv0ENTjKgJErktLtBDfOGCrmqRbIaPZJLH4q8JoxO1pe5GkqKxi7B89EJ1t20uT93BeN6g2XQbLrSCFs4o6QL48K5bILyfWyW2K1XBVtSqAPSAl0IQGT/vYUJl0j9eOZOttsfyVVpp1b+gjAyFAvYzRYoSzAO9wKqN X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 489e5b47-e35a-4f0f-3b62-08d8f4112a4f X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2021 06:49:43.7380 (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: +U6xRcRypmnfSj+HSafcaCLdGTFb/i/be5gqIQTeikhIPpVEpu/W6WQZm7w6OdfFCQ741PBVlnXbGSZf+gkM2A== 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 LVDS display bridge(LDB). Reviewed-by: Rob Herring Signed-off-by: Liu Ying --- v6->v7: * No change. v5->v6: * No change. v4->v5: * No change. v3->v4: * Add Rob's R-b tag. v2->v3: * Drop 'fsl,syscon' property. (Rob) * Mention the CSR module controls LDB. v1->v2: * Use graph schema. (Laurent) * Side note i.MX8qxp LDB official name 'pixel mapper'. (Laurent) .../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 31 06:33:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 413202 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.8 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, 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 5BFB4C433E9 for ; Wed, 31 Mar 2021 06:50:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2AF25619DE for ; Wed, 31 Mar 2021 06:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233947AbhCaGuL (ORCPT ); Wed, 31 Mar 2021 02:50:11 -0400 Received: from mail-eopbgr00062.outbound.protection.outlook.com ([40.107.0.62]:9539 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233690AbhCaGtz (ORCPT ); Wed, 31 Mar 2021 02:49:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GwwFM0yHIOh+TKvj/iyZp1h6tkuir+kad6ogF871PU81jdRscZs0RLgPi/YaFfQRXUVIRZS9wR3h8u5XSOOebRUQEGCZZrrkeL8obPfy/rEfAWsUyEPnVIPtgTNGM73AcOVrDM2pbgT74dmdcVFGjPR2KhiQlF9SbmY1PjGbkwhyacUt6Jc37qjmWzRwKDj+SkGnG3YTu24PDaqpDmacSV2U9Jg9N9F6Aoo7wmepVynSw2kXoylDulrrrJzDt8MMHIz8adKluy4xofFvwzbbyJMbYGNAihfQ8cXo0G9+RHCf+svldxC/G6KkCS4K8wL2YISjaZLe6S/je223xpA31w== 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=na7FTzAmHTKvNefHCKi0E2v2E5PRZ4yj0khSlocpgG8=; b=LOjAX8gbcdtHkTWrFT2dyTmJoVSLFg5DUZOasEEiQxYIypTpYa3HN8DH778ierYCnVt0AgU6cuRZzMjIEy+eHFznKN2DXjMNLBFydB5G3X92c6eVHZADMznVXGUw0f4hSZZM8aK/ncMookTpekiVPtS5+8nOtUAYV/vBlNp+hm+EELAXiLhj5mu3ihas/VXLcYzM4tisHJg+oc0JexUj0vuTUaIjeFdmJ+P97I6dnIc7d3HHGWzgRREhj8JqdV0euMz/cHeA+GBntqq0hh1osJae5YN7AkJemZR1rruU8UebF3EzuQ3vurX4+wJuzhqrJSgBGVWeLD+nXtXTk5jHOA== 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=na7FTzAmHTKvNefHCKi0E2v2E5PRZ4yj0khSlocpgG8=; b=NiABlbEnRKFJ2MaSpCc8wyue8g4RF7jbcFEbOggVbdyHJ7cEUa9R2vruDAYux0N56esc3LMhjTnjKTPBcLoQ1Hi+dbta9mJpWCLM+Yazpm8SX34Wztt8GwjJYFlZGLzukPkvQALneMPdDZ7pqHlTv2cIlNiBqCAqYHxGAtHaRf4= 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 VI1PR0402MB2815.eurprd04.prod.outlook.com (2603:10a6:800:ae::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.26; Wed, 31 Mar 2021 06:49:51 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c%5]) with mapi id 15.20.3977.033; Wed, 31 Mar 2021 06:49:51 +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, marcel.ziswiler@toradex.com Subject: [PATCH v7 12/14] drm/bridge: imx: Add LDB support for i.MX8qxp Date: Wed, 31 Mar 2021 14:33:23 +0800 Message-Id: <1617172405-12962-13-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> References: <1617172405-12962-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) 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 MA1PR01CA0105.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.26 via Frontend Transport; Wed, 31 Mar 2021 06:49:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c671dd62-bceb-4395-97b5-08d8f4112e8a X-MS-TrafficTypeDiagnostic: VI1PR0402MB2815: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E8ZAj66cHWGDnTOUapNODGPhiQTs6PvR8O/wxKeSj0vCdxUyI9SKy84x2fHKwktT2WUzhanG8nR/C0G98bvGdAa9tzFAB5TtUCAd2Xg44Hoft0JxRuTQG4qp0WP0zE/Zhmuwnze/y3/CjB/O3XLKBfJ7PLo1zBLO++mslzE3LVyAdX+ZaYbTD5gdE1XtCRwrhEpAT8OK9hRsKhE7VXbWCvxl6xHYtcPW805kHM12OR5Oi0VjaiFgBCFLnvS/KiSWXgZejO1LxjPVYQGiqDZifESYg6ZLXUBVifVnQ8kulOCJJoXtb/QC+T0AyeBs2vP3BedajJgSa7ZAsffkzHf7leHqGKi9t7/kzyLTblTO3wscwqaMq2cj0/Er1/NcwGRb3TXAKznp3KC1ngEhKSHyB0JR946Lk6UCXbGXuGLMA5DCxkkngaYN68gOgNcAYlkGgnjJeVz9SW8SMhEXm9p0Yk9KvqMr2Qonq7XqU/6KEhAGYzchicuZPyCNDrgcQyKi5VlTqdkVcgyGROTeAOSqPp/jKkpDG4RhT+9YnGAx1CRd5TibMDDm2mQs8nu3SPLtFcHRlLfkhlCuhxefLc20P7knpMcSaBL0gHNQCN0IO2tP3Apps81KXtPpCSWJWkyMMF25bSGKKeJB5ofvkd9M258nskHOcRXnOUrS7QI+RsM3rRF6KlUn3xB4n4gE1D6GX/4XiD3WkJ/JTT8XIcJ3n5RYawGxXnSLKiK78wQQJvTV+r49ju/Ilqfdj8ISoLaYjuVlZjXyKEowywbuPezibg== 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)(26005)(86362001)(498600001)(52116002)(83380400001)(38100700001)(6486002)(30864003)(69590400012)(2906002)(5660300002)(7416002)(966005)(4326008)(956004)(2616005)(36756003)(66556008)(186003)(8936002)(6512007)(16526019)(6666004)(6506007)(66946007)(8676002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: PPOS2rqJ3H7C8rg+Y0AsU0gmLj6jhCwkWnfzSqXngh0hvBEMjOWIcOtTUStSUbGsnVrUbFHs8kXO2KcY0vnKNnFKPbj6D6a2vsRraE9LDscLFRqdAHHiYNCCNX4UNDdkxq4I3WeGZs49zTtctiRERQ1pdmrhZ38/yAU6pYwXzUu0N8em9JSw7BtYVt95SUs68jNMFKmLm+mkn5wa6Wqb7aBqIY0R9nbg1SQ27MvcKvHCJ5RPqtJYq+8bYlIVFitaB3kfOf8OPRGysEn6z8BzN8/N6mDB9IVZJUF+sGcb0TlHYPu6UM2z94eAH0oYNcX3VocYlkNWvCrawYGNKCXJY2IMPM1D+K1O1ZIh67azA02ctCW3NztYdHCZaxx9aQKW9kPKcVRkpcF9iv8H3fJwqO87rVNP2393M5qdu27cV6iM5/qpoWZ6bR4xFkiJHi9shfNPC2BzSsw2xLRT+mIWabEKt4rBjqxm0g6XhZ7EOPMXE6xPIEL75YnmwhOENW/AsFkGmkbWfSlIbTOoZSE6RMm21GjX23vZSlTjvNw2MJOMKNY52tiNpLsFycB4YhdFqXBZdqFv5WXasuj60jw1ebwmYmCOlPI9ceCqB/dDf5ygCQSQRQJqtMfL8y+HLb2VDCvQ6DMsN91FEfp/1aOvZnUd41CybJ+/vAaQi+XthcuGhtEj/GhqauK1yJhIf65ZcSlCX+uww6ATyKvR/0poQXVFXgetsc5HpeBLACtxRBY23xPGiozMvMjauF4fCsLlkG6N5o1gTDyEYutqQXPuakp3yQ7DLc/fswpkdMv8lsHelATYmCT2b0CBXVQRwOJR6ZQEEieZfjXfG1oP9RDV14PzM9tu1vcNbvyRyADZGM1I3UETEpvjyafY3HnOI/bSPaehPJ90wqKvddzZpIvbggW2Xqk2DMtJfcKwAcM/vJl7cYQvTFlFxAVzFMgGZ0pKLiEMa2k4IF577ix8ClMl3Uh7tcJXxubelh0QcxIr7pXDJsxw8i27hVwrvvZz/Apy58gOYWjkR1L4P3Az7HqqrDYjlCkCC5l/lgQT5GJ+OwnfyOCECq9s432ZeoL4mm7TZMfX9K2hyPrOmHIsg0LisSMLVVO8fUXRSr0Qvgkbq+eAexWb/wx+L4fBaZfwVy0xiumPIbIvcX4jS/k7YYUdEtjv1Qxd7Zerx1Wh/nBUp3Lj2SGKbduXKxXL2pd5MZTz6PafnBoUDskBv/Qn/HH0xk5mlg3r2Us6KoQXjGEGY/o/7alyzTFPOivFwb10XhNqGf5dk//tnDuzCDnvM4POqZrHEOEOb0PqLeSis7fClQS4uSJwltLrkRduqu1ZA7+r X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c671dd62-bceb-4395-97b5-08d8f4112e8a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2021 06:49:50.9139 (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: MiV3epAHtPimbuZbrFqBOsxep/q+Qyhgfeu+5TKY4f9Kf9uJmCPRJqA7GcYg0P2UaPrto626mJ7TlWqBC8l3SA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2815 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds a drm bridge driver for i.MX8qxp LVDS display bridge(LDB) which is officially named as pixel mapper. The LDB has two channels. Each of them supports up to 24bpp parallel input color format and can map the input to VESA or JEIDA standards. The two channels cannot be used simultaneously, that is to say, the user should pick one of them to use. Two LDB channels from two LDB instances can work together in LDB split mode to support a dual link LVDS display. The channel indexes have to be different. Channel0 outputs odd pixels and channel1 outputs even pixels. This patch supports the LDB single mode and split mode. Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- 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/devicetree/msg414149.html Marcel, I add your T-b tag from v6, let me know if you want me to drop it, as the checkpatch fix in v7 is trivial. v6->v7: * Fix below complaints from 'checkpatch.pl --strict'. (Robert) - 'Prefer using the BIT macro' - 'Alignment should match open parenthesis' - 'Comparison to NULL could be written "!companion_port"' - 'ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP' * Add Marcel's T-b tag. * Add Robert's R-b tag. v5->v6: * No change. v4->v5: * Link with the imx-ldb-helper object. (Robert) * Correspondingly, rename 'imx8qxp-ldb.c' to 'imx8qxp-ldb-drv.c'. v3->v4: * No change. v2->v3: * No change. v1->v2: * Drop unnecessary DT validation. * Use of_graph_get_endpoint_by_regs() and of_graph_get_remote_endpoint() to get the input remote endpoint in imx8qxp_ldb_set_di_id(). * Avoid using companion_port OF node after putting it in imx8qxp_ldb_parse_dt_companion(). * Mention i.MX8qxp LDB official name 'pixel mapper' in the bridge driver and Kconfig help message. drivers/gpu/drm/bridge/imx/Kconfig | 9 + drivers/gpu/drm/bridge/imx/Makefile | 3 + drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c | 722 +++++++++++++++++++++++++++ 3 files changed, 734 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index 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..1cca5fc --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb-drv.c @@ -0,0 +1,722 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "imx-ldb-helper.h" + +#define LDB_CH_SEL BIT(28) + +#define SS_CTRL 0x20 +#define CH_HSYNC_M(id) BIT(0 + ((id) * 2)) +#define CH_VSYNC_M(id) BIT(1 + ((id) * 2)) +#define CH_PHSYNC(id) BIT(0 + ((id) * 2)) +#define CH_PVSYNC(id) BIT(1 + ((id) * 2)) + +#define DRIVER_NAME "imx8qxp-ldb" + +struct imx8qxp_ldb_channel { + struct ldb_channel base; + struct phy *phy; + unsigned int di_id; +}; + +struct imx8qxp_ldb { + struct ldb base; + struct device *dev; + struct imx8qxp_ldb_channel channel[MAX_LDB_CHAN_NUM]; + struct clk *clk_pixel; + struct clk *clk_bypass; + struct drm_bridge *companion; + int active_chno; +}; + +static inline struct imx8qxp_ldb_channel * +base_to_imx8qxp_ldb_channel(struct ldb_channel *base) +{ + return container_of(base, struct imx8qxp_ldb_channel, base); +} + +static inline struct imx8qxp_ldb *base_to_imx8qxp_ldb(struct ldb *base) +{ + return container_of(base, struct imx8qxp_ldb, base); +} + +static void imx8qxp_ldb_set_phy_cfg(struct imx8qxp_ldb *imx8qxp_ldb, + unsigned long di_clk, bool is_split, + struct phy_configure_opts_lvds *phy_cfg) +{ + phy_cfg->bits_per_lane_and_dclk_cycle = 7; + phy_cfg->lanes = 4; + + if (is_split) { + phy_cfg->differential_clk_rate = di_clk / 2; + phy_cfg->is_slave = !imx8qxp_ldb->companion; + } else { + phy_cfg->differential_clk_rate = di_clk; + phy_cfg->is_slave = false; + } +} + +static int +imx8qxp_ldb_bridge_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + base_to_imx8qxp_ldb_channel(ldb_ch); + struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb); + struct drm_bridge *companion = imx8qxp_ldb->companion; + struct drm_display_mode *adj = &crtc_state->adjusted_mode; + unsigned long di_clk = adj->clock * 1000; + bool is_split = ldb_channel_is_split_link(ldb_ch); + union phy_configure_opts opts = { }; + struct phy_configure_opts_lvds *phy_cfg = &opts.lvds; + int ret; + + ret = ldb_bridge_atomic_check_helper(bridge, bridge_state, + crtc_state, conn_state); + if (ret) + return ret; + + imx8qxp_ldb_set_phy_cfg(imx8qxp_ldb, di_clk, is_split, phy_cfg); + ret = phy_validate(imx8qxp_ldb_ch->phy, PHY_MODE_LVDS, 0, &opts); + if (ret < 0) { + DRM_DEV_DEBUG_DRIVER(imx8qxp_ldb->dev, + "failed to validate PHY: %d\n", ret); + return ret; + } + + if (is_split && companion) { + ret = companion->funcs->atomic_check(companion, + bridge_state, crtc_state, conn_state); + if (ret) + return ret; + } + + return ret; +} + +static void +imx8qxp_ldb_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb_channel *companion_ldb_ch; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + base_to_imx8qxp_ldb_channel(ldb_ch); + struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb); + struct drm_bridge *companion = imx8qxp_ldb->companion; + struct device *dev = imx8qxp_ldb->dev; + unsigned long di_clk = adjusted_mode->clock * 1000; + bool is_split = ldb_channel_is_split_link(ldb_ch); + union phy_configure_opts opts = { }; + struct phy_configure_opts_lvds *phy_cfg = &opts.lvds; + u32 chno = ldb_ch->chno; + int ret; + + ret = pm_runtime_get_sync(dev); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to get runtime PM sync: %d\n", ret); + + ret = phy_init(imx8qxp_ldb_ch->phy); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to initialize PHY: %d\n", ret); + + ret = phy_set_mode(imx8qxp_ldb_ch->phy, PHY_MODE_LVDS); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to set PHY mode: %d\n", ret); + + if (is_split && companion) { + companion_ldb_ch = bridge_to_ldb_ch(companion); + + companion_ldb_ch->in_bus_format = ldb_ch->in_bus_format; + companion_ldb_ch->out_bus_format = ldb_ch->out_bus_format; + } + + clk_set_rate(imx8qxp_ldb->clk_bypass, di_clk); + clk_set_rate(imx8qxp_ldb->clk_pixel, di_clk); + + imx8qxp_ldb_set_phy_cfg(imx8qxp_ldb, di_clk, is_split, phy_cfg); + ret = phy_configure(imx8qxp_ldb_ch->phy, &opts); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to configure PHY: %d\n", ret); + + if (chno == 0) + ldb->ldb_ctrl &= ~LDB_CH_SEL; + else + ldb->ldb_ctrl |= LDB_CH_SEL; + + /* input VSYNC signal from pixel link is active low */ + if (imx8qxp_ldb_ch->di_id == 0) + ldb->ldb_ctrl |= LDB_DI0_VS_POL_ACT_LOW; + else + ldb->ldb_ctrl |= LDB_DI1_VS_POL_ACT_LOW; + + /* + * For split mode, settle input VSYNC signal polarity and + * channel selection down early. + */ + if (is_split) + regmap_write(ldb->regmap, ldb->ctrl_reg, ldb->ldb_ctrl); + + ldb_bridge_mode_set_helper(bridge, mode, adjusted_mode); + + if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, CH_VSYNC_M(chno), 0); + else if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, + CH_VSYNC_M(chno), CH_PVSYNC(chno)); + + if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, CH_HSYNC_M(chno), 0); + else if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, + CH_HSYNC_M(chno), CH_PHSYNC(chno)); + + if (is_split && companion) + companion->funcs->mode_set(companion, mode, adjusted_mode); +} + +static void +imx8qxp_ldb_bridge_atomic_pre_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb); + struct drm_bridge *companion = imx8qxp_ldb->companion; + bool is_split = ldb_channel_is_split_link(ldb_ch); + + clk_prepare_enable(imx8qxp_ldb->clk_pixel); + clk_prepare_enable(imx8qxp_ldb->clk_bypass); + + if (is_split && companion) + companion->funcs->atomic_pre_enable(companion, old_bridge_state); +} + +static void +imx8qxp_ldb_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + base_to_imx8qxp_ldb_channel(ldb_ch); + struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb); + struct drm_bridge *companion = imx8qxp_ldb->companion; + struct device *dev = imx8qxp_ldb->dev; + bool is_split = ldb_channel_is_split_link(ldb_ch); + int ret; + + if (ldb_ch->chno == 0 || is_split) { + ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK; + ldb->ldb_ctrl |= imx8qxp_ldb_ch->di_id == 0 ? + LDB_CH0_MODE_EN_TO_DI0 : LDB_CH0_MODE_EN_TO_DI1; + } + if (ldb_ch->chno == 1 || is_split) { + ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK; + ldb->ldb_ctrl |= imx8qxp_ldb_ch->di_id == 0 ? + LDB_CH1_MODE_EN_TO_DI0 : LDB_CH1_MODE_EN_TO_DI1; + } + + ldb_bridge_enable_helper(bridge); + + ret = phy_power_on(imx8qxp_ldb_ch->phy); + if (ret) + DRM_DEV_ERROR(dev, "failed to power on PHY: %d\n", ret); + + if (is_split && companion) + companion->funcs->atomic_enable(companion, old_bridge_state); +} + +static void +imx8qxp_ldb_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + base_to_imx8qxp_ldb_channel(ldb_ch); + struct imx8qxp_ldb *imx8qxp_ldb = base_to_imx8qxp_ldb(ldb); + struct drm_bridge *companion = imx8qxp_ldb->companion; + struct device *dev = imx8qxp_ldb->dev; + bool is_split = ldb_channel_is_split_link(ldb_ch); + int ret; + + ret = phy_power_off(imx8qxp_ldb_ch->phy); + if (ret) + DRM_DEV_ERROR(dev, "failed to power off PHY: %d\n", ret); + + ret = phy_exit(imx8qxp_ldb_ch->phy); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to teardown PHY: %d\n", ret); + + ldb_bridge_disable_helper(bridge); + + clk_disable_unprepare(imx8qxp_ldb->clk_bypass); + clk_disable_unprepare(imx8qxp_ldb->clk_pixel); + + if (is_split && companion) + companion->funcs->atomic_disable(companion, old_bridge_state); + + ret = pm_runtime_put(dev); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret); +} + +static const u32 imx8qxp_ldb_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, + MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, + MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA, + MEDIA_BUS_FMT_FIXED, +}; + +static bool imx8qxp_ldb_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx8qxp_ldb_bus_output_fmts); i++) { + if (imx8qxp_ldb_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx8qxp_ldb_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + struct drm_display_info *di; + const struct drm_format_info *finfo; + u32 *input_fmts; + + if (!imx8qxp_ldb_bus_output_fmt_supported(output_fmt)) + return NULL; + + *num_input_fmts = 1; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_FIXED: + di = &conn_state->connector->display_info; + + /* + * Look at the first bus format to determine input format. + * Default to MEDIA_BUS_FMT_RGB888_1X24, if no match. + */ + if (di->num_bus_formats) { + finfo = drm_format_info(di->bus_formats[0]); + + input_fmts[0] = finfo->depth == 18 ? + MEDIA_BUS_FMT_RGB666_1X24_CPADHI : + MEDIA_BUS_FMT_RGB888_1X24; + } else { + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + } + break; + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: + input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X24_CPADHI; + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + break; + default: + kfree(input_fmts); + input_fmts = NULL; + break; + } + + return input_fmts; +} + +static u32 * +imx8qxp_ldb_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + unsigned int *num_output_fmts) +{ + *num_output_fmts = ARRAY_SIZE(imx8qxp_ldb_bus_output_fmts); + return kmemdup(imx8qxp_ldb_bus_output_fmts, + sizeof(imx8qxp_ldb_bus_output_fmts), GFP_KERNEL); +} + +static enum drm_mode_status +imx8qxp_ldb_bridge_mode_valid(struct drm_bridge *bridge, + const struct drm_display_info *info, + const struct drm_display_mode *mode) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + bool is_single = ldb_channel_is_single_link(ldb_ch); + + if (mode->clock > 170000) + return MODE_CLOCK_HIGH; + + if (mode->clock > 150000 && is_single) + return MODE_CLOCK_HIGH; + + return MODE_OK; +} + +static const struct drm_bridge_funcs imx8qxp_ldb_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .mode_valid = imx8qxp_ldb_bridge_mode_valid, + .attach = ldb_bridge_attach_helper, + .atomic_check = imx8qxp_ldb_bridge_atomic_check, + .mode_set = imx8qxp_ldb_bridge_mode_set, + .atomic_pre_enable = imx8qxp_ldb_bridge_atomic_pre_enable, + .atomic_enable = imx8qxp_ldb_bridge_atomic_enable, + .atomic_disable = imx8qxp_ldb_bridge_atomic_disable, + .atomic_get_input_bus_fmts = + imx8qxp_ldb_bridge_atomic_get_input_bus_fmts, + .atomic_get_output_bus_fmts = + imx8qxp_ldb_bridge_atomic_get_output_bus_fmts, +}; + +static int imx8qxp_ldb_set_di_id(struct imx8qxp_ldb *imx8qxp_ldb) +{ + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + &imx8qxp_ldb->channel[imx8qxp_ldb->active_chno]; + struct ldb_channel *ldb_ch = &imx8qxp_ldb_ch->base; + struct device_node *ep, *remote; + struct device *dev = imx8qxp_ldb->dev; + struct of_endpoint endpoint; + int ret; + + ep = of_graph_get_endpoint_by_regs(ldb_ch->np, 0, -1); + if (!ep) { + DRM_DEV_ERROR(dev, "failed to get port0 endpoint\n"); + return -EINVAL; + } + + remote = of_graph_get_remote_endpoint(ep); + of_node_put(ep); + if (!remote) { + DRM_DEV_ERROR(dev, "failed to get port0 remote endpoint\n"); + return -EINVAL; + } + + ret = of_graph_parse_endpoint(remote, &endpoint); + of_node_put(remote); + if (ret) { + DRM_DEV_ERROR(dev, "failed to parse port0 remote endpoint: %d\n", + ret); + return ret; + } + + imx8qxp_ldb_ch->di_id = endpoint.id; + + return 0; +} + +static int +imx8qxp_ldb_check_chno_and_dual_link(struct ldb_channel *ldb_ch, int link) +{ + if ((link == DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS && ldb_ch->chno != 0) || + (link == DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS && ldb_ch->chno != 1)) + return -EINVAL; + + return 0; +} + +static int imx8qxp_ldb_parse_dt_companion(struct imx8qxp_ldb *imx8qxp_ldb) +{ + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch = + &imx8qxp_ldb->channel[imx8qxp_ldb->active_chno]; + struct ldb_channel *ldb_ch = &imx8qxp_ldb_ch->base; + struct ldb_channel *companion_ldb_ch; + struct device_node *companion; + struct device_node *child; + struct device_node *companion_port = NULL; + struct device_node *port1, *port2; + struct device *dev = imx8qxp_ldb->dev; + const struct of_device_id *match; + u32 i; + int dual_link; + int ret; + + /* Locate the companion LDB for dual-link operation, if any. */ + companion = of_parse_phandle(dev->of_node, "fsl,companion-ldb", 0); + if (!companion) + return 0; + + if (!of_device_is_available(companion)) { + DRM_DEV_ERROR(dev, "companion LDB is not available\n"); + ret = -ENODEV; + goto out; + } + + /* + * Sanity check: the companion bridge must have the same compatible + * string. + */ + match = of_match_device(dev->driver->of_match_table, dev); + if (!of_device_is_compatible(companion, match->compatible)) { + DRM_DEV_ERROR(dev, "companion LDB is incompatible\n"); + ret = -ENXIO; + goto out; + } + + for_each_available_child_of_node(companion, child) { + ret = of_property_read_u32(child, "reg", &i); + if (ret || i > MAX_LDB_CHAN_NUM - 1) { + DRM_DEV_ERROR(dev, + "invalid channel node address: %u\n", i); + ret = -EINVAL; + of_node_put(child); + goto out; + } + + /* + * Channel numbers have to be different, because channel0 + * transmits odd pixels and channel1 transmits even pixels. + */ + if (i == (ldb_ch->chno ^ 0x1)) { + companion_port = child; + break; + } + } + + if (!companion_port) { + DRM_DEV_ERROR(dev, + "failed to find companion LDB channel port\n"); + ret = -EINVAL; + goto out; + } + + /* + * We need to work out if the sink is expecting us to function in + * dual-link mode. We do this by looking at the DT port nodes we are + * connected to. If they are marked as expecting odd pixels and + * even pixels than we need to enable LDB split mode. + */ + port1 = of_graph_get_port_by_id(ldb_ch->np, 1); + port2 = of_graph_get_port_by_id(companion_port, 1); + dual_link = drm_of_lvds_get_dual_link_pixel_order(port1, port2); + of_node_put(port1); + of_node_put(port2); + + switch (dual_link) { + case DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS: + ldb_ch->link_type = LDB_CH_DUAL_LINK_ODD_EVEN_PIXELS; + break; + case DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS: + ldb_ch->link_type = LDB_CH_DUAL_LINK_EVEN_ODD_PIXELS; + break; + default: + ret = dual_link; + DRM_DEV_ERROR(dev, + "failed to get dual link pixel order: %d\n", ret); + goto out; + } + + ret = imx8qxp_ldb_check_chno_and_dual_link(ldb_ch, dual_link); + if (ret < 0) { + DRM_DEV_ERROR(dev, + "unmatched channel number(%u) vs dual link(%d)\n", + ldb_ch->chno, dual_link); + goto out; + } + + imx8qxp_ldb->companion = of_drm_find_bridge(companion_port); + if (!imx8qxp_ldb->companion) { + ret = -EPROBE_DEFER; + DRM_DEV_DEBUG_DRIVER(dev, + "failed to find bridge for companion bridge: %d\n", + ret); + goto out; + } + + DRM_DEV_DEBUG_DRIVER(dev, + "dual-link configuration detected (companion bridge %pOF)\n", + companion); + + companion_ldb_ch = bridge_to_ldb_ch(imx8qxp_ldb->companion); + companion_ldb_ch->link_type = ldb_ch->link_type; +out: + of_node_put(companion_port); + of_node_put(companion); + return ret; +} + +static int imx8qxp_ldb_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct imx8qxp_ldb *imx8qxp_ldb; + struct imx8qxp_ldb_channel *imx8qxp_ldb_ch; + struct ldb *ldb; + struct ldb_channel *ldb_ch; + int ret, i; + + imx8qxp_ldb = devm_kzalloc(dev, sizeof(*imx8qxp_ldb), GFP_KERNEL); + if (!imx8qxp_ldb) + return -ENOMEM; + + imx8qxp_ldb->clk_pixel = devm_clk_get(dev, "pixel"); + if (IS_ERR(imx8qxp_ldb->clk_pixel)) { + ret = PTR_ERR(imx8qxp_ldb->clk_pixel); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get pixel clock: %d\n", ret); + return ret; + } + + imx8qxp_ldb->clk_bypass = devm_clk_get(dev, "bypass"); + if (IS_ERR(imx8qxp_ldb->clk_bypass)) { + ret = PTR_ERR(imx8qxp_ldb->clk_bypass); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get bypass clock: %d\n", ret); + return ret; + } + + imx8qxp_ldb->dev = dev; + + ldb = &imx8qxp_ldb->base; + ldb->dev = dev; + ldb->ctrl_reg = 0xe0; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) + ldb->channel[i] = &imx8qxp_ldb->channel[i].base; + + ret = ldb_init_helper(ldb); + if (ret) + return ret; + + if (ldb->available_ch_cnt == 0) { + DRM_DEV_DEBUG_DRIVER(dev, "no available channel\n"); + return 0; + } else if (ldb->available_ch_cnt > 1) { + DRM_DEV_ERROR(dev, "invalid available channel number(%u)\n", + ldb->available_ch_cnt); + return -EINVAL; + } + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + imx8qxp_ldb_ch = &imx8qxp_ldb->channel[i]; + ldb_ch = &imx8qxp_ldb_ch->base; + + if (ldb_ch->is_available) { + imx8qxp_ldb->active_chno = ldb_ch->chno; + break; + } + } + + imx8qxp_ldb_ch->phy = devm_of_phy_get(dev, ldb_ch->np, "lvds_phy"); + if (IS_ERR(imx8qxp_ldb_ch->phy)) { + ret = PTR_ERR(imx8qxp_ldb_ch->phy); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get channel%d PHY: %d\n", + imx8qxp_ldb->active_chno, ret); + return ret; + } + + ret = ldb_find_next_bridge_helper(ldb); + if (ret) + return ret; + + ret = imx8qxp_ldb_set_di_id(imx8qxp_ldb); + if (ret) + return ret; + + ret = imx8qxp_ldb_parse_dt_companion(imx8qxp_ldb); + if (ret) + return ret; + + platform_set_drvdata(pdev, imx8qxp_ldb); + pm_runtime_enable(dev); + + ldb_add_bridge_helper(ldb, &imx8qxp_ldb_bridge_funcs); + + return ret; +} + +static int imx8qxp_ldb_remove(struct platform_device *pdev) +{ + struct imx8qxp_ldb *imx8qxp_ldb = platform_get_drvdata(pdev); + struct ldb *ldb = &imx8qxp_ldb->base; + + ldb_remove_bridge_helper(ldb); + + pm_runtime_disable(&pdev->dev); + + return 0; +} + +static int __maybe_unused imx8qxp_ldb_runtime_suspend(struct device *dev) +{ + return 0; +} + +static int __maybe_unused imx8qxp_ldb_runtime_resume(struct device *dev) +{ + struct imx8qxp_ldb *imx8qxp_ldb = dev_get_drvdata(dev); + struct ldb *ldb = &imx8qxp_ldb->base; + + /* disable LDB by resetting the control register to POR default */ + regmap_write(ldb->regmap, ldb->ctrl_reg, 0); + + return 0; +} + +static const struct dev_pm_ops imx8qxp_ldb_pm_ops = { + SET_RUNTIME_PM_OPS(imx8qxp_ldb_runtime_suspend, + imx8qxp_ldb_runtime_resume, NULL) +}; + +static const struct of_device_id imx8qxp_ldb_dt_ids[] = { + { .compatible = "fsl,imx8qxp-ldb" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qxp_ldb_dt_ids); + +static struct platform_driver imx8qxp_ldb_driver = { + .probe = imx8qxp_ldb_probe, + .remove = imx8qxp_ldb_remove, + .driver = { + .pm = &imx8qxp_ldb_pm_ops, + .name = DRIVER_NAME, + .of_match_table = imx8qxp_ldb_dt_ids, + }, +}; +module_platform_driver(imx8qxp_ldb_driver); + +MODULE_DESCRIPTION("i.MX8QXP LVDS Display Bridge(LDB)/Pixel Mapper bridge driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME);