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: 12174407 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 44C57C433DB for ; Wed, 31 Mar 2021 06:48:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC141619CF for ; Wed, 31 Mar 2021 06:48:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC141619CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 28BC06E9E0; Wed, 31 Mar 2021 06:48:38 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2076.outbound.protection.outlook.com [40.107.21.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9618B6E9E0 for ; Wed, 31 Mar 2021 06:48:36 +0000 (UTC) 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12174409 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 19293C433DB for ; Wed, 31 Mar 2021 06:48:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA8EC61494 for ; Wed, 31 Mar 2021 06:48:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA8EC61494 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B15C6E9E2; Wed, 31 Mar 2021 06:48:45 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2070.outbound.protection.outlook.com [40.107.21.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACCCD6E9E2 for ; Wed, 31 Mar 2021 06:48:43 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TSjJ9TbzmcvY8lFxd5HhCKBpNbQx50RpwE17ft+FtO8ccl0zRUWQ99m2wldVg6SpHZEE2ZExUnqm648zcCB7cMlNKnyoHhkpiBQxq8UU0WUM20lLb6bS1QInjdKle7vXwHyx6nJQeuFcvYSBkSU/cUH4gsVssk7se846xofDvZ9D/p1388sOjX/zzho0CEZw8/zHnpYz2699vQ9UKkxtot/H+DO2nPdHUjhgRMnrNNZMsE1gzNgvRL6CTGz3furAYGkJZ4KGR1VLyqpNZlBgyxVYSbQcMA0DJby2zHeIQ7XH5WbOdvBRvA9CA0YWyZokD4HJtJTwvJFfV7wd5M8pGw== 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=0fIvUbqgzh2AM1uyMHedNUJvc1wwHR065UxLSpMCKso=; b=g5vmX/49if7yo4BD4wPV/QKiEYB6Gadl8BLv0vCTWqqQzjODw6tJxcWix/IzuTxonWk9ayaHiPzOXpfY1H4HH9VzzLjlkmzTgm9avaJME/cFp/VwwIBelkQqOgb7OcT0lMQN8DgrjRi2kEK5dwPjX3r0Kbods7hA+1cNGcSmnIcpwOHm4juVHTzmUWy5jwEbCzIAwyrBaRSCmvrB8sM6+JBJ6BCTgx24jqBZWePzOUb3h8/zr/t1JXNsCfLl1NnfsSOJFNz2WsmE3QRaiq2TLRM0tG97aQqsMajTB7eloscwROHuoPSO8yf8MhdsnmGAbQwOA4UcfWuceS28dvS2QQ== 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=0fIvUbqgzh2AM1uyMHedNUJvc1wwHR065UxLSpMCKso=; b=e9F84dGNGZRqkr5Jpt3sbPRb5qsOOWCrx5nzgvjM42UE63R/ExZoJVf4PQS9Z6b/xB11917yNQXYxaARbo3gRGIPT/IJOO1cdng2kDXlD5kAiM+QrnoHWGxv/uc8+gKw2CYTGeU1fcOSSzn+3CvA82Nyi+d4/wHctRUS65v8el8= 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:39 +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:39 +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 Subject: [PATCH v7 02/14] media: docs: Add some RGB bus formats for i.MX8qm/qxp pixel combiner Date: Wed, 31 Mar 2021 14:33:13 +0800 Message-Id: <1617172405-12962-3-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:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6288f849-89a6-44b1-c589-08d8f4110425 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:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +W3wivkbEUjkdW9axNZjCeyPp9t/7O/t4ts69ufR1KJQdG4XScTwXYZaldP99oFvu9eR5n7+OJI5UKyJrlcmMZY9hXzPbL22LmDVYEYOBoUn/w1vPt4IgFiPD+7aY3Awv9KBVeIfSDRNhvDzxllYSR1d7gpMN98xrjflXFlPetcnL/N6uOYYT0qP8LF7QnLgxH/mqDr0GA2HYv2QYdIcNeKEUCf4gu5+43eJsVgtCqT3lJ8QPlWWg7OLqPukUw6No8IW5fV9b9ZwcmWXpTukYOK1htHGupGr8b3pXlCbTUY1SOD3SXZtdrZ8+fnRNU5Fk0SR/A9nfduOQTTe0v1Z1CUKKAR+UuisOkJBBBlZ5eAmoVot9s63TJLTmQ8gk3nMXgRSoN+XcL6Nm3B+dUXVYkhgBVfTnQKFl8P6RzUA2GrME5UkPDgV2+28OeGHeNa2vS2dnQ+cCYJghXtJuThaEzPIMOIOZZNFR/uZ9JZ4Nvd9DMbt3d+P/uq0MqEln9ABRmaCoTi8Vd2UUq6OOhW0TZCmJHeYhkwGZXg87SGJXuQoeYwgvQDe2/we37MfsPOtLxjk6X3mTKngGvQyCnnRDc8kuBOsAQ/RlhbPbVzMRwrvse/fbY7tc8GxbNttankfBEPOnp8gZyIoREMKnAX0KJxr1djWb5Ulb+QOgprTh8cJ89ls6dXtKCVvTgUfUy0K 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)(36756003)(2906002)(6666004)(8936002)(6486002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: W9XD5KIT/K2YhtKsIdxcwXrgEhvEUmuvUFwwAUWmkfKzuFQHEis8AYQG1lOUAZ+mwFOYO9ZxSh5kuvYoufFfr3Oah7xCjqfdf6oNWYxGq/18P4Ft0H0h3FTVKABYohsNqu11iD5/w62t1gcr77T6CTwPjZXK5mWJFYwpbTNx2EqaE4tNLLjhmxBRkgQZhrsB5uFXwXGqR0HT5P/hQrtNkzmzUob9/ZXjfPajOfuvqNwMQj6EugmxG/YCUPVmUG3SPm1y/xoXNllGwK7xFVHeumYkjZv2YE3O+6zrq2Xa9YrT0dRlqMgHJNYIt0vZo+DeJnhJfLA4TmKgkgX53leqHosGq+HWkoI0x9lbEBodZfJszKeIejKKM/KGJf5ytJOoABQOPVhAyebyXi+mG7i6CxyI1Fp68FN9y25UVG2NonRte9c1M54Gj+uuFWMPrCqlM2Vz35SEnPpVcuKTrnK7qfXaMdhX89tVjYfp3VW0DODaD5wZF8BqH1bq11xQVWW1gacDPyXU6Zgdvawp60B5+zannWX3jtUmNFj4wJkFgGto6LQfMouIXA6amd9gK6Hl49GjtbJhQ+/dnnsYS4G6AHQPwVuCgPQwFRaj7taYuWdCWYFb1L5L8Ft3EwkgZdomlen6HHCrcLe1/UOkHUfSxCJerPbqC0wxIMDVK7dKAQkvig/MQGu0qrRR4dr2jKHeTrTlefDhs0BewQ5cCumqvC13c9WR0jbE6ijKOVMVa/AnyHZDCO0Rikz4QDLWz9j5dAaFtC5YommHtLXuxj82aHv8vu2EgoF+yvnMkmo8Ieo6MQfMamnja++qsAj+vOlX0CowRJYUBs71h20Bc7AKAgzIGKoko2KpM027eHJayE8p9YvwGkFunNFwDj/NAoLpvYxeh9E5ntLBNcPAOcaHe6fTIVVWdZlBBAIk/HOKgFugu8wwsthgxze9T8ZDKxef4kYAYpUwfcg+h96+daH3qpXeKHhSwHPArFW4EFfTlf8MCd8oStf68XZZJ3teoLdWyIOXTx9IAPrnZrAEte9eaHrzxc1ErIaXs0jBb+dvfom5YfpWbEdD+P8V/2VqHzQC2XLYPon2NNT5yR7YneAN+xTHllosXpTyxXLfCKdvXFxbH37n4pQphpveNsDmPAyiXNc8GZWDEuznv67v7E86jIBnv6FAcz0+Ibj6lUQOkjKTEd2rgZ7bbJY9tq4s+zsh7zzvg3Wm4opL19m9JlUnnvMwNIqwtMkQmBvMGyAdWuw5CxQhaebT4U+TPU7zz+sAzVIiZIuQzVf6qv7Mi4hUMZ9NK/Rag8lJ95zZoXzkhLMe4cVkojmgRez2PDx1A+JB X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6288f849-89a6-44b1-c589-08d8f4110425 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:39.6639 (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: MMfFYytUKnnu2VeD71McFanxYJNaJNL7ouYNhaBsHgaCfoAodw/uQrFpYyGm6Xa+VQmAcVCMKfSGCR25OND+fg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6349 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch adds documentations for RGB666_1X30_CPADLO, RGB888_1X30_CPADLO, RGB666_1X36_CPADLO and RGB888_1X36_CPADLO bus formats used by i.MX8qm/qxp pixel combiner. The RGB pixels with padding low per component are transmitted on a 30-bit input bus(10-bit per component) from a display controller or a 36-bit output bus(12-bit per component) to a pixel link. Reviewed-by: Robert Foss Reviewed-by: Laurent Pinchart Signed-off-by: Liu Ying --- Robert, I keep your R-b tag from v5. Let me know if you want me to drop it, as v6 contains a fix. v6->v7: * No change. v5->v6: * Fix data organizations of MEDIA_BUS_FMT_RGB{666,888}_1X30-CPADLO. (Laurent) * Add Laurent's R-b tag. v4->v5: * Add Robert's R-b tag. v3->v4: * No change. v2->v3: * No change. v1->v2: * No change. .../userspace-api/media/v4l/subdev-formats.rst | 156 +++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/subdev-formats.rst b/Documentation/userspace-api/media/v4l/subdev-formats.rst index 7f16cbe..1402e18 100644 --- a/Documentation/userspace-api/media/v4l/subdev-formats.rst +++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst @@ -1488,6 +1488,80 @@ The following tables list existing packed RGB formats. - b\ :sub:`2` - b\ :sub:`1` - b\ :sub:`0` + * .. _MEDIA-BUS-FMT-RGB666-1X30-CPADLO: + + - MEDIA_BUS_FMT_RGB666_1X30-CPADLO + - 0x101e + - + - + - + - r\ :sub:`5` + - r\ :sub:`4` + - r\ :sub:`3` + - r\ :sub:`2` + - r\ :sub:`1` + - r\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - g\ :sub:`5` + - g\ :sub:`4` + - g\ :sub:`3` + - g\ :sub:`2` + - g\ :sub:`1` + - g\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - b\ :sub:`5` + - b\ :sub:`4` + - b\ :sub:`3` + - b\ :sub:`2` + - b\ :sub:`1` + - b\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + * .. _MEDIA-BUS-FMT-RGB888-1X30-CPADLO: + + - MEDIA_BUS_FMT_RGB888_1X30-CPADLO + - 0x101f + - + - + - + - r\ :sub:`7` + - r\ :sub:`6` + - r\ :sub:`5` + - r\ :sub:`4` + - r\ :sub:`3` + - r\ :sub:`2` + - r\ :sub:`1` + - r\ :sub:`0` + - 0 + - 0 + - g\ :sub:`7` + - g\ :sub:`6` + - g\ :sub:`5` + - g\ :sub:`4` + - g\ :sub:`3` + - g\ :sub:`2` + - g\ :sub:`1` + - g\ :sub:`0` + - 0 + - 0 + - b\ :sub:`7` + - b\ :sub:`6` + - b\ :sub:`5` + - b\ :sub:`4` + - b\ :sub:`3` + - b\ :sub:`2` + - b\ :sub:`1` + - b\ :sub:`0` + - 0 + - 0 * .. _MEDIA-BUS-FMT-ARGB888-1X32: - MEDIA_BUS_FMT_ARGB888_1X32 @@ -1665,6 +1739,88 @@ The following table list existing packed 36bit wide RGB formats. - 2 - 1 - 0 + * .. _MEDIA-BUS-FMT-RGB666-1X36-CPADLO: + + - MEDIA_BUS_FMT_RGB666_1X36_CPADLO + - 0x1020 + - + - r\ :sub:`5` + - r\ :sub:`4` + - r\ :sub:`3` + - r\ :sub:`2` + - r\ :sub:`1` + - r\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - g\ :sub:`5` + - g\ :sub:`4` + - g\ :sub:`3` + - g\ :sub:`2` + - g\ :sub:`1` + - g\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - b\ :sub:`5` + - b\ :sub:`4` + - b\ :sub:`3` + - b\ :sub:`2` + - b\ :sub:`1` + - b\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + * .. _MEDIA-BUS-FMT-RGB888-1X36-CPADLO: + + - MEDIA_BUS_FMT_RGB888_1X36_CPADLO + - 0x1021 + - + - r\ :sub:`7` + - r\ :sub:`6` + - r\ :sub:`5` + - r\ :sub:`4` + - r\ :sub:`3` + - r\ :sub:`2` + - r\ :sub:`1` + - r\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - g\ :sub:`7` + - g\ :sub:`6` + - g\ :sub:`5` + - g\ :sub:`4` + - g\ :sub:`3` + - g\ :sub:`2` + - g\ :sub:`1` + - g\ :sub:`0` + - 0 + - 0 + - 0 + - 0 + - b\ :sub:`7` + - b\ :sub:`6` + - b\ :sub:`5` + - b\ :sub:`4` + - b\ :sub:`3` + - b\ :sub:`2` + - b\ :sub:`1` + - b\ :sub:`0` + - 0 + - 0 + - 0 + - 0 * .. _MEDIA-BUS-FMT-RGB121212-1X36: - MEDIA_BUS_FMT_RGB121212_1X36 From patchwork Wed Mar 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: 12174411 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 E1783C433C1 for ; Wed, 31 Mar 2021 06:48:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A46C614A7 for ; Wed, 31 Mar 2021 06:48:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A46C614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 214CB6E9E4; Wed, 31 Mar 2021 06:48:53 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2086.outbound.protection.outlook.com [40.107.21.86]) by gabe.freedesktop.org (Postfix) with ESMTPS id B177A6E9E4 for ; Wed, 31 Mar 2021 06:48:51 +0000 (UTC) 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12174413 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=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,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 D3E38C433C1 for ; Wed, 31 Mar 2021 06:49:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24EDD614A7 for ; Wed, 31 Mar 2021 06:49:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24EDD614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 967B86E9E5; Wed, 31 Mar 2021 06:48:59 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2067.outbound.protection.outlook.com [40.107.21.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 99E516E9E5 for ; Wed, 31 Mar 2021 06:48:58 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EQCV7IfeslGALR308kpW1dfPWZj9mZcXd1OqhNUKZRHxXnWcQELRxtYpd++QE3dgsdXCJhGiBX6SEREPkmb33lR2a6jFYp0gEHi7wqkVdd7YkZIhcrSk6ZJyNGzu9HAnQp4gH9hGFtz2PdRJCqetFUJ3BE69bm9mwKCAjR7ABY5dgw3p7xxWXGa03IgGcaCD5qI1EoC2kxYEeQXxg4WvYjXr70hQEgyOhuTXDj4B3ZS1CiuFr9FFAziH4KtNC4MXm5Hdv9ABuPycONnh7kYpEpdUjm0wotrld4o50paETT48LQMMsv6O6RteZbv06PMJY1hdIl3X18a9p3UKk/Wq/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j+IhPebX/ZY2rLqNfnoXFb6GzrQHPO8TVwBxmqAOH8M=; b=NM+EkeSLOVgle0WHg7Rgv7lJdlRNQOQa7wnPftnPrMbxUZyWy5D1hJAB3o+uAkYcwgK7vUKHuCDGQifKPYk+6yf1sP+ub7UHXqQeNDInesrcfzE8zCXrMPkzdV7dvx79JdfQjTTjM7TlQni7X7hcTtrDDbZlCNo+gVfBjbigUzzkGED40Hb/ggoQ+IlqZSJHbZ1fIHSGlUjI68i5ws+9Ylzs/69khK4EAYu3ASBlyKk046h7lE2gs+ZoIJi7lY+gn1kXq6X1r9U2OSVzEKPjN5e0cc3pkUXNHbH0I5xwavZx2hkg0ETG2QZ8+Jd+HCCRrP/WVdgH1cgNRbTwe6jzkw== 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=j+IhPebX/ZY2rLqNfnoXFb6GzrQHPO8TVwBxmqAOH8M=; b=FbfcmVYogqWd/fSCrpi0JIE84MlrR83VggtPmqifWeg6X6Q/ItM2wuD6mW0Gvemca/a6cXh2bZbdpLaY0H46rVKIAFlp10JX8SBxcuS0DnILDRImvjkXrFmpfBvrb1jvx5cBBbGEXLRFLe+OFM/P1PsDfV9bjOa/z0rOiU98Xzs= 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:54 +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:54 +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 Subject: [PATCH v7 04/14] drm/bridge: imx: Add i.MX8qm/qxp pixel combiner support Date: Wed, 31 Mar 2021 14:33:15 +0800 Message-Id: <1617172405-12962-5-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:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d87d722b-a417-44a6-0e2a-08d8f4110c91 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:95; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7LS4rZVRvHmRagEI479NPpUGLydTz6gNe5rj9b1CpDAafJwZHqFVA9wjZOqfkfY1MCD8VMXn9cc4l5ICxv/FB40l9N+10EnHc6gH8+jR6wkpasQI0n8fe96GhULOG98Bz6znzVLVGFZEH0U3s+Rw7mMaPTeTdPyEuqxytFhBxDpNS4JjAJpsKh5w/aJsGgCXT/g+Jaj/zSA+KfK6+Cs4+WNqSJ0lPgjI5hrMO6h0VjqEHawdQgPndPl5+3pRzd3JbpdmQufkO2iSa010TjmqCkyhLGJ/O8Vd1PJMJ25EPbrgn2+BPVd/QIAAT6f5PgzE//DIYNHDxRcWAGUOKjKHIoadfCxEYCHCsYpxjWaJKkTW7NV6rD5Let1UlM9M53+wQKMiYZ5kbNqF/J54+FCnfNvcwrIQCAU2IkafSXk75fIWozXjtYivi7p4T7IB5lbUTbTvqynxO3/juwoTqlQHyuOqzbhUBvDSj/eAXsOK5iZCCXi0Htg6zfYYyY3O/xIvivg5wacJ8VozQEbl2R5FdM/pv7BzufrWGuZS4exYUdL62sSlfVKly/Nvv9ZA4nNFLSG0UR0g4CI2hi+7SzMtiooLeso88I9X0/sMeHLL1ydFYqqSNZDGcUjiBYDhH0Z5L/Srp0LyuBzth8fKRSHiJLBHeEIhRgeImpNRC7M9VRXuT+5GmTG19ctliXkHKZB6 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)(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: QwbmpvBKxx+C5YHWfkH7kgSst7JdRxIdVuk3G4+uUAzCbNJNw5IXRY3CK2FwHea9CUuu1pQiZViACagLANscFGj2RV7dboxU5u5fPP6MGV5wDZM8ZqHSQtxzTs5xeQPmZmAxJrUeZAD9oIf1LkIqzsTaCY3s0YMHg3IUmSO08YWoaslfucnfBTRn4gxMVqW4XOfVL4CUsDtqDLaIOmtZCf+7eVPd72TOGZ+Cn3+WHix/6jyQTUD/SwTC5lyvAxPJykN5xv8V7j3oJrApPZPVsLFYd2EXmvAO1tv5XMac0u8sK5pdbTiB+B31LWhSu/165cvb9UT5Nxf3QxgLb77JLZe09ux88qt66pO4/2lbxu8LL6Cn/J+0V2ifCeeF6X9OehKePuRHh7OeRg5ThhV1QNaBAlWsQD8AFWSyIlpBoC5e2J27DiyNHo6P1B+0H1Q7339Gb3aFLVHs11E3ty4XEXpa9ffzT46u3kLXf+jQzh7zLCtmONbhPY8wQu69TfFILRvwHhb6sxaYLQ8cX86g5hJ6U5H2uBY9u95sP6pFkC4GErYPFBO0Z3ZyMUNxrIdq3HNpNvixkJsCLAeghS2jbTQ3IlC2qQO9DdTVPBLANnAAOdrwjOhUXTtJeAltMi/tVB5QtJbIxfmf4gnbY/u0SBWKhGgu14vL4V2R9gfnLzeO+pICXOeFddfwyMW6FuHQXRo1rfCEz1OQQjoBbHO1jztBtDX7+4HCPYkduvoth5RK0g27y/MswfOSDKNpleUcYKdrSEGGqLj1whV+k3fRLytCgE8zS2rk0eGMJAiSJal8BIIl2213A9sxnIKPvmwre5x129K4eHnimMqJd+czHFc7jg/nPRCqHXOnbtFddSGAdWh9p0poWtL5NRx7GjdqZKOejBAweQGgCNyf2PD7MKHS1g/63tbGbXL4gEDRw3kPBlnjbhgN0KDwTalVt4oyWnNwZ9FKWV1YT0xswDZyqi2Gq5Bg/RXKGJDmJFMpKKpTU94PZntWZR+NKNrMDyoOKSsbXPH9emqT6kl4F14PiOH470Siwha5Zq2MW3pTh9caNNQCVtam85zk4eFitjfg+lWtI8VxJZXGNqa7phnYxduPzaEgTPNQkieAfdNVNl4P024TdJUWHIz8iK1dUtf01hZ5jsUrSbrg4DqtTRu7WvRf2h9HyBJySfhnYGlqYnXjf1f8QNfHel3MKUBCuvZ8DqQdVKoR8fHqcsD3fQxPKaAJm8D2fSmOoWpi3xePYVN8TNfDfjnmPDEjDEMSw+TKCg71V0nUB75WjBJF0F/YL92aGbmnBmHRPMGEK5xb9b+hh9SCnpp6n/P5b8KoQ77V X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d87d722b-a417-44a6-0e2a-08d8f4110c91 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:53.9427 (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: iATkBccuQEIpH6UnybosLdaT62pV5oQs5fdXbv7SQd6wJwhl2qBQCSexjuyZoIv5oR0rkXXo1xrzR8Y2CRmamg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6349 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch adds a drm bridge driver for i.MX8qm/qxp pixel combiner. The pixel combiner takes two output streams from a single display controller and manipulates the two streams to support a number of modes(bypass, pixel combine, YUV444 to YUV422, split_RGB) configured as either one screen, two screens, or virtual screens. The pixel combiner is also responsible for generating some of the control signals for the pixel link output channel. For now, the driver only supports the bypass mode. Reviewed-by: Robert Foss Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Signed-off-by: Liu Ying --- Robert, I keep your R-b tag from v5. Let me know if you want me to drop it, as v7 contains a fix for checkpatch complaints. Marcel, as the fix is trivial, I add your T-b tag. Let me know if you want me to drop it. v6->v7: * Fix 'Alignment should match open parenthesis' complaints from 'checkpatch.pl --strict'. * Add Marcel's T-b tag. v5->v6: * No change. v4->v5: * Drop the 'PC_BUF_PARA_REG' register definition. (Robert) * Add Robert's R-b tag. v3->v4: * No change. v2->v3: * No change. v1->v2: * No change. drivers/gpu/drm/bridge/Kconfig | 2 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/imx/Kconfig | 8 + drivers/gpu/drm/bridge/imx/Makefile | 1 + .../gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 448 +++++++++++++++++++++ 5 files changed, 460 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/Kconfig create mode 100644 drivers/gpu/drm/bridge/imx/Makefile create mode 100644 drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index dba62f9..ded1853 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -283,6 +283,8 @@ source "drivers/gpu/drm/bridge/adv7511/Kconfig" source "drivers/gpu/drm/bridge/cadence/Kconfig" +source "drivers/gpu/drm/bridge/imx/Kconfig" + source "drivers/gpu/drm/bridge/synopsys/Kconfig" endmenu diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 5c61b50..c302c532 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -29,4 +29,5 @@ obj-$(CONFIG_DRM_NWL_MIPI_DSI) += nwl-dsi.o obj-y += analogix/ obj-y += cadence/ +obj-y += imx/ obj-y += synopsys/ diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig new file mode 100644 index 00000000..f1c91b6 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -0,0 +1,8 @@ +config DRM_IMX8QXP_PIXEL_COMBINER + tristate "Freescale i.MX8QM/QXP pixel combiner" + depends on OF + depends on COMMON_CLK + select DRM_KMS_HELPER + help + Choose this to enable pixel combiner found in + Freescale i.MX8qm/qxp processors. diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile new file mode 100644 index 00000000..7d7c8d6 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_DRM_IMX8QXP_PIXEL_COMBINER) += imx8qxp-pixel-combiner.o diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c new file mode 100644 index 00000000..86ae98a --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c @@ -0,0 +1,448 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define PC_CTRL_REG 0x0 +#define PC_COMBINE_ENABLE BIT(0) +#define PC_DISP_BYPASS(n) BIT(1 + 21 * (n)) +#define PC_DISP_HSYNC_POLARITY(n) BIT(2 + 11 * (n)) +#define PC_DISP_HSYNC_POLARITY_POS(n) DISP_HSYNC_POLARITY(n) +#define PC_DISP_VSYNC_POLARITY(n) BIT(3 + 11 * (n)) +#define PC_DISP_VSYNC_POLARITY_POS(n) DISP_VSYNC_POLARITY(n) +#define PC_DISP_DVALID_POLARITY(n) BIT(4 + 11 * (n)) +#define PC_DISP_DVALID_POLARITY_POS(n) DISP_DVALID_POLARITY(n) +#define PC_VSYNC_MASK_ENABLE BIT(5) +#define PC_SKIP_MODE BIT(6) +#define PC_SKIP_NUMBER_MASK GENMASK(12, 7) +#define PC_SKIP_NUMBER(n) FIELD_PREP(PC_SKIP_NUMBER_MASK, (n)) +#define PC_DISP0_PIX_DATA_FORMAT_MASK GENMASK(18, 16) +#define PC_DISP0_PIX_DATA_FORMAT(fmt) \ + FIELD_PREP(PC_DISP0_PIX_DATA_FORMAT_MASK, (fmt)) +#define PC_DISP1_PIX_DATA_FORMAT_MASK GENMASK(21, 19) +#define PC_DISP1_PIX_DATA_FORMAT(fmt) \ + FIELD_PREP(PC_DISP1_PIX_DATA_FORMAT_MASK, (fmt)) + +#define PC_SW_RESET_REG 0x20 +#define PC_SW_RESET_N BIT(0) +#define PC_DISP_SW_RESET_N(n) BIT(1 + (n)) +#define PC_FULL_RESET_N (PC_SW_RESET_N | \ + PC_DISP_SW_RESET_N(0) | \ + PC_DISP_SW_RESET_N(1)) + +#define PC_REG_SET 0x4 +#define PC_REG_CLR 0x8 + +#define DRIVER_NAME "imx8qxp-pixel-combiner" + +enum imx8qxp_pc_pix_data_format { + RGB, + YUV444, + YUV422, + SPLIT_RGB, +}; + +struct imx8qxp_pc_channel { + struct drm_bridge bridge; + struct drm_bridge *next_bridge; + struct imx8qxp_pc *pc; + unsigned int stream_id; + bool is_available; +}; + +struct imx8qxp_pc { + struct device *dev; + struct imx8qxp_pc_channel ch[2]; + struct clk *clk_apb; + void __iomem *base; +}; + +static inline u32 imx8qxp_pc_read(struct imx8qxp_pc *pc, unsigned int offset) +{ + return readl(pc->base + offset); +} + +static inline void +imx8qxp_pc_write(struct imx8qxp_pc *pc, unsigned int offset, u32 value) +{ + writel(value, pc->base + offset); +} + +static inline void +imx8qxp_pc_write_set(struct imx8qxp_pc *pc, unsigned int offset, u32 value) +{ + imx8qxp_pc_write(pc, offset + PC_REG_SET, value); +} + +static inline void +imx8qxp_pc_write_clr(struct imx8qxp_pc *pc, unsigned int offset, u32 value) +{ + imx8qxp_pc_write(pc, offset + PC_REG_CLR, value); +} + +static enum drm_mode_status +imx8qxp_pc_bridge_mode_valid(struct drm_bridge *bridge, + const struct drm_display_info *info, + const struct drm_display_mode *mode) +{ + if (mode->hdisplay > 2560) + return MODE_BAD_HVALUE; + + return MODE_OK; +} + +static int imx8qxp_pc_bridge_attach(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct imx8qxp_pc_channel *ch = bridge->driver_private; + struct imx8qxp_pc *pc = ch->pc; + + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { + DRM_DEV_ERROR(pc->dev, + "do not support creating a drm_connector\n"); + return -EINVAL; + } + + if (!bridge->encoder) { + DRM_DEV_ERROR(pc->dev, "missing encoder\n"); + return -ENODEV; + } + + return drm_bridge_attach(bridge->encoder, + ch->next_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); +} + +static void +imx8qxp_pc_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct imx8qxp_pc_channel *ch = bridge->driver_private; + struct imx8qxp_pc *pc = ch->pc; + u32 val; + int ret; + + ret = pm_runtime_get_sync(pc->dev); + if (ret < 0) + DRM_DEV_ERROR(pc->dev, + "failed to get runtime PM sync: %d\n", ret); + + ret = clk_prepare_enable(pc->clk_apb); + if (ret) + DRM_DEV_ERROR(pc->dev, "%s: failed to enable apb clock: %d\n", + __func__, ret); + + /* HSYNC to pixel link is active low. */ + imx8qxp_pc_write_clr(pc, PC_CTRL_REG, + PC_DISP_HSYNC_POLARITY(ch->stream_id)); + + /* VSYNC to pixel link is active low. */ + imx8qxp_pc_write_clr(pc, PC_CTRL_REG, + PC_DISP_VSYNC_POLARITY(ch->stream_id)); + + /* Data enable to pixel link is active high. */ + imx8qxp_pc_write_set(pc, PC_CTRL_REG, + PC_DISP_DVALID_POLARITY(ch->stream_id)); + + /* Mask the first frame output which may be incomplete. */ + imx8qxp_pc_write_set(pc, PC_CTRL_REG, PC_VSYNC_MASK_ENABLE); + + /* Only support RGB currently. */ + val = imx8qxp_pc_read(pc, PC_CTRL_REG); + if (ch->stream_id == 0) { + val &= ~PC_DISP0_PIX_DATA_FORMAT_MASK; + val |= PC_DISP0_PIX_DATA_FORMAT(RGB); + } else { + val &= ~PC_DISP1_PIX_DATA_FORMAT_MASK; + val |= PC_DISP1_PIX_DATA_FORMAT(RGB); + } + imx8qxp_pc_write(pc, PC_CTRL_REG, val); + + /* Only support bypass mode currently. */ + imx8qxp_pc_write_set(pc, PC_CTRL_REG, PC_DISP_BYPASS(ch->stream_id)); + + clk_disable_unprepare(pc->clk_apb); +} + +static void +imx8qxp_pc_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct imx8qxp_pc_channel *ch = bridge->driver_private; + struct imx8qxp_pc *pc = ch->pc; + int ret; + + ret = pm_runtime_put(pc->dev); + if (ret < 0) + DRM_DEV_ERROR(pc->dev, "failed to put runtime PM: %d\n", ret); +} + +static const u32 imx8qxp_pc_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB888_1X36_CPADLO, + MEDIA_BUS_FMT_RGB666_1X36_CPADLO, +}; + +static bool imx8qxp_pc_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx8qxp_pc_bus_output_fmts); i++) { + if (imx8qxp_pc_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx8qxp_pc_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + u32 *input_fmts; + + if (!imx8qxp_pc_bus_output_fmt_supported(output_fmt)) + return NULL; + + *num_input_fmts = 1; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_RGB888_1X36_CPADLO: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X30_CPADLO; + break; + case MEDIA_BUS_FMT_RGB666_1X36_CPADLO: + input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X30_CPADLO; + break; + default: + kfree(input_fmts); + input_fmts = NULL; + break; + } + + return input_fmts; +} + +static u32 * +imx8qxp_pc_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + unsigned int *num_output_fmts) +{ + *num_output_fmts = ARRAY_SIZE(imx8qxp_pc_bus_output_fmts); + return kmemdup(imx8qxp_pc_bus_output_fmts, + sizeof(imx8qxp_pc_bus_output_fmts), GFP_KERNEL); +} + +static const struct drm_bridge_funcs imx8qxp_pc_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .mode_valid = imx8qxp_pc_bridge_mode_valid, + .attach = imx8qxp_pc_bridge_attach, + .mode_set = imx8qxp_pc_bridge_mode_set, + .atomic_disable = imx8qxp_pc_bridge_atomic_disable, + .atomic_get_input_bus_fmts = + imx8qxp_pc_bridge_atomic_get_input_bus_fmts, + .atomic_get_output_bus_fmts = + imx8qxp_pc_bridge_atomic_get_output_bus_fmts, +}; + +static int imx8qxp_pc_bridge_probe(struct platform_device *pdev) +{ + struct imx8qxp_pc *pc; + struct imx8qxp_pc_channel *ch; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct device_node *child, *remote; + u32 i; + int ret; + + pc = devm_kzalloc(dev, sizeof(*pc), GFP_KERNEL); + if (!pc) + return -ENOMEM; + + pc->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(pc->base)) + return PTR_ERR(pc->base); + + pc->dev = dev; + + pc->clk_apb = devm_clk_get(dev, "apb"); + if (IS_ERR(pc->clk_apb)) { + ret = PTR_ERR(pc->clk_apb); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get apb clock: %d\n", ret); + return ret; + } + + platform_set_drvdata(pdev, pc); + pm_runtime_enable(dev); + + for_each_available_child_of_node(np, child) { + ret = of_property_read_u32(child, "reg", &i); + if (ret || i > 1) { + ret = -EINVAL; + DRM_DEV_ERROR(dev, + "invalid channel(%u) node address\n", i); + goto free_child; + } + + ch = &pc->ch[i]; + ch->pc = pc; + ch->stream_id = i; + + remote = of_graph_get_remote_node(child, 1, 0); + if (!remote) { + ret = -ENODEV; + DRM_DEV_ERROR(dev, + "channel%u failed to get port1's remote node: %d\n", + i, ret); + goto free_child; + } + + ch->next_bridge = of_drm_find_bridge(remote); + if (!ch->next_bridge) { + of_node_put(remote); + ret = -EPROBE_DEFER; + DRM_DEV_DEBUG_DRIVER(dev, + "channel%u failed to find next bridge: %d\n", + i, ret); + goto free_child; + } + + of_node_put(remote); + + ch->bridge.driver_private = ch; + ch->bridge.funcs = &imx8qxp_pc_bridge_funcs; + ch->bridge.of_node = child; + ch->is_available = true; + + drm_bridge_add(&ch->bridge); + } + + return 0; + +free_child: + of_node_put(child); + + if (i == 1 && pc->ch[0].next_bridge) + drm_bridge_remove(&pc->ch[0].bridge); + + pm_runtime_disable(dev); + return ret; +} + +static int imx8qxp_pc_bridge_remove(struct platform_device *pdev) +{ + struct imx8qxp_pc *pc = platform_get_drvdata(pdev); + struct imx8qxp_pc_channel *ch; + int i; + + for (i = 0; i < 2; i++) { + ch = &pc->ch[i]; + + if (!ch->is_available) + continue; + + drm_bridge_remove(&ch->bridge); + ch->is_available = false; + } + + pm_runtime_disable(&pdev->dev); + + return 0; +} + +static int __maybe_unused imx8qxp_pc_runtime_suspend(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct imx8qxp_pc *pc = platform_get_drvdata(pdev); + int ret; + + ret = clk_prepare_enable(pc->clk_apb); + if (ret) + DRM_DEV_ERROR(pc->dev, "%s: failed to enable apb clock: %d\n", + __func__, ret); + + /* Disable pixel combiner by full reset. */ + imx8qxp_pc_write_clr(pc, PC_SW_RESET_REG, PC_FULL_RESET_N); + + clk_disable_unprepare(pc->clk_apb); + + /* Ensure the reset takes effect. */ + usleep_range(10, 20); + + return ret; +} + +static int __maybe_unused imx8qxp_pc_runtime_resume(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct imx8qxp_pc *pc = platform_get_drvdata(pdev); + int ret; + + ret = clk_prepare_enable(pc->clk_apb); + if (ret) { + DRM_DEV_ERROR(pc->dev, "%s: failed to enable apb clock: %d\n", + __func__, ret); + return ret; + } + + /* out of reset */ + imx8qxp_pc_write_set(pc, PC_SW_RESET_REG, PC_FULL_RESET_N); + + clk_disable_unprepare(pc->clk_apb); + + return ret; +} + +static const struct dev_pm_ops imx8qxp_pc_pm_ops = { + SET_RUNTIME_PM_OPS(imx8qxp_pc_runtime_suspend, + imx8qxp_pc_runtime_resume, NULL) +}; + +static const struct of_device_id imx8qxp_pc_dt_ids[] = { + { .compatible = "fsl,imx8qm-pixel-combiner", }, + { .compatible = "fsl,imx8qxp-pixel-combiner", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qxp_pc_dt_ids); + +static struct platform_driver imx8qxp_pc_bridge_driver = { + .probe = imx8qxp_pc_bridge_probe, + .remove = imx8qxp_pc_bridge_remove, + .driver = { + .pm = &imx8qxp_pc_pm_ops, + .name = DRIVER_NAME, + .of_match_table = imx8qxp_pc_dt_ids, + }, +}; +module_platform_driver(imx8qxp_pc_bridge_driver); + +MODULE_DESCRIPTION("i.MX8QM/QXP pixel combiner bridge driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME); From patchwork Wed Mar 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: 12174415 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 37967C433DB for ; Wed, 31 Mar 2021 06:49:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E9018614A7 for ; Wed, 31 Mar 2021 06:49:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9018614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 773D76E9E8; Wed, 31 Mar 2021 06:49:08 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2045.outbound.protection.outlook.com [40.107.21.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id A76D56E9E8 for ; Wed, 31 Mar 2021 06:49:06 +0000 (UTC) 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12174417 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 A5EBBC433DB for ; Wed, 31 Mar 2021 06:49:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B4E6614A7 for ; Wed, 31 Mar 2021 06:49:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B4E6614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B46166E9EA; Wed, 31 Mar 2021 06:49:14 +0000 (UTC) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40059.outbound.protection.outlook.com [40.107.4.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id D8E736E9E9 for ; Wed, 31 Mar 2021 06:49:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jVu9aolOXrH6oGDPzBVQ4RTpor6XgBjHm2vUqLLhOFjK8/zFXqnO3FlW9DLWThy/fFBLlPzlrtaReH7InBHqYQ3cx5fQnym34dbsi34bCgAKJcR3T94aFU5hWl8ccrDo0YuNJO9e4T5OyKDk9EGTgqPGwGo8dmA1tQSVeKfps6od8FfNlm1Lcs5dXsep1s7Yb9p0ya4e4tbDyhoL5o8XHwkWKcojwf/S8JBH+mRY2M9CHzpoRcX9fOygr3zy1g5SZ/O4YMP51ene9zVpMewzdzz7H2xMJcFu80yEnRWKPZdQKsPW78p52pXkYS/FZz6zijVyab5YFbGmhgIhyrib0A== 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=eUoliFvlLveYUmc1p18D3TQS1GcA7Smm0Lp3LO/J11I=; b=HMxkOU/WhVrbkhFJ4Avvto5LdUlWQRm6TocH/7oBonTfkWE2a8/yT/vrFKIL58AJfo1YEyRXm4WqSWogWOmxujYc7c5xauyPipQPNmqUHZ2SSaUOR419i/HZ+yd+U32cqp+YY3NZsISmqoCVBy1D2l+bdCngzzHQvHhkojNASR/eVTnTpGJjIL/k3eE83aYHbHnDZMYrI5uTaaTAhXS+E9krDc57ZZ64lszmch8ipxg6/tpapR3W9vfk2G8gjiRrzkqjnoovdypTgjyT5bmEPebVdPIrf56T4TRHjLxxnma70piNy4oMHlqM/VjacG1f8/2spaAo7aoRt8LLFH/rMQ== 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=eUoliFvlLveYUmc1p18D3TQS1GcA7Smm0Lp3LO/J11I=; b=PF6bhhKoopRgyiof+6B9kTdZ2Lcrlfu5MpYW4m7uZSplxdXj7OxxNxbiBYOrLOGA7PavotiEeLJilFiMK4NolmlSxeWq8VaxWwnXFEoqmcm4h6rOINRUNkbnlu3f9B1jngZ6N7vTXFMkkwQNtEQlmy6tClmDqunBrHsr2T7PJKE= 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:08 +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:08 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v7 06/14] drm/bridge: imx: Add i.MX8qm/qxp display pixel link support Date: Wed, 31 Mar 2021 14:33:17 +0800 Message-Id: <1617172405-12962-7-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:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 64963825-6399-4265-76ca-08d8f4111522 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:1265; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u04il67rfXjQAan4D4jFV6SOXBIJV2QulsllX8NhntFTnvQfKpFgRNhfJ8gakGqMzO/5OqyVUXnyP5WwiZ+sSZvxCHeTLz1GCe9SJ4UO4v8CInrkyc/xcONoeU1iypeyxou/2k2Dpmho13g7PHMt0BL9P4sU4R+YMUCCzQgMVLqHXvktBC+MBmS4dieH5v/xJ1N7eymWivC7afbgnAuOt9YcYKGMLPX/LXYyyUQ+Fm2i1F33hUjCfM2zMA6s+P4Z/IicLadnOdlFsjB4rWIipH7egarjqtSKVJSsAutS7O6tiEiq8xP0dxKQ8bwLDK+zlUE6qU/V9Eu8wVuLfMtTB5fd7U4iGjWEgzFh9lM6KKIiuxPQv109H9ny1GIPDaP56YYaX8hb6BlI41wggpv+iBNAQHNwL2wv9G6YoSdkGGHGRQaj54D5Cn0/4LNS7si3/ls3kPV5Ryi6vl2P+kYrsdLw36bJ1fh40b4L/kOEYQ5mX0BSYhymoXtJQnSTrxWThNkIZ7FzzyACHfeu9AwC/IrdRX4mdIn+EcxJsD9qU1lDzNV574+X7qwrrh0jL51FP9Ek5AM/qMqkb7ZE9V5gZjSeVFZwBbUsSn3vcMxWwFksf8PUFsqONoRLSeHp6HrzYjMODaAMOPGG6rB/3NDktOehf4vvZ2BT0y06PQhpq6cJ8OWGIcMrNQ29evksAyiJ 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)(69590400012)(186003)(66556008)(5660300002)(26005)(498600001)(66476007)(38100700001)(4326008)(2616005)(956004)(36756003)(2906002)(6666004)(8936002)(6486002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CFuqUpjHmTz7OkcxzaiUAVpPSXKFyjOa5E5SPg4MyGh6tDN2tEOzTwWcyN0bpxWGghsgBzXkWgNFKW2/KCiJBYZeAXSqstLrxiyOG+QVyuzZJ3VIJN51LiAhNkNzu/OHGE3lBVGFw04xO6jrZdLxphOTADRmpdecJTixS8TEcIjx0vPXm0wQ/Ip6GyLABUDJjgJRHqAf3P4yz7VGcgKnx45wzPnv2178fgMimxMvhotPLmc5p1qoBDDqW8r+2wLxE5Pv7pBPEbK/4ohagTdjw4DvbbuiFr6lEQL/BeO7wUJYh1REWHEHYpLz0oHk7orypYwZLbbEByUULuoyaarrLgct/2L4yK/UWvE+HJvVZ969AcKPosVMhhDPIzVi2ldrIHMQM6tP/gHy2M4XZgJ0ml5U8cNNvNaBCRtMM8ViCJgvUfTxf8J/Ni1L0NIAsy0HmdTWLBO4M1Tq1qmMmjtYwuEeuXxJmnE0TgyQ1y1f2HU0bbn17PHQufC5havgN26xt1nV6z+Jod8Yiy246h58H31ZpVQI5hefH/PcJKfcrVeLNDx3m1zmLIGf6NpJ+dHCH3c70uUOU08QJol3RNgS7sgPYC+dhYgIDkvA7LT8upiSYCW6RJPZ1vce1XFgzTF/SViHzWunHjEwck4zNnT5Z07UQSu/SGNPo1lJ6Q7QEa+7CzdYKgTVpfJcIEF6XToZzIWV2Pjgdxb3LdXiFPFCa4YPjzmt1CYRAopmxYGwz1AbculEmZKlT84/voO2efs0gIb9fevCEkqLtogczv1tZUqoSPRRjI6eZ3s7Nevr6KH/HwupOEmTwHgF7W4m67YCwFzmYenzuOlW/84YrKnsWyzyC1tyfmUOpCONxFCmoK6BpiMlIQV4JOtE2zwH3bjJJnNK9v5qqlQY+PrsKEaZvYikytyz9FVLENYoej2sOmgGD/PXCbmCLhuUDIVNfvFUrZfMd6bhUKaQZ8xvVdv/yBZ56OQI6pH78Bkmf2nTGgNayXqejgns9dktVtMvaX7iftmZsZf4COt6rlaa4vnC7FqTj0Fxo2SS4pNYcAWSi1It3RursBsnbXO33yU3NQO4efNH9D7B2hXcwVkyWy4/VEMf7dAicqR84EYHE/DRiWqjoqode/JV9ybA9HrvF33LYsnqKxo0ryu7fk7STHY+SbuL9ejE+27YIARGVhcN5XngHQ+dYboi/sxIem9A90LXlW7AjpP0037xpDOzTFHLduyxQTirmZKBERqZkYSfagTutyERMMVLVJFr0vkcCBnniEnMmQoMDkkvk5pGbbgC881uv22gBofzzWLOlrW4bo38iqPsgoi2hJ3UywJ+RjEM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64963825-6399-4265-76ca-08d8f4111522 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:08.2674 (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: UBfIAA0v4kkiGkqkATzq9qCxP2qtOvo7/WZiQpjo8tXteb3wmmGNU4eK3NP6ZKwCn2ntJymU9sX7t3mHio1LgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6349 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch adds a drm bridge driver for i.MX8qm/qxp display pixel link. The pixel link forms a standard asynchronous linkage between pixel sources(display controller or camera module) and pixel consumers(imaging or displays). It consists of two distinct functions, a pixel transfer function and a control interface. Reviewed-by: Robert Foss Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Signed-off-by: Liu Ying --- Robert, I keep your R-b tag from v5. Let me know if you want me to drop it, as v7 contains a fix for checkpatch complaints. Marcel, as the fix is trivial, I add your T-b tag. Let me know if you want me to drop it. v6->v7: * Fix 'Alignment should match open parenthesis' complaints from 'checkpatch.pl --strict'. * Add Marcel's T-b tag. v5->v6: * No change. v4->v5: * Make a comment occupy a line. (Robert) * Add Robert's R-b tag. v3->v4: * No change. v2->v3: * Drop two macros which help define functions and define them directly. * Properly disable all pixel link controls to POR value by calling imx8qxp_pixel_link_disable_all_controls() from imx8qxp_pixel_link_bridge_probe(). v1->v2: * Rewrite the function to find the next bridge by properly using OF APIs and dropping unnecessary DT validation. (Rob) drivers/gpu/drm/bridge/imx/Kconfig | 8 + drivers/gpu/drm/bridge/imx/Makefile | 1 + drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 429 ++++++++++++++++++++++++ 3 files changed, 438 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index f1c91b6..4d1f027 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -6,3 +6,11 @@ config DRM_IMX8QXP_PIXEL_COMBINER help Choose this to enable pixel combiner found in Freescale i.MX8qm/qxp processors. + +config DRM_IMX8QXP_PIXEL_LINK + tristate "Freescale i.MX8QM/QXP display pixel link" + depends on OF + select DRM_KMS_HELPER + help + Choose this to enable display pixel link found in + Freescale i.MX8qm/qxp processors. diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile index 7d7c8d6..c15469f 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -1 +1,2 @@ obj-$(CONFIG_DRM_IMX8QXP_PIXEL_COMBINER) += imx8qxp-pixel-combiner.o +obj-$(CONFIG_DRM_IMX8QXP_PIXEL_LINK) += imx8qxp-pixel-link.o diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c new file mode 100644 index 00000000..52b9b96 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -0,0 +1,429 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020 NXP + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define DRIVER_NAME "imx8qxp-display-pixel-link" +#define PL_MAX_MST_ADDR 3 +#define PL_MAX_NEXT_BRIDGES 2 + +struct imx8qxp_pixel_link { + struct drm_bridge bridge; + struct drm_bridge *next_bridge; + struct device *dev; + struct imx_sc_ipc *ipc_handle; + int id; + int stream_id; + int dc_id; + u32 sink_rsc; + u32 mst_addr; + u8 mst_addr_ctrl; + u8 mst_en_ctrl; + u8 mst_vld_ctrl; + u8 sync_ctrl; +}; + +static void imx8qxp_pixel_link_enable_mst_en(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->mst_en_ctrl, true); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to enable DC%d stream%d pixel link mst_en: %d\n", + pl->dc_id, pl->stream_id, ret); +} + +static void imx8qxp_pixel_link_enable_mst_vld(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->mst_vld_ctrl, true); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to enable DC%d stream%d pixel link mst_vld: %d\n", + pl->dc_id, pl->stream_id, ret); +} + +static void imx8qxp_pixel_link_enable_sync(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->sync_ctrl, true); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to enable DC%d stream%d pixel link sync: %d\n", + pl->dc_id, pl->stream_id, ret); +} + +static int imx8qxp_pixel_link_disable_mst_en(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->mst_en_ctrl, false); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to disable DC%d stream%d pixel link mst_en: %d\n", + pl->dc_id, pl->stream_id, ret); + + return ret; +} + +static int imx8qxp_pixel_link_disable_mst_vld(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->mst_vld_ctrl, false); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to disable DC%d stream%d pixel link mst_vld: %d\n", + pl->dc_id, pl->stream_id, ret); + + return ret; +} + +static int imx8qxp_pixel_link_disable_sync(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, + pl->sync_ctrl, false); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to disable DC%d stream%d pixel link sync: %d\n", + pl->dc_id, pl->stream_id, ret); + + return ret; +} + +static void imx8qxp_pixel_link_set_mst_addr(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx_sc_misc_set_control(pl->ipc_handle, + pl->sink_rsc, pl->mst_addr_ctrl, + pl->mst_addr); + if (ret) + DRM_DEV_ERROR(pl->dev, + "failed to set DC%d stream%d pixel link mst addr(%u): %d\n", + pl->dc_id, pl->stream_id, pl->mst_addr, ret); +} + +static int imx8qxp_pixel_link_bridge_attach(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct imx8qxp_pixel_link *pl = bridge->driver_private; + + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { + DRM_DEV_ERROR(pl->dev, + "do not support creating a drm_connector\n"); + return -EINVAL; + } + + if (!bridge->encoder) { + DRM_DEV_ERROR(pl->dev, "missing encoder\n"); + return -ENODEV; + } + + return drm_bridge_attach(bridge->encoder, + pl->next_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); +} + +static void +imx8qxp_pixel_link_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct imx8qxp_pixel_link *pl = bridge->driver_private; + + imx8qxp_pixel_link_set_mst_addr(pl); +} + +static void +imx8qxp_pixel_link_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct imx8qxp_pixel_link *pl = bridge->driver_private; + + imx8qxp_pixel_link_enable_mst_en(pl); + imx8qxp_pixel_link_enable_mst_vld(pl); + imx8qxp_pixel_link_enable_sync(pl); +} + +static void +imx8qxp_pixel_link_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct imx8qxp_pixel_link *pl = bridge->driver_private; + + imx8qxp_pixel_link_disable_mst_en(pl); + imx8qxp_pixel_link_disable_mst_vld(pl); + imx8qxp_pixel_link_disable_sync(pl); +} + +static const u32 imx8qxp_pixel_link_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB888_1X36_CPADLO, + MEDIA_BUS_FMT_RGB666_1X36_CPADLO, +}; + +static bool imx8qxp_pixel_link_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx8qxp_pixel_link_bus_output_fmts); i++) { + if (imx8qxp_pixel_link_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx8qxp_pixel_link_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + u32 *input_fmts; + + if (!imx8qxp_pixel_link_bus_output_fmt_supported(output_fmt)) + return NULL; + + *num_input_fmts = 1; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + input_fmts[0] = output_fmt; + + return input_fmts; +} + +static u32 * +imx8qxp_pixel_link_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + unsigned int *num_output_fmts) +{ + *num_output_fmts = ARRAY_SIZE(imx8qxp_pixel_link_bus_output_fmts); + return kmemdup(imx8qxp_pixel_link_bus_output_fmts, + sizeof(imx8qxp_pixel_link_bus_output_fmts), GFP_KERNEL); +} + +static const struct drm_bridge_funcs imx8qxp_pixel_link_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .attach = imx8qxp_pixel_link_bridge_attach, + .mode_set = imx8qxp_pixel_link_bridge_mode_set, + .atomic_enable = imx8qxp_pixel_link_bridge_atomic_enable, + .atomic_disable = imx8qxp_pixel_link_bridge_atomic_disable, + .atomic_get_input_bus_fmts = + imx8qxp_pixel_link_bridge_atomic_get_input_bus_fmts, + .atomic_get_output_bus_fmts = + imx8qxp_pixel_link_bridge_atomic_get_output_bus_fmts, +}; + +static int imx8qxp_pixel_link_disable_all_controls(struct imx8qxp_pixel_link *pl) +{ + int ret; + + ret = imx8qxp_pixel_link_disable_mst_en(pl); + if (ret) + return ret; + + ret = imx8qxp_pixel_link_disable_mst_vld(pl); + if (ret) + return ret; + + return imx8qxp_pixel_link_disable_sync(pl); +} + +static struct drm_bridge * +imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pixel_link *pl) +{ + struct device_node *np = pl->dev->of_node; + struct device_node *port, *remote; + struct drm_bridge *next_bridge[PL_MAX_NEXT_BRIDGES]; + u32 port_id; + bool found_port = false; + int reg, ep_cnt = 0; + /* select the first next bridge by default */ + int bridge_sel = 0; + + for (port_id = 1; port_id <= PL_MAX_MST_ADDR + 1; port_id++) { + port = of_graph_get_port_by_id(np, port_id); + if (!port) + continue; + + if (of_device_is_available(port)) { + found_port = true; + of_node_put(port); + break; + } + + of_node_put(port); + } + + if (!found_port) { + DRM_DEV_ERROR(pl->dev, "no available output port\n"); + return ERR_PTR(-ENODEV); + } + + for (reg = 0; reg < PL_MAX_NEXT_BRIDGES; reg++) { + remote = of_graph_get_remote_node(np, port_id, reg); + if (!remote) + continue; + + if (!of_device_is_available(remote->parent)) { + DRM_DEV_DEBUG(pl->dev, + "port%u endpoint%u remote parent is not available\n", + port_id, reg); + of_node_put(remote); + continue; + } + + next_bridge[ep_cnt] = of_drm_find_bridge(remote); + if (!next_bridge[ep_cnt]) { + of_node_put(remote); + return ERR_PTR(-EPROBE_DEFER); + } + + /* specially select the next bridge with companion PXL2DPI */ + if (of_find_property(remote, "fsl,companion-pxl2dpi", NULL)) + bridge_sel = ep_cnt; + + ep_cnt++; + + of_node_put(remote); + } + + pl->mst_addr = port_id - 1; + + return next_bridge[bridge_sel]; +} + +static int imx8qxp_pixel_link_bridge_probe(struct platform_device *pdev) +{ + struct imx8qxp_pixel_link *pl; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + int ret; + + pl = devm_kzalloc(dev, sizeof(*pl), GFP_KERNEL); + if (!pl) + return -ENOMEM; + + ret = imx_scu_get_handle(&pl->ipc_handle); + if (ret) { + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get SCU ipc handle: %d\n", + ret); + return ret; + } + + pl->id = of_alias_get_id(np, "dc_pl"); + if (pl->id < 0) { + DRM_DEV_ERROR(dev, + "failed to get pixel link node alias id: %d\n", + pl->id); + return pl->id; + } + + pl->dev = dev; + + pl->dc_id = pl->id / 2; + pl->stream_id = pl->id % 2; + + pl->sink_rsc = pl->dc_id ? IMX_SC_R_DC_1 : IMX_SC_R_DC_0; + + if (pl->stream_id == 0) { + pl->mst_addr_ctrl = IMX_SC_C_PXL_LINK_MST1_ADDR; + pl->mst_en_ctrl = IMX_SC_C_PXL_LINK_MST1_ENB; + pl->mst_vld_ctrl = IMX_SC_C_PXL_LINK_MST1_VLD; + pl->sync_ctrl = IMX_SC_C_SYNC_CTRL0; + } else { + pl->mst_addr_ctrl = IMX_SC_C_PXL_LINK_MST2_ADDR; + pl->mst_en_ctrl = IMX_SC_C_PXL_LINK_MST2_ENB; + pl->mst_vld_ctrl = IMX_SC_C_PXL_LINK_MST2_VLD; + pl->sync_ctrl = IMX_SC_C_SYNC_CTRL1; + } + + /* disable all controls to POR default */ + ret = imx8qxp_pixel_link_disable_all_controls(pl); + if (ret) + return ret; + + pl->next_bridge = imx8qxp_pixel_link_find_next_bridge(pl); + if (IS_ERR(pl->next_bridge)) { + ret = PTR_ERR(pl->next_bridge); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to find next bridge: %d\n", + ret); + return ret; + } + + platform_set_drvdata(pdev, pl); + + pl->bridge.driver_private = pl; + pl->bridge.funcs = &imx8qxp_pixel_link_bridge_funcs; + pl->bridge.of_node = np; + + drm_bridge_add(&pl->bridge); + + return ret; +} + +static int imx8qxp_pixel_link_bridge_remove(struct platform_device *pdev) +{ + struct imx8qxp_pixel_link *pl = platform_get_drvdata(pdev); + + drm_bridge_remove(&pl->bridge); + + return 0; +} + +static const struct of_device_id imx8qxp_pixel_link_dt_ids[] = { + { .compatible = "fsl,imx8qm-dc-pixel-link", }, + { .compatible = "fsl,imx8qxp-dc-pixel-link", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qxp_pixel_link_dt_ids); + +static struct platform_driver imx8qxp_pixel_link_bridge_driver = { + .probe = imx8qxp_pixel_link_bridge_probe, + .remove = imx8qxp_pixel_link_bridge_remove, + .driver = { + .of_match_table = imx8qxp_pixel_link_dt_ids, + .name = DRIVER_NAME, + }, +}; +module_platform_driver(imx8qxp_pixel_link_bridge_driver); + +MODULE_DESCRIPTION("i.MX8QXP/QM display pixel link bridge driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME); From patchwork 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: 12174419 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 7CCB2C433C1 for ; Wed, 31 Mar 2021 06:49:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 41ADB614A7 for ; Wed, 31 Mar 2021 06:49:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41ADB614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AFFF16E9E9; Wed, 31 Mar 2021 06:49:20 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2063.outbound.protection.outlook.com [40.107.21.63]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACCB26E9E9 for ; Wed, 31 Mar 2021 06:49:19 +0000 (UTC) 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12174421 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 55CCFC433C1 for ; Wed, 31 Mar 2021 06:49:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E57B614A7 for ; Wed, 31 Mar 2021 06:49:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E57B614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 823C16E9EC; Wed, 31 Mar 2021 06:49:28 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2081.outbound.protection.outlook.com [40.107.21.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id E3E226E9EC for ; Wed, 31 Mar 2021 06:49:26 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FOFBBsx93Nr5lKrGAmM5Vd0RSs621s0hq0PAAJ01xG7kav62mJcUhao6wpQ9lBZFFG7R2UlXj2Pux/+gsPup04YsMrunyNU4n+c3wKkDGcU4+Q7WOaOFMDwxqwImwYr9kUcXRFH1WU28PoMieFDqcwr62cxSFD/alH3UJFJEWw1VW/n6r2m06EduHD48RUcCGEOwVRy8xDeZXHV+4XH1nSmA6l9X6X1aJ6IUOgyfG1upaYnUNAen/SDQOJ78Z9CmlQSrc5xrUV8szh/oDa2h4d+KLrhYoU+nYiB1YVlz/x0fkM87pTWrOCtWxO3W8lmP04jEY6MPExpqX4nSSTVl7A== 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=iLTGvSsFUIGytzOZ+vKY3syhSDxCzbKula7lrr7jotQ=; b=mrTu04HBI5LmT7XgY4Apwe47+fHvQAqTZF/WDvRjRwlN2roQeYgaVx3ZJtoqDFoOv66zZEiA3lcl0EOi1ZTrX8u9DZu3laZvEtj2DWyksm+BpKfpPh+cSX1xfS/PVrSUZ1KqOtsSZMGHdImrTO6gECG/GkbrIg4Bmes0LOmAV+7+Cv7xVKteNkn55U/sdAgFi/Ub5P4um3v4Coj4inaZnuKwiojOiXczyVEQMzFgw8BnpKEypMwrw/VA7xxgeyyNGFS9bsHh6zpscbdwoRqST3YA33NuGr1obrhlpsexB7X3jWhUsqDFzuF+UZYsUEnase7ydQGijh2sSqGGVIFj8Q== 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=iLTGvSsFUIGytzOZ+vKY3syhSDxCzbKula7lrr7jotQ=; b=jbWPJZraLroZ9ZOX+4lwCHPk5h7PfiDdZAxI+VG/YjNR2eCtOxG2yRy5ma950CVSPZt+i7zHFvQ/zC1jzh8ZVOc73VWdmE8ePvFmRnJb5oyVVstOOhmM3xaVI2DwEtdK5HN8oEsMjuAuz6Gw4CrDpI7ffFF/+L1G8n/2hhOLXPY= 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:22 +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:22 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v7 08/14] dt-bindings: display: bridge: Add i.MX8qxp pixel link to DPI binding Date: Wed, 31 Mar 2021 14:33:19 +0800 Message-Id: <1617172405-12962-9-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:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 651f3b43-1337-427b-ee25-08d8f4111d9b 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:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PATS8ObErPAmE8B6HY8WWIzBsUTADSGsotIwo0PSjHvJw0zgsW4anwgU4S1cSm6pNJl1GHlRJ6E3Pxpn48jgTl5kO30zUSC7kJOb9IqFpcmzAvHSUi7KsbDkOfJ21/FQJLlB8WpzdT6qG848EDnibKgXnk06zYdOtPvGHwJHHXdMgWyN+d3EgHqUR5xuf5mNkDbeBc1iCWilsal4/ganU2v1/mhJXnUUdZIBJ5ZC9+XWzHa4QGqkigdobdoIxKO/zA8kwxDoCAvSaid8SkAyxiRgSyaTAQ8KDW4VE7XbBVmNFa1mbWQTneOZCob1k/fFFlwXAqkO5vxOtelH2fJ3/SvUfemLKLXpxo34GH0wgfsisgNBKCCAP0R/JORmj3MQ3RgajvfMnlW1gwV7guM07NpZ3o8Tmqe/KA+W4/tWYc3NRinoSOL2MUzII1ey7h8Er76vTYhKsZ/bshS8HW1Bqma54eL3XwXCWGN+sNVDK5/Kktz8/4TC8ddpcHmYVuBa2IBZ4MI5wl0D8zdmABuClpEfx35yW3kmKY+YtyOHdRW1vQr/wZ2YJZXWVAi+5F5TIWHiVW0zfe9CjEmWzq/MlFLnMugCdsdGsVkIn6g8uriQnRqBYVa7cN7BVEUq+y8RWOvyL26FGlKnBbUh6y6JQe+2M7B/+TLAjSqtGyFl7tFXhORXp8Xn0c1XCwE3AAb9WEEI76BpX7bLJYkf8z0+fzQnuTxEs/dN1GyIMpHlEYM= 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)(186003)(66556008)(5660300002)(26005)(498600001)(66476007)(38100700001)(4326008)(2616005)(956004)(36756003)(2906002)(8936002)(6486002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?4pF3EvHYIBjCP9z+B+EzEkTU/+zPBI?= =?utf-8?q?u/iAt1acOGx2N39pMmSrUb86RaTQyTIL82HSm3S8KZLi3rWs+L4L/1GVVKGst+O+w?= =?utf-8?q?XU3nnX2wrP9D3VlRwEXGAeyFutDeZUxLJ+/DMw0MBTURQRXrkt42yDs8hxKc8WWAT?= =?utf-8?q?PfE3jWN+XtfJlx1jYvu9L8Zqe/E4TBvfOt0bkNJtL7fMqBcX7T+Wogt7SpnjInsHt?= =?utf-8?q?B6EZn3iXRDnYi35LNQ7PXZh1qrNU9oiQqL2l0upF82zjAQ6YrzE6BLvSOf2omijrl?= =?utf-8?q?OnF5WPa3PdO9I5j+CMc1AzCqKTY0OG/3DCUTnRjvhjlnUwhmoqQcxBcqal1kBQ5Te?= =?utf-8?q?P7CvbQzWlexqIgdub0S7c92kZRMX15gBr/wNAv880X+VVJDsrRk9DkffYlEFth5Ic?= =?utf-8?q?hIWtEkOLsPmYV/vFB8tNWtUksBfvbM09yMq5XNUzPYDR4LPGlgWNVfQwl0l1nN6/M?= =?utf-8?q?0wnjNWitH+oyZCBxgOY34e+4dw9W7d44hc3UgusqjxJ5pAC4TrTzTundp+kn+N18J?= =?utf-8?q?Y9FXKz9UQcyNDbVAdFZvH8EY7hwVvlsD0pWAat8LorVaCAPOvARO7l0BthaPK5MCW?= =?utf-8?q?i+aDOaZf4pOpjfNN6JFVMpYblrPs5koF7QVOq3/nmrNMR+FPGGSsbCvVHdy/uTIen?= =?utf-8?q?nzY7Zqz37fIvNLMqxg70kFRVHhy2wWoAPihSnfyRX/TdmhfM6Ac5IhKyJE7Bp45x/?= =?utf-8?q?fG8itaxaaT9MiebXXX2S9g5jn4aLVMp4pR7xDY/6V/tR0/+m5zneu6F62nsCfcp/r?= =?utf-8?q?Mn0RnDyEhmz5Y4T/hG9ZX8oe+7RB3s+DNOKadCZjoNx3hlN7CddRyov/HoO+Ba8QA?= =?utf-8?q?ilQAdtBO5q/mgwhVcWikdBLxFtNqyXwlDBmKvyfaboYse4hvdj4KzR6uSek09qQOh?= =?utf-8?q?afPpJF9SiAmH2GMsKppO6YXNFgfAuiSu3w/2T26Gd14eUbh+RXGw4bvxOiBC8m8Aj?= =?utf-8?q?ZTV8NHzDZ+pAepCkis5bh9L13S1qPdYSHHjLTqryMQKjrFHssHI5vzADi1oic/2Iu?= =?utf-8?q?PZafPqlXwZlH5ubKhrmb/+ZwYVTxMjBFcUxCjal7vi9WwSG9ZiUJ9XX+BzUsCwY7p?= =?utf-8?q?QJa8REiokpLeODga2A5EGsP3gtjk7rwDWMx4Bv5lYU+R5X2bQ5rhsUupsZ9DYqdPe?= =?utf-8?q?HObXqVS+SjrhO4DDVuZJ0LVmRah2MlGmLNK0j8bjPktrbrH47jfK0Eik7WLOjDroK?= =?utf-8?q?k80RMV/EOgqNkX6te1HJq3vIh25+8UHkUH7lucOced0d840rWywyf0amXmGus912z?= =?utf-8?q?fAkDdnjB3UAhPw?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 651f3b43-1337-427b-ee25-08d8f4111d9b 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:22.3643 (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: 78kMQYt902XTwaqUEYmZFVz1uMP9Dzy3z+X8/k6f0eS+usJXex3FcOkfL7PRio0miCqjUiHqjXJtvkN+hilADQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6349 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch adds bindings for i.MX8qxp pixel link to DPI(PXL2DPI). Reviewed-by: Rob Herring Signed-off-by: Liu Ying --- v6->v7: * No change. v5->v6: * Add Rob's R-b tag. v4->v5: * No change. v3->v4: * Add 'fsl,sc-resource' property. (Rob) v2->v3: * Drop 'fsl,syscon' property. (Rob) * Mention the CSR module controls PXL2DPI. v1->v2: * Use graph schema. (Laurent) .../display/bridge/fsl,imx8qxp-pxl2dpi.yaml | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml new file mode 100644 index 00000000..e4e77fa --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml @@ -0,0 +1,108 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/fsl,imx8qxp-pxl2dpi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX8qxp Pixel Link to Display Pixel Interface + +maintainers: + - Liu Ying + +description: | + The Freescale i.MX8qxp Pixel Link to Display Pixel Interface(PXL2DPI) + interfaces the pixel link 36-bit data output and the DSI controller’s + MIPI-DPI 24-bit data input, and inputs of LVDS Display Bridge(LDB) module + used in LVDS mode, to remap the pixel color codings between those modules. + This module is purely combinatorial. + + The i.MX8qxp PXL2DPI is controlled by Control and Status Registers(CSR) module. + The CSR module, as a system controller, contains the PXL2DPI's configuration + register. + +properties: + compatible: + const: fsl,imx8qxp-pxl2dpi + + fsl,sc-resource: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The SCU resource ID associated with this PXL2DPI instance. + + power-domains: + maxItems: 1 + + fsl,companion-pxl2dpi: + $ref: /schemas/types.yaml#/definitions/phandle + description: | + A phandle which points to companion PXL2DPI which is used by downstream + LVDS Display Bridge(LDB) in split mode. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: The PXL2DPI input port node from pixel link. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: The PXL2DPI output port node to downstream bridge. + + required: + - port@0 + - port@1 + +required: + - compatible + - fsl,sc-resource + - power-domains + - ports + +additionalProperties: false + +examples: + - | + #include + pxl2dpi { + compatible = "fsl,imx8qxp-pxl2dpi"; + fsl,sc-resource = ; + power-domains = <&pd IMX_SC_R_MIPI_0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + mipi_lvds_0_pxl2dpi_dc_pixel_link0: endpoint@0 { + reg = <0>; + remote-endpoint = <&dc_pixel_link0_mipi_lvds_0_pxl2dpi>; + }; + + mipi_lvds_0_pxl2dpi_dc_pixel_link1: endpoint@1 { + reg = <1>; + remote-endpoint = <&dc_pixel_link1_mipi_lvds_0_pxl2dpi>; + }; + }; + + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch0: endpoint@0 { + reg = <0>; + remote-endpoint = <&mipi_lvds_0_ldb_ch0_mipi_lvds_0_pxl2dpi>; + }; + + mipi_lvds_0_pxl2dpi_mipi_lvds_0_ldb_ch1: endpoint@1 { + reg = <1>; + remote-endpoint = <&mipi_lvds_0_ldb_ch1_mipi_lvds_0_pxl2dpi>; + }; + }; + }; + }; From patchwork Wed Mar 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: 12174423 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 E586AC433DB for ; Wed, 31 Mar 2021 06:49:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A33D4614A7 for ; Wed, 31 Mar 2021 06:49:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A33D4614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F6A16E9ED; Wed, 31 Mar 2021 06:49:35 +0000 (UTC) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40084.outbound.protection.outlook.com [40.107.4.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id C249F6E9ED for ; Wed, 31 Mar 2021 06:49:33 +0000 (UTC) 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 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?swRKIM2r53XMQZrX0tB5P8rhWth81q?= =?utf-8?q?VDt/dI+Xjfg5LVtpnCNNwYwwvUnYZ+Oww/xdCnbv53qC8SGFZRuIw5FqYjMorWzVW?= =?utf-8?q?15Xle7pF1t7FCkgDyKFRPVn4kR32ISU75IXx3PPBaN/8vcC9pvX+a4hBxYXWFGtlF?= =?utf-8?q?0P/cpOLZWOHz2Yla70aenxE60MlwUXD5F0jHJK73+P5wEIzku/ldvJXVbU9bGm/dv?= =?utf-8?q?uUREbR/N3x3zexE3bk7mnVqxxqni6CT69gAOBZujNyWmO7lf/HUZVY111qxoAUX5j?= =?utf-8?q?jHVNzQr4yGHijjnHB2Imt8YNz7u4Gw846oUGOXQPLr0n00JTg/XncaeUlWUSk2gzz?= =?utf-8?q?ZVK+jgqZkC/hJOxTCVwgh5hvhN9UYnsXE0Etj7gwsACaySBq2+pqHruYOzDtI94+Z?= =?utf-8?q?qiY3S6r3lZ6Lp+veaXc2SH+2xYAfXatTJWDuaoJq+tZuA13FhdczMNzy57rIsSnOZ?= =?utf-8?q?wUdJxdmh+bm00FedSDjfMOsNgpUo8Ryty1i6SKcC57iTVVvu82cMevayTprNaEgPt?= =?utf-8?q?qCqwNvJuZ5uzhVrGDo+fnR6vddbyQV/d7AdNpx9g/HbZmOc/99ZyBBnWqryD/m84/?= =?utf-8?q?V4RKJ7nuhVd9XE8fosxvWJKXLOd2YzUDF2VLIxw/E0IFTTKtWf8HMesaBhTbfUpHt?= =?utf-8?q?ZsRAip5cTYpUdfEvhA8ALMtyEdErwqycgC2EusPSTo6PuisVDeIoQIEVGUuQ205Y1?= =?utf-8?q?J9uTCsF5bvvUB4CTOhAhZAweswPyOvyj9U77lVLBU8InRDTz7RY1Qos06JpQTmZMt?= =?utf-8?q?fMrGxh1F2XgTK+VALRj/uino5nqu3ELMog2JzfuTm5Zk17hCZvik5ykdXwcBfAgVR?= =?utf-8?q?0d88JPXLjfNtk2deXqIVXq5j5131Wjx0MRWHit1jbxcv7Smh9i+MyGY4ucDWg/EQ3?= =?utf-8?q?QBWvZIFNyMFLAeoLDuYRATg8189B2dgNDjl9P45S6CJeavG5YEBIGjmyQcufLwaSL?= =?utf-8?q?4gvX8fDqj2nD626lPSR+bUwSft0BJ8qRwaTPvgvZqD7a0kJi3BXCSUSgV2u2UiypV?= =?utf-8?q?NpB+S7Mk2XGMA3An1XK8HRUFbomT5vMOxHbPOQcH+JWgF/hj2tefc5zKKwq/pgWQg?= =?utf-8?q?Tq6cy7/dDOTYpxhSg/eAdauAAqqlqiYG2HWvnZ8JOXZky1/KWP0wje9jPG4N3UOsy?= =?utf-8?q?VVMJ9QVD2XX5tg7TAo1zrTosuBOfAgEYJLZ+aMXj4ISqKXhabLNN39OGupZWiisij?= =?utf-8?q?IQFyU8xpqs6cfj3Yv1VW7snjcSvg17YAS0pIHf8HorjLRauVDEaLNn9aDbjRK/WRE?= =?utf-8?q?S7VDZWZ9lA612G?= 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12174425 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 87A08C433DB for ; Wed, 31 Mar 2021 06:49:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 507936192B for ; Wed, 31 Mar 2021 06:49:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 507936192B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C1BD16E9EF; Wed, 31 Mar 2021 06:49:42 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2043.outbound.protection.outlook.com [40.107.20.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5E786E9EF for ; Wed, 31 Mar 2021 06:49:40 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HgQ6vC34nhKqua1agQNFbaDNvgiOjifhD2FmNExTeGic15A8DRnSRAoGmU56HkETt9IH/VcLLZW1l7nkIF65pZAzbhxI1F6CpELM2RdKsPnWlHUkYdPT6EHpp2oiR1F80ukVUzkWvhnuaWGYAdONbamq3Z06s+o9qRP8yoTkEGCKl5SRQ0HC4Wp2W1qqIJ9uNKFRCYQqx15DzBUv9ZfX7qk1KfzEKScBqkkcyf/RL98typ1aYTRNd76+OCpS/on1lMSwWrq5aQSj+FqMW6uIe97Z00UHsvOuAnd64xenMjNr9B7CoBKdu+uE1LNvM4hBazkXgGsxwwadxHNsapekLw== 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=vHThHkeEz7Xr/t0E8mrjESs/8sP92r2HbPMzb6nZJ6w=; b=XlU0U2ZLAbeAJZRLAKqNiNg67qy4tSMDHUPwcHAFL3CnU4sDHS+vjtyXNVQQVJY+OtOrUHmHCzfMajcqWumjvHb9V8SbB4aX3WOuSxvST+lZ/MPWRqYIFOLnx5GTQbn4tFDPkQMIheglE9Cepb5akixz+GxN4itKzm48VxKKmxWSqwNAQUHpSwYm2a3CncV6Oy8H4Q8fXtjDVrtRefHAcFuAMZqhqwZ5IVz4I4q9XfWRxZJlc640bhEz3jd9JWM1dJNP4WST+IleXSVEnVhU+5gqfP5vgBSXYiXfWKeFjKzPPhgVAXJ9xUOhQGcpZAzfIBcJUQ0wzAo/Q/NckbPIyw== 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=vHThHkeEz7Xr/t0E8mrjESs/8sP92r2HbPMzb6nZJ6w=; b=C2ejYemYDqQxJUHDrYSXbdbqVN/KY8E53OryrKT733RrY7vXFE0FT/PRbhIg5j8gvXgtNNt8WjD45QBBrJ61x12uO9Yiq3ATBxT9YDn9L080lY2E+bUKIbItN1DZiff8z9pXF7Bb1YCe/wBu1HJsP/eP5XTJj3GtLI+/YEm7/T8= 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:36 +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:36 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v7 10/14] drm/bridge: imx: Add LDB driver helper support Date: Wed, 31 Mar 2021 14:33:21 +0800 Message-Id: <1617172405-12962-11-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:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 971081ec-f739-4a90-8c82-08d8f4112615 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:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tLyrNRlxZYOXpemNtDj1tik+rQ2DRSHMy7qqr/I9KLXlYrNbfmOcTWlSaa7HacZ8W+BA6EKTskfROFq2wcP+dLf5pMWfCVImAE1PcWmDSUYRCEjer/2InPOUCU0JkDqYBB3hgnUtexf0/FurOrq4gPfjiaimOZwxrhaEzNFYTVEKyzVXVgSmlrpbmxjo+LCvVdNjCicI6NepMxKxu4ON2o5+Nt7WUsTdz86y+zbwyrjRdHxMFk1P5CgSKlvGzSr4xxAX3U96yXs+nGNxFGV5azis9BFHcCbfwzdFT4WngoEFc/JHUZ6NTDQ3sfRuwcrgpO9jhlxselYXwZ2lEX5vGEp0FkamHPjho2MBMlekDW6x84Hv6RwBsZJu6IZ0yVvPzCBz7DzXSh9DzEffMjH6f8ZGxcnNPLZt8/QwMKjgye6DUXPK3P7+ewHLf6co2rnhj7tEPximMvz2WLFlA61qTeGyr3UdzGtqBpmLmBOYjTl6IitsZuLwlKOk7FSdEFYyNlrg8xq4Qe/Yexa45sFJD9Fiad2UBT4ztpg19AI8qJsklWK9vMUSAGLdIOrbeh0YAoiCUWqFckwr4GVnrB2+/7G7XvsOCXvTq8kZNZ2mOxpR/mcZsLori3f3sR8B+APXqyDDqdBv8JGWf0Fl9rlz4ReCvBKW+L5JCZHBnhbFisZ46OWGZUNJMeooV1Q2uB7q 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)(36756003)(498600001)(956004)(16526019)(186003)(6486002)(26005)(6506007)(6512007)(66476007)(66946007)(66556008)(38100700001)(2616005)(4326008)(30864003)(86362001)(5660300002)(7416002)(8676002)(2906002)(52116002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3Xm3GJ5MgkZqKUcU8GZ0Pfb5iWUA8pEXtCabOeXCEeGbyAzMYwfJUNs1wYlRAca1xkRxDQDNGZkSPh6SYJuRX0lunjur8vZjBPqEI60/U51SRqgTkRCHHX6yfDkdj4fJAvvzYMUUCPPqP1ALafzbZM/Tha8NTiFbZJSgcJxtOt5eBLDinI/TFdW5Hli9Fet9h2YRLK5NMW+f1hTIgbUTHAzb7dmHI6/58PbMFzESnzvF4fzy5rpc8zfSsVglpPOd/9M62YA23M0UU8rLIp9CvsRqltvZpaKeztxLOeVEIrNQ+NShYPdlFaQIhDWqYcqw+8iS2/yd0NMoMIrBBj1AwE13NeCln/uu7XPLbkS8Z3NhLaX/FQ2RlFUxx1HnEmz9eoBu55m7Hrxs9bqZjhYiIxzWvjqwp2pLwWHlipohehek2naKorx6AjmE3qDELPceGREasJQuqx1FH7kgjBgudqu5C4QvPQ3BjI3h2sNWrxh+jQsRfuZSS5weMzpdskY9zd4TX4y9a8m2SaHFg4kL3KZx2xVQy15+sm5kplovKjqf8pUQkR6GwlFGeTd/edamOQStTJ6sj017NkK3rjshcJwr+zoetRYapg2gMIXmfcn76b9agHCS/AiDKNo8vhkdOgbGeFELNHdNedj7FRKQtb6USPPWSup2ChqYaX6zbdC2mKk57HJAnqcQ5+yAIchrpSVI7mt4KEvtdRBAI96LRNuyEyqR72naMs7nlGB+/xv9lpOlTXBy2qZLTf4M4dsUAtUWigMFWvBFcAiC6xUMe17r/6YZj0jlStwAwzZbYWCY4snyPBrLYLrvZoKCvy5DwArrBkDrR8NYyNNxEz26tp2J8pjGtnZlOV6Z1pQQPHjqh2w0tpHczHsxzQD2qaiOByTQMKz6I1bOsq/SQxidjAvno2qEROs6hxYv2vktgBsLT75ti6BqO9z9bi3Rvmfel/cWZg7VKyKv03CHm8z3ItEajfkxnqIvUu0XwRz0fU/Nn9NIRV3igmndREtMeiaDV4QEciZV+I63J/WTD9MbG3GdEtVHrJ0fByGzM3ZccW1npalKUuau6ZQnltUDep6Fs7Jv+Kv4m4QzkzrRv5j4qDZd1AdRWB/Lio8Q7ZjQtI9OLBya1BVSWeqUN8pU+kR7belkFWR3Pn0+Alg8P6mcgwViGX5rIjtzlpuIPH80ix/57aWUNP1ED07AteaGSa2n8NcC3lGbWgJ+xx34QpQQLmbe62XZsxk0CvXjFQkL4UKRH0002r7RwWQgg7SOg1VR2FKR/qALQbTw4f23SBCYpmv4FLaJl2+JlySHirczviA7LcAaq5utyIMnSWD2wH5Q X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 971081ec-f739-4a90-8c82-08d8f4112615 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:36.6151 (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: j/HRRvwzJCRouwXHxZ3/k8TP7udLchSFH7mRGtoWP8J7JQZdIoiIswu9bqvEnBIptB1MmgAibo+pZ9aqF4+dsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2318 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch adds a helper to support LDB drm bridge drivers for i.MX SoCs. Helper functions supported by this helper should implement common logics for all LDB modules embedded in i.MX SoCs. Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- Marcel, I add your T-b tag from v6, let me know if you want me to drop it, as the checkpatch fix in v7 is trivial. v6->v7: * Fix below complaints from 'checkpatch.pl --strict'. (Robert) - 'Alignment should match open parenthesis' - 'Prefer using the BIT macro' * Add Marcel's T-b tag. * Add Robert's R-b tag. v5->v6: * No change. v4->v5: * Make imx-ldb-helper be a pure object to be linked with i.MX8qxp LDB bridge driver and i.MX8qm LDB bridge driver. (Robert) * Move 'imx_ldb_helper.h' to 'drivers/gpu/drm/bridge/imx/imx-ldb-helper.h'. (Robert) * s/__FSL_IMX_LDB__/__IMX_LDB_HELPER__/ for 'imx-ldb-helper.h'. v3->v4: * No change. v2->v3: * Call syscon_node_to_regmap() to get regmap instead of syscon_regmap_lookup_by_phandle(). v1->v2: * No change. drivers/gpu/drm/bridge/imx/imx-ldb-helper.c | 232 ++++++++++++++++++++++++++++ drivers/gpu/drm/bridge/imx/imx-ldb-helper.h | 98 ++++++++++++ 2 files changed, 330 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx-ldb-helper.c create mode 100644 drivers/gpu/drm/bridge/imx/imx-ldb-helper.h diff --git a/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c new file mode 100644 index 00000000..67425fc --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c @@ -0,0 +1,232 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2012 Sascha Hauer, Pengutronix + * Copyright 2019,2020 NXP + */ + +#include +#include +#include + +#include +#include +#include + +#include "imx-ldb-helper.h" + +bool ldb_channel_is_single_link(struct ldb_channel *ldb_ch) +{ + return ldb_ch->link_type == LDB_CH_SINGLE_LINK; +} + +bool ldb_channel_is_split_link(struct ldb_channel *ldb_ch) +{ + return ldb_ch->link_type == LDB_CH_DUAL_LINK_EVEN_ODD_PIXELS || + ldb_ch->link_type == LDB_CH_DUAL_LINK_ODD_EVEN_PIXELS; +} + +int ldb_bridge_atomic_check_helper(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + + ldb_ch->in_bus_format = bridge_state->input_bus_cfg.format; + ldb_ch->out_bus_format = bridge_state->output_bus_cfg.format; + + return 0; +} + +void ldb_bridge_mode_set_helper(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + bool is_split = ldb_channel_is_split_link(ldb_ch); + + if (is_split) + ldb->ldb_ctrl |= LDB_SPLIT_MODE_EN; + + switch (ldb_ch->out_bus_format) { + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: + if (ldb_ch->chno == 0 || is_split) + ldb->ldb_ctrl |= LDB_DATA_WIDTH_CH0_24; + if (ldb_ch->chno == 1 || is_split) + ldb->ldb_ctrl |= LDB_DATA_WIDTH_CH1_24; + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: + if (ldb_ch->chno == 0 || is_split) + ldb->ldb_ctrl |= LDB_DATA_WIDTH_CH0_24 | + LDB_BIT_MAP_CH0_JEIDA; + if (ldb_ch->chno == 1 || is_split) + ldb->ldb_ctrl |= LDB_DATA_WIDTH_CH1_24 | + LDB_BIT_MAP_CH1_JEIDA; + break; + } +} + +void ldb_bridge_enable_helper(struct drm_bridge *bridge) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + + /* + * Platform specific bridge drivers should set ldb_ctrl properly + * for the enablement, so just write the ctrl_reg here. + */ + regmap_write(ldb->regmap, ldb->ctrl_reg, ldb->ldb_ctrl); +} + +void ldb_bridge_disable_helper(struct drm_bridge *bridge) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + bool is_split = ldb_channel_is_split_link(ldb_ch); + + if (ldb_ch->chno == 0 || is_split) + ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK; + if (ldb_ch->chno == 1 || is_split) + ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK; + + regmap_write(ldb->regmap, ldb->ctrl_reg, ldb->ldb_ctrl); +} + +int ldb_bridge_attach_helper(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { + DRM_DEV_ERROR(ldb->dev, + "do not support creating a drm_connector\n"); + return -EINVAL; + } + + if (!bridge->encoder) { + DRM_DEV_ERROR(ldb->dev, "missing encoder\n"); + return -ENODEV; + } + + return drm_bridge_attach(bridge->encoder, + ldb_ch->next_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); +} + +int ldb_init_helper(struct ldb *ldb) +{ + struct device *dev = ldb->dev; + struct device_node *np = dev->of_node; + struct device_node *child; + int ret; + u32 i; + + ldb->regmap = syscon_node_to_regmap(np->parent); + if (IS_ERR(ldb->regmap)) { + ret = PTR_ERR(ldb->regmap); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "failed to get regmap: %d\n", ret); + return ret; + } + + for_each_available_child_of_node(np, child) { + struct ldb_channel *ldb_ch; + + ret = of_property_read_u32(child, "reg", &i); + if (ret || i > MAX_LDB_CHAN_NUM - 1) { + ret = -EINVAL; + DRM_DEV_ERROR(dev, + "invalid channel node address: %u\n", i); + of_node_put(child); + return ret; + } + + ldb_ch = ldb->channel[i]; + ldb_ch->ldb = ldb; + ldb_ch->chno = i; + ldb_ch->is_available = true; + ldb_ch->np = child; + + ldb->available_ch_cnt++; + } + + return 0; +} + +int ldb_find_next_bridge_helper(struct ldb *ldb) +{ + struct device *dev = ldb->dev; + struct ldb_channel *ldb_ch; + int ret, i; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + ldb_ch = ldb->channel[i]; + + if (!ldb_ch->is_available) + continue; + + ret = drm_of_find_panel_or_bridge(ldb_ch->np, 1, 0, + &ldb_ch->panel, + &ldb_ch->next_bridge); + if (ret) { + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to find panel or bridge: %d\n", + ret); + return ret; + } + + if (ldb_ch->panel) { + ldb_ch->next_bridge = + devm_drm_panel_bridge_add(dev, ldb_ch->panel); + if (IS_ERR(ldb_ch->next_bridge)) { + ret = PTR_ERR(ldb_ch->next_bridge); + DRM_DEV_ERROR(dev, + "failed to add panel bridge: %d\n", + ret); + return ret; + } + } + } + + return 0; +} + +void ldb_add_bridge_helper(struct ldb *ldb, + const struct drm_bridge_funcs *bridge_funcs) +{ + struct ldb_channel *ldb_ch; + int i; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + ldb_ch = ldb->channel[i]; + + if (!ldb_ch->is_available) + continue; + + ldb_ch->bridge.driver_private = ldb_ch; + ldb_ch->bridge.funcs = bridge_funcs; + ldb_ch->bridge.of_node = ldb_ch->np; + + drm_bridge_add(&ldb_ch->bridge); + } +} + +void ldb_remove_bridge_helper(struct ldb *ldb) +{ + struct ldb_channel *ldb_ch; + int i; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + ldb_ch = ldb->channel[i]; + + if (!ldb_ch->is_available) + continue; + + drm_bridge_remove(&ldb_ch->bridge); + } +} diff --git a/drivers/gpu/drm/bridge/imx/imx-ldb-helper.h b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.h new file mode 100644 index 00000000..54dfe28 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.h @@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +/* + * Copyright 2019,2020 NXP + */ + +#ifndef __IMX_LDB_HELPER__ +#define __IMX_LDB_HELPER__ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#define LDB_CH0_MODE_EN_TO_DI0 BIT(0) +#define LDB_CH0_MODE_EN_TO_DI1 (3 << 0) +#define LDB_CH0_MODE_EN_MASK (3 << 0) +#define LDB_CH1_MODE_EN_TO_DI0 BIT(2) +#define LDB_CH1_MODE_EN_TO_DI1 (3 << 2) +#define LDB_CH1_MODE_EN_MASK (3 << 2) +#define LDB_SPLIT_MODE_EN BIT(4) +#define LDB_DATA_WIDTH_CH0_24 BIT(5) +#define LDB_BIT_MAP_CH0_JEIDA BIT(6) +#define LDB_DATA_WIDTH_CH1_24 BIT(7) +#define LDB_BIT_MAP_CH1_JEIDA BIT(8) +#define LDB_DI0_VS_POL_ACT_LOW BIT(9) +#define LDB_DI1_VS_POL_ACT_LOW BIT(10) + +#define MAX_LDB_CHAN_NUM 2 + +enum ldb_channel_link_type { + LDB_CH_SINGLE_LINK, + LDB_CH_DUAL_LINK_EVEN_ODD_PIXELS, + LDB_CH_DUAL_LINK_ODD_EVEN_PIXELS, +}; + +struct ldb; + +struct ldb_channel { + struct ldb *ldb; + struct drm_bridge bridge; + struct drm_panel *panel; + struct drm_bridge *next_bridge; + struct device_node *np; + u32 chno; + bool is_available; + u32 in_bus_format; + u32 out_bus_format; + enum ldb_channel_link_type link_type; +}; + +struct ldb { + struct regmap *regmap; + struct device *dev; + struct ldb_channel *channel[MAX_LDB_CHAN_NUM]; + unsigned int ctrl_reg; + u32 ldb_ctrl; + unsigned int available_ch_cnt; +}; + +#define bridge_to_ldb_ch(b) container_of(b, struct ldb_channel, bridge) + +bool ldb_channel_is_single_link(struct ldb_channel *ldb_ch); +bool ldb_channel_is_split_link(struct ldb_channel *ldb_ch); + +int ldb_bridge_atomic_check_helper(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state); + +void ldb_bridge_mode_set_helper(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode); + +void ldb_bridge_enable_helper(struct drm_bridge *bridge); + +void ldb_bridge_disable_helper(struct drm_bridge *bridge); + +int ldb_bridge_attach_helper(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags); + +int ldb_init_helper(struct ldb *ldb); + +int ldb_find_next_bridge_helper(struct ldb *ldb); + +void ldb_add_bridge_helper(struct ldb *ldb, + const struct drm_bridge_funcs *bridge_funcs); + +void ldb_remove_bridge_helper(struct ldb *ldb); + +#endif /* __IMX_LDB_HELPER__ */ From patchwork Wed Mar 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: 12174427 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 645B1C433C1 for ; Wed, 31 Mar 2021 06:49:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F1FD614A7 for ; Wed, 31 Mar 2021 06:49:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F1FD614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 700CE6E9F0; Wed, 31 Mar 2021 06:49:47 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2052.outbound.protection.outlook.com [40.107.20.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 42B7D6E9F0 for ; Wed, 31 Mar 2021 06:49:46 +0000 (UTC) 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 12174429 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 A58ACC433DB for ; Wed, 31 Mar 2021 06:49:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5A1D6619CF for ; Wed, 31 Mar 2021 06:49:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A1D6619CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A126C6E9F2; Wed, 31 Mar 2021 06:49:55 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2047.outbound.protection.outlook.com [40.107.20.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4CFC96E9F2 for ; Wed, 31 Mar 2021 06:49:54 +0000 (UTC) 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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); From patchwork Wed Mar 31 06:33:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12174431 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 E294BC433DB for ; Wed, 31 Mar 2021 06:50:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A465F619BC for ; Wed, 31 Mar 2021 06:50:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A465F619BC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 06BDE6E9F4; Wed, 31 Mar 2021 06:50:03 +0000 (UTC) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00057.outbound.protection.outlook.com [40.107.0.57]) by gabe.freedesktop.org (Postfix) with ESMTPS id 466C96E9F4 for ; Wed, 31 Mar 2021 06:50:01 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nntn6k/xM+BL0U/+ry+lahluv0xBKwlytIOFM1qpIuInNiVBjddIbwqvvcLicREsuonC8NsZKtE1WY6Rn/8A9l+B4W9nON4CUYNj8asid0q/LZ9I5jrwzOov3jIMRHP0ICqNnDcftAwxFCy/I3X3edIDIizhQrC2OENXbLOocksUYpBjVXe4TazADJhp074J0U5AteIKgplc4XjxygpaZZkOse8VbZ7xgK8TBssVcuiXJ59aFHQceQRyCPLkF48nBB42Fk37WQQmPFprm7jGqgkTaiCt40sxs4dh8EDPtsrlzt8cr0DJrUQvs1z+TsW6NHi72av5LSoEy6/OZX5Nsw== 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=y2kBxGBSiP18XfKZFCpq9j2mI0yTDCtjE6QOUE39fU0=; b=Q7fAywOwPKgfZaW8HV/+xssXSkw596Kbj8NXkMN6Lh7vkqF9odjdnzLMxA6yjWJbIRCjCpxOyOLC81lyoIGm4eBqocLJE99aN7CsKJvU0EqLZgZIzLO/QlmB9ADrmam3hX0Y0dN4kk2W2qeVChbMzyua8t4ecOung/4pPWmXoXAsbWVQxEZrVqdBT2+1WrygDh5g2EF2544iDmVdMpuCUQirfIIAtniAf8T8hY6T5PxVCl8PSunCQzFLgRd0vZSLkRgnHrrPNo5BlAOoGCFxMwn14Lda1pe9XR9Qg0uDgNKkjxe9FMFrIybwvLCFdcQVHgT/STocVObX+xHr4tao1Q== 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=y2kBxGBSiP18XfKZFCpq9j2mI0yTDCtjE6QOUE39fU0=; b=j3qbJ1Qtq+SNJnT8Me3OqVDQENI8DyGcwxUBW6okGrPC3VIrr5KQPKx/E0rU3ComeIxLireYP4lBngrA/n0PgDv1IL2+Skpx4/UPPojgjcaKIFJG1NvRFpM2IRgef5wLtq4lSRchn1H2O5S08uuZtRUhR28ESlue9XR8KmfeBSg= 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:58 +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:58 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v7 13/14] drm/bridge: imx: Add LDB support for i.MX8qm Date: Wed, 31 Mar 2021 14:33:24 +0800 Message-Id: <1617172405-12962-14-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:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b1ee12cf-1956-422d-9c54-08d8f41132d2 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:3826; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: erUEvG0sBUmoG//H3HgUt3rCC0lYiGsYzgsQIhBjtHLk+ExpPd/5z01ZmrOf4B+nYdlKanqva2Bz9nQKz+pv9UQ4+qikvjhaCMYhD3RwnfKbO40sEOZFQri2Ew+3cZV6+KVirnYbsAkjtyJ6CZs9gEO8OxYBkjvBOhL6EEYMFzor6vq1Rr8zlaZtkWd4bdosIzk9qM+wYX1W/vUeZXeMPxhlHP0/krTqV9ijYvnQ/HU1FKsp29Y2lzp1YJ1C75oZQ9EUvOFYi2s+azqCoOy0ORQHRykRxq92uUHLk67YEm4VovY7MHEtPSog/iDtrCNqKJTmlkVpB80ltdCX7O1MLgFHFtBNyH3L0Oba4nCkttVc689msz6IQa6tuXQrrX+fJACsqXjcMbR6s9GB7z96cO5WwG42PVBXDayLUoPkeuXUCcqs+OxYr2OO6EsdGw2jPnsr/aMksS84D60cnZ0k1HJt5JGUAhTDUXkkgNC7n2woCu4P12si+dY4Vhm4yhj7sjN9tubLV7XTQQG3cXPBsSkVTGy1yDkclUz2X9Mr826SKLldaAfP6AUZdgvW5ykgHWFBNbPpn2FjTnx7pbGOtfteoijSbPZ2Q7jgtWg9x4C8L7WLImGgJky4StdNd/rHW2njlX7lAZLmcjGXuae1PkoaH4FD20pJMetNe8dimmswUxCn+wPWZ/zBynspABfvebvI6KZcUYP2aogw404muOuUvpBRxf/zFFIFxM3dGlC20gOygABSkwyiV5F5bwej+Ro7cSHYHechTqnChpa9zQ== 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: /iUSetn3KfTbVX2UZzWr3fqsh+rkT8v2aojiGL2AAY1rZcWhd8zmRcwa9RnKJDVk4+JVxiAuT/18yegcggCILE27tTVRctbxOg4d22w96Exz6XZXXWqRNTSm+EMkSJprhVTEhyMh5F36gq1L8gqD0HVz7AHSvCgRxdByeSuRK+jWzLo3qTBGbjCtrbBTHPfkhF+rbTIaoZi3A0kYd5B0+e16ifUI8vMIRq0SrDMlDbkNZTBEVvGUv9oFP1WlhBLMu/y1lOwebniqClnsFN3woNTqrL+t0QRUviyPeNPrgxnPMtYzCm73hTUKyLXcfcVRLIBaYafiSYAnLv8T0q0OelPZHXf8yZGPzTepURzDvo1CitJ4pmNbpuWbFGRRu2T9v18CtwLbks5OKzZtESQcoeUOiB5F3RTzbHfRn1Bm23NRKP+3WPr4bk8XKRBx74jmzLqdD18654v2HgzBiKx5X87YS+SFCqd2X+yE4Z8B0AETuwg47lotSRR/qhvAczFWGB9ff9vVsyNBFZF59NlcQ6Eunk6R3MI54T/ZeK8OcRqpOLGk4NHaT/gqjmu4eXfX95hNSbdprLiqazaxWGVqgYtTuCruYLVeB9fGZtZ38aBXYY4hEYMMbUFOFMrmAtRlmIbytUwkOel4SZK5mD8dtnEnwRy41eXmM+hObLcELG1WKGuth/KaZhmJu7TUuI4lv5+GPLlnXTx6ZJaIySmko6Q2TM5VkyiL3vW9IydsBQwD9lZi2A49O64jSeYfOkwvJUY0U/fHm5Ody7m/IJxgfud/q4cQiQDHBKB89ngqIt/a40t2hi+SwaSw19UxFFZRBaBoYby1/yJ1pkuoANS27xJfy2YUUtsc84rIUCgvLTAS7cxOgc+cnTUOcQpFUEGn2T1Z2nO3AZRRYMJzmbM0XbnapxusVcTQpvoE8ob48BLLHXKqkfn8l3mLh3zrcAenWe2Zdb/hf/pNE1EFNQtJG9VtO1GiDI6HGCYF3h+sNQMsTHhHwd4OIRjN1OTWG1/g++6Rdf5zpbR5X6uVW81l48OEKIH1pOOSvAQ2JrjCt+b+jNYvwfumWEGfl9Fj2bQVXt3o2OY+eZ2q/YtigT8d0eLg2CH2wOCAzJPqw1Tnz825Au0QWyZ0QnfFPV4swgBvY4ngwFDvBczvd8Tv+F0Dw/rraYGWXmVtkJ0NW5mybxbUaSwkKxsMaoC3v0t+ITEINGxiQ8GWnLHr7cngDPpTZoQIE9Xx9FAp9aKJcPnsCXNnToxC11/SOM5tH0cmH9EqwbQJ+h7obaaCppvWkuJiSqzffubkhLSmJbc6QX5/msFWOc0ibZ6VIakoqw8KV0Pj X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1ee12cf-1956-422d-9c54-08d8f41132d2 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:58.2197 (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: eva3zm4sJy2VvduSRcjw4zjObw3nEyAtjWzCp/tX8QlG2l2IspuGyX3XgpZ/bYuG8Wi3qJSooXqlZOd74kW7Qw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2815 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch adds a drm bridge driver for i.MX8qm LVDS display bridge(LDB) which is officially named as pixel mapper. The LDB has two channels. Each of them supports up to 30bpp parallel input color format and can map the input to VESA or JEIDA standards. The two channels can be used simultaneously, either in dual mode or split mode. In dual mode, the two channels output identical data. In split mode, channel0 outputs odd pixels and channel1 outputs even pixels. This patch supports the LDB single mode and split mode. Tested-by: Marcel Ziswiler # Colibri iMX8X, LT170410-2WHC, LP156WF1 Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- 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' * Add Marcel's T-b tag. * Add Robert's R-b tag. v5->v6: * No change. v4->v5: * Link with the imx-ldb-helper object. (Robert) * Correspondingly, rename 'imx8qm-ldb.c' to 'imx8qm-ldb-drv.c'. v3->v4: * No change. v2->v3: * No change. v1->v2: * Drop unnecessary check for maximum available LDB channels. * Mention i.MX8qm LDB official name 'pixel mapper' in the bridge driver and Kconfig help message. drivers/gpu/drm/bridge/imx/Kconfig | 9 + drivers/gpu/drm/bridge/imx/Makefile | 3 + drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c | 587 ++++++++++++++++++++++++++++ 3 files changed, 599 insertions(+) create mode 100644 drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig index 94f8db4d..3a8683f 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -1,3 +1,12 @@ +config DRM_IMX8QM_LDB + tristate "Freescale i.MX8QM LVDS display bridge" + depends on OF + depends on COMMON_CLK + select DRM_KMS_HELPER + help + Choose this to enable the internal LVDS Display Bridge(LDB) found in + Freescale i.MX8qm processor. Official name of LDB is pixel mapper. + config DRM_IMX8QXP_LDB tristate "Freescale i.MX8QXP LVDS display bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile index 96d5d1e..aa90ec8 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -1,3 +1,6 @@ +imx8qm-ldb-objs := imx-ldb-helper.o imx8qm-ldb-drv.o +obj-$(CONFIG_DRM_IMX8QM_LDB) += imx8qm-ldb.o + imx8qxp-ldb-objs := imx-ldb-helper.o imx8qxp-ldb-drv.o obj-$(CONFIG_DRM_IMX8QXP_LDB) += imx8qxp-ldb.o diff --git a/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c b/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c new file mode 100644 index 00000000..29f8f36 --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb-drv.c @@ -0,0 +1,587 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2020 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "imx-ldb-helper.h" + +#define LDB_CH0_10BIT_EN BIT(22) +#define LDB_CH1_10BIT_EN BIT(23) +#define LDB_CH0_DATA_WIDTH_24BIT BIT(24) +#define LDB_CH1_DATA_WIDTH_24BIT BIT(26) +#define LDB_CH0_DATA_WIDTH_30BIT (2 << 24) +#define LDB_CH1_DATA_WIDTH_30BIT (2 << 26) + +#define SS_CTRL 0x20 +#define CH_HSYNC_M(id) BIT(0 + ((id) * 2)) +#define CH_VSYNC_M(id) BIT(1 + ((id) * 2)) +#define CH_PHSYNC(id) BIT(0 + ((id) * 2)) +#define CH_PVSYNC(id) BIT(1 + ((id) * 2)) + +#define DRIVER_NAME "imx8qm-ldb" + +struct imx8qm_ldb_channel { + struct ldb_channel base; + struct phy *phy; +}; + +struct imx8qm_ldb { + struct ldb base; + struct device *dev; + struct imx8qm_ldb_channel channel[MAX_LDB_CHAN_NUM]; + struct clk *clk_pixel; + struct clk *clk_bypass; + int active_chno; +}; + +static inline struct imx8qm_ldb_channel * +base_to_imx8qm_ldb_channel(struct ldb_channel *base) +{ + return container_of(base, struct imx8qm_ldb_channel, base); +} + +static inline struct imx8qm_ldb *base_to_imx8qm_ldb(struct ldb *base) +{ + return container_of(base, struct imx8qm_ldb, base); +} + +static void imx8qm_ldb_set_phy_cfg(struct imx8qm_ldb *imx8qm_ldb, + unsigned long di_clk, + bool is_split, bool is_slave, + struct phy_configure_opts_lvds *phy_cfg) +{ + phy_cfg->bits_per_lane_and_dclk_cycle = 7; + phy_cfg->lanes = 4; + phy_cfg->differential_clk_rate = is_split ? di_clk / 2 : di_clk; + phy_cfg->is_slave = is_slave; +} + +static int imx8qm_ldb_bridge_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qm_ldb_channel *imx8qm_ldb_ch = + base_to_imx8qm_ldb_channel(ldb_ch); + struct imx8qm_ldb *imx8qm_ldb = base_to_imx8qm_ldb(ldb); + struct drm_display_mode *adj = &crtc_state->adjusted_mode; + unsigned long di_clk = adj->clock * 1000; + bool is_split = ldb_channel_is_split_link(ldb_ch); + union phy_configure_opts opts = { }; + struct phy_configure_opts_lvds *phy_cfg = &opts.lvds; + int ret; + + ret = ldb_bridge_atomic_check_helper(bridge, bridge_state, + crtc_state, conn_state); + if (ret) + return ret; + + imx8qm_ldb_set_phy_cfg(imx8qm_ldb, di_clk, is_split, false, phy_cfg); + ret = phy_validate(imx8qm_ldb_ch->phy, PHY_MODE_LVDS, 0, &opts); + if (ret < 0) { + DRM_DEV_DEBUG_DRIVER(imx8qm_ldb->dev, + "failed to validate PHY: %d\n", ret); + return ret; + } + + if (is_split) { + imx8qm_ldb_ch = + &imx8qm_ldb->channel[imx8qm_ldb->active_chno ^ 1]; + imx8qm_ldb_set_phy_cfg(imx8qm_ldb, di_clk, is_split, true, + phy_cfg); + ret = phy_validate(imx8qm_ldb_ch->phy, PHY_MODE_LVDS, 0, &opts); + if (ret < 0) { + DRM_DEV_DEBUG_DRIVER(imx8qm_ldb->dev, + "failed to validate slave PHY: %d\n", + ret); + return ret; + } + } + + return ret; +} + +static void +imx8qm_ldb_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qm_ldb_channel *imx8qm_ldb_ch = + base_to_imx8qm_ldb_channel(ldb_ch); + struct imx8qm_ldb *imx8qm_ldb = base_to_imx8qm_ldb(ldb); + struct device *dev = imx8qm_ldb->dev; + unsigned long di_clk = adjusted_mode->clock * 1000; + bool is_split = ldb_channel_is_split_link(ldb_ch); + union phy_configure_opts opts = { }; + struct phy_configure_opts_lvds *phy_cfg = &opts.lvds; + u32 chno = ldb_ch->chno; + int ret; + + ret = pm_runtime_get_sync(dev); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to get runtime PM sync: %d\n", ret); + + ret = phy_init(imx8qm_ldb_ch->phy); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to initialize PHY: %d\n", ret); + + clk_set_rate(imx8qm_ldb->clk_bypass, di_clk); + clk_set_rate(imx8qm_ldb->clk_pixel, di_clk); + + imx8qm_ldb_set_phy_cfg(imx8qm_ldb, di_clk, is_split, false, phy_cfg); + ret = phy_configure(imx8qm_ldb_ch->phy, &opts); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to configure PHY: %d\n", ret); + + if (is_split) { + imx8qm_ldb_ch = + &imx8qm_ldb->channel[imx8qm_ldb->active_chno ^ 1]; + imx8qm_ldb_set_phy_cfg(imx8qm_ldb, di_clk, is_split, true, + phy_cfg); + ret = phy_configure(imx8qm_ldb_ch->phy, &opts); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to configure slave PHY: %d\n", + ret); + } + + /* input VSYNC signal from pixel link is active low */ + if (ldb_ch->chno == 0 || is_split) + ldb->ldb_ctrl |= LDB_DI0_VS_POL_ACT_LOW; + if (ldb_ch->chno == 1 || is_split) + ldb->ldb_ctrl |= LDB_DI1_VS_POL_ACT_LOW; + + switch (ldb_ch->out_bus_format) { + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: + if (ldb_ch->chno == 0 || is_split) + ldb->ldb_ctrl |= LDB_CH0_DATA_WIDTH_24BIT; + if (ldb_ch->chno == 1 || is_split) + ldb->ldb_ctrl |= LDB_CH1_DATA_WIDTH_24BIT; + break; + } + + ldb_bridge_mode_set_helper(bridge, mode, adjusted_mode); + + if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, CH_VSYNC_M(chno), 0); + else if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, + CH_VSYNC_M(chno), CH_PVSYNC(chno)); + + if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, CH_HSYNC_M(chno), 0); + else if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) + regmap_update_bits(ldb->regmap, SS_CTRL, + CH_HSYNC_M(chno), CH_PHSYNC(chno)); +} + +static void +imx8qm_ldb_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qm_ldb_channel *imx8qm_ldb_ch = + base_to_imx8qm_ldb_channel(ldb_ch); + struct imx8qm_ldb *imx8qm_ldb = base_to_imx8qm_ldb(ldb); + struct device *dev = imx8qm_ldb->dev; + bool is_split = ldb_channel_is_split_link(ldb_ch); + int ret; + + clk_prepare_enable(imx8qm_ldb->clk_pixel); + clk_prepare_enable(imx8qm_ldb->clk_bypass); + + /* both DI0 and DI1 connect with pixel link, so ok to use DI0 only */ + if (ldb_ch->chno == 0 || is_split) { + ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK; + ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI0; + } + if (ldb_ch->chno == 1 || is_split) { + ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK; + ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI0; + } + + if (is_split) { + ret = phy_power_on(imx8qm_ldb->channel[0].phy); + if (ret) + DRM_DEV_ERROR(dev, + "failed to power on channel0 PHY: %d\n", + ret); + + ret = phy_power_on(imx8qm_ldb->channel[1].phy); + if (ret) + DRM_DEV_ERROR(dev, + "failed to power on channel1 PHY: %d\n", + ret); + } else { + ret = phy_power_on(imx8qm_ldb_ch->phy); + if (ret) + DRM_DEV_ERROR(dev, "failed to power on PHY: %d\n", ret); + } + + ldb_bridge_enable_helper(bridge); +} + +static void +imx8qm_ldb_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + struct ldb *ldb = ldb_ch->ldb; + struct imx8qm_ldb_channel *imx8qm_ldb_ch = + base_to_imx8qm_ldb_channel(ldb_ch); + struct imx8qm_ldb *imx8qm_ldb = base_to_imx8qm_ldb(ldb); + struct device *dev = imx8qm_ldb->dev; + bool is_split = ldb_channel_is_split_link(ldb_ch); + int ret; + + ldb_bridge_disable_helper(bridge); + + if (is_split) { + ret = phy_power_off(imx8qm_ldb->channel[0].phy); + if (ret) + DRM_DEV_ERROR(dev, + "failed to power off channel0 PHY: %d\n", + ret); + ret = phy_power_off(imx8qm_ldb->channel[1].phy); + if (ret) + DRM_DEV_ERROR(dev, + "failed to power off channel1 PHY: %d\n", + ret); + } else { + ret = phy_power_off(imx8qm_ldb_ch->phy); + if (ret) + DRM_DEV_ERROR(dev, "failed to power off PHY: %d\n", ret); + } + + clk_disable_unprepare(imx8qm_ldb->clk_bypass); + clk_disable_unprepare(imx8qm_ldb->clk_pixel); + + ret = pm_runtime_put(dev); + if (ret < 0) + DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret); +} + +static const u32 imx8qm_ldb_bus_output_fmts[] = { + MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, + MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, + MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA, + MEDIA_BUS_FMT_FIXED, +}; + +static bool imx8qm_ldb_bus_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(imx8qm_ldb_bus_output_fmts); i++) { + if (imx8qm_ldb_bus_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +imx8qm_ldb_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + struct drm_display_info *di; + const struct drm_format_info *finfo; + u32 *input_fmts; + + if (!imx8qm_ldb_bus_output_fmt_supported(output_fmt)) + return NULL; + + *num_input_fmts = 1; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_FIXED: + di = &conn_state->connector->display_info; + + /* + * Look at the first bus format to determine input format. + * Default to MEDIA_BUS_FMT_RGB888_1X36_CPADLO, if no match. + */ + if (di->num_bus_formats) { + finfo = drm_format_info(di->bus_formats[0]); + + input_fmts[0] = finfo->depth == 18 ? + MEDIA_BUS_FMT_RGB666_1X36_CPADLO : + MEDIA_BUS_FMT_RGB888_1X36_CPADLO; + } else { + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X36_CPADLO; + } + break; + case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG: + input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X36_CPADLO; + break; + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X36_CPADLO; + break; + default: + kfree(input_fmts); + input_fmts = NULL; + break; + } + + return input_fmts; +} + +static u32 * +imx8qm_ldb_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + unsigned int *num_output_fmts) +{ + *num_output_fmts = ARRAY_SIZE(imx8qm_ldb_bus_output_fmts); + return kmemdup(imx8qm_ldb_bus_output_fmts, + sizeof(imx8qm_ldb_bus_output_fmts), GFP_KERNEL); +} + +static enum drm_mode_status +imx8qm_ldb_bridge_mode_valid(struct drm_bridge *bridge, + const struct drm_display_info *info, + const struct drm_display_mode *mode) +{ + struct ldb_channel *ldb_ch = bridge->driver_private; + bool is_single = ldb_channel_is_single_link(ldb_ch); + + if (mode->clock > 300000) + return MODE_CLOCK_HIGH; + + if (mode->clock > 150000 && is_single) + return MODE_CLOCK_HIGH; + + return MODE_OK; +} + +static const struct drm_bridge_funcs imx8qm_ldb_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .mode_valid = imx8qm_ldb_bridge_mode_valid, + .attach = ldb_bridge_attach_helper, + .atomic_check = imx8qm_ldb_bridge_atomic_check, + .mode_set = imx8qm_ldb_bridge_mode_set, + .atomic_enable = imx8qm_ldb_bridge_atomic_enable, + .atomic_disable = imx8qm_ldb_bridge_atomic_disable, + .atomic_get_input_bus_fmts = + imx8qm_ldb_bridge_atomic_get_input_bus_fmts, + .atomic_get_output_bus_fmts = + imx8qm_ldb_bridge_atomic_get_output_bus_fmts, +}; + +static int imx8qm_ldb_get_phy(struct imx8qm_ldb *imx8qm_ldb) +{ + struct imx8qm_ldb_channel *imx8qm_ldb_ch; + struct ldb_channel *ldb_ch; + struct device *dev = imx8qm_ldb->dev; + int i, ret; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + imx8qm_ldb_ch = &imx8qm_ldb->channel[i]; + ldb_ch = &imx8qm_ldb_ch->base; + + if (!ldb_ch->is_available) + continue; + + imx8qm_ldb_ch->phy = devm_of_phy_get(dev, ldb_ch->np, + "lvds_phy"); + if (IS_ERR(imx8qm_ldb_ch->phy)) { + ret = PTR_ERR(imx8qm_ldb_ch->phy); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get channel%d PHY: %d\n", + i, ret); + return ret; + } + } + + return 0; +} + +static int imx8qm_ldb_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct imx8qm_ldb *imx8qm_ldb; + struct imx8qm_ldb_channel *imx8qm_ldb_ch; + struct ldb *ldb; + struct ldb_channel *ldb_ch; + struct device_node *port1, *port2; + int pixel_order; + int ret, i; + + imx8qm_ldb = devm_kzalloc(dev, sizeof(*imx8qm_ldb), GFP_KERNEL); + if (!imx8qm_ldb) + return -ENOMEM; + + imx8qm_ldb->clk_pixel = devm_clk_get(dev, "pixel"); + if (IS_ERR(imx8qm_ldb->clk_pixel)) { + ret = PTR_ERR(imx8qm_ldb->clk_pixel); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get pixel clock: %d\n", ret); + return ret; + } + + imx8qm_ldb->clk_bypass = devm_clk_get(dev, "bypass"); + if (IS_ERR(imx8qm_ldb->clk_bypass)) { + ret = PTR_ERR(imx8qm_ldb->clk_bypass); + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, + "failed to get bypass clock: %d\n", ret); + return ret; + } + + imx8qm_ldb->dev = dev; + + ldb = &imx8qm_ldb->base; + ldb->dev = dev; + ldb->ctrl_reg = 0xe0; + + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) + ldb->channel[i] = &imx8qm_ldb->channel[i].base; + + ret = ldb_init_helper(ldb); + if (ret) + return ret; + + if (ldb->available_ch_cnt == 0) { + DRM_DEV_DEBUG_DRIVER(dev, "no available channel\n"); + return 0; + } + + if (ldb->available_ch_cnt == 2) { + port1 = of_graph_get_port_by_id(ldb->channel[0]->np, 1); + port2 = of_graph_get_port_by_id(ldb->channel[1]->np, 1); + pixel_order = + drm_of_lvds_get_dual_link_pixel_order(port1, port2); + of_node_put(port1); + of_node_put(port2); + + if (pixel_order != DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS) { + DRM_DEV_ERROR(dev, "invalid dual link pixel order: %d\n", + pixel_order); + return -EINVAL; + } + + imx8qm_ldb->active_chno = 0; + imx8qm_ldb_ch = &imx8qm_ldb->channel[0]; + ldb_ch = &imx8qm_ldb_ch->base; + ldb_ch->link_type = pixel_order; + } else { + for (i = 0; i < MAX_LDB_CHAN_NUM; i++) { + imx8qm_ldb_ch = &imx8qm_ldb->channel[i]; + ldb_ch = &imx8qm_ldb_ch->base; + + if (ldb_ch->is_available) { + imx8qm_ldb->active_chno = ldb_ch->chno; + break; + } + } + } + + ret = imx8qm_ldb_get_phy(imx8qm_ldb); + if (ret) + return ret; + + ret = ldb_find_next_bridge_helper(ldb); + if (ret) + return ret; + + platform_set_drvdata(pdev, imx8qm_ldb); + pm_runtime_enable(dev); + + ldb_add_bridge_helper(ldb, &imx8qm_ldb_bridge_funcs); + + return ret; +} + +static int imx8qm_ldb_remove(struct platform_device *pdev) +{ + struct imx8qm_ldb *imx8qm_ldb = platform_get_drvdata(pdev); + struct ldb *ldb = &imx8qm_ldb->base; + + ldb_remove_bridge_helper(ldb); + + pm_runtime_disable(&pdev->dev); + + return 0; +} + +static int __maybe_unused imx8qm_ldb_runtime_suspend(struct device *dev) +{ + return 0; +} + +static int __maybe_unused imx8qm_ldb_runtime_resume(struct device *dev) +{ + struct imx8qm_ldb *imx8qm_ldb = dev_get_drvdata(dev); + struct ldb *ldb = &imx8qm_ldb->base; + + /* disable LDB by resetting the control register to POR default */ + regmap_write(ldb->regmap, ldb->ctrl_reg, 0); + + return 0; +} + +static const struct dev_pm_ops imx8qm_ldb_pm_ops = { + SET_RUNTIME_PM_OPS(imx8qm_ldb_runtime_suspend, + imx8qm_ldb_runtime_resume, NULL) +}; + +static const struct of_device_id imx8qm_ldb_dt_ids[] = { + { .compatible = "fsl,imx8qm-ldb" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qm_ldb_dt_ids); + +static struct platform_driver imx8qm_ldb_driver = { + .probe = imx8qm_ldb_probe, + .remove = imx8qm_ldb_remove, + .driver = { + .pm = &imx8qm_ldb_pm_ops, + .name = DRIVER_NAME, + .of_match_table = imx8qm_ldb_dt_ids, + }, +}; +module_platform_driver(imx8qm_ldb_driver); + +MODULE_DESCRIPTION("i.MX8QM LVDS Display Bridge(LDB)/Pixel Mapper bridge driver"); +MODULE_AUTHOR("Liu Ying "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRIVER_NAME); From patchwork Wed Mar 31 06:33:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12174433 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,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 8A7CDC433E0 for ; Wed, 31 Mar 2021 06:50:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A66E614A7 for ; Wed, 31 Mar 2021 06:50:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A66E614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B9196E9F5; Wed, 31 Mar 2021 06:50:09 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2048.outbound.protection.outlook.com [40.107.20.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF8AA6E9F5 for ; Wed, 31 Mar 2021 06:50:07 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SkX0IsNmXln9m+KUWZUED1qGae6lbw90KHwC+YX3lM5fc2RHnv7GR+ybCS0of9u2za9lFyPXvcr/VSRnBhe8qs/F0mvOFSbs0WSxyXjDcH53lO6u75aeFFgie/1jM9mu86VIb9NOqnhye0ujDloPxO+cFXTwUECU57WY+KqJuvrJswN2C+LOOrAFD5xUCDIFmm4IgB0E70OBTw2OBghHdOEeSD4RjA4qks9tD1U7XRL5xtt7I+5NptAhFCJI8ywUFpViHpImfKGkbDymQPHQ2anjnhWcMlbt9/eZ5rwBXrm1Jq/pfgTOAohp7JNzk/XewV/TtOhfOoSMhlIlljCYRw== 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=YuWwNrXQyIlnasUYMuYSUXt1x8OcmCYh/KNfGQpJtgQ=; b=DSNJBXN8Fg//JxZpLYEOM7VvQ8LO7n0b1+BX9xV9NasrCB2JZf4hs7CN1E9KX4p8ocdk+QavtvtCWQQICundT8RDFUMZvrkAai9DFGeNGL0k0BNVyre/Bhm8EnhYF59s93cDF+avUc4/p9z7rsyojZ83SwAI46Pu2Ezcr7M9g4ibuohoK4CyRUNSgK+JKwxaTnk0f8w8EnWzsnK4jCiHQDS9rGw3oOdpc1J7CIO2u1b/w2K9T4SjmoVJT2c52Kmw6rX4WEenmCTvgIBd3HXyfhk6iTZSyw36Cp08lViUjVJ+aSISduxphPiN5TSSUC6zj3ibDrmi/EKYBAhakpx5xw== 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=YuWwNrXQyIlnasUYMuYSUXt1x8OcmCYh/KNfGQpJtgQ=; b=oz6jHBtdPlC38XzTFgXUIVTLTZQCi/1pe/zew88FnfB+Woz5Coy5c+j7xWM1pDLU1ekxU+mqpotZZFOmxpebEAbg2MGrOe1+vf5uud7wM+t3lsDn8sOT6oZckXp+gbG5QhycdOmV0M+68tww9GHOiw/4UtY37H2YanbhSj78N8Y= 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:50:05 +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:50:05 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v7 14/14] MAINTAINERS: add maintainer for DRM bridge drivers for i.MX SoCs Date: Wed, 31 Mar 2021 14:33:25 +0800 Message-Id: <1617172405-12962-15-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:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e85a1ee6-dcf2-479e-742c-08d8f411372e 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:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 96T6PO6JaKB0rI6x0FFNnmW7UY8dnUwbyM60czjINOcsZdYxz3D3/6rhh6G5b7P60Sl20PHY8nLf2xVj8jBDrT/Y5791F4oEsU+Dkx6xzFF9x4LAKhXTLfQyaCr+PX7eFoT+D6dhM0Be+MIeeKhNC/iCmu3+Zd/+tU3O4BQR+PWUHjnoNVU/Cw0TzwbesGD+JQqRaZkmP50uLHTXpl8M8+Yh6L2ARj7ZrSO3ES2+9ozyAj8Vzd0B7VGUlBUNf97zvKZWC8EOGMuT7UxKYezHFCdxgcczdu6GbcIKow9hMEY8X6C7s8qKWT7QrIsSpSlaPp2HhkRlsXJVU2xQUMlQ5Mfe4mmt+4PC8cccoSpzRtgMqah4J7S63aSAn6deMX4IuZDT49x6/KzPEHvgn7su8UDbzkgcLd2DRIpQq1QG24m0acSgceAIIz3OY8AbnTqmYhrr+gtPEdtOa1qORRTcWFyeG/w/J0z4lXO9c7BgYwF7oG4N1QpUlUx8/7SHoO4Z240wDJVU81kQwu3kEickfGLiWr+kiifskEVNI6nYidD/asY5jXTUsfb2C9j3R30KH9MjA5kafKC90Xg6+ZCw0qLfGC3bhjbSPZ2GKpl2NnUix4pksDDa9rDTdKJf4atH5VYpA2eIkpQVBRa97a64yHA6A+fXiB7EVvl8ZicyOcriytUQnbYuw9AYBwtcGkkW X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3983.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(6029001)(4636009)(366004)(6666004)(69590400012)(36756003)(498600001)(956004)(16526019)(186003)(6486002)(26005)(6506007)(6512007)(66476007)(66946007)(66556008)(38100700001)(2616005)(4326008)(86362001)(5660300002)(7416002)(8676002)(2906002)(52116002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: KYNRu5zJHRBL6W2POoHPFDuWMO236+Ob7zQQmneQ/gCwRCTR1zyWjrLK78YYp5JUacD9lIYkuGEuPijPKpSANasSha9W5sGtwJKXtbLsBV7861iKKXes0IHW3L1qnpuqcZMCBlHgJHXmb5DkFAnl7YQLHpqd4+OcN3GBxhqp0gMqT5JVmhrdxspnjwPt51e3sXeouIUM7xWGQGepaupp2vgBrIgSOdCThmLA1SWIpzzWXcxepxxsA7RDlQZkaVGLCtXSFyQN9EC/1vUdv0CioUJWPBg/FG5X0zObE/fOBlS0aX7QbW7mUjJEapnhVR71I6GNpaZ2vs2AlF6TX/aiwzR8VWuudwMIQlOBS4JJ8SRkb1brlS6onBHPorlCuTlzOPsRr62zRY4hlOXDS1etCRsBT1n+o3WMkosQ7NrX3gTygDTdZBcHPB+O0R9CPfbVzPrW7EG4yQj/3fYJ9Pd5vwJ5EQfWeB7lr4caYBfnn+r+Tzq9Klee9sFtdsoO5Z/heR+kCk/PxciGhliGw5fQ1unS/NEeBpcp13yiKlKK4AbIVNtRjDljhxl4hTlISt7P7k36LSG/noXb2DJJRZMdXC1/YI1g/PSTYs7M20HuYi5ywMeBzHXjfLVJvTsjKvnf2MaEVceklKUboXIou16+JFg1z+I57psD2BZurXn44k/dAVgN7yoGkNM4sOIb6cufJa2+xz5EktT5/4KrfXK+78Kde2fGZgYohPP3vdAlxw9hPvMdiN8ZU2yfd3GRBpZjX/D032KfX05mOKy/GT67dRkakhjMyx1H8u7RbySIIkuvNeS7tA0FcBMxG8R8Nf1G/V3RYA/pSveAEF9AJQd1bZKvrVcl/JhtVquWj9F6QTtwzDhKNfO9HFEySIwfXRK17gv46bj8u3JtW8peBYNDUBlgvZ2JdnXqaEK7IDL5/M0lHdXMzTuU5G7MaKzVOuaMmTCUs0P527XiWW4sLIceiqU9veriKq7LTR/3in+/w5Q4r58wuJo+qKMGkTYyA122FxOz5mdPnUAvpuQqO+tG6CupioRqJble5yfXvCi1GzaShzu+vFQtWgAeicU3yzCmogTT5DUr82USG2PTgrwGYgCk6hKgP9SZOyje9eC1FB2MQuy3jrVCb2OKVTTGt7UWrPMBn920pAtPMu0J/k/PBSgo71IB/Vgp0KO/IT8S2xlM/cfvyo7od4R+1D1LR1Ub5c/An8DQKvJRre1Qp0INUyRbBEmH41+J8Ow7us4I+CZM8R/yuDAfnLAz+EPpYphYOQQEnz1levv02ysK0wodVcc5FysmMxQNDeqaVl8Bra3CWlXzEB+p77BPuQCN7V1y X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e85a1ee6-dcf2-479e-742c-08d8f411372e 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:50:05.3755 (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: wr4Sls161WDORpPQyhh/y6H1pg+bEXLWQahmQHj21KXbU07UYg4M4E93qPs4qsEXqaTYDhS6DuPiSWrq/Msrzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2318 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jernej.skrabec@siol.net, marcel.ziswiler@toradex.com, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, robert.foss@linaro.org, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, lee.jones@linaro.org, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add myself as the maintainer of DRM bridge drivers for i.MX SoCs. Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- v6->v7: * Add Robert's R-b tag. v5->v6: * No change. v4->v5: * No change. v3->v4: * No change. v2->v3: * No change. v1->v2: * No change. MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a247285..e286f3a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5946,6 +5946,16 @@ F: Documentation/devicetree/bindings/display/imx/ F: drivers/gpu/drm/imx/ F: drivers/gpu/ipu-v3/ +DRM DRIVERS FOR FREESCALE IMX BRIDGE +M: Liu Ying +L: dri-devel@lists.freedesktop.org +S: Maintained +F: Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-ldb.yaml +F: Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-combiner.yaml +F: Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pixel-link.yaml +F: Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml +F: drivers/gpu/drm/bridge/imx/ + DRM DRIVERS FOR GMA500 (Poulsbo, Moorestown and derivative chipsets) M: Patrik Jakobsson L: dri-devel@lists.freedesktop.org