From patchwork Fri Dec 11 01:46:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 11967487 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,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59FA6C4361B for ; Fri, 11 Dec 2020 08:16:37 +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 18BEE23E56 for ; Fri, 11 Dec 2020 08:16:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18BEE23E56 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 89E0D6EC9F; Fri, 11 Dec 2020 08:16:10 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2059.outbound.protection.outlook.com [40.107.20.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id 48A846E817 for ; Fri, 11 Dec 2020 01:54:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TU6syKgUCRG19ZNZch7tCUcwVhvXGhmCL+F3nhzXpZduvkc+HmrGMF3PslgS2YNM2ePKB5Mura3Tl3WElpmLPKoKGEXzsFWW7U0CO+c6xV7zZ3B6sz7fj1uikzisSdBXPSNHczpuwJ/sTxpmQhkRb/taZKnBXy9GUpfED7wPtjhasO/xw03teoheVZ5GGLEP9/+mXst/2+Xz60cBzhHp+A0xMFCNnI29nwHFzfITsV8Mj9+tkFk51zdW4nw/5zNU0apjCmftrcKnDQd9xd4PCm+rc5Se/1k72gVOCG7xe0bIdhlIS6WODr2vY/UR+xZWN+A2vrlmeIVXuHqOn7dngA== 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=F7JCMEc2TvZTAAQajmMNmgCYyH/TNXyB8QG4yF7Olg8=; b=OEmVrt0eINLSWY3nbtPtJ4RZY6CsxFSaQCV3q2VmcWga79Y9eQMVixkQv8ZNGw61duER4YAJqUQnxFE0ToSBPEPwHIGxAvx2WG1GNUztldJbrSddrIQUjdISQ+qAlONNQ571GF0yWSJ+3tI6L31lODzKRPcweKUb9UciVGwsxyvB1BEFNwOlPZBarsWfprYtFON4oV8JsR9Y9cCVh2J11TENgO5eGOSGTu32t9Kk8WgTpxZBTH/5uHvSdlUx+x/nVG0UZHLYqtrUeDyYNnNNGEexVmg2t/PXF/c8nXeNPRj2gXu1ep4Pw/eKCU9Vs+dfYyKr+7rN7hz11HQsrwHr9A== 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=F7JCMEc2TvZTAAQajmMNmgCYyH/TNXyB8QG4yF7Olg8=; b=XH+DIHrh2wefqYV2uyHiJMlBHigg5nbluj6N535iWAnhS05noRSUDtKWPV/PY9T7kTReI8aVQukZEy5P+aw28MpDjwX9d0emOaThR95oHquQhMmngLAVMxbP0DmwO5Gr3Lj9/kVG6WmcWGx0K8vfza3YA9TB0Q7+0cnwJ0Dj2V4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB3952.eurprd04.prod.outlook.com (2603:10a6:803:1c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12; Fri, 11 Dec 2020 01:54:48 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685%7]) with mapi id 15.20.3632.023; Fri, 11 Dec 2020 01:54:48 +0000 From: Liu Ying To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 1/5] drm/bridge: nwl-dsi: Set PHY mode in nwl_dsi_enable() Date: Fri, 11 Dec 2020 09:46:18 +0800 Message-Id: <1607651182-12307-2-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607651182-12307-1-git-send-email-victor.liu@nxp.com> References: <1607651182-12307-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) 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 SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3676.5 via Frontend Transport; Fri, 11 Dec 2020 01:54:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: bc22d55c-db69-412b-3f22-08d89d77bdaa X-MS-TrafficTypeDiagnostic: VI1PR0402MB3952: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YawtK11IMTjcTjvC1VXb+ZtgHyfVT6PktdNPo9O0Ud4iS/5LQukSrpVHMrlZEhS1LJS9juuruQEzvpv2IAX3M4dAzc/mp3bwPCnc8BixbkzLOGgk9C0Px5dpPLAaOMEX2Z7yOuHY+/+VIE71gFPH81Ij4W49aM2yeB/8GZZgq92OYLoHoZJ56K1JXmloeZWaS8FomfZ2wKPXWfrC6+H0PGhfiGHK0vBjr0rixfGoMlbBa23ZneDrRGZNC51lhccsNBNuwQIceeddDe0Jbip2w7u5R6nr5XdPM6tO8FDAmimZOe5YtYdlXgP62Q37J+XaFgE7Yv3gDRmO3+SN6o4K9g== 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)(136003)(396003)(376002)(39860400002)(346002)(366004)(52116002)(316002)(956004)(2616005)(5660300002)(66556008)(4326008)(66476007)(2906002)(66946007)(6512007)(7416002)(8676002)(16526019)(26005)(186003)(8936002)(6486002)(36756003)(478600001)(86362001)(6666004)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?+kaqbjNQDIT9onti2OTAZxnLG6anNC?= =?utf-8?q?VI4Pozy7iaHFaEubqp5UgktTVCr70lmeNfcrXUZp5Wl13Zy3UB4Gkt92PuYEOP90q?= =?utf-8?q?ann1a95PP73paBMcwwXbaDkNKLqOkX1TAVwyipQmkRfhVlWWeHAaBKqIzDqaUAEhe?= =?utf-8?q?e/JDZrx48wIO8H7eq9dA2icPMvIYqLa/hJstW+inSJZzwQJkjcQVB7x9itGSTUd8H?= =?utf-8?q?YrIhUP7ei81OjdNhMTlqSCkI59ghAvpxbPsSXTqPdeA4mv3vGe1Pst1Vp0hVO8rWG?= =?utf-8?q?ChcNgPjDiqANk16YmATj984ZwvEDbJfcAj1FLsdHOJ/ANH1nUzzsGBLV7jAfjGZ+/?= =?utf-8?q?EfUROZ3vSiMosbfe5MvYQE3ZrWUik7+LXVSM/3sq8kQV/ehWw1uZ005CpvR36QU29?= =?utf-8?q?Je4TLqtD+Ts5EBPZeayB00mMt3OmWbv9DzVXjQeDcs4mQ2TCYqmoOgAaetBB1dAHr?= =?utf-8?q?skWyiSnw0fkRYHl5+x+B1yK6SrN7cQBqRj67eZYwn1oNeCKEjxxQJqpyOPZSLMBk1?= =?utf-8?q?Yy4sCKAIQ2qFhelYpL6CUmNhm9S2a0NSrEcDdy90kyRZmXuOh9W7WnB5ZFQaVkQ0X?= =?utf-8?q?PC130Y7quNU2eyxoSXpyAajcxKQ4RqBDA9uIK+0w3XizOELHdrmDg4xO8lWW7FjKK?= =?utf-8?q?sVSXpAzimre9arm96hUOAiJ6a9b9zG1kAVndfsr8dfsGek+LSCpXVDEYsPR60tnHy?= =?utf-8?q?dTSfvTrmRRiDeL6IgnUArOhbqc3BkIni1WCtgbj94yDYIHyIVFyr2RQZjwrUBTzo8?= =?utf-8?q?LYsLMTjCRMKb1QahGRS1DKiUUx/i52zVqkd+Ob5XZG6cq5S34nqOkb7S923zM8W9V?= =?utf-8?q?mtO5DrncAgPqZquto2L/W1re5V9TnbM44oMCtbREpnPSRWPSLmCGUoV9qfZ2pkCFs?= =?utf-8?q?5loWAoe7x6jYBde54tZ4tibCTvJFWUzOr+hGA/Hohq11uR7R87cxg076Lc9WZHX8D?= =?utf-8?q?qWhR7fzrgDWcWwLJL01?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2020 01:54:47.8846 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: bc22d55c-db69-412b-3f22-08d89d77bdaa X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: c4Ft0Plr/xtyJRrxoICZ2Z2hTPmf2fhUWDkpSwdc0gLjH5tVHSw1RZLCjVLmzPz2b104fnRoNqpmV0EIauOJxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3952 X-Mailman-Approved-At: Fri, 11 Dec 2020 08:16:08 +0000 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: martin.kepplinger@puri.sm, jernej.skrabec@siol.net, kernel@pengutronix.de, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, Laurent.pinchart@ideasonboard.com, robert.chiras@nxp.com, shawnguo@kernel.org, agx@sigxcpu.org, linux-imx@nxp.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The Northwest Logic MIPI DSI host controller embedded in i.MX8qxp works with a Mixel MIPI DPHY + LVDS PHY combo to support either a MIPI DSI display or a LVDS display. So, this patch calls phy_set_mode() from nwl_dsi_enable() to set PHY mode to MIPI DPHY explicitly. Cc: Guido Günther Cc: Robert Chiras Cc: Martin Kepplinger Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: David Airlie Cc: Daniel Vetter Cc: NXP Linux Team Reviewed-by: Guido Günther Signed-off-by: Liu Ying --- v2->v3: * No change. v1->v2: * Add Guido's R-b tag. drivers/gpu/drm/bridge/nwl-dsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c index 66b6740..be6bfc5 100644 --- a/drivers/gpu/drm/bridge/nwl-dsi.c +++ b/drivers/gpu/drm/bridge/nwl-dsi.c @@ -678,6 +678,12 @@ static int nwl_dsi_enable(struct nwl_dsi *dsi) return ret; } + ret = phy_set_mode(dsi->phy, PHY_MODE_MIPI_DPHY); + if (ret < 0) { + DRM_DEV_ERROR(dev, "Failed to set DSI phy mode: %d\n", ret); + goto uninit_phy; + } + ret = phy_configure(dsi->phy, phy_cfg); if (ret < 0) { DRM_DEV_ERROR(dev, "Failed to configure DSI phy: %d\n", ret); From patchwork Fri Dec 11 01:46:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 11967527 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,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 618FDC4361B for ; Fri, 11 Dec 2020 08:17:28 +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 2832F23E56 for ; Fri, 11 Dec 2020 08:17:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2832F23E56 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 42C186ECD1; Fri, 11 Dec 2020 08:16:27 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2067.outbound.protection.outlook.com [40.107.20.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 531A66E81C for ; Fri, 11 Dec 2020 01:54:56 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ATs3oGYzGWbiRte05RklO2FWL39Vars/gSVhWwf8W/YlR2PTOumm8GPeP2sF1DSTapONHJSgSmmOjnTGfMm4uMCZf83cTs2AtHT0aKBPhdRlzRKVVaXkXikC8GggKR7Ye9x8lt0Ri1X5PJGKOFygE39EHPEjzASpELjQupr9YCxOSe68DSwgH/AAI1hv/yRORgsZ55lTZ9gZCBiJxUDfaL3EDTfQcQtsO0nPSENx2vMVgxcUgUbJ6aSASG8/FaXLDfg/G9DpxtXjmqn8xM/JwnT0t5WvMuZ5ve2adCvRSshkK/laQGZliLJJyTHhxgtqP/sIthLtEFaOZQ161I+uZw== 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=rC86KoH3wlxsXwcy+lYW7cA6YGyblupeW24O0ThV7Y0=; b=jrW8COBBbFfSRHsRTApVBxLmkLZv51ypPYtcdSs5LqqH4b1As1RV5msWXP1tRUM28Ex2eJEWP/k/UWZSfn7XN2J+NZgE8QNFnZmIMiatc6dsEb8VeQiZabpzLgq+9SgyJ+76eENgzCJMp0l5m5gSzdNtfEI/L/bC29xugBAsJ/049BOl65BCrcA03xeq6+elRnuTGZZirsYGz9hhehYDzFk6g0jS/0761aGEPN+244hBiR9D3KtlqwdBXyI2+cl5vC7R9RPSfhCLgxCJZmJCJPAe516g9FaIxq2bgrumcTT5aCGabe1D84arokGA1cq+I80ZUcOQdSE+rJ+5Mj9l6w== 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=rC86KoH3wlxsXwcy+lYW7cA6YGyblupeW24O0ThV7Y0=; b=c1k37B0cZVMrHChieBhsEexkPhUiDSvgqghHgfJqEEOhCYU8If1eHpq1Xss0310AmdS51iTKqgXvv1Vjsbdn712Acrg1FYiedun7PuF3Gu4iC1Avk53YSvAUuqFUj7zB2b4r9QBVuxu2D3v4tNTLYy4w5JL1/TahLZ5y+nyoc1M= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB3952.eurprd04.prod.outlook.com (2603:10a6:803:1c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12; Fri, 11 Dec 2020 01:54:54 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685%7]) with mapi id 15.20.3632.023; Fri, 11 Dec 2020 01:54:54 +0000 From: Liu Ying To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/5] phy: Add LVDS configuration options Date: Fri, 11 Dec 2020 09:46:19 +0800 Message-Id: <1607651182-12307-3-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607651182-12307-1-git-send-email-victor.liu@nxp.com> References: <1607651182-12307-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) 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 SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3676.5 via Frontend Transport; Fri, 11 Dec 2020 01:54:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2442d012-9fe8-4559-82d7-08d89d77c153 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3952: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M8qkN84mSV4sy9/v3O3Cn2751/sozrcxo3fgyixzm8MtFAOJP2Ed97Ok/Nn29Z7LKv67EjkhLeyvUshF35aeWFTiYQBbVGrpZNo7LcK5fUxJ9jRR5DUBC7ETCHRsWKn+dPne7B16jVtNyXeddDS1LlSDI4YMh6MuMlqJ7hzebRZchh1DdFbksu0NY0ugwZZ7ieTyuLeR7thVxCphwRxO/w7TeSFA5DU7YEi3sHcnMe6L61+WZ4p8Qogrjb9B9+VabvKTNfCiwEAa/s41BzJsnYnsYyzbcvgsOCwh1z2EbQ+HdrkAUlPDVXMj7RPBIOTN/7UKsoi7AVDROA4nwGOEZ5b9Xv0dt+UNo7HWShw/s4mH8ORdhLcM4fgGUssBMVXp 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)(136003)(396003)(376002)(39860400002)(346002)(366004)(52116002)(316002)(956004)(69590400008)(2616005)(5660300002)(66556008)(4326008)(66476007)(2906002)(66946007)(6512007)(7416002)(8676002)(16526019)(26005)(186003)(8936002)(6486002)(36756003)(478600001)(86362001)(6666004)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hpYX5s26RqPZYxgXd94mUSNCABPqkWJcNnhHhDO5XnavFeZChMQeFp22T7/b0aHI6y4bkjzRo8FGfCcl5QeTZdNwEFQcmwvqvT9Ptbh6s6iefewNO0spEi4R0bOgb5FQyl/XcmWuYlLAt5DvFvkxj7HhwAEML3Iy+agKrNAN2goH8rK3E+JNvbkdm4jNBHkipcttwGKkwIojBkebrkJuP3I+GNbDLZBPKaefeJ63m3fKGIFwx37thP9T/hEG3bBxjG7wz9bLOF7yBBpNbL68rmRzohgtzmW793krR84r/68UZAebapgfWrHi2bX1pPiPDayh2SZmNnmKD0aE2Vl4+JsD8rzTkCkoArwe0V38DliNQHvfhsuFRTgrKxRY9MLF4CGAbH43BDiS3tci2Acbn33QA7KHyuAEutqquZzJBb6FoFwczTC5q3ihg1CzOE2rSRLVwqFZx9THwePZEX/Cx7ksV85SA6A/Kd3k5/Bsx2nUwb2ENmBk9+itEPn68YGfdd+IgOkpsrfyETfMLGP6r1SHj4EP41AF82Pol8Jrl6GW6epURH3LTBXgCYoG4eDSZI3HE9TEAQBz5hBi7fuxFtytpmd9dkLwwa9whUJbZIxDkrt9HgsUqleenldw7NafLyzMOfFLH4Dv0P0TMZjqQ7lvLWePLhqDFqPctcgm1ddLicI4YkKgBgtMXKcqDHj1MesXLX8lLf/PBbPSZSdTkB3t8Fe/Qu/X9COUnPkhNOXZnLv82kd87h1mrS/eeq3tmVtzWghtkLuC7hIrW27BT6a5hmy06wDKCAxQLXsHO3KC/J9dLjX1SypadV8SrN83af0hRlXS+sN3mKm/33Ic3WUf9dV/T9XBCncNGysIBFRPiGt7XrwcXnhz7/qlb+LDiusSUbYQd2k6LMwUKYiuZIpPlQ6FbiS+CAQ+emYFIw11B8TcrvvIQuDSimMjEqZ+9QgbeQR+FUAT5XDYiqU3y8XAWLH18WpZWp+bRIp4axICrp/AW6Syv+eK+pPSB0Ra X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2020 01:54:54.1900 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 2442d012-9fe8-4559-82d7-08d89d77c153 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: e5nYxN60quRGfNzjUnfVQiLXGqmcNI6FRMl1NMWkfTU2r8/5WzI39zfi4MVoAzifqxNMH1MmLW11yb3D67cIlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3952 X-Mailman-Approved-At: Fri, 11 Dec 2020 08:16:08 +0000 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: martin.kepplinger@puri.sm, jernej.skrabec@siol.net, kernel@pengutronix.de, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, Laurent.pinchart@ideasonboard.com, robert.chiras@nxp.com, shawnguo@kernel.org, agx@sigxcpu.org, linux-imx@nxp.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch allows LVDS PHYs to be configured through the generic functions and through a custom structure added to the generic union. The parameters added here are based on common LVDS PHY implementation practices. The set of parameters should cover all potential users. Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: NXP Linux Team Signed-off-by: Liu Ying Reviewed-by: Robert Foss --- v2->v3: * No change. v1->v2: * No change. include/linux/phy/phy-lvds.h | 48 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/phy/phy.h | 4 ++++ 2 files changed, 52 insertions(+) create mode 100644 include/linux/phy/phy-lvds.h diff --git a/include/linux/phy/phy-lvds.h b/include/linux/phy/phy-lvds.h new file mode 100644 index 00000000..1b5b9d6 --- /dev/null +++ b/include/linux/phy/phy-lvds.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2020 NXP + */ + +#ifndef __PHY_LVDS_H_ +#define __PHY_LVDS_H_ + +/** + * struct phy_configure_opts_lvds - LVDS configuration set + * + * This structure is used to represent the configuration state of a + * LVDS phy. + */ +struct phy_configure_opts_lvds { + /** + * @bits_per_lane_and_dclk_cycle: + * + * Number of bits per data lane and differential clock cycle. + */ + unsigned int bits_per_lane_and_dclk_cycle; + + /** + * @differential_clk_rate: + * + * Clock rate, in Hertz, of the LVDS differential clock. + */ + unsigned long differential_clk_rate; + + /** + * @lanes: + * + * Number of active, consecutive, data lanes, starting from + * lane 0, used for the transmissions. + */ + unsigned int lanes; + + /** + * @is_slave: + * + * Boolean, true if the phy is a slave which works together + * with a master phy to support dual link transmission, + * otherwise a regular phy or a master phy. + */ + bool is_slave; +}; + +#endif /* __PHY_LVDS_H_ */ diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index e435bdb..d450b44 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -17,6 +17,7 @@ #include #include +#include #include struct phy; @@ -51,10 +52,13 @@ enum phy_mode { * the MIPI_DPHY phy mode. * @dp: Configuration set applicable for phys supporting * the DisplayPort protocol. + * @lvds: Configuration set applicable for phys supporting + * the LVDS phy mode. */ union phy_configure_opts { struct phy_configure_opts_mipi_dphy mipi_dphy; struct phy_configure_opts_dp dp; + struct phy_configure_opts_lvds lvds; }; /** From patchwork Fri Dec 11 01:46:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 11967551 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,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10F47C433FE for ; Fri, 11 Dec 2020 08:17:51 +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 CB86523E56 for ; Fri, 11 Dec 2020 08:17:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB86523E56 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 50E1E6ECD2; Fri, 11 Dec 2020 08:16:53 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2073.outbound.protection.outlook.com [40.107.20.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id F35B16E7E5 for ; Fri, 11 Dec 2020 01:55:04 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jeqa9t6cyyLs1h0UsNZieskfIMQXCO53tZa4u7moS1DenvX8zUkY8YuxQb4eWWzSHE33UHTvMXe/Q4l9kluEnkvRhnyxHBXkIE9g6tdIWC88IE56MlMyNDicKpi7Oe/Y7Yeyg1jncZhm1dl/y5D1vbkUu9ZG/30EouFnx4HyWfm6sKGGQ56zT6+xVW4xJIxeyYw3b10gSK5NuBz6Edr04lHJExBcPmqFYpO3aLTUNBvsqFYVSpwyWjaFZ/NMNA/vurgvfkGXOpO071FlMj6YUAWtzCPCEoZ6dN7rAyCY1+g08jnpC/i2rsTDhh3XF6hlWv0aMc5BZM1YvzSq4AA99Q== 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=vTQt44M7XtQAFncnJe3Nu7zGVUbs8IkzfxqUDT1dzsg=; b=Vcw52Zhk2FOJ0Entnd+oazF8ImRTKO35cr/n+4Q1yQqJ8zP+qp2f4P+JIWgFUjyDUOnukVjwQFiodqZkM11OfHpJpLRnmgXBPPId7iphyfPoY508s5i/6AgHEVUl6Y83qbcRIoBKVcegVxnKv/1vXrJQ4Ak46PZxuLjTHY//Of3XpY2JNWSeO0djiUtQXY+JiiuLpR98pttnRtJWEGBaX72po8Rvv/sq+LfOson8o6P7GZ+U913uLtV7pLJr/OTJngFayM+mPh+YNarV02WQ5BV85KoVIly9wvc+c7hGQTTF1VEqgGSjA78kDJsEWfZ5JC8T4a4PyklEnwGn1o+AvA== 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=vTQt44M7XtQAFncnJe3Nu7zGVUbs8IkzfxqUDT1dzsg=; b=XRIF0+BqoDxUf6es3/7+2p6xUV3dHlQp+CAbmjgXG0nzdIFmn5jQ4A6xAsAsuA2urVs87Wg8Fs43t98wA38vfyTio995Iykp1GSWvUJZUUFrlU1g2yKOve3etqkNbgxMQA2FGZ1P3M3Tbq+CoEvelyiQWCN5yenTSU0vFA7fJ2M= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR0402MB3952.eurprd04.prod.outlook.com (2603:10a6:803:1c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12; Fri, 11 Dec 2020 01:55:00 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685%7]) with mapi id 15.20.3632.023; Fri, 11 Dec 2020 01:55:00 +0000 From: Liu Ying To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 3/5] dt-bindings: phy: Convert mixel, mipi-dsi-phy to json-schema Date: Fri, 11 Dec 2020 09:46:20 +0800 Message-Id: <1607651182-12307-4-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607651182-12307-1-git-send-email-victor.liu@nxp.com> References: <1607651182-12307-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) 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 SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3676.5 via Frontend Transport; Fri, 11 Dec 2020 01:54:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 37b54dbb-0972-4232-5a68-08d89d77c4f8 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3952: 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: HqGe4yEyb95kbPCMzzwXCTNT5wu5zZz4KhXxHYrRmMyZc6ZifTY4Va/3DlFFHUyrgTPIRkh+XNryBXaiu+3/SI7hxGr3I3xypRiAMPLqqHo1M7hKCw0YULkaKarPBdnZa4Aw5jS88p8iTWgHn6N21fqq4tuNIBGYIvvVrNX8pecwC9rw9Wz+u0Na5fPlgBHCiQLCulF1Ke0B5lrfB+1PYqXW/BHAzNt81DZloapHzGMxEEGa7hWasJCwIvOQbljxVzYmC3G+xnZn9NZg4RoS2MjHg583LCcRGg9RhINIESgSSRS5C2YuLJJxwT4oWiOcJ7CRDJooL9Kl5jBSDOLbGxuPpBwBQWBMKA+sBUUeaEEm3b4FjRQ11RGk5pBbgEK9wpZVsdHe4Otq8f8SDWbFEQ== 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)(136003)(396003)(376002)(39860400002)(346002)(366004)(52116002)(316002)(956004)(2616005)(5660300002)(66556008)(4326008)(66476007)(2906002)(66946007)(6512007)(7416002)(8676002)(16526019)(26005)(186003)(8936002)(6486002)(36756003)(478600001)(966005)(86362001)(6666004)(6506007)(83380400001)(66574015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?sEjiKTa8Bwtc6bgSiUyKR01PDOftks?= =?utf-8?q?KsBMhc64VueCqVlc5m6JXt1kf6tr09JQQ7iA1m77uZ3b647cyc8DpeoK0++FfQsJ4?= =?utf-8?q?6lv75sPSAMK/WZyTqRxk2qlEPv/d0/UWTEI22SGtyMuCNbN26uzgmyBAUrxgkZ0oG?= =?utf-8?q?PV7v0A9APgd89frC/BRKtexM1vrOLwNkSURv+KI0yauJGq55gX9Yu0Bw3wW2+gh+x?= =?utf-8?q?w/zlleaAc9lxrwQyTj67sAD0QRzGCIqVFHj614tA58TUECligY6lToH4FyHvbsleT?= =?utf-8?q?whMukngAZEkBmc+a+JE0RQf9ySNLFnqprRo5vzEwFy3zdKng7KpmZRkqk4RlxB96G?= =?utf-8?q?sfFODiYf+r8dUzDLfpR0f+y1Ql2tMmkwcEQxfcjd5aP+zRQEG3sG77SABzOy3TFDB?= =?utf-8?q?GeOM2jFTXXkji67a60kQxVe7xUawnD9FWyZIdQ+IibDJFjsPe0jrp089bjIQAchMI?= =?utf-8?q?YV7QaPMtWHymtaO2jV7Jcbw5Sqc/g0jatHFfA2W+koiAxszlzoWbaJTfV9DG1Be5I?= =?utf-8?q?kmz0o0Ec0DBfgt/DpbPwXtLdB74hDh6hDXUdB8Njsefgx43ns4rvia3edhfsRXabT?= =?utf-8?q?8RVHv8vbvt0pDDUedUlUZv4fyAe4C5jSvipeRw1hdq91ZtkRJxRNIrUC4zG7OJTOM?= =?utf-8?q?cw3QnXuDNtA/8n7q2dzCfypmqa/Lno3L+zjk9t3zRgYcjRsQpmXYgoJ91JlcGLKlw?= =?utf-8?q?iS3eOH33BQGWpwu4XTQqHvvr/FG12tO186el1gfQRcy5LUeITguof8q+FyPcMg4mn?= =?utf-8?q?gabiAJNixT4nwPypmZ6imDGmSFshcGy19hhPXkhJ9f02meViGetUnAaHCHGw8Mn1O?= =?utf-8?q?ctD2kystActc5JXkYnHVmRkKK3DUKoNoUUrxsoHrycLY9TK8f+jEq/yclsyUd5k3b?= =?utf-8?q?izhxKYuGk/tJZA97JRAaS04AxC2X4lqZQZS+EB/VtgjUhPmRq2/83tZXoh8+a4xMj?= =?utf-8?q?0hwFMNGW4K5Ixl1tWCG?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2020 01:55:00.2885 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 37b54dbb-0972-4232-5a68-08d89d77c4f8 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Xr1zB7tatXcVZIsVsDzWPvJ17BHqe/GpkUeYAQVaQCFpd2WLdjby0z8s7ENxPAAv770PNsQQ0qJTbswgD58ahA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3952 X-Mailman-Approved-At: Fri, 11 Dec 2020 08:16:08 +0000 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: martin.kepplinger@puri.sm, jernej.skrabec@siol.net, kernel@pengutronix.de, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, Laurent.pinchart@ideasonboard.com, robert.chiras@nxp.com, shawnguo@kernel.org, agx@sigxcpu.org, linux-imx@nxp.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch converts the mixel,mipi-dsi-phy binding to DT schema format using json-schema. Comparing to the plain text version, the new binding adds the 'assigned-clocks', 'assigned-clock-parents' and 'assigned-clock-rates' properites, otherwise 'make dtbs_check' would complain that there are mis-matches. Also, the new binding requires the 'power-domains' property since all potential SoCs that embed this PHY would provide a power domain for it. The example of the new binding takes reference to the latest dphy node in imx8mq.dtsi. Cc: Guido Günther Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Rob Herring Cc: NXP Linux Team Signed-off-by: Liu Ying Reviewed-by: Rob Herring Reviewed-by: Guido Günther --- v2->v3: * Improve the 'clock-names' property by dropping 'items:'. v1->v2: * Newly introduced in v2. (Guido) .../devicetree/bindings/phy/mixel,mipi-dsi-phy.txt | 29 --------- .../bindings/phy/mixel,mipi-dsi-phy.yaml | 72 ++++++++++++++++++++++ 2 files changed, 72 insertions(+), 29 deletions(-) delete mode 100644 Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.txt create mode 100644 Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.yaml diff --git a/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.txt b/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.txt deleted file mode 100644 index 9b23407..00000000 --- a/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.txt +++ /dev/null @@ -1,29 +0,0 @@ -Mixel DSI PHY for i.MX8 - -The Mixel MIPI-DSI PHY IP block is e.g. found on i.MX8 platforms (along the -MIPI-DSI IP from Northwest Logic). It represents the physical layer for the -electrical signals for DSI. - -Required properties: -- compatible: Must be: - - "fsl,imx8mq-mipi-dphy" -- clocks: Must contain an entry for each entry in clock-names. -- clock-names: Must contain the following entries: - - "phy_ref": phandle and specifier referring to the DPHY ref clock -- reg: the register range of the PHY controller -- #phy-cells: number of cells in PHY, as defined in - Documentation/devicetree/bindings/phy/phy-bindings.txt - this must be <0> - -Optional properties: -- power-domains: phandle to power domain - -Example: - dphy: dphy@30a0030 { - compatible = "fsl,imx8mq-mipi-dphy"; - clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>; - clock-names = "phy_ref"; - reg = <0x30a00300 0x100>; - power-domains = <&pd_mipi0>; - #phy-cells = <0>; - }; diff --git a/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.yaml b/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.yaml new file mode 100644 index 00000000..c34f2e6 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.yaml @@ -0,0 +1,72 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/mixel,mipi-dsi-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mixel DSI PHY for i.MX8 + +maintainers: + - Guido Günther + +description: | + The Mixel MIPI-DSI PHY IP block is e.g. found on i.MX8 platforms (along the + MIPI-DSI IP from Northwest Logic). It represents the physical layer for the + electrical signals for DSI. + +properties: + compatible: + enum: + - fsl,imx8mq-mipi-dphy + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + const: phy_ref + + assigned-clocks: + maxItems: 1 + + assigned-clock-parents: + maxItems: 1 + + assigned-clock-rates: + maxItems: 1 + + "#phy-cells": + const: 0 + + power-domains: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - assigned-clocks + - assigned-clock-parents + - assigned-clock-rates + - "#phy-cells" + - power-domains + +additionalProperties: false + +examples: + - | + #include + dphy: dphy@30a0030 { + compatible = "fsl,imx8mq-mipi-dphy"; + reg = <0x30a00300 0x100>; + clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>; + clock-names = "phy_ref"; + assigned-clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>; + assigned-clock-parents = <&clk IMX8MQ_VIDEO_PLL1_OUT>; + assigned-clock-rates = <24000000>; + #phy-cells = <0>; + power-domains = <&pgc_mipi>; + }; From patchwork Fri Dec 11 01:46:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 11967555 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,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84A8DC433FE for ; Fri, 11 Dec 2020 08:17:54 +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 33D0F23EB2 for ; Fri, 11 Dec 2020 08:17:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33D0F23EB2 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 51EA16ECD8; Fri, 11 Dec 2020 08:16:53 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2051.outbound.protection.outlook.com [40.107.22.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA8F36E817 for ; Fri, 11 Dec 2020 01:55:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MafHRAIaZLxyOqG9NDdIJPISa3nfXAB2eTX7OCIzmehFdrEsSPfWlBz6enon1iFOSRmD2I08RbCQNgmU1XgqrzHszMHSyPdBqYs1TERb8xIEyQh3d5jfox886jMV4X1WFcZa1VESw2rgZG3pSSsffyiUEz7YTftFl0blaFnTwln/hnbQ9jrXVJcN0SmxxIcrtcO34NAq1LiljDcymQ1VZZdmpBr7JqVWUkgD+8W2UG9avkhQaOlXxdZ28UEqdjRrpe2KhwJHgbAB0mRv/wIX/Z/wyUSJLrteRGQhvScv3cufBBgoSep0iWo02gdptQC2xGTa91RLhtRDiK2571Tycg== 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=ttQ/OcOu/Epp1ERZEqByxHR+fVO/OATaPAD8cfj/eN0=; b=NjhD0PZVeK82UOOh0SYuGpK9BQIXRUc4XIJ+3StyLH+AtNka9GANQVkZWhWVukiIObSyb9hW3QHu6SUQgMsBM8Pmz5pvQWLLlY/2Co6h7Z4gJlwkIzsVSsNRbSxXCEQvIkAcFFCT0ulc01L2nlHfUU83Tr9cDzyM8z2LqfLxpKVP2XlBWQ4Boz64hDDlViLt515itZ33+5B/jQMCmfsf+Wskuc8ynJAWKusH0YbvHuPi0tg7DjIyjJqdvk4FBKwRb8nj8KeDse7b6bwY/UhC9wq/vVQ46IA0pYTrkVcQ4ntsThOyN4NnppGj++wg/iypAOzRNeDy+Qu5WNg/tzHkNw== 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=ttQ/OcOu/Epp1ERZEqByxHR+fVO/OATaPAD8cfj/eN0=; b=ojd6COTUZC6w2Y5+SUhu3Ghtd5IUeCsOBgZBLTECuBYKB95FkwX4oqdj95bVR6zbHuV0yfzAvbjprne6LY3FUiMSBs8J4W+igeRJuZFPucVQ36yD+bmNQLsWfwmQulXKhkFj+xPOhByfLAm7PStG4YtlB8EVtOvT5rQNjyCj6+g= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR04MB4045.eurprd04.prod.outlook.com (2603:10a6:803:43::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12; Fri, 11 Dec 2020 01:55:06 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685%7]) with mapi id 15.20.3632.023; Fri, 11 Dec 2020 01:55:06 +0000 From: Liu Ying To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 4/5] dt-bindings: phy: mixel: mipi-dsi-phy: Add Mixel combo PHY support for i.MX8qxp Date: Fri, 11 Dec 2020 09:46:21 +0800 Message-Id: <1607651182-12307-5-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607651182-12307-1-git-send-email-victor.liu@nxp.com> References: <1607651182-12307-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) 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 SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3676.5 via Frontend Transport; Fri, 11 Dec 2020 01:55:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d21a3e2a-2f14-4152-62a9-08d89d77c890 X-MS-TrafficTypeDiagnostic: VI1PR04MB4045: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5tTf6H2SB74uXjmvWO1qApYrZsoydvc4NDsHD1noY/ZTNqpzdSe29QPZ5HKxYuUZM5JR1k0JEqVzzidCYSHlGMeUgNb3aFUXWBQR1XL8o9h0FWly3TvVeF9Z+TlGmhGrQouUQmzWcY16nUdrN1oO2UwPc+g/+eNEWJ/RzlgAZWHxCIKmCILIeSEQriCDQUbSjp8AbM47j+4oqJVPMOOHI4WFw9KojiYfWIPeZk493cKaSp7iUeWdTFZkDc1C3Rad79ENbEVqstrzbxCzKwazYl4R21ddo7VH5QemT8wkOimi2Z2tDmZYj96gBC3Enwk+0imz+J4BR2MQINXel0FzSQ== 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)(396003)(346002)(376002)(136003)(39860400002)(366004)(2616005)(66946007)(66476007)(6512007)(186003)(66556008)(26005)(7416002)(83380400001)(6486002)(16526019)(316002)(52116002)(956004)(2906002)(4326008)(6506007)(36756003)(6666004)(5660300002)(86362001)(478600001)(8676002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?Y9JMW4ZQ6Z+RcoTZoSlqYxOczonHsJ?= =?utf-8?q?6d5whSmqpJSn9YYfVeTp9hP+2GCrR3k6TLQq3+TWUXh7jFeYivFZ4L1/W6DkWXU/a?= =?utf-8?q?1hqzzOh1wBj2gU++53H8nZooOngawWK/6PfAJdS4J5gFJFfL9TbNWqVCbN8+5BAMZ?= =?utf-8?q?7XZHGGfdiwdFzh3Xd7h3xnjb/T0Z5oH68UtP7JV8jaA0WnYoBdVVUSY+zAg+epcHN?= =?utf-8?q?uwwXebMxTt2KDiNbnmI5ZLGbBFDUXjl0eHBRwce7hlvbPzcmM3IqWIw+3GTQ/Kn4+?= =?utf-8?q?VAoxFi9OKBlkhTIIKgL7aMe3yJhjBS8Lon4yQWi+mv44XpGp0tBP5H3N5c9d+4m0s?= =?utf-8?q?BVf4wN7cQYgSmAeParNK1JMTZghz/Av/XLcT/q5WJ1TH46sMC7Epk02oOrb3vlo92?= =?utf-8?q?inLSJzMRc0MMyn0kgYBCfLW+oFLOwz8qZRkEqq+5RYhlQny+TJZ0LINkTsUUDjY4L?= =?utf-8?q?GL+0iBKSZe8DaNCnOhIznqp3L596MHMupq3ln2y31DK3dDf4H/h0anok0e48JnRdS?= =?utf-8?q?vTMEdaxcu2g4H3e1XiLXPZ80uyaz3snWTlmxk0Ky883tox/D02FaKw5AP2XMl4m//?= =?utf-8?q?4QoleLv+/4/VIoSFl1L2KXa6gWGqpFwUES0vEh8vshKRCC0ZIzZNtYe5OSGxFlPJ3?= =?utf-8?q?XSyOiosYLAbw/ryqTesypwFt45NfGBX6r+LTynu75VDL120bROZGX49geLOiG335v?= =?utf-8?q?yzURwvULrlh2QC4P6hBYkJxJZp6Dqn6VBQrd5fgAdbVpcry2KaxU9Cv0NmNN9CsXn?= =?utf-8?q?EZl5L1hUWYz5//vOlpSmXjtK58KUdjsBLKv0IB2miqwgDbj+mkRGkHxf08+T8Ob4C?= =?utf-8?q?kCDm5wObxia4/ZLOQmCQpNAJv+hux2RtPbNBstBgzi1xJ0/VGENuldPs2Uoi4Wp4N?= =?utf-8?q?O4Hgn8dBBkKzN6UkdWxkftPIhaPCo66UOVV4NgmZwWpkDf2mocPGDxXu/OgeJns2b?= =?utf-8?q?xXlly4w0iLXKGCAEuNu?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2020 01:55:06.3670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: d21a3e2a-2f14-4152-62a9-08d89d77c890 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3GoFzv2ioe5ZPTXACyTQxnJfXv48zvZCUsUrVmc8D1QnCE2HtRX1IdPtG1Efk/Kr9Ff3eQQeqGzFpCmv2ZEQtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4045 X-Mailman-Approved-At: Fri, 11 Dec 2020 08:16:08 +0000 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: martin.kepplinger@puri.sm, jernej.skrabec@siol.net, kernel@pengutronix.de, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, Laurent.pinchart@ideasonboard.com, robert.chiras@nxp.com, shawnguo@kernel.org, agx@sigxcpu.org, linux-imx@nxp.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add support for Mixel MIPI DPHY + LVDS PHY combo IP as found on Freescale i.MX8qxp SoC. Cc: Guido Günther Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Rob Herring Cc: NXP Linux Team Signed-off-by: Liu Ying Reviewed-by: Rob Herring Reviewed-by: Guido Günther --- v2->v3: * No change. v1->v2: * Add the binding for i.MX8qxp Mixel combo PHY based on the converted binding. (Guido) .../bindings/phy/mixel,mipi-dsi-phy.yaml | 41 ++++++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.yaml b/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.yaml index c34f2e6..786cfd7 100644 --- a/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.yaml +++ b/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.yaml @@ -14,10 +14,14 @@ description: | MIPI-DSI IP from Northwest Logic). It represents the physical layer for the electrical signals for DSI. + The Mixel PHY IP block found on i.MX8qxp is a combo PHY that can work + in either MIPI-DSI PHY mode or LVDS PHY mode. + properties: compatible: enum: - fsl,imx8mq-mipi-dphy + - fsl,imx8qxp-mipi-dphy reg: maxItems: 1 @@ -40,6 +44,11 @@ properties: "#phy-cells": const: 0 + fsl,syscon: + $ref: /schemas/types.yaml#/definitions/phandle + description: | + A phandle which points to Control and Status Registers(CSR) module. + power-domains: maxItems: 1 @@ -48,12 +57,38 @@ required: - reg - clocks - clock-names - - assigned-clocks - - assigned-clock-parents - - assigned-clock-rates - "#phy-cells" - power-domains +allOf: + - if: + properties: + compatible: + contains: + const: fsl,imx8mq-mipi-dphy + then: + properties: + fsl,syscon: false + + required: + - assigned-clocks + - assigned-clock-parents + - assigned-clock-rates + + - if: + properties: + compatible: + contains: + const: fsl,imx8qxp-mipi-dphy + then: + properties: + assigned-clocks: false + assigned-clock-parents: false + assigned-clock-rates: false + + required: + - fsl,syscon + additionalProperties: false examples: From patchwork Fri Dec 11 01:46:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ying Liu X-Patchwork-Id: 11967521 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.7 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,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE9E0C433FE for ; Fri, 11 Dec 2020 08:17:23 +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 5FF2C23E56 for ; Fri, 11 Dec 2020 08:17:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FF2C23E56 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 901FD6ECC4; Fri, 11 Dec 2020 08:16:25 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2054.outbound.protection.outlook.com [40.107.22.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 613316E81C for ; Fri, 11 Dec 2020 01:55:18 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n+lkh7TcnYLTIAp6kaSpvd04d2F8HaPYsyMNo2+rCUOE9VNZuqdiAGekoMh9UCWZNpEMRWYDVFFiyuiPUEgcaSnx/97FgVhVXZOg3weZp8GKbn7nZYF160YFk/cIx448AcCjV2gR9eXCrhAp6QG9ixSCWiTMuaXJwGmq+8lnbv7dccXkb9wOwzdgzb8JeajWpzL9IOgidLP/0K7FFs8Cg0NkAcQFFDH6ZqTt7HOIjKPZvuGK76gQ3/pWbs2ijapMHyZGUelf1keHOZVqbYFLwMx9Bo02y/PywG591TPG5tSOKNzxsNIE4WmNcyCsEY0A3chtrn9251gYlEt63bDqXA== 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=OM3xBl5UVQvmZN/wAHDcKFAarE/aVAMSnledIegaDkw=; b=CIjJ56VNaeADYh++25HlQdmc+35vZypy8Po6OpNJ3NIvdmQal11msGSl+9U0b5F3j4KMtPbKwOrurJqiZM3OMPAZNrSlwAH6Q9eFKWxNVA5bw7p9uqdDYjSF8SgiGKYeLC7pNR7g1jfYDUT6TLMJXFzRctjwi30FIHqNl086nT5AGZto/jJqSdB+wxelxV7R7M46qVbbaemPEbjHNUOKnSrU2BVyEFAKq5mXFqYH9hXsqqM+bTaOreA42zejDfSuff668oUIpqL0GT02EqH38euwogCnzvWl1f5rVaSeitCacSmZ1SZX0fp+hTv/kB9urkCbqnbczf4zJKOVz33GRg== 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=OM3xBl5UVQvmZN/wAHDcKFAarE/aVAMSnledIegaDkw=; b=qavVUfARBnjDC4f0fGMnq67Gse2adbyS8GTa/1N3M3uwqTau+nWnJHa+gNGjF/9R3MABarLjDd6MLZY1jLJ4DM0DCJCgHORMtRwu9ZBik432wFoEoBv7HGIfWdTupqzb9BP/8dP7H07mwGfxlB+eyPy7ukiTbzj8rfv2/YPECv8= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR04MB4045.eurprd04.prod.outlook.com (2603:10a6:803:43::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12; Fri, 11 Dec 2020 01:55:12 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685%7]) with mapi id 15.20.3632.023; Fri, 11 Dec 2020 01:55:12 +0000 From: Liu Ying To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 5/5] phy: freescale: phy-fsl-imx8-mipi-dphy: Add i.MX8qxp LVDS PHY mode support Date: Fri, 11 Dec 2020 09:46:22 +0800 Message-Id: <1607651182-12307-6-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607651182-12307-1-git-send-email-victor.liu@nxp.com> References: <1607651182-12307-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) 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 SG2P153CA0042.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3676.5 via Frontend Transport; Fri, 11 Dec 2020 01:55:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 66838810-cf88-4684-0d78-08d89d77cc49 X-MS-TrafficTypeDiagnostic: VI1PR04MB4045: 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: 0zD+EZlYUuwiu7c0982u94Y1xjrwLnLbofeEzp9o3vpiVZsNQ0laYSObql96s3sl6E0egjNLUESCR5BAsjkV+yFQltAp94i3IX08QgCIrifSRkiTHsUp1Ajsaun3du7UbP2srXcvANIielHJjat5z6ZQV2/Z8mYJ7YD/XsSsJbWCxEDZ2tBpgh5liB6VS/rB0RJXj7XclBvMvK9Nig6uPF5yEhvWwUmanjIFn67PiuXCtsXZ+CLxZ3BZjz9k5n7CLf+k5lvoAs+zMhmMHn7BXJoVvs+56TeWVxfi6S6F5TlU8ZfFEkIiIM+yAIqzctEuuN8qyD14HxmstOcOWau+PAmH/dTHeNVl/4cugcie+IXv54YbAjICgJPnwdv7g4Ms 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)(396003)(346002)(376002)(136003)(39860400002)(366004)(2616005)(66946007)(66476007)(6512007)(186003)(66556008)(26005)(66574015)(7416002)(83380400001)(6486002)(16526019)(316002)(52116002)(956004)(2906002)(4326008)(6506007)(36756003)(6666004)(5660300002)(86362001)(30864003)(478600001)(8676002)(8936002)(473944003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?bcEBdg9jbbVnYau03y8R7ScbKPzHDP?= =?utf-8?q?/OIKQfTLJVXuW40ozvYB86yMwMEjjUZZusF5WTMyM/ZSx4D8TL199kXJ7bzTwf1IF?= =?utf-8?q?gDap+2oETldje9Do4BREyP4RCYn7YCDjbMmxfjztmqs7ZinzUNZPZmFI1dKsKQCq0?= =?utf-8?q?p5HeuvK0Q3gQsXtwIyUb5evsIT5RAXNcPryBRg08Rjf0B0cENbUj/6cITkvZ8Z+Jn?= =?utf-8?q?AGSriKwy6+R7yq0/PFTPeDTzB40LgVFVXJZ19+NGsLKm8oZHVQAvfHkP4S+QtOb5D?= =?utf-8?q?nsX5EmT4698Fh7RqrN2b6xCRjg1KkqlOF/RF5S89we6rNaOGd7z+0ON8OH7kQOgyM?= =?utf-8?q?Bfkh3ik0FJLUVnSdXDyfFUBpqXj5z2YmJVDVQnNxLQcH/GJWUH793zWy8sc3soDVI?= =?utf-8?q?ndtKU6sRIVlkPH7OgyzSM0QnxY5qD+K1CW8zWJ0Iur5hSgkbDqBeobVSUuxwkTc+n?= =?utf-8?q?1JBr2jGkAwkexKvdwe9sYBAeugpSzZ41VZRbWNN939g+dBRbJE8d8qWE2O4v81bvv?= =?utf-8?q?mVXcZV6dI60p5LABoxLd7VeXNae98fbsadYM/S0VhLSLwvQjhIZ7soBJ1rdXzc4XE?= =?utf-8?q?cFKDdQ+xwtBxp+ziNtMKtTJSdEeai6NWHQNYpNNmGrMcuI4e3UOYr4xxMFT/qWoWA?= =?utf-8?q?SkUEDbtWzQ/Xi37xnUa9wpdqqtRAG9K5MRG1BIiuOx+rILNWVrue4HihWTXeQMUht?= =?utf-8?q?9eZIMyxOAs88W/2DUF64cL13eRGdiwGLuQvR4XZzONkWlUjXaKGEBJAcPZA8rfUY7?= =?utf-8?q?JomgrM6ECdtX+/FRRSVB0R55XmLRozxgdFCk9QF0sEWwRHInCucnXwqxfinrd2Q6P?= =?utf-8?q?+u/MK7xDDLYH2orBCxiSVWJCYBWcArpyMCNjafEqXWsgePeIdOHra/Z6qXHcPGupt?= =?utf-8?q?0RO3Egu99H2lquCaVKUrb9tgT+wKBbb1iQfG+MulF5h4A3Jg0HWYzKQS3d6sKNyZe?= =?utf-8?q?HzDGNCLHzFMiT8u6Lra?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2020 01:55:12.5844 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 66838810-cf88-4684-0d78-08d89d77cc49 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kmPEPVeUmusFSdPop+lRV+Yh0IHnMeGISuK0o/sTbcLoGV3QcCw5abOar74+JDzINYL0+L+rxHwGhGPuLDx7JQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4045 X-Mailman-Approved-At: Fri, 11 Dec 2020 08:16:08 +0000 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: martin.kepplinger@puri.sm, jernej.skrabec@siol.net, kernel@pengutronix.de, narmstrong@baylibre.com, airlied@linux.ie, s.hauer@pengutronix.de, jonas@kwiboo.se, kishon@ti.com, a.hajda@samsung.com, vkoul@kernel.org, robh+dt@kernel.org, Laurent.pinchart@ideasonboard.com, robert.chiras@nxp.com, shawnguo@kernel.org, agx@sigxcpu.org, linux-imx@nxp.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" i.MX8qxp SoC embeds a Mixel MIPI DPHY + LVDS PHY combo which supports either a MIPI DSI display or a LVDS display. The PHY mode is controlled by SCU firmware and the driver would call a SCU firmware function to configure the PHY mode. The single LVDS PHY has 4 data lanes to support a LVDS display. Also, with a master LVDS PHY and a slave LVDS PHY, they may work together to support a LVDS display with 8 data lanes(usually, dual LVDS link display). Note that this patch supports the LVDS PHY mode only for the i.MX8qxp Mixel combo PHY, i.e., the MIPI DPHY mode is yet to be supported, so for now error would be returned from ->set_mode() if MIPI DPHY mode is passed over to it for the combo PHY. Cc: Guido Günther Cc: Robert Chiras Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Signed-off-by: Liu Ying Reviewed-by: Guido Günther --- Guido, I also print invalid PHY mode from mixel_dphy_configure(). v2->v3: * Improve readability of mixel_dphy_set_mode(). (Guido) v1->v2: * Print invalid PHY mode in dmesg. (Guido) drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c | 269 ++++++++++++++++++++++++- 1 file changed, 258 insertions(+), 11 deletions(-) diff --git a/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c b/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c index a95572b..af1ecda 100644 --- a/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c +++ b/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c @@ -4,17 +4,31 @@ * Copyright 2019 Purism SPC */ +#include #include #include #include +#include +#include #include #include +#include #include #include #include #include #include #include +#include + +/* Control and Status Registers(CSR) */ +#define PHY_CTRL 0x00 +#define CCM_MASK GENMASK(7, 5) +#define CCM(n) FIELD_PREP(CCM_MASK, (n)) +#define CA_MASK GENMASK(4, 2) +#define CA(n) FIELD_PREP(CA_MASK, (n)) +#define RFB BIT(1) +#define LVDS_EN BIT(0) /* DPHY registers */ #define DPHY_PD_DPHY 0x00 @@ -55,8 +69,15 @@ #define PWR_ON 0 #define PWR_OFF 1 +#define MIN_VCO_FREQ 640000000 +#define MAX_VCO_FREQ 1500000000 + +#define MIN_LVDS_REFCLK_FREQ 24000000 +#define MAX_LVDS_REFCLK_FREQ 150000000 + enum mixel_dphy_devtype { MIXEL_IMX8MQ, + MIXEL_IMX8QXP, }; struct mixel_dphy_devdata { @@ -65,6 +86,7 @@ struct mixel_dphy_devdata { u8 reg_rxlprp; u8 reg_rxcdrp; u8 reg_rxhs_settle; + bool is_combo; /* MIPI DPHY and LVDS PHY combo */ }; static const struct mixel_dphy_devdata mixel_dphy_devdata[] = { @@ -74,6 +96,10 @@ static const struct mixel_dphy_devdata mixel_dphy_devdata[] = { .reg_rxlprp = 0x40, .reg_rxcdrp = 0x44, .reg_rxhs_settle = 0x48, + .is_combo = false, + }, + [MIXEL_IMX8QXP] = { + .is_combo = true, }, }; @@ -95,8 +121,12 @@ struct mixel_dphy_cfg { struct mixel_dphy_priv { struct mixel_dphy_cfg cfg; struct regmap *regmap; + struct regmap *lvds_regmap; struct clk *phy_ref_clk; const struct mixel_dphy_devdata *devdata; + struct imx_sc_ipc *ipc_handle; + bool is_slave; + int id; }; static const struct regmap_config mixel_dphy_regmap_config = { @@ -317,7 +347,8 @@ static int mixel_dphy_set_pll_params(struct phy *phy) return 0; } -static int mixel_dphy_configure(struct phy *phy, union phy_configure_opts *opts) +static int +mixel_dphy_configure_mipi_dphy(struct phy *phy, union phy_configure_opts *opts) { struct mixel_dphy_priv *priv = phy_get_drvdata(phy); struct mixel_dphy_cfg cfg = { 0 }; @@ -345,15 +376,121 @@ static int mixel_dphy_configure(struct phy *phy, union phy_configure_opts *opts) return 0; } +static int +mixel_dphy_configure_lvds_phy(struct phy *phy, union phy_configure_opts *opts) +{ + struct mixel_dphy_priv *priv = phy_get_drvdata(phy); + struct phy_configure_opts_lvds *lvds_opts = &opts->lvds; + unsigned long data_rate; + unsigned long fvco; + u32 rsc; + u32 co; + int ret; + + priv->is_slave = lvds_opts->is_slave; + + /* LVDS interface pins */ + regmap_write(priv->lvds_regmap, PHY_CTRL, CCM(0x5) | CA(0x4) | RFB); + + /* enable MODE8 only for slave LVDS PHY */ + rsc = priv->id ? IMX_SC_R_MIPI_1 : IMX_SC_R_MIPI_0; + ret = imx_sc_misc_set_control(priv->ipc_handle, rsc, IMX_SC_C_DUAL_MODE, + lvds_opts->is_slave); + if (ret) { + dev_err(&phy->dev, "Failed to configure MODE8: %d\n", ret); + return ret; + } + + /* + * Choose an appropriate divider ratio to meet the requirement of + * PLL VCO frequency range. + * + * ----- 640MHz ~ 1500MHz ------------ --------------- + * | VCO | ----------------> | CO divider | -> | LVDS data rate| + * ----- FVCO ------------ --------------- + * 1/2/4/8 div 7 * differential_clk_rate + */ + data_rate = 7 * lvds_opts->differential_clk_rate; + for (co = 1; co <= 8; co *= 2) { + fvco = data_rate * co; + + if (fvco >= MIN_VCO_FREQ) + break; + } + + if (fvco < MIN_VCO_FREQ || fvco > MAX_VCO_FREQ) { + dev_err(&phy->dev, "VCO frequency %lu is out of range\n", fvco); + return -ERANGE; + } + + /* + * CO is configurable, while CN and CM are not, + * as fixed ratios 1 and 7 are applied respectively. + */ + phy_write(phy, __ffs(co), DPHY_CO); + + /* set reference clock rate */ + clk_set_rate(priv->phy_ref_clk, lvds_opts->differential_clk_rate); + + return ret; +} + +static int mixel_dphy_configure(struct phy *phy, union phy_configure_opts *opts) +{ + if (phy->attrs.mode == PHY_MODE_MIPI_DPHY) + return mixel_dphy_configure_mipi_dphy(phy, opts); + else if (phy->attrs.mode == PHY_MODE_LVDS) + return mixel_dphy_configure_lvds_phy(phy, opts); + + dev_err(&phy->dev, + "Failed to configure PHY with invalid PHY mode: %d\n", + phy->attrs.mode); + return -EINVAL; +} + +static int +mixel_dphy_validate_lvds_phy(struct phy *phy, union phy_configure_opts *opts) +{ + struct phy_configure_opts_lvds *lvds_cfg = &opts->lvds; + + if (lvds_cfg->bits_per_lane_and_dclk_cycle != 7) { + dev_err(&phy->dev, "Invalid bits per LVDS data lane: %u\n", + lvds_cfg->bits_per_lane_and_dclk_cycle); + return -EINVAL; + } + + if (lvds_cfg->lanes != 4) { + dev_err(&phy->dev, "Invalid LVDS data lanes: %u\n", + lvds_cfg->lanes); + return -EINVAL; + } + + if (lvds_cfg->differential_clk_rate < MIN_LVDS_REFCLK_FREQ || + lvds_cfg->differential_clk_rate > MAX_LVDS_REFCLK_FREQ) { + dev_err(&phy->dev, + "Invalid LVDS differential clock rate: %lu\n", + lvds_cfg->differential_clk_rate); + return -EINVAL; + } + + return 0; +} + static int mixel_dphy_validate(struct phy *phy, enum phy_mode mode, int submode, union phy_configure_opts *opts) { - struct mixel_dphy_cfg cfg = { 0 }; + if (mode == PHY_MODE_MIPI_DPHY) { + struct mixel_dphy_cfg mipi_dphy_cfg = { 0 }; - if (mode != PHY_MODE_MIPI_DPHY) - return -EINVAL; + return mixel_dphy_config_from_opts(phy, &opts->mipi_dphy, + &mipi_dphy_cfg); + } else if (mode == PHY_MODE_LVDS) { + return mixel_dphy_validate_lvds_phy(phy, opts); + } - return mixel_dphy_config_from_opts(phy, &opts->mipi_dphy, &cfg); + dev_err(&phy->dev, + "Failed to validate PHY with invalid PHY mode: %d\n", mode); + return -EINVAL; } static int mixel_dphy_init(struct phy *phy) @@ -373,27 +510,75 @@ static int mixel_dphy_exit(struct phy *phy) return 0; } -static int mixel_dphy_power_on(struct phy *phy) +static int mixel_dphy_power_on_mipi_dphy(struct phy *phy) { struct mixel_dphy_priv *priv = phy_get_drvdata(phy); u32 locked; int ret; - ret = clk_prepare_enable(priv->phy_ref_clk); - if (ret < 0) - return ret; - phy_write(phy, PWR_ON, DPHY_PD_PLL); ret = regmap_read_poll_timeout(priv->regmap, DPHY_LOCK, locked, locked, PLL_LOCK_SLEEP, PLL_LOCK_TIMEOUT); if (ret < 0) { dev_err(&phy->dev, "Could not get DPHY lock (%d)!\n", ret); - goto clock_disable; + return ret; } phy_write(phy, PWR_ON, DPHY_PD_DPHY); return 0; +} + +static int mixel_dphy_power_on_lvds_phy(struct phy *phy) +{ + struct mixel_dphy_priv *priv = phy_get_drvdata(phy); + u32 locked; + int ret; + + regmap_update_bits(priv->lvds_regmap, PHY_CTRL, LVDS_EN, LVDS_EN); + + phy_write(phy, PWR_ON, DPHY_PD_DPHY); + phy_write(phy, PWR_ON, DPHY_PD_PLL); + + /* do not wait for slave LVDS PHY being locked */ + if (priv->is_slave) + return 0; + + ret = regmap_read_poll_timeout(priv->regmap, DPHY_LOCK, locked, + locked, PLL_LOCK_SLEEP, + PLL_LOCK_TIMEOUT); + if (ret < 0) { + dev_err(&phy->dev, "Could not get LVDS PHY lock (%d)!\n", ret); + return ret; + } + + return 0; +} + +static int mixel_dphy_power_on(struct phy *phy) +{ + struct mixel_dphy_priv *priv = phy_get_drvdata(phy); + int ret; + + ret = clk_prepare_enable(priv->phy_ref_clk); + if (ret < 0) + return ret; + + if (phy->attrs.mode == PHY_MODE_MIPI_DPHY) { + ret = mixel_dphy_power_on_mipi_dphy(phy); + } else if (phy->attrs.mode == PHY_MODE_LVDS) { + ret = mixel_dphy_power_on_lvds_phy(phy); + } else { + dev_err(&phy->dev, + "Failed to power on PHY with invalid PHY mode: %d\n", + phy->attrs.mode); + ret = -EINVAL; + } + + if (ret) + goto clock_disable; + + return 0; clock_disable: clk_disable_unprepare(priv->phy_ref_clk); return ret; @@ -406,16 +591,51 @@ static int mixel_dphy_power_off(struct phy *phy) phy_write(phy, PWR_OFF, DPHY_PD_PLL); phy_write(phy, PWR_OFF, DPHY_PD_DPHY); + if (phy->attrs.mode == PHY_MODE_LVDS) + regmap_update_bits(priv->lvds_regmap, PHY_CTRL, LVDS_EN, 0); + clk_disable_unprepare(priv->phy_ref_clk); return 0; } +static int mixel_dphy_set_mode(struct phy *phy, enum phy_mode mode, int submode) +{ + struct mixel_dphy_priv *priv = phy_get_drvdata(phy); + int ret; + + if (priv->devdata->is_combo && mode != PHY_MODE_LVDS) { + dev_err(&phy->dev, "Failed to set PHY mode for combo PHY\n"); + return -EINVAL; + } + + if (!priv->devdata->is_combo && mode != PHY_MODE_MIPI_DPHY) { + dev_err(&phy->dev, "Failed to set PHY mode to MIPI DPHY\n"); + return -EINVAL; + } + + if (priv->devdata->is_combo) { + u32 rsc = priv->id ? IMX_SC_R_MIPI_1 : IMX_SC_R_MIPI_0; + + ret = imx_sc_misc_set_control(priv->ipc_handle, + rsc, IMX_SC_C_MODE, + mode == PHY_MODE_LVDS); + if (ret) { + dev_err(&phy->dev, + "Failed to set PHY mode via SCU ipc: %d\n", ret); + return ret; + } + } + + return 0; +} + static const struct phy_ops mixel_dphy_phy_ops = { .init = mixel_dphy_init, .exit = mixel_dphy_exit, .power_on = mixel_dphy_power_on, .power_off = mixel_dphy_power_off, + .set_mode = mixel_dphy_set_mode, .configure = mixel_dphy_configure, .validate = mixel_dphy_validate, .owner = THIS_MODULE, @@ -424,6 +644,8 @@ static const struct phy_ops mixel_dphy_phy_ops = { static const struct of_device_id mixel_dphy_of_match[] = { { .compatible = "fsl,imx8mq-mipi-dphy", .data = &mixel_dphy_devdata[MIXEL_IMX8MQ] }, + { .compatible = "fsl,imx8qxp-mipi-dphy", + .data = &mixel_dphy_devdata[MIXEL_IMX8QXP] }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, mixel_dphy_of_match); @@ -436,6 +658,7 @@ static int mixel_dphy_probe(struct platform_device *pdev) struct mixel_dphy_priv *priv; struct phy *phy; void __iomem *base; + int ret; if (!np) return -ENODEV; @@ -467,6 +690,30 @@ static int mixel_dphy_probe(struct platform_device *pdev) dev_dbg(dev, "phy_ref clock rate: %lu\n", clk_get_rate(priv->phy_ref_clk)); + if (priv->devdata->is_combo) { + priv->lvds_regmap = + syscon_regmap_lookup_by_phandle(np, "fsl,syscon"); + if (IS_ERR(priv->lvds_regmap)) { + ret = PTR_ERR(priv->lvds_regmap); + dev_err_probe(dev, ret, "Failed to get LVDS regmap\n"); + return ret; + } + + priv->id = of_alias_get_id(np, "mipi_dphy"); + if (priv->id < 0) { + dev_err(dev, "Failed to get phy node alias id: %d\n", + priv->id); + return priv->id; + } + + ret = imx_scu_get_handle(&priv->ipc_handle); + if (ret) { + dev_err_probe(dev, ret, + "Failed to get SCU ipc handle\n"); + return ret; + } + } + dev_set_drvdata(dev, priv); phy = devm_phy_create(dev, np, &mixel_dphy_phy_ops);