From patchwork Wed Dec 9 06:24:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 11960589 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92E9FC4361B for ; Wed, 9 Dec 2020 06:34:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 43C0023B7D for ; Wed, 9 Dec 2020 06:34:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43C0023B7D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tBlSoKtGcZUGu6ZFjezkGqrFKIvZZWhS7vUuFJ9+IEw=; b=LMOQrrMzI/QUWjZxmWGuZnZUw GO2vMeB+5Tt1WyynuQH+JfTjinEtlHIubLqs2FSLARSAQdA4DrsBbMphg5cKSYSZO63mDegfscuxh /YOgWrDzG3tr6KKpdNitcssOleQaMK60I6VYtHMxeHEiRNAuX2b8JRQHMCOmgJJbIqArpzROUxUpe c/ffVVP3mgY581vMmIBdz5MpYw5nFjBZq/BLAVlOIThedXSwJugjiby0Jg9tvrp/x8YVqxnC2hTKC QlnuHXldT76hChmi3ngPLsVeJN7G2H1NhygLr8Tal4/0vMl8GSabx719ocG5n1efea2rMnx3goWv2 Ey96my+Hg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmt2B-0005Gh-HG; Wed, 09 Dec 2020 06:33:07 +0000 Received: from mail-db8eur05on2074.outbound.protection.outlook.com ([40.107.20.74] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmt28-0005Fq-AU for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 06:33:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XwQO1CKPzb7TuDFr6kt6z2WI7orcNRKOLxmQQ8aths1IxZDGkl2nkUDmXPMq6IelS0CobEDOEaydk4Ye2m8I/1YDxKU/IPdGiEqjhGoiJ5UW+J1DbZlvBpSr2y9BcAq5huzwLtQ4/D161LNZbEv4y7NeYde0U2dgFlgppspHkMoQUxegruKI11e832eSn9ir5ZGFWxFQO9XiXuIkxJZLfkUaPrPqvmx4prJPnDRIT4k9xfYPbaRn3g48DAGdpTO8cim927FgWNwhAtwX1E3Fly5awQmPP06rPzRI+T+almhIdXJg+Z5TX8D82fgJ/BmFzP94UqRuAKh3dOmxUWSPRw== 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=lG1zJgoDHOPeXa0tD82qWzRQ8c/TDnK/mnh4zsxzewo=; b=A5b7x6Hnjm43eXc7HI3oAg4zuX1umLhgKvlkV3w2fpXB5s2b5fEn6o5/8/GrHXutn3qPTIy7Q/hRJaKs3ZTtMjP5z2ZuMMTdFCUkwMjo8VviIE9nTSooGgctaFoafOJ2v1GZb8TmpHSE1t0c/bUJwxTRojy8hKdsRXZ3MDqLFHxfq6S8BbkuyU3J68IYXrAaG1rx/ntzeqh8Z34SkgS8fo8Y66GGXoz2gc1CVNtFnN7PujKwDJkfAdfwuLAc2jus2AYuaIjYe5XdT60i5xPOV1nyXT3NE1YFODXs+oPt6ArnKujewA95DmEqP/mDYdwxO1MZe5DbFVzmVNDcDX9eTA== 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=lG1zJgoDHOPeXa0tD82qWzRQ8c/TDnK/mnh4zsxzewo=; b=G8ysRQNhUPf5jZQD61MUEmiyW02ryZNOEodYL03KhKC4elQTLOmhw37y15+TvNHVTxR+H7ntJhyNdMgljmNqbckWnBmF5XdTh9GpHH6NUq7dOjT83MVA2Cdf1tk1JX8BDAJRovDZ+9VOti1/nSvQDvOTfX73/XYONcS8bkWUVpo= 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 VI1PR04MB6144.eurprd04.prod.outlook.com (2603:10a6:803:fd::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Wed, 9 Dec 2020 06:32:59 +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; Wed, 9 Dec 2020 06:32:59 +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 v2 1/5] drm/bridge: nwl-dsi: Set PHY mode in nwl_dsi_enable() Date: Wed, 9 Dec 2020 14:24:24 +0800 Message-Id: <1607495069-10946-2-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607495069-10946-1-git-send-email-victor.liu@nxp.com> References: <1607495069-10946-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR06CA0148.apcprd06.prod.outlook.com (2603:1096:1:1f::26) 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 SG2PR06CA0148.apcprd06.prod.outlook.com (2603:1096:1:1f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3654.12 via Frontend Transport; Wed, 9 Dec 2020 06:32:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 791e4ddb-fc67-4224-9422-08d89c0c457c X-MS-TrafficTypeDiagnostic: VI1PR04MB6144: 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: KZFgGssoxvMYJwGnrUmeYGO/HtvlTK6lZyMzcJKp+yD50ZyUXZ0ZydPZW3WDuhnuyjug/0Ej2fXxvINO0yhdb8m+rW3T1esraWtjpkU+nGnueaWizWTkU0+a+wrnAQMDpjkP0O9LUT9MR7b5nKx964/lGLv6RCZ5bVV7MqXgkoqMRapYkUrMBOYqhkxfZyAq9racUGmz9Hjw7z4sWvjt/mOGvMPlLSHoCU3azXUZ3VII/LYkeRcWA6aFKI8Hh8U7NHoRh7XmM3vVxpQU3smuv5ZiZhyyCpiee+HDS5eitecCBeFC6WLmCMTy1nBZlo+sRGDtpEcWiIrwLE3eJBLdaludY541ozSGG5Ni1kRLPNE4DOX2XqkNQL3iuqZJV/B9 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3983.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(136003)(376002)(2616005)(26005)(52116002)(5660300002)(186003)(16526019)(34490700003)(8936002)(8676002)(6486002)(6666004)(66476007)(2906002)(7416002)(956004)(36756003)(6512007)(508600001)(66946007)(4326008)(6506007)(86362001)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?a02TgasWUaEJONcTV5c8I24OJ3vjYa?= =?utf-8?q?NCUdinTD9A65RBmPO6qwUBkuZ+E/LM5/QFpBQo5Hz03SeQbjI0u5zlj7RgIqqQAGx?= =?utf-8?q?iOc4nRCz4v90QxXkL3UQnirVo54pTkGra+G6QCBYTjhZUdbpEtd9uUC8ixv7cY0rr?= =?utf-8?q?7UdIQWTMioK2M3Rj1gN6T8+4l93+MJ2+QOLRU2+RSKqkjaVOa20XF73Y1IW+DEXY5?= =?utf-8?q?XCTvVn+zQjkA9HOn6Vg82wqJzVToeG82hJom9n4OAymK93mmLaMZ+ebDdb2UG12h6?= =?utf-8?q?kR6sHpjieiWGItcFUCTcHzO9Alntuy26H+Sdazgfeuz6n63N3jnHLvNijTgvosVWz?= =?utf-8?q?EE8Kc70MN3quh6WQe2TDfw50Mj6R7xW3zgaZhsekXSxkyReUpXPz8P8n4avtShpMW?= =?utf-8?q?Alf597yzM3v+W1HEdPr74oXqM0P8gr1tHYrjJ5zfUczk3y696scAL/eysgw5tsmd3?= =?utf-8?q?I1Z+XWUjWGPKoXHmAzrMjtsIUo9p9laAK7/Lwe3Ct9iUrWZAedMUCn9plXxRsbVJr?= =?utf-8?q?ueUzTJ80bZcurG+phY/ZbYfS0r5A9r3CXy5lJKbMUGnsINfqIlGKsve97k94pDbyV?= =?utf-8?q?Pj2ZqH6+MNii7goKFjWdiCYsEAwVpClAa1gQAg9bZ11vEALlPRdm95fGlqScCkfdR?= =?utf-8?q?fWKUES6mLyZMy4CsXOu6Vt2EfdrwKNCN/aIjGkHv+EWFbmdezsmCL6s6I1HHc3/ub?= =?utf-8?q?urTJfjMHREnLGGv6//z3iVIof6/MbaR/XlKjp2ESxbqVhhNBJPzLHq2BjWV9dRz7d?= =?utf-8?q?rgY4AVgFZXZ4skSemTXG08K8hTxg4mnzTjZ7N1ERuU444K6jHuoCILDON5z1JDMSy?= =?utf-8?q?F4p/74g2SJk7QZxPZcxKhy2uUGJ1IKYC0SMSsJOM4WTKQIekYW2cJGLlYrWY0qsr/?= =?utf-8?q?r67tuHkdxqd3DQKWOrF2a11En78L/Hq/dX9HH2D2+l6f5wBQXvSvAeUQESHl+GmkR?= =?utf-8?q?ak9ts4ZA+9V6Pd5gaxC?= 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: 09 Dec 2020 06:32:59.0499 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 791e4ddb-fc67-4224-9422-08d89c0c457c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L8Rx8kTRN613DoWxiiy7aIadLWU+pf3rxCm3DD7sO0Kzrz3iVgM7zMuMqxGUU0/etJNZdsfzEY0QziJDnK2Qdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6144 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_013304_412368_A64FD413 X-CRM114-Status: GOOD ( 14.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, festevam@gmail.com, 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, daniel@ffwll.ch, robert.chiras@nxp.com, shawnguo@kernel.org, agx@sigxcpu.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 Wed Dec 9 06:24:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 11960591 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6228CC433FE for ; Wed, 9 Dec 2020 06:34:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 28CA623BCC for ; Wed, 9 Dec 2020 06:34:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28CA623BCC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WOmXIDuVc4gSyL+YwOunGuG+gQUzyjp5FJOGiQL2TCs=; b=KnsikojBPD0Uh3EGNQPQCFBlS F4uXNrDkgX6VzJ8+3D87IzbjjrhYrmhjB4MJH+NvX1kpcFHmJdySSnXPCHE9Is3uV67Fq3H+dQgka KsXE26+714k8IibIbTeRP4CrZmQDa+zhrAwKbwXOUs7iR93Z76170DajMGPcQ/O1lD/5qYUVMiDV9 iYKuIfBXC4DLOBZOueTV7CAjjocwrus8QDaEE9yg0wWHVhZk0WeX7XVHYWVSccxkmVb/hp1LFwr+g 5wNa8C5CoiVfqTGRAC1gS/SP3FiE+++V57v9YJ6Ii68gSyFbJms9+RK8Kl2RFZr+acsjwmc257Un0 d+NcBolBQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmt2H-0005IG-6h; Wed, 09 Dec 2020 06:33:13 +0000 Received: from mail-db8eur05on2045.outbound.protection.outlook.com ([40.107.20.45] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmt2F-0005HL-0R for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 06:33:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OJbfmTJfIa0tQ7ATW/04T6TNuG7M2g/KsoqYfJHbp0zSxVoTP712xxl7m/j5XOQUVSKvQqeXjuLtEe93/D9SbquCI4tudNthbOwdOXd47sooGrRrg8GqyN/xTFQur+w+gk1o1WseHSYqU59JqZFROipUayHaB7dJVJb79XOr2fUSdfv/RiyKX5PQR7OSjUzgCIrre9F+wSRepQGW/SYGEt9kuIt0vDhgEUcBFVcGr4WXCsfwHqBC6i7c9+lOuOyXfyghWhC5FIWp/RZ5cWlDXJFb5jnxd/Nz2dFM9oToFJMPg5pF8K7hBkQaGyCEU/FnDfK1vVXmKmVbTzHUL9v0yA== 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=SFvT59+r4gZfTsCQGwYdSt1yVz2qzP7N0XAR+GjRjjE=; b=mPpug9YHcYxMdoMRPZzG9p5Pb77oZHsVL6n2YJpy+AX2eKej7Yh3MwAoxSfF8pd9h6BbAOYg+/R3+qRe9JPZyc5dqfWLvfJZ1IWbCKs6JYi4oXo7aUKSCVgOHXrAEgCWi2YkU1JwMWFH3aJnOiMc9X3FNBiMICYmdD+lRZ8KsonwaxDyLecZ5BFf/ya+FE5KEWcXQgI94Zgna1m/Lug3tp88IY8ku9ESsOTCbpq3mJDKk5hg2pIT/FRyErNZa/3TR36Ehbn3p7imkO+fy+DIKOq8S3DI6/R+BsdYzksIQpg30eBl2gHMB7GsDNOCQwG7hBAhAz7BEnDAribxb1/rLQ== 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=SFvT59+r4gZfTsCQGwYdSt1yVz2qzP7N0XAR+GjRjjE=; b=UxjwARv8s+71rvHLTo4y4xN8hXSocrmpJN+xTfWIA40OoA+zfTZq22KASiKzU99xkXweA5zF/kCvrmikJCHP4L/+AGyC2jAeKMOEtoJWlxEgu60Ka0JSEDlkbbEVcq1Oj078FOZLFEd9Owgm4HjDdfsfWfALN4BfGTnF7w6/DxQ= 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 VI1PR04MB6144.eurprd04.prod.outlook.com (2603:10a6:803:fd::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Wed, 9 Dec 2020 06:33: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; Wed, 9 Dec 2020 06:33: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 v2 2/5] phy: Add LVDS configuration options Date: Wed, 9 Dec 2020 14:24:25 +0800 Message-Id: <1607495069-10946-3-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607495069-10946-1-git-send-email-victor.liu@nxp.com> References: <1607495069-10946-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR06CA0148.apcprd06.prod.outlook.com (2603:1096:1:1f::26) 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 SG2PR06CA0148.apcprd06.prod.outlook.com (2603:1096:1:1f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3654.12 via Frontend Transport; Wed, 9 Dec 2020 06:32:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5602feb3-d7f1-478e-3acf-08d89c0c49b1 X-MS-TrafficTypeDiagnostic: VI1PR04MB6144: 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: FQLLIto9KUBlOVou4DBi6VVgpDkg+JCsv/3TVlmnda1nbmSYlorNpMC3kwihQvzH0vSoSPzYOHLTU4cMZnMMozDx6FG2q8l3QeB4zs6QZyKgc2IduHOWuY5xNWPknD7HMo5Q/hl2mCQqazX+Kt//a58WnLQnJ0VhQ6u+Dq7vY0DmDbJqlTmIfClZu0BoOuaQTNZiwC8aJKIW/Ys4z6A7Yf5PU+OzOZpxIim7q9G9CXiaoOh1q5NWRXK5z0APvYQ0UraH3qe9lOpi7rH/pHXSHd9Fn+n3KscrE8XPZVa20yDTR0ybgTyTLXpEhSoHGuOTRXktPlwmUx2Uz42xUl2mjh9tSEbIs9r7F1YCznv74j9/yqXxcvDf50lAEldJjDzou1V0AsL5ZfMiz3xwF7N1ZndesB3OdEJ8L7+0WOIF83c= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3983.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(136003)(376002)(2616005)(26005)(52116002)(5660300002)(186003)(16526019)(34490700003)(8936002)(8676002)(6486002)(6666004)(66476007)(2906002)(69590400008)(7416002)(956004)(36756003)(6512007)(508600001)(66946007)(83380400001)(4326008)(6506007)(86362001)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: I7TdXgdPSJRCVffNPsgmxqvDD3WdgnqxdCqVodqZH6fEst8ub+7P8moolTG7rD6x7dLnjbZWoawv2Whj5qtq2n9or4BvrNkq45Xr5OGvjAuujeMc277hv0LFEqq60oskPjFIFThJmRz+VzxgjqP5jPCXjOZxaYXPAOnXOwFQ5Ilr0YtZyUX4Yd3F334pVUUV/A/LEZuHLcK2SOZW5Q8oX1kS8yr2sVjgJXg2TkzNamZpbyUsp0j6mbWHIw6Ypqjeoknkx8Q6Q2un0uYITqFNpdMYyTdoU7uJfWNLUhjaFLQHvDwxnTR0PQKZbnRjYltsWd/NWxyvrG/LUaiue3iPJzqm//zA5vw4k3dGOR5pwBZBuYiB3uNBb0U9PbUFPks1Dyhp5vv08znEihP+SJlwqeHdl235Y4iHTnWAhW5+9/N6RLrmAgzKjbjHCfAsKhFvfYaSIq/olCPQxMXjIWB19kbIM4wKu3azSPPHMscamn2B+257tvjVkwEFR/q+b5vqlgLf5MHYggoHvH+roKUWU33aoy4bIb4E9h4ca6p/CxjzWhkeGlWOfJVKrNSwS+ND2ii1y5hNkEOkdD/qVOtqbP+9wbbR4LJNHzoOD3C0O4mWOntvSR/xJVr6SEUz4Vv2D3ysupe5mwKOSEKzQxfjhZ3X8uU7m2aR40EeZ+l53+3Mob3I99K/1juq84uV1R55EUH1yN1CkEH2TNCi8y43f+0zj1E3OVIYeZOaqvoxf8LChvMssljbZQ8P1ocbzZ9xQW5/RO93O5i7aKVjNJ8OgsS71EQ8LipHsmADRMrkqRMOVSY7lj4ifMyeW/s8I3Ook/PfyExGkMLTnjJbgt1bZFhrYB/VKhM5ST/AIckrYhN8g3A/vKxu/Gw1a+4v2ueazSBtXMZ0g6aPwBfX6CMzGcdlEUzVnol3pCG2JNSY84L2ClGfVepw5YGbuhm7tSx0QijAOLRcncq7K5SqALvWHb41uihRWX7Z3fpf+toIdetoKFpfkDKegMlzoI2xLVJL 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: 09 Dec 2020 06:33:06.1888 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 5602feb3-d7f1-478e-3acf-08d89c0c49b1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i/rrSpsBp7V9UAgFOt9k7MNttI4602VH0p1BzSJC9rMhFkVGHpfA/ANmBz5phitGAJsu+oURiUjRiEmRntZDMw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6144 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_013311_064053_161444A8 X-CRM114-Status: GOOD ( 21.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, festevam@gmail.com, 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, daniel@ffwll.ch, robert.chiras@nxp.com, shawnguo@kernel.org, agx@sigxcpu.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 Wed Dec 9 06:24:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 11960593 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A708C4361B for ; Wed, 9 Dec 2020 06:34:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 B332C233A1 for ; Wed, 9 Dec 2020 06:34:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B332C233A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tL17OmX/0OFb6SLbCneilQ2Hz6iFzn8LPZE+VjCfDBg=; b=bYTKmspVIkFZarNzRvGW3z7Xp pLOhiBnBMEp3JYnqgC2grUGH1hAUNqwRiJw9drmfGN+uWnxfxb8hSFmY1sQ6obI3yp3rehO0B5HID /V7Si4B25L2MhZjcTcQoC668ID2riGS/CUV7bj14MLvrOVlWmsUjF40piIyTzspfvpsJMcd2jGUKP +YsAOYpf38cU0zDT5aMmcs9e92HhEmu5BoH4zwb/0xXeUSWXbRub/uY0aQHghme3Ui9mxHzLlBVI+ aLA+lnZ2sD1uSO+LeyyUttoZt06/awCKusosCRO36YeFsfyo0T3+Klf96pCopa0dMiSpbYgPTKVsJ XPpNZq5+Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmt2Q-0005LR-Gt; Wed, 09 Dec 2020 06:33:22 +0000 Received: from mail-db8eur05on2065.outbound.protection.outlook.com ([40.107.20.65] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmt2M-0005Jw-Ua for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 06:33:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bR2B5zcl5I+q8O5wQnu6Wdz/x8ROf6IY5YzHz88iDMPG8N19y6kf70lBR1Akl4oKJE1Rvc3OveJACd9dndIVWNExjXbwJ0z1QIDgV1/uk2GYXPS5Ect15EcoL2uuhsXVQI+kheNN+nJ98r32tqKD6peRK7um54MwBER+VtUsaWhvxIUN6xEHoOPqV6gT5oLRk0b0uk/InmWdCEM52NGahCahQLLg49M182tI+pE80med7i0P4oRK6xE0UdPydpu98QdWvQMx5ue3083gZ35Kb9x4OhSg0OlQBsenj6MofgotVIwNNRPXJyvox2UgKwxUs4i1efTjtzoC4Y/lOtETng== 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=UlVIqCF3ResnuFKj8jDnBInEWttMi/afewLrFoCzYy4=; b=D7FOnCQ8qjzcYs2Mc9k+xOeu5TZH+2VSEVIqNiOtq2tFome2DueVuEs5ySH5j+934bgYCr+70l6WpqYPCkuhzMYm68NFHU/PC1pkYTP3uAeOj1kuHt2e3OiNGPbLE0al4o3geDZ4lDWGL8TCP7Gyc3BLJ7EB8Dmcpis+auKTJIXX1IGcu3j+h2VvFp/APEF0Vd2AWgYTUQxPgbtF50m3xxse1bFL3Z2rL11A+Ra63Dolfl3O8XWmwk/KlwqexFffWe4Gd5vtRwtwUnoi1WWtFNVF+fzueMDqz2NNRVeK0oxOvZBLMn6+F1IFd+Lu1PPvbitI+3zDvDJSJ854yL+VLQ== 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=UlVIqCF3ResnuFKj8jDnBInEWttMi/afewLrFoCzYy4=; b=fEUQU7RQI+WArBmlZ/GNwvM0GZV/4wfiMMe4KYdyJKfL527lCGriBfz6JhFGDwWSYiGHR1dXwhVpQ7C49aJ89mPwp+yiB/Cq5gnrKKmDNQTgk4zpgebcb+TlkHE5ZQ/nKCquvuPHEwZ2Nb5CSxI6P0VJO/pqeSw/uFCzrKERvAs= 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 VI1PR04MB6144.eurprd04.prod.outlook.com (2603:10a6:803:fd::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Wed, 9 Dec 2020 06:33: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; Wed, 9 Dec 2020 06:33: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 v2 3/5] dt-bindings: phy: Convert mixel, mipi-dsi-phy to json-schema Date: Wed, 9 Dec 2020 14:24:26 +0800 Message-Id: <1607495069-10946-4-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607495069-10946-1-git-send-email-victor.liu@nxp.com> References: <1607495069-10946-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR06CA0148.apcprd06.prod.outlook.com (2603:1096:1:1f::26) 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 SG2PR06CA0148.apcprd06.prod.outlook.com (2603:1096:1:1f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3654.12 via Frontend Transport; Wed, 9 Dec 2020 06:33:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: aa97d772-ec87-404b-5f87-08d89c0c4da5 X-MS-TrafficTypeDiagnostic: VI1PR04MB6144: 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: ckiPI9h8cplZwygdNyDWwmzuNIvMKcthP3hxpFsxSW55Nd82vHYjDfk4fjmKpt+8BCyycF3D06cw77kkOCMvEAJLkYCLGTkhYtjBsHfmS3qhM4qaTaPWJ9LwUP/yxEWIhF5mhJVTYIChDpdAPPA6aaGDWvxYggplrGHcpVkzG3mAcqssY0VVtYqQhTy0QlLDJbvxlOlA7dhMog3FJvoW2yMfy6WRLC8D9Jjx67f87JFQVB1tpleLRTzA8K98D5gwR96wlaFuRkORQ0E06ERtCSDBuQYGVjTuSs7vo/Mvc/SAu+ON2D5nBv885lUiB4aJ+nuYMBF2nfZhEMjsWO4vS1ODuycHytwzhlVfb+PBJUmoC5gAjpZS6HQRQso9zd3i5KjvFIc8tWEDkKoY0p11naRv4yoAQFxAGEqOZFGBKt+TYog5Vsz5577CnYC53AttJEsSO8PCLsao5YDvfoywpQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3983.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(136003)(376002)(2616005)(26005)(52116002)(5660300002)(186003)(16526019)(34490700003)(8936002)(8676002)(6486002)(66574015)(6666004)(66476007)(2906002)(7416002)(956004)(36756003)(6512007)(508600001)(66946007)(83380400001)(4326008)(6506007)(86362001)(66556008)(966005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?whmjqMMFFZo+SJcaB+eBNEeyLyPJqW?= =?utf-8?q?CBvsp1BQ77IebZ66hh/vcEzk0NV2hSFJHuqvwnfjHr5R8/qSldbm66/+t414yi5si?= =?utf-8?q?eMp65t7O9+ENLQEQ9L0x9akdm5BkXRPoNGDdPNx84sgBEalYvniqp1E0QckFduo0E?= =?utf-8?q?q4DX+9zJsFnyNpURsmx9ffoOnk7J/zIYuLylgYSJELCF7fKA/OTNkvCE6IhRqpvl2?= =?utf-8?q?X1XjfySakVOtyofatdptUYPut9JWQySKj8/8/i0ILJn1/upRMFULpnLuUo3k3YNVA?= =?utf-8?q?QYzgOHYqeQIN1LuPprW1OqQThX9xZE0aQSBR25kcF2IdokITC6bUd0c9Jiv0zwQvr?= =?utf-8?q?JLpsN81qRPu3SncmFkgf3xF2kVQ3xarZNifmzWNYbVkM1Hy/kpX6UcAmEClDX9n6P?= =?utf-8?q?w0KIRXpSagtmpgNbeIPvwIlA+87rX6u7cOu7DHGQu48OBe6yN90RY/Xl1GjAfqVYZ?= =?utf-8?q?I19Kp3rgrVOlDGHSF4PUfTCrtNrDq248ZoW6E73OZbDsBbalBxh6IvwhLKLL2Phps?= =?utf-8?q?DjlU8rNfdCt+F+sulu17QHZZPQuVGdGfPpq+PU9dLbQDyA7gtvlcfj1ayrZ50Ed7+?= =?utf-8?q?H/XO7aTBGSfxnyHy57mzCxdYduBNA4lSTXQd8hgKWBCpjMZEQwLWQSXpdey5J/xc1?= =?utf-8?q?vc5JyWLXdCq3vGpie3klMHi//63AHCwQBNuAMTnqgVkSTQw48DGIbL+y2DhH20sDF?= =?utf-8?q?u4QixmRre9pKk4ELodtjV3jbj/OYkO0zVGGEDxM6Z15L9KFhexU9Civ/6F3jmXK3T?= =?utf-8?q?8ooNFIOADZt3IFTmi6ABwB+8hxZ77IngBOzEMEyj67XCWreHOvBK4O4MxR4sczgFh?= =?utf-8?q?/jBFPBZCUbe58DgKl6iCqLXgCEcRNlkVqN7S1A4WO5Oyq+w4SxrnqwLtDDmZO5TIV?= =?utf-8?q?It3bJ2/+u3QApGUNzrIeygbxfdPLvRJBPqOOgKwjI6Lxv6wCRdg/2XC/huPaUHhiy?= =?utf-8?q?yau+zzrLoCrqZZ/oSz8?= 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: 09 Dec 2020 06:33:12.7900 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: aa97d772-ec87-404b-5f87-08d89c0c4da5 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UgTEC7ApeNUlHaFBAwqMfGR+avdiS/zROMyKI7rsCKbxrC9VXlpeu7fxySebPeBBb3T4DFaLiaWwcCO4D4MM/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6144 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_013319_011149_5117AA7D X-CRM114-Status: GOOD ( 20.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, festevam@gmail.com, 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, daniel@ffwll.ch, robert.chiras@nxp.com, shawnguo@kernel.org, agx@sigxcpu.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- v1->v2: * Newly introduced in v2. (Guido) .../devicetree/bindings/phy/mixel,mipi-dsi-phy.txt | 29 --------- .../bindings/phy/mixel,mipi-dsi-phy.yaml | 73 ++++++++++++++++++++++ 2 files changed, 73 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..f869fd2 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/mixel,mipi-dsi-phy.yaml @@ -0,0 +1,73 @@ +# 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: + items: + - 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 Wed Dec 9 06:24:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 11960595 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C16FC1B0E3 for ; Wed, 9 Dec 2020 06:34:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 4BC99233A1 for ; Wed, 9 Dec 2020 06:34:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BC99233A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Eo3DpIV6w7bShdDjJEseASPhHjbXBKVZ8Az8PLmJfkA=; b=cXz4YZ0iv1OQ3FXA6bEWTL0pP Ld6Y7809CykH3Tslc2UHPzI3JAHwPPijmUmUXYxKicRrXuzxBzbrtEYgijXAD4ip4FJ00Tk+b1nRi pmn5dNuBbKiNAaR5ftPWyp0riN6ZmjajQxnScDaa1OBeJPIu9DLoEXYVdKTv20begkRPg2f4c8NSB OTkEoN/zT61LctL8muKgFlhj4K0/9B0dCBcUO2AvpF7X3sahPCjvHu1VBPl/0pcbE0JYmfKSb4/xW kD0aHMLIgwaP+WGv6O/VgiYb/k7HbqB/tSgINfQ2Fjad9MAAnC60nDCyJwB9nY4zeoxx4LZOgD1ZY wHlFzorQQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmt2Y-0005Oq-Kv; Wed, 09 Dec 2020 06:33:30 +0000 Received: from mail-db8eur05on2058.outbound.protection.outlook.com ([40.107.20.58] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmt2S-0005M6-Or for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 06:33:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MkfVZQzp53Hpp9zuMIFLiP2NE66oBgAHSMBSQH/zJjoIj/F601PxFY+LJ/oWvUB8We3me89Bpxjk2kExKO+FacoBsuO2qHK9xGrak0sBKPrFX+hpjqETWhZ5SUAL16mJFR6uc1aKNSEsQVq11Ra3PN9QKP+c/5yNFpGgm8U9CcegphqYttUg2Y+Y+rLpwWbgF/+/jWSzh6W34g6iAfCFX1YwPVPLmglJO5rjYa7CUNyzXYlAovLR3tOBY76r2f8cUivIUBYROUi/nxHkXrnEhLBT8MuiPsy7KM8STnRYxMnOoRgL4+JihFoVlB51V3gTv83OcN65gmw7Hjh8dnU0DA== 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=kEsZvVVMgoy/JmFSnfE3Xg6oPLliZDQ74ZOmZfzTvxk=; b=LrCGYA9tTVKhzWNCAmTMQjs5zEwBAfs9dnsYFK/yWdeYtMiezs9z7OXO199jm/mtrSCPwz6nNzoN4gyuXtzsJEVV7oP5/Lo2NjxTVcOfp1iUZQFGmVKRTvvBJ2GqoOtBb+o8h0VWMWyt8Nh8Wl1U1jMltJxQ1A1OSieXcszvsKCk6Ey5wrmrdFWupty70/VUPOCcTF5l+2VTw5lL3eK6xwqc0mWyrOk9CxeY2wILF6daPVFPFkQhvkzbQ0lPUHFMvtt2Nwg/hw8yi5XOHKTgHI+2iZ49TkRKhSrCJ1tbMWqOocfaac+prqGbpb5MmOHCb5G67R30hMHI6Vi5P1ejdg== 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=kEsZvVVMgoy/JmFSnfE3Xg6oPLliZDQ74ZOmZfzTvxk=; b=Ab3u5bMhQ0mQiX26qFJsIq6aUsW2/9qrSPdLaL7Z9/CY7n9C8KFXIFbeaTt9L5zX0cX0OBMMf9FVwW39DmNz5f6SZI08mFs9DylflWrQyxZyWNAiTv7g3t91diQNJUaTgiA+Gg1V7fUawLKGvSgjEiw+hrrMTRQfgH84Brm4smk= 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 VI1PR04MB6144.eurprd04.prod.outlook.com (2603:10a6:803:fd::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Wed, 9 Dec 2020 06:33:19 +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; Wed, 9 Dec 2020 06:33:19 +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 v2 4/5] dt-bindings: phy: mixel: mipi-dsi-phy: Add Mixel combo PHY support for i.MX8qxp Date: Wed, 9 Dec 2020 14:24:27 +0800 Message-Id: <1607495069-10946-5-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607495069-10946-1-git-send-email-victor.liu@nxp.com> References: <1607495069-10946-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR06CA0148.apcprd06.prod.outlook.com (2603:1096:1:1f::26) 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 SG2PR06CA0148.apcprd06.prod.outlook.com (2603:1096:1:1f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3654.12 via Frontend Transport; Wed, 9 Dec 2020 06:33:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d3f85ab4-6ac3-40a8-fb45-08d89c0c51bb X-MS-TrafficTypeDiagnostic: VI1PR04MB6144: 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: SJQkCpR6BwPOcU0zERKKTFSing0AcpEEFOTCp9azpwEnFTetInBT8e870CqLd/d0YhZZdBA4Jk3fC+gumAfF5rtm/o9aBkBXVzS5CfBwuaHFXseTx9Bzf2LeyK0x/OOsz1aQZokU89ZQo6/m6MpUt2IdmJvgrWqb1aaLDKbTulr+bhy0NM1r1YofEWeKgRhO7TYawUkGwSEiQ2aVOZukv+FJkkxq48/QxfT34ofn3QLY+d4vNRwMZRa+NamS3Ua+xahaTrbUI0v+p50PjFf+4Rp9MAa+tk1JVeNzozcrxqDblt+lfxmy7GNpqp3CollZNXeQPxCW9tS23dPzwj0bMnm1EKJNc50/6irNmB3qlixX6ySGOGN6ugxKCKkxGWnA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3983.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(136003)(376002)(2616005)(26005)(52116002)(5660300002)(186003)(16526019)(34490700003)(8936002)(8676002)(6486002)(6666004)(66476007)(2906002)(7416002)(956004)(36756003)(6512007)(508600001)(66946007)(83380400001)(4326008)(6506007)(86362001)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?DPvGS0T0mi5FY/KMDQ+rpSH2GnchaA?= =?utf-8?q?ZRY92AnYtRqu5QzhQXcMewRr/h8p1mLDhx4WQKOIKjxo66842o8wxaj6ip3zzZiK4?= =?utf-8?q?IvxEYwxfhfkmBwfPHVsKbZuZV9KSlg3h2vqmtB1fYQoY5xWhCqN0nJtKCC6zu8Tu4?= =?utf-8?q?GwuH+/66t33NizlFnrqhE/CpPacudR8MmQ5QhvN46zwLbNChUwQTN671LW3kYxDhq?= =?utf-8?q?QAnyKGfThVTiSNwZ3J6xPSLHinkLhUX1TEfXzR1z/FVzl1cZoE1QxGKlLw4mh+Fik?= =?utf-8?q?/6NHetsvgVMSfedwhKbnj9pMjZMqxDYj35rPogvYURMftoeg6eaFqY89LqIr/Ejd8?= =?utf-8?q?hvM6CGXqIaWhA/z+zW8BuvziYim+EujllcxO+5TXixb7egZWW3EIXXyhx/675ek/S?= =?utf-8?q?opdSZDX/l3iuCmvzTe0z6GW4yUFMkoIMjUneO9lBSmyDHR30lp+8M/ooZ3XFh7QGA?= =?utf-8?q?IO9cTkg1nNhKst1OX4zJiXkcVEM8LW3spz+SXVLnq913PVjlk9rNGIIrU9dPjftfl?= =?utf-8?q?md1/jtoNrOMM28hO+wjxrvGm2SS27SXwEqbpliXcjHHgGMYMXE08VUKJErNY0DqG+?= =?utf-8?q?BI0v+cEd0vvoim4W8g8dTJ+VuhGEVVFGsFzcgGlEU7Civw7hZeVHmDxhcyuusH63I?= =?utf-8?q?u9zmbe/9xrHwF9XRrHvYE8BsTkczxrvYWi7l2HQBpKXXxj00M2eBaPnt1sZsBEpPr?= =?utf-8?q?6w9jRNYn1rc2ncI85jUZ9SRkmRAOUfYjtdh8ktZoNSpas8Va70BwKa0L/n7sMYAyS?= =?utf-8?q?0TpzYyoGr45rjxKwugxYo4dR1kuVu8DA4GzAA2y6VNL7hlPsLw8joE6GZxkwX9Usw?= =?utf-8?q?PNzbBeDoou+ZNT0SiOGgAk7lQU9tNUMUG6MYNJmz/0dFHe3SZNwQVg+o7Wg95MTYQ?= =?utf-8?q?wB/eQ2vkXrBZ0z4Z+upzp+BYhHZTJp2LAGjnjyDXFKJbZ3MokW+akkk8D7xnSGsvB?= =?utf-8?q?Ogsxj++wixnoF8M5pnk?= 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: 09 Dec 2020 06:33:19.6590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: d3f85ab4-6ac3-40a8-fb45-08d89c0c51bb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DyZh6JqqErHrG4AXHDkvP/CpdjHEUaVkkFOasUMFfjsid52a4GJZ+S0u+D+GTI2bscQsnfx4+PGzlMWmXENG8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6144 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_013324_874603_DCBCCD68 X-CRM114-Status: GOOD ( 13.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, festevam@gmail.com, 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, daniel@ffwll.ch, robert.chiras@nxp.com, shawnguo@kernel.org, agx@sigxcpu.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 f869fd2..07b9849 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 @@ -41,6 +45,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 @@ -49,12 +58,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 Wed Dec 9 06:24:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 11960597 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.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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=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 6D6E9C4361B for ; Wed, 9 Dec 2020 06:34:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 23BD723B7D for ; Wed, 9 Dec 2020 06:34:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23BD723B7D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=l/vKDyqqgy3SyBE2GpV/o3VHbtyjMgNysrsNk7Zft7c=; b=HOUKZkjopQ38OS+Able0+4+vA GnwdaLBTyPC3RZilXGw5+meZT3oC94L1NFJc8SuLFR0P4gV8Xv6XB0icjcuHybsgdty62p9WrPkEK bXHMV8mn6oVu8NgbO6VqjuQYicF98fiTA6Z6qV22xqtnjMeUQXbrhK6rIpE/20yZwS/nX8MmqfPSq +M+EUvKyeckNPQfdCkcHlRt70yE92OkgI4AP/Sh6ExFh3TrCc+Z29Z8gEprHQRPPq/X6aI8NPcQ1N IjYK9w1KX6hGdLxpDNqCtdNp3zKe5mKv+oFnfNElUU5DyPnRx1z50cxaUgVK1h5VbC6XvMsQ/iS5Q 2u86KJymw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmt2g-0005Sa-IT; Wed, 09 Dec 2020 06:33:38 +0000 Received: from mail-db8eur05on2047.outbound.protection.outlook.com ([40.107.20.47] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmt2Z-0005PQ-Pb for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 06:33:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nyTK2JgN9YDx9ELPzDZArh5rYxvzg3h6vM2mq8q6UNihY8fNMJawLy9UesT3Ex23zbyV801qiYvBRQ+9Vm6A488F2P4/3nOlDT8+RxTN/kxL/H9PFy/pn791MJ657djvBBX2tXKdqSFEj5NwB51hRTDxaJMYiEzds6iMl9tgFHu1oS5r1gDystMRp7H1eq5T5d8H4fck/uPvQFyIIXEGjd70s5RHoVk7p7GLC3mmthvEmka5PQ11q2S3tkg2lDSEQDxnmbZZXFTx5wTBT3Q1F4plF1BvSwOYvcp+b3TQcLQ9O7/9iFCUo4ljSrseA/aAuNtDIlPTPuGWO2yKE4jV1w== 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=069niK7Af9dM4jz4/pu6lxXowc5x5ckLr2AYz1Ks/Ww=; b=NMwDe3rVBU4V66vdSbFf36YzRI0rNmx41QxNBQQb2x9xDO9q+Y1u6cOM5a+J1TGXMfMnf0jHzf+mdh4KgtlR9ME0CGRsAiuwfRw1yDJukb5H5ZbxuS/UUkdaRmenGADSFKnufD31RL8fFC6gtY0oEzmnAUsJNGWTgxzvAITHdQK1bOHPouj1cPGBFL4DPSmSVuRBGgTSdJCbYgSLK5O1JZcb7SJxErQdKStCAL2UConyURYlP3NvpIHF5zD15WtdldCyU2r7H2dmG2nbs9qEqfjjqISc2SsWcGAae5F+wFlJ69fzhbUqug5l7Bykj9jSR+dKDjOtm1wmMfgGbuS4kw== 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=069niK7Af9dM4jz4/pu6lxXowc5x5ckLr2AYz1Ks/Ww=; b=hyMVkFjojRfN+yNKuv5ntR/MdMr823H8P79jgHUApFaNf7AFg1RkySXlbYcdRsM+/RjJAE0WPHhaLYCl+CwDXkVimpRJODhoUDrHLj/jRTZmTuIfzvhjRn0Fi57967uS1iygyxbFsVyph4qo4swD+1ziunJcTQmfJBECB/0f0yk= 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 VI1PR04MB6144.eurprd04.prod.outlook.com (2603:10a6:803:fd::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Wed, 9 Dec 2020 06:33:27 +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; Wed, 9 Dec 2020 06:33:27 +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 v2 5/5] phy: freescale: phy-fsl-imx8-mipi-dphy: Add i.MX8qxp LVDS PHY mode support Date: Wed, 9 Dec 2020 14:24:28 +0800 Message-Id: <1607495069-10946-6-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607495069-10946-1-git-send-email-victor.liu@nxp.com> References: <1607495069-10946-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR06CA0148.apcprd06.prod.outlook.com (2603:1096:1:1f::26) 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 SG2PR06CA0148.apcprd06.prod.outlook.com (2603:1096:1:1f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3654.12 via Frontend Transport; Wed, 9 Dec 2020 06:33:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7dab6835-4c1b-412e-0c2e-08d89c0c5610 X-MS-TrafficTypeDiagnostic: VI1PR04MB6144: 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: nj2dPBXw0Zj2ZwNORJT6YbwwF29vc/o1zmXFOeVOe3ZdikZPlRi5G7MgQAqg46AbK81oEf8hDCu95JES1DlDo4h7RtKgJQQ/TcdBxieZv1sQFBsUKpA6GN1SPPGsPjUM9OWn+K/MNuTt8ySnq1MPfi+mtPPWjJh+QD/Y/2XHiWXLo308wZZHTiW5TmzDby3kNidbCqSDyd0+2y99zeUhfG/0QyHSxcqv2Vgh14uyN++sDjgKsNZVdhsy2AV2iZ4VCcDVaZoJBXwKdJtItppDbz6MaPqbUpLnKva9LbSA+Ey3UdK/jSJVTwHgbbP/JWWmTOXgWRmHd+7tr5x8SplNtXRcGgoHag5Ur5DGwXqNgP0lsxL4BlF5qiCClfaWbKyI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3983.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(136003)(376002)(2616005)(26005)(52116002)(5660300002)(186003)(16526019)(34490700003)(8936002)(8676002)(6486002)(66574015)(66476007)(2906002)(7416002)(956004)(36756003)(6512007)(508600001)(66946007)(83380400001)(4326008)(6506007)(86362001)(66556008)(30864003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?k6FwxIR+lSQ0lrytES9NrK/ym2TI7y?= =?utf-8?q?rRNtXtfqJZEk6KI3NOE+7nPQtDUpE7uy0n84i75uG1EQXs3l4Fvh4v4krBBD6K+dh?= =?utf-8?q?5JYFLrnh2IU1LQUsKWTTCnOpUG9p4T7kIhbX7wUF5aJElx0zhYRWckwpwBkKHP5IJ?= =?utf-8?q?//GXG02Xwn+jF1grMosMEwxVsS/qGBdp7y/asTxyf9dU+nc/jCJCDv2hpwVYZ0Q8C?= =?utf-8?q?1NYJu4Zqs3Wl+JCs9XtXwnYlvlRAKY636fSOpiRajUgyK+Utuh15Cxt++arASqx9G?= =?utf-8?q?zCd/BYvQwCG92AFVKlBZz2BWp4OB5muY2s+3gto8GyA/48q1LaLJRpVqYMdqAtCVJ?= =?utf-8?q?sJ8E3CYnXSg2WIeqf3/62M51NMT8JSQCdnY16OXGMPmSXKwT7GZf23krar6ix0TUp?= =?utf-8?q?vttbSU1oQCRSpjqJrZHI60Ug4vLKV+pIL8R1Cg4Zf7JOs4GArrOE7/JlSwQoK/1pv?= =?utf-8?q?MR9uHnk1QJWzx+LbO/Jd1o7bcnvk1jEwQ6N3oQfgpCZWPgi7X4Esi046rCvtNVQcj?= =?utf-8?q?BnnYPY72bh9hzWilNaD62Sc/qwNODYTDaK5wRIHxnXg82LKjr7PU5AzoeQZFdhh/A?= =?utf-8?q?hpXjMR5ujsSC1J60xBvr7ZS/KJjwou43Rb5TrRG64qJPbNkL1xgxTO73prdmXk6+X?= =?utf-8?q?+rhQPiugmlUIBvqt0uqhNOVQ2vBaxsnIm1+EiC+ovQtsNpByOa/4yRPKC2M+5VRpN?= =?utf-8?q?llfmVS/iUgtCLYxdQJcM/HtVszbZmWVNuJfKhTjgevA5Ef0Ibvmo7yWJSHSBt/GHE?= =?utf-8?q?/FyGU22X2AXwcaL168G/UF4w5nZHMKo33R1TSoQEO0cK7hIL/8j6sKTAo8YJ02dxG?= =?utf-8?q?UF17oasGApWxVY7GJKBAgFUF9YqHeMVnQukBo7RPoGOVq08Pn+xVVKUSM/7bp7P2w?= =?utf-8?q?T1N73GQa7HmgDS4I9K86NKQGAPfcNzBF1hRKkEYh/VX8JECyjKBrpQ5ZrqVF1O3Sz?= =?utf-8?q?hIpNIRtn6SAHx9NQ/Qg?= 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: 09 Dec 2020 06:33:26.8888 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 7dab6835-4c1b-412e-0c2e-08d89c0c5610 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: t0h6sMTd3Zk0wCaOES2NJ2KSautYcBLhD8KlWCQYSVKJMZCH1ApE85XsoWZrXRrKzpZB6pVfgmehnIKcQ7xziw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6144 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_013332_145807_D17E0888 X-CRM114-Status: GOOD ( 27.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, festevam@gmail.com, 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, daniel@ffwll.ch, robert.chiras@nxp.com, shawnguo@kernel.org, agx@sigxcpu.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- Guido, I also print invalid PHY mode from mixel_dphy_configure(). v1->v2: * Print invalid PHY mode in dmesg. (Guido) drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c | 270 ++++++++++++++++++++++++- 1 file changed, 259 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..25c97ad 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,52 @@ 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; + + /* Currently, MIPI DPHY mode only, if it's not a combo PHY. */ + 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 && mode != PHY_MODE_LVDS) { + dev_err(&phy->dev, "Failed to set PHY mode for combo PHY\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 +645,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 +659,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 +691,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);