From patchwork Tue Apr 19 01:08:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12817186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3EE6DC433EF for ; Tue, 19 Apr 2022 01:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1nxk237xHoTBuCZACa/ms2bRP/ALGzaXnf5bOS954+0=; b=xFgdF1oiJbmzJu DGhFaeKb/E6fNgN8L2V3RJIfFl55ULBwZUbdEh7+N3Vr7FnZPgoNgeczRotawGupP0A2elGqMVxS1 fDCNyOhFZvD3INSci5V0b8GCq7bLJn8CE+0PzGhbnXD/KO6kSu2+5QhuPWAslFXqmqs7gibLJYQco soW7/eQ1PNPzaKlPFnlhyR+EAhMPdbYC8YN4tr1Ti4EwDacTHdXqzZcSiNZF0ytQgOyjClN8CoAzf sjIDWk9NGUWybSxrdrf2F9kV1241/4fAkJJwVwDc8ePVChP5QDB4DLwKWSeODffVG74vg6mJpGDMm feZPHII3EvSpTnNg2iiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngcL4-0010Uj-LP; Tue, 19 Apr 2022 01:07:30 +0000 Received: from mail-vi1eur05on20620.outbound.protection.outlook.com ([2a01:111:f400:7d00::620] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngcKu-0010Pj-4L; Tue, 19 Apr 2022 01:07:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oQPxRp8iZzxMUzdZg6YDW7f0Nbp63RgVrWFHv7RZTMK2QMTER2eoHy4tdpTSiIBb9pEvmnvckTc6pJIpsljayrLEWO7l4D6Rz+ibiGxNFpAcsEm8RVPRrEs+z6hq/5NPc3CvadsnweglIQ+aK6ZANCPUB1ERQna1fiJL7cRXxXEgzv1hkUeGO5y9VvwYdn7BZPPjl0gnblCTKAth6xkeWVU/jAICdaxHMW8NP+jlMunSoH7pgryZRgoQ0RgvsCMtCA7FWfWC89TZy111PNxB0GSQG7giml97JToohc6mzaWIUt3grnFN/TapXGxDqlvQZ/gQN2hqARM67qacCdAOUA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oslkYcgQ48zUnKLesDh+7ZOPuZ0okPDV5oPLB5C+n30=; b=Dhg5xAWoTgq0yl3T6ffQEy2RuGYtvASonwr8m0GPZiECASxxe+1oJMGSioSA+I3QXbqfLr6j/333kf7Ph0YLUjp9Q0c7pNyokv6G2i8Oy8N2qIHr1ZYcDNEE3nj0BLCQgReso3fUeoiAW41whszNizwGJLGO9QtOCC0CxEnVbZ78XyypEdf5Dnt+FPxh+niGRqJSRfzznqNjNz9cMlOsoarO6fT3H8u6Dm1wGyYfkQWp2CBDQITpzCndrqpu8Bo8/g4ixmA0paE4OSn5SP8lmfphnisgbT5C5vuv+xmNRKMljekMkylRiwGOvSAk0IdmfoTmEs5F96mpJ1zK5OYNyg== 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=oslkYcgQ48zUnKLesDh+7ZOPuZ0okPDV5oPLB5C+n30=; b=kOGoCGQ0ihKK169HgyeuWeODWSeLSUXnSwxpe3eAHVmTqYZgr7kFZOHPQlfYGGwU1VCiDMuCNNCUKdm3e5zq3ZY8HpvnRpmANbayPlPr+xZ6KSfSUwWznFANJrpbJRuvwkgrJNcIIFQMdd0VFXzJMLDsGFUCo71rQOmgyhTmDYk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by HE1PR04MB3291.eurprd04.prod.outlook.com (2603:10a6:7:18::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Tue, 19 Apr 2022 01:07:17 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387%9]) with mapi id 15.20.5164.026; Tue, 19 Apr 2022 01:07:16 +0000 From: Liu Ying To: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Cc: kishon@ti.com, vkoul@kernel.org, robh+dt@kernel.org, krzk+dt@kernel.org, andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, agx@sigxcpu.org, robert.chiras@nxp.com, martin.kepplinger@puri.sm Subject: [PATCH resend v8 1/5] drm/bridge: nwl-dsi: Set PHY mode in nwl_dsi_mode_set() Date: Tue, 19 Apr 2022 09:08:48 +0800 Message-Id: <20220419010852.452169-2-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220419010852.452169-1-victor.liu@nxp.com> References: <20220419010852.452169-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0023.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::6) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8bf39387-859e-435b-acf7-08da21a0f21a X-MS-TrafficTypeDiagnostic: HE1PR04MB3291:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nL/pFJA02ZzuemXlJL3P1PATUtkJ5u/Lf4RIBp49gjaJK5t7us6zygQe56W2GUIqDJwBlk9bKc4XdqxQXdtYTsgtTScHdavchI47QBZY6LKOhyfPlKiBLupq/URltnYi7buWQ5G9oDDoZJHggB/5IxMBwPPijc4rvfPMzYZghpjuHWs7GeJGiFRNwMcEOmb4JGv2Zw3E/eUlPkclWLDPfVebO/5JmF7hTuiHGkm1g/e0vbhhPfjcbzlrMLzCMo/g+eIVBEd+du2au9TAzK62uuoE89EmeSTxPYpwFCOHhtLrsnipRBnoq+O9NsyfKqlvMrXcuXlkqkond/O7pKEdQkBwei02h72ydCGkWB8KGuKXZUwrCtiLI/+0V6qLGq6KuDxoAHBiGqzVvQ3YXsE6CgNxME3N91mq/xD4vadB9VsMCejbDPqM2+E40uYEgaBuHuuM3Bq5siFvgXUPYRKROta+VjE8gYgJ6yFRAW3Sz/2NiVzfJu92mRQnBH8ndatG4dLx7PoxxQ/8HgE04Xr55a4blRoxRYP8eT9YWXRKCMcdHLDhhBBLqgDsgCY8gnRJtxPiFmvDfduIvRbqSLYL3fFubNDmdWbb8pKkfTjWeZpmsyw9Bei1331AkkWkzAcjCCx6sjc140B164N59OUgu6GX5rfs9jHASAU3cIM5qHoCX7blo38gUMPfbf105ennBGzFAc+Pj3nImUC3tm4qZQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7046.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(66946007)(508600001)(8676002)(4326008)(86362001)(6486002)(36756003)(52116002)(6512007)(6506007)(6666004)(316002)(66556008)(66476007)(2906002)(26005)(186003)(83380400001)(2616005)(1076003)(5660300002)(7416002)(8936002)(38100700002)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?QWNBCNeQa29nIrbxGoJe2IruV3jr?= =?utf-8?q?K9nhksu6wH4QiG2+fgE18YZzMOCWX9oPLI5rBuPegTJpTphD7WMYtbk1hp0YQgUph?= =?utf-8?q?1m6Bzz2u4PgmTqZN71kMCgrkLbOxBCT2UFGO2nxUVkICDpHc+yKyzIlgBU9hdyIq5?= =?utf-8?q?YpZ2a4N91xWiFwybgIFBt3gZcTwTdZFOJH9MqE1hcN/zCyZsoJGUXtNVc/QVI7/+P?= =?utf-8?q?RhP5P3mnBsJ4VkKJS2xKF9Uehbj6ireLR6WaUdVjCZxd32aB45Br+0YzW02fZ3bWE?= =?utf-8?q?0+rVJT53VCjB6mVyZ/4049x6T5w1EhWKTPpWoKrOSn328RjTTAAaR4pYcv3U4YH6i?= =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M3FXGv+FZ4RZhWBpgUvR45bEErGnLpPLkZtcGQqFSKEiUwalRaOLwHg?= =?utf-8?q?cQWLLugCclqIjgDIDUOv1cXT0dBKL6ijYUOUEtjS//mDDzTSMNR5wth4qp1U9tl2d?= =?utf-8?q?0uTME0aRywnEAKR8PqkfGeCpsINIu/Ug1h+fTCQpvM9XpdiH+ERQlvwRoEyMSR2Ek?= =?utf-8?q?8eTitBAgZf5yqMGTAM1h+dYqI7FvOnVrXVfROmLp347Qpd400UgpZ2dgK2E5MUyid?= =?utf-8?q?djZZ1cTrtfh5NnC3kqFWsY2EOCV7oo6++At3YZwl+EbZBedJGRwgtAasRro/gLb/B?= =?utf-8?q?VQPiWO3RSgJA2/b74Cju001/IUq7r27MNw3LzvNevSmK/g5OMeutRE7XfdLXm4uSO?= =?utf-8?q?PrvSlQixL4lwiJfEklYAFRm9J/k7gpri4aM4OjmXZUQqET0VCbwY5y0fxapKevUFI?= =?utf-8?q?Zr+DpBSWbVdkqEC7jzv2JTj3K5rSL0qw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8bf39387-859e-435b-acf7-08da21a0f21a X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2022 01:07:16.8227 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HLRPclahNG4QUxk7/OJ9RbHl+rWD3isTjXQ8yDJ2+o5cC1Kc+myJyHxpzVp5UWRO9R9hJY7JNN9Zlipv8Fu31A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3291 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_180720_214060_FA87544F X-CRM114-Status: GOOD ( 11.83 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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_mode_set() 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 Signed-off-by: Liu Ying Acked-by: Robert Foss Reviewed-by: Guido Günther --- v7->v8: * Resend with Andrzej's and Jernej's mail addressed updated. v6->v7: * No change. v5->v6: * Rebase the series upon v5.17-rc1. * Set PHY mode in ->mode_set() instead of ->pre_enable() in the nwl-dsi bridge driver due to the rebase. * Drop Guido's R-b tag due to the rebase. v4->v5: * No change. v3->v4: * No change. 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 d5945501a5ee..85bab7372af1 100644 --- a/drivers/gpu/drm/bridge/nwl-dsi.c +++ b/drivers/gpu/drm/bridge/nwl-dsi.c @@ -666,6 +666,12 @@ static int nwl_dsi_mode_set(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 Tue Apr 19 01:08:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12817187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6795EC433EF for ; Tue, 19 Apr 2022 01:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=h10pThUKnWa6y5jGwHeDhfFrIuMlVx0mtivX9DeqL3k=; b=riYAeL7yUkqamJ 2bzIOe9eWqz2bK7vK0ts4rKYuNVkqCcbt+1BCi7bRDjJuQ2GgvTXYN/gjnc27cZrQjjYt0gkNv21L Tuowqw5EbXDRLBPeT5VBbczuhshFml5KkOurlGeuTT8OWKbsPNCg2iMFYFtlmu7ybS9pMAujCR0Vw HTgSIKveeUAgRWKg7ZKXaKVikNy4cMycsBL0wrT2T+IWvM8tmEVdKt0MiKtgAx7w9z/MduLkXdPZl q/5jYzVJxYUj2dkgVc85JJiKGfZAPYpnURZyP6T7ugfoXPf1iHw5qDaLgM5ZHr/+fMW/l1RbftFfg bfhrL7kpby9wBkgqzTAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngcLF-0010a6-R0; Tue, 19 Apr 2022 01:07:41 +0000 Received: from mail-am6eur05on20610.outbound.protection.outlook.com ([2a01:111:f400:7e1b::610] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngcL1-0010T2-RP; Tue, 19 Apr 2022 01:07:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N+HCX+u4AxWM9SdQEN7TPGMZvsvs3EzV6IIMdw/f6ISA08cJ/y89+fX/1k18Q9QJGXTWwG9AJAcfg16fcK7Fcy9Zwss08xI3G/D0dpi0UFSr6Z7QVV947VRHn3YowOOOJdl22W+VWFssjtVEX7vKmqjpjVdvBSZl+v72xAefcJ5qC9YfSbGcrnaOG54OuCR00z9cd5bJ5PKSWSaCr5LiqU62puHgC274/3gjX+0OQrvjjBafliHth4LBxlYNvq8ZN2EOJ8Mn+E42V2TzWcW7sgGCsc1a7fcmNCVtjrTCTD2NblaykHH5Unlrin0m8CS6iURvhshPHXLsKwQeaqwzyg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zikVNYi3cS+FrIsX3tOfjPXYjapqrG9gbDqBXBxuQPQ=; b=eD6iU9wHDlJS8W6q+lagTNRVg+TkPcajCKPWrshoaab1b5XUaLUoGviWa3V2nFDH6wIHwM5XNizIGAlqxwpnFCAepVZBgcK5fnC4+DK4jJMfHW+PsDaGuqM6YfXxT0ChhjJ8C2vn+4rKIeP5ewLNZYtKEyB8jBpM9dsIjToEk0C7UjFm89BdAzutyNcxa060NAXFaU03ET9kmZrRO0cchKOGRFFHnxsw8YxjvYgS2seZ899oh9Nscpk+E5k+Voi2b7ot48vV0Jz7HqS4srO2+OHncZvFms9PTOffXlAnkuux9lJVhnrgMyefL6BHE2yUaZPJxEr0glGidBdqVBrFaw== 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=zikVNYi3cS+FrIsX3tOfjPXYjapqrG9gbDqBXBxuQPQ=; b=AOhFs3fFlRFlIu14lBGBqyi7ChPAZG9hQPsd6N0g3ydteIWhyjjY1umVCTBOE+7IJIAXIGbYIy5H/JFOIy1vYzpxD0OFrIPH6sAWvHXh6fqaWQplwrhiuXvzoTeqn6JmeRX2izfOe3N3qvksY8t8RzLqZGTcobmQGtYXnoDyZTM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by HE1PR04MB3291.eurprd04.prod.outlook.com (2603:10a6:7:18::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Tue, 19 Apr 2022 01:07:23 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387%9]) with mapi id 15.20.5164.026; Tue, 19 Apr 2022 01:07:23 +0000 From: Liu Ying To: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Cc: kishon@ti.com, vkoul@kernel.org, robh+dt@kernel.org, krzk+dt@kernel.org, andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, agx@sigxcpu.org, robert.chiras@nxp.com, martin.kepplinger@puri.sm Subject: [PATCH resend v8 2/5] phy: Add LVDS configuration options Date: Tue, 19 Apr 2022 09:08:49 +0800 Message-Id: <20220419010852.452169-3-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220419010852.452169-1-victor.liu@nxp.com> References: <20220419010852.452169-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0023.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::6) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 382e2425-80bd-482b-d915-08da21a0f61a X-MS-TrafficTypeDiagnostic: HE1PR04MB3291:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /rEIucyih/0UqZg3TZ/BE1bbJBtFS9/bJOT80Nm/IgAbns5mKHTaYr4s70vLnuaG+akElLKx0xtJtW0Y9d8sltGanikNK9w561QuekUExjBglbLeha7CKq3QKqngW/BzLFewJo1+XmP+jzBiuHy7aaOOCB5LOez9v/u4ftAfmCCzve2liWBcarf5TBM6C4/n5AMAYv7y/cWUnOACxi4xnU4pEP5C7y19k7qz35MYM/KRivcIUDc4/ztC9q2uWzw6w1h2ZC1UxriY8p8V63oLHe5UF57renTviVLdfkiOZ+3+nzNLCBhaWa1RYwYCP++EvkOf8XO7EAHCh0QxsqNNllIvSVaURezg8xAiuWfATgZaqKwhuYcFxvpq7BeN2mwHOvu17RUy1dfCKcahvwnOq+lm8vRDftv+E0hYVLqnEOm8jUxBuRMG247XJSdr3+yvWLQOtCOPXJQmlJCWHK03leOqO0qoUlxiB4jJPI1HjmGK83NyhNO4CDxgRUZSz+sA75aCTRayYFLxnF7W02TwcY/oEmahZdNjoOcYNv/SiPYprQutpzUiae9/MegRwffQSijbjX5696uVUFe1KTK8WJThqg81K2ilNQk7YfsOYpFoAQO7WqFGMYelOByLnN2aXnXKe+JWhmLdTVh7q7VlYk/bbNSMxtMvx2o6CaP8iNFhD4TdDM7zuCfobqHCGCiDARhx86kjeny3JO6g/CbZaw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7046.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(66946007)(508600001)(8676002)(4326008)(86362001)(6486002)(36756003)(52116002)(6512007)(6506007)(6666004)(316002)(66556008)(66476007)(2906002)(26005)(186003)(83380400001)(2616005)(1076003)(5660300002)(7416002)(8936002)(38100700002)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mdpiAyV7BO6TVzJ8AUCngKK92OL6vdd1J6qz59LCkHYCnxSUzHR8R9RL7hKL9j3zJ55F+7quTHRG7d5J25mAayMsoZDSJxKEkm9tN8nAXMvx17xpPIal0cMcKhX+ZV5CthCdaue1ml2fCqfx3kC0Pncsr42qNSkzw5eH6935BhBd1n7kusCmdjaneAfV5cBypHNNk+/deeHcg+KjjqWbOclGttKSLjcJe+G8M+f7vEpvScuXHMRE1ekNb2Fdf56FT9BjDv9VTJ+jtu+8YQei/FjWlGevFbY54vsbuI+DHIigDsvKiJ/B1KHFOBvoZoz1ReG2IFkeGmE0Jcb+xgNyK5UdMeTy/KDIbo1ayg5nivepsuLppb6nqhUECGYLSUxCaYPwArwb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FX68/9s3J8uIp7dyN/+XbGbxgbmGwgTiYvQNtfIdfAE+LGidOznPty7oB3P/jmvw/QQrQ1J0YJJhlBGusuCYK6ARNQDPZsn7d0gDpzwYky9cTwT11pHcuWunXe6xfIvkupJABiHrNtWw576aN/p7glfvr455CysUhLCEsJCSM0TlP3ZvEFP6V/7L9y8SI+xWL1TReyTd93ycLtPGntCmcnwlp9PWnoTvxNjVVgll8TO/dTFOGPHZwvPdu85RsaKlI2AOSyoBGnzX/fXQzrKP+Wjw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 382e2425-80bd-482b-d915-08da21a0f61a X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2022 01:07:23.6284 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: duWNk1GP3LcN+pSd2XYyk3E640VGcsT6mASYGcOjswO0HQBW41zsGbcpesGgd8BQVskmr6q935GfFxVwdedLFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3291 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_180727_956501_CC2E0A1C X-CRM114-Status: GOOD ( 18.19 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 --- v7->v8: * Trivial kernel doc style fix - add '*'. v6->v7: * Update the year of copyright. * Better variable explanation for bits_per_lane_and_dclk_cycle. v5->v6: * Rebase upon v5.17-rc1. v4->v5: * Align kernel-doc style to include/linux/phy/phy.h. (Vinod) * Trivial tweaks. * Drop Robert's R-b tag. v3->v4: * Add Robert's R-b tag. v2->v3: * No change. v1->v2: * No change. include/linux/phy/phy-lvds.h | 32 ++++++++++++++++++++++++++++++++ include/linux/phy/phy.h | 4 ++++ 2 files changed, 36 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 000000000000..09931d080a6d --- /dev/null +++ b/include/linux/phy/phy-lvds.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2020,2022 NXP + */ + +#ifndef __PHY_LVDS_H_ +#define __PHY_LVDS_H_ + +/** + * struct phy_configure_opts_lvds - LVDS configuration set + * @bits_per_lane_and_dclk_cycle: Number of bits per lane per differential + * clock cycle. + * @differential_clk_rate: Clock rate, in Hertz, of the LVDS + * differential clock. + * @lanes: Number of active, consecutive, + * data lanes, starting from lane 0, + * used for the transmissions. + * @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. + * + * This structure is used to represent the configuration state of a LVDS phy. + */ +struct phy_configure_opts_lvds { + unsigned int bits_per_lane_and_dclk_cycle; + unsigned long differential_clk_rate; + unsigned int lanes; + bool is_slave; +}; + +#endif /* __PHY_LVDS_H_ */ diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index f3286f4cd306..b1413757fcc3 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -17,6 +17,7 @@ #include #include +#include #include struct phy; @@ -57,10 +58,13 @@ enum phy_media { * 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 Tue Apr 19 01:08:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12817188 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BC2BC433F5 for ; Tue, 19 Apr 2022 01:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zeM/fHSR481ahSS38NYtGtxGURYUlZ1IqaXxMgzZOrg=; b=TZxU4r+O9m/AQ1 6ieo1ab2d+1K/O9h1c5l6/L/+92JkCUB7NuaQndkBjwB/XjEqGqUIEorDZr7HVC0ooQVcc9H7Eoc4 iG6K8AK2Pxv8SR0cenkFiAmlPooEUHdHz7ppgX9JbOgiDkniqqAddTVIc9/MWeTKRz24dwWgrDpiJ vFH3HR+KdInNcGpkMm8by2Lv617uKJGvJqOJyrlS1ejQdcE+Hx/57gu36gb4ZSG/ZUoZ36QFcl+Hq lIgUc42+T4SrTZ4xzZoKGbKXOAOSvyzzFGzRwjaE0PAnUZYJ1rRKfKJttNyGZYBjMKC8WQoyEhXsY 4kPA5nO9+XVNAseUU5nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngcLT-0010g0-Ok; Tue, 19 Apr 2022 01:07:55 +0000 Received: from mail-am6eur05on20627.outbound.protection.outlook.com ([2a01:111:f400:7e1b::627] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngcL8-0010Va-Ee; Tue, 19 Apr 2022 01:07:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bBfCidynRtAwbJMstiuDkmscrWPNZ+X72vxuFD3M32pMu9ga7Vn570hM0oWCgkAk2J3ogVhh2MBcyQo8ZDIXno3mb46DuRUgTf1qebblfSnFmPQgNW5WpYLlNa8PtMOHpGEL5OOcdOFwvFp42jNjFUvzfUFczGmmwSBTXSjivzDL266McyS/ThwNja2BG6gnq5sRLGntF6CUPm1cjwj6Lq0xQh/zCPzkD0y1CwTBsqh9KCArdMfYgJihAdu3IIEX9n38TIFtcjRQdmk4wK3QFXyerhjyht5hRjqSlsdnMviPDSejgFWnE1Crpae8zvCgTCbpGTbjTHqaRbl3eqZ9Kw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=J2oGElILzCk+igiUTrOVzfcg+9IEz0ALDeKTJRlftv0=; b=Fezq8evn7PGTALQGOq8cdhU2PZhZkMXUO3XkqkiP+5fqgAUaau/n4Dl5rpbnWpAxwwcIRBvyq5fsRsm50kmIzxvu0pgy4S8JsBtF9j1V2LOpPYj83sEsLmiy5Ma3ebL2If0icEh7ySwOkxC5GwisXfBS+sXr7QNOcmiGQYAO3F2blSXIxvlnqCJC+W5FxmAjbxke+UwK0lpEDakdBeeyIDHR1n5M55sNl5M90wq81d9fJGME+BtwG9Ljg4XZabD3c4AJho2lznVB3CUHMOpNF17K7An8Q/QOSRFDzS+w8pJo0WBrczu6r41Few8fFODRiZxtVvMK/XbWuZT1IbevDQ== 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=J2oGElILzCk+igiUTrOVzfcg+9IEz0ALDeKTJRlftv0=; b=OdjNptzfmi6MnV//wOORAI6uycLJIMob+2GhwnEv6GUu5tmiCysita+I8Wte1KFZST3PMlX2OKvAYDvlkO6q7G/Y+2C5TrsIa0J3xzjtMn+U3tD9Hw3hKNCA8Y/XnqsbLyJr55FFrcxK75ZdOsaXoOcplR24D9IGoGOQ9WHrDnI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by HE1PR04MB3291.eurprd04.prod.outlook.com (2603:10a6:7:18::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Tue, 19 Apr 2022 01:07:30 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387%9]) with mapi id 15.20.5164.026; Tue, 19 Apr 2022 01:07:30 +0000 From: Liu Ying To: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Cc: kishon@ti.com, vkoul@kernel.org, robh+dt@kernel.org, krzk+dt@kernel.org, andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, agx@sigxcpu.org, robert.chiras@nxp.com, martin.kepplinger@puri.sm, Rob Herring Subject: [PATCH resend v8 3/5] dt-bindings: phy: Convert mixel, mipi-dsi-phy to json-schema Date: Tue, 19 Apr 2022 09:08:50 +0800 Message-Id: <20220419010852.452169-4-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220419010852.452169-1-victor.liu@nxp.com> References: <20220419010852.452169-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0023.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::6) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1b3c89ac-798f-4b75-79e4-08da21a0fa4e X-MS-TrafficTypeDiagnostic: HE1PR04MB3291:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RMWmopOr4beyiq2RJzOTb6KUZprCfaoEnzh4bs7RhhsJ2x7cMN9otIfbfJdzRjfcKkaTAx43L4UYC+fTr8/iGprIsQPFtnczlbZjOAgfCV/ztZSzfpo+494owJbmDZyM8dTuSxB8wn4ZvmevjjTrWGjPOkM8PqkJfVoOOdpoRMBSdRmDG2A7jZi62Z5w7tb53pTInrCd/yfXm8ESZoK7FewtaiNktsFvvc2/CHQ7kbfue4k7Z3TsH/yxFoToj0a55f+7rYq20rYU1fMv+Yy27jRn2P4q+TfXZAGKCk4tHw/WmH+M4g/4CWeUU2wdN9sjvHWD0gHja+PamXQp1JcVWCr6OpCi0xlD2UWeyrYdqWmW19TR0JmhjrPvJfPLeXSA60eYF9y+hQHnH/3wxQC9cG0lDDzba0C/7GogQ5tPZrxO07/XJ44xVbLzMN3hNpKDAgZpaVOvs04REm77BggacJBqVng2TthTVxWEfTPJGTlnjuz7B+dpEzbwljtwmggGmXqESmFEqhkXN5MjqaNa2Ggih8cuA01VxGjiBGxr414AJn6QQsnQcRyB/qtF1CUGuMSntPPdY+St+UMPZyR0J29AJy8jIVpD2w/EaDzT2tIkOQxPzRW7h6ALc7Nac5BilZ7eL6QT0fotokZdE1xp7ctw4C/mFIdegqpL5sBvFmbLjEITrNKuctsIsrkLrCSdvA2231v6nXgWlM00ibRCH3CReiTgsDSS9CQkHnIFpZt0j9EeQWQv0XXaO56DghqQ3r4s6TQcSb/swaJygWMEOgPUNKJwGBVUIBBOgxJiTFlgOpyuJa8GN6JPS8dYr0QHA+uGaa3iv1ZKUvt3Czy6yA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7046.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(66946007)(508600001)(8676002)(4326008)(66574015)(86362001)(966005)(6486002)(36756003)(52116002)(6512007)(6506007)(6666004)(316002)(66556008)(66476007)(2906002)(26005)(186003)(83380400001)(2616005)(1076003)(5660300002)(7416002)(8936002)(38100700002)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Lka9RQ0+lmEvsD1d67t+XkBzfL+J?= =?utf-8?q?h6jq+PlgC1YWS4lbKhtFFCyoJk+YjDrs9+p3Nc/aw0/iL+jonKTxYPfKYc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B4Hy/APZbGXKAp+B0S6RHZG37?= =?utf-8?q?GlYBzkrE4lPr/xONcb1PxET3zbvZS5arljViKAHG+Skd+N+jQ0aBAXNMhZdljNMcg?= =?utf-8?q?LZZnNDB3HXoecEKWGdnJJGm3QfmIESIQriGMRBvAcMmcJn7hBbPW++s4jQ33u7krq?= =?utf-8?q?WR43xGACwdvb68BUYhLix4F4nddLn8kKWmotqcgdCt2aqRJ15jT3kL7EGtwBQXdB5?= =?utf-8?q?YmBTCsuP7HZXi/GiETWBN7Yg+ac5yRWUjJujykj7bkHcImwuPGVphFi5J8k3y9N7J?= =?utf-8?q?JTQtqL1XYlHbna/Z3wMMpNTkX4b9vO/aaiiPhETWWtg544lLdjIX33Qg22nguZB/H?= =?utf-8?q?nr265+7RxqzxUKU2P0xbhv2eSW7WAK3XvvV8Lr6qtBxKeSyrg7SbKqBzqfZ55+9Fh?= =?utf-8?q?ZGDMK7DTc/iyzhSq8kM53FDD0/cUmZhv3NYCCbOjLCasdAn6ijxJvrBhN83wFh2Y2?= =?utf-8?q?nVqH85XVD0g7/PAsDMlbL6fakvudxHIfQksurPZqpL2o42xEBg5sRbvQOlCPiiae9?= =?utf-8?q?kh02+YSeU+6P/I0ypE/kgTBgnFhPU+tds3b8WvE5iW/f8ZFschW8cJimHxta1vMw5?= =?utf-8?q?AgbkkwXGeBzDzIpKP5Lq35yc+BOLz2NhE09BGaf/MGbOq/hZ7NFmAzfLpO8Rw/srx?= =?utf-8?q?U64y0TXVhrNmF8+X9RzgVKf1YhiprDeaiCUDCQfnqFRpX7rn+iJvkzJjcUZIC1Mfd?= =?utf-8?q?yRKcclR2Ekf/wZQI4RHhvwzK9Bcxi/Yg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b3c89ac-798f-4b75-79e4-08da21a0fa4e X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2022 01:07:30.6789 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2DJXPlal7BcBcVY32rlFx1lzH2vGFVWK6/RQDOJST+m4xMZGbAseZ70jJVAbIWBUuvwMN2jBXyu9LnXbeblQ/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3291 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_180734_566253_35F36774 X-CRM114-Status: GOOD ( 17.38 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 Reviewed-by: Rob Herring Reviewed-by: Guido Günther Signed-off-by: Liu Ying --- v7->v8: * No change. v6->v7: * No change. v5->v6: * No change. v4->v5: * No change. v3->v4: * Add Rob's and Guido's R-b tags. v2->v3: * Improve the 'clock-names' property by dropping 'items:'. v1->v2: * Newly introduced in v2. (Guido) .../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 9b23407233c0..000000000000 --- 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 000000000000..c34f2e6d6bd5 --- /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 Tue Apr 19 01:08:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12817201 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37A49C433EF for ; Tue, 19 Apr 2022 01:08:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+q23EMwSXtSFk3H15y4ORxzJs2cs+ds98EPlU056FAQ=; b=x9gYHV/y8gVkN2 jTTA6xl40cgV6gZCMmDBiwaI4qhaLgdyv1Tm6qVfEohnWzVkKodGAIkNpN2N2AEhN2WlK/edXTCmB 7KwCdb2DDo43u2pCW5gT/6A04FltKxAvQNMgEssjMWWnzw3gseAJ8ziCcpfzz3lKGOPthfIi0oeV0 Fqn1r57JHLZ0/IfJoGMMKj2lno0j3zu32/NKozUdi0K/6zfi0Mk+q9BkYsMdGjaYy4bNZv2A+ui0C fprhY8NNYF/wAMLgUoDas9Z/4I56A3X99I+KDlDtVXWjckKudpF+BGlVbwbiVreQEG5yBkFl1yXGT ME9QcT/31tjnnn9wyZUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngcLg-0010l7-Ig; Tue, 19 Apr 2022 01:08:08 +0000 Received: from mail-am6eur05on20600.outbound.protection.outlook.com ([2a01:111:f400:7e1b::600] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngcLF-0010Yt-T6; Tue, 19 Apr 2022 01:07:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pb69xiJIxX8cFiuwer7SDsuDo+KPLcDch+dmcskpgkY0zmFWxrLNjhWOcwmLlTZedLG12le6bkOyjGWCyJ01p4K+oZWdBd4n2jJPAaQommWT2956Ox1/pWHsW9OhvMFVyzIM03FKasD2YXuQQBCIW7MOCTbZnxr34L8O50rxtIqAXMsUvjoHPifpX1Hxy4vJaSciv1EQ+hFhHJpM18Th79Q4X2nlCG7ptm9m13ckyOf7OV+pa9nC4us+cVJ2ROiWSA0BWDepl31DoiTlyx/qLGO70bx/gRqRRxPwCKMz3ZVfsqpU78yD7+Y8gwQXpIGsWUvrTJpeiQcnlyarusHAWQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bwVgVujLCDokFEM7c0bPtR5ihAMPkZO/ohpa4ZORM/I=; b=FeuHW1JKxXMFH3+ln86M63blQ9nZmwby/iksz50AVfVnSuYOwyqxtrCK21oCvEdwluXIUX761jX5uahwjS+E5cbZb7tECHk5IzjGLB6VOtXYhy3SgXSaKBmxulPRBJR4MimfgP7CtThqdLLstRZlpjzHiFp36iuwRJ9eqs1ke60ptqCb8FEQ5bPgLSxiOgdcEYlTdBPPPqZNFsHMUVaaikrzACSLavC5Z2Xgbpp5mX9cmT2CxB45K/cdFc2QUD53AVPGWp7FzUD1C5nXEu/SNoIE2DuK+MbiAtCvhwIbtvfmzd46Qk7v6BfR5/WczYXxnxYDU0HE9iB5iuJBLaU46A== 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=bwVgVujLCDokFEM7c0bPtR5ihAMPkZO/ohpa4ZORM/I=; b=IKkVgLbahvMCiA0jMyjlpqbELaxutbU9Q9GNdP0+5QAd0hLdQKPoekfuKNfduI9rQ8AMRmGr9poCdimuK81TNyI4W3Ogfs2lAwa0W8r+sF0IfiJ25dOH9TU05cUMQ1lpHClcRlnuboPtGG6ctmWguhHr51b400WRsSv0cJLs3bY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by HE1PR04MB3291.eurprd04.prod.outlook.com (2603:10a6:7:18::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Tue, 19 Apr 2022 01:07:37 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387%9]) with mapi id 15.20.5164.026; Tue, 19 Apr 2022 01:07:37 +0000 From: Liu Ying To: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Cc: kishon@ti.com, vkoul@kernel.org, robh+dt@kernel.org, krzk+dt@kernel.org, andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, agx@sigxcpu.org, robert.chiras@nxp.com, martin.kepplinger@puri.sm, Rob Herring Subject: [PATCH resend v8 4/5] dt-bindings: phy: mixel: mipi-dsi-phy: Add Mixel combo PHY support for i.MX8qxp Date: Tue, 19 Apr 2022 09:08:51 +0800 Message-Id: <20220419010852.452169-5-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220419010852.452169-1-victor.liu@nxp.com> References: <20220419010852.452169-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0023.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::6) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0e9c6af-f83a-41c4-e977-08da21a0fe86 X-MS-TrafficTypeDiagnostic: HE1PR04MB3291:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vAFLN096UYyBJi5aSYP4QfS6/e0uF3o/Y//RhB+j0OLp8Y+eqf9Ge1HPerxo5pDEJm6rOBw+uRcIH7dSXc8+OXILtE0TTZxsmSoYQpN1uiqAxt/orFU+IT0H7diziyrku4mHTG4drnRfz/yLTOmuxOUw3F5i9/4A83qm5yZZ0AcdW9wfDoZ9n1L1WTF219DM+1UsdROYw2coUJUUsAqtRy++q1Jx6FAoDjgsqA3Q5gc0tWykKUZpJYacKhjRP5PMD3fJfhLoidAbZGpCONX8FQ+uyENwNWqjRfSTqy2tzdzIzreGqvxcHZa++0uyvGaEFuJqVgmUjgKw8P1W8Z/bbk3vU/eHWiCt9cOPvFgxC4pkgfVZ1AkM9qJEjLsZAdbyv9OPJFGpLqTH9uTeto6eIoFC8TSm5lOhFj8kxI1Fz4OMTX5Xd7h6WNcPbbh/YyQkdtWZinNVo5QTk7uMCfO2Jma6Tb0l9yUKe+2g5dG0Zcm5r002Z7PaqVLtEvgjeZNviA1Jac1xgU37wwWFCTdFetHeT3M9wq1kkBG360xePx4El8vA3KyquJuHbs8zO/qGDt0q0uYumravhkuuLas67I2JbmpqicStEvke5HuN2jGqeFFtFQVbqYMvt1uDdf8oxvkcsxPC2gHgcdubHGmIfxc8OrvTimhpM4nmS4fd6V04/DhD0p8qO6H/Pz1KyzWGNcZfMxo7WKaLuv2rOcGdMA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7046.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(66946007)(508600001)(8676002)(4326008)(86362001)(6486002)(36756003)(52116002)(6512007)(6506007)(6666004)(316002)(66556008)(66476007)(2906002)(26005)(186003)(83380400001)(2616005)(1076003)(5660300002)(7416002)(8936002)(38100700002)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?mAEHGjbJBburgrrJkU+Bo3EK+2LO?= =?utf-8?q?YogmQhsch1+75LkhHcvZsQh6qfMaCyqdE3mXw3CVJ6roRUhUjCLrRYMIxcgqtsqwD?= =?utf-8?q?OJjQtJhPuhuDOcBanOh+lS2tgY18oreCE3X6C/6BnAOTx9I5L/YfdKiqRVaqhDPZ9?= =?utf-8?q?fNAEQy+eSGQdmyQhYPKHqZA4oLBdbY5Rv2/GTodP/kuvQRAtVJNDT0ij7NZnxOPxg?= =?utf-8?q?I7icZCjttksvx/+z8B3DPgcJIDNzYEDOJNQuczVH1beC4ODvooSUxeUtzvWCV7Zz5?= =?utf-8?q?m+BvTFE+2Ar0r/j7QMphXLvNi7UbpxQfNBlBCvDUxoOPYznOpxzNprKoQ18pF0PnG?= =?utf-8?q?GrAORFgQMHVGHJDnmDkH8iA1Zh/VTYkdbIH+6R/BPqZVoJvRsoNnqvG95MiL1qPYi?= =?utf-8?q?pkk52hR2dfEh3OgNSKVKfgUD/YezCUM63qEwqGGyCm9xhBtPBfUdB1ZOdSRRFKay7?= =?utf-8?q?BJ9CKqTl8WjS19cxRtww2t08zIkAvaiEWY1NJZ8r6E9c6hyFfoa81h98n+OP+i+xG?= =?utf-8?q?pj/x0RR4D3Ebri3L1tyBra95f6bq3Cm1uhDwkVPiJwuD/X/RBZqdmCiJRR0V563YU?= =?utf-8?q?MZJfWiIAiYgB+EiYQwQwpmWqL8XtACl3+CIa+2JhKp+i/VMSb3Nr5j29S4IsS+L8m?= =?utf-8?q?wwRsKEbKDjhw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WTlYg3+FSCphQg3vndimbKUKaWdfX4270QJW?= =?utf-8?q?NjxXrPL/yi9IHvuvz8RxJpPkcbmGiCSQPgoE7cu6zIWK3p61jY3mnpUsuqL3fFHH+?= =?utf-8?q?ilKhA7hL282UcaE+sRJk1hBziWBWDBBg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0e9c6af-f83a-41c4-e977-08da21a0fe86 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2022 01:07:37.7272 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NvTQ2BlxzOMbW7hBQNV4+9jqo8AhCPyN+QFeM3MCooEQDoe8PHd/IgdeQDUeDbSNIv9QBXZMfhPnqXUxoXVqkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3291 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_180741_996795_54E0E801 X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 Reviewed-by: Rob Herring Reviewed-by: Guido Günther Signed-off-by: Liu Ying --- v7->v8: * No change. v6->v7: * No change. v5->v6: * No change. v4->v5: * No change. v3->v4: * Add Rob's and Guido's R-b tags. 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 c34f2e6d6bd5..786cfd71cb7e 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 Tue Apr 19 01:08:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 12817202 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 265B1C433F5 for ; Tue, 19 Apr 2022 01:08:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VAHmnC4GKtHiJvnj5hKuLoMreZYkRwMn3wZs75KFTEA=; b=mk9ePohlLllwGc Kq6OR0DcPd5guojx3+uulC54tHZQ6w1DuTXZmy+nVb4uYX5Rf7dWciD+Bg0dDzHfUm12q5gosy1dh SS1TyZcVxyOPap1gJbkCKj+tg7Qeey17F4rVe6LFd4IVou44XhyWmKYxy2iLrdUA5ULXUF4djrfXs 1+UzmaogaAt1O6q23pcyptnpi+ikCdg9pGmp3LRTQTQnR6jZLg89Ogtl9vI15bMw2Hlgve0X4PTAs JyT4YdsyTedpkbTSRDcxnLCqUinLdnBbVURP2pTo/iILQ1qkWUlLb8fzWcA61nR2tWAq1blwdkOK5 G+sOBFW2LeElq/g7SvUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngcLx-0010pb-Bg; Tue, 19 Apr 2022 01:08:25 +0000 Received: from mail-am6eur05on20622.outbound.protection.outlook.com ([2a01:111:f400:7e1b::622] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngcLM-0010cD-LE; Tue, 19 Apr 2022 01:07:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NlpaOwF5UM0UmcEdDf8E5f/q/Rj9jNKwseuEbfxfCuVbSV/ckd7EMF9m9bgCW556s64e9K1gdvDrNoHbQlY7meIyofyLTV+u3IvbGXBWWIROs3Kms3DdUC4PMvIs2gR83zF8ZcFD+9nGYqsMKAh599owEu7Kk6dTWI3VJguJhVQD409E84xDmt4Ko9zikCwo6rMekdZN8drznxoKWUGayysugiU2ZFVpniCc8TG2vr1RpZ76LhQ/ADH1HK40hZ+Xn+uP9jTmqdkuhjfW8EoIUGB1Ma8o+fdKuj4wXhS4tugeG52/StWr/8rsNp6ol3NgGaRbg5n+q93M+BwzBx5xVQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0L4vMIUf1mDanswpJo8fhPsQYyiOeSJQ+w6SBa7SJpo=; b=lF4H4NwcMeI4u1gdcgXrSLf5jlaJ9qAzfPDDpUP6SOuV7+xoCeZAkCHWfLjU8yEVqnjuZJeuyTYO68AWs1r6U4RPYW1pQAnov+LtYEdKFXP/8MD/g0EejGppWN7RJLIV4RAVR+3CnHQqSBLVtoIJc/uydIOL1gVUZ4jsfncT99X6KPDXOt8vgw0FNUTl1dYUaZm7yFYbk5zwqwt3sec4xovc7s4wGPIz9wDPSvTywWAJf/jn2lR08MwpsrsWLOXteBeswwZ5D24xfxVPASd69ZGh7vTKBljHKMPRmMPy5rpp4Qz3J26pedkkCgtwUV3IBiuYQpdktHtbGkJ7sNlvzQ== 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=0L4vMIUf1mDanswpJo8fhPsQYyiOeSJQ+w6SBa7SJpo=; b=AKLGjBRCSQ8cykmCCNyuQcOferAfDVjXwowzeFXGtD8b3p4qYFXMvz9ClwV88+3C5qTHh+e3bS12ulMY8JPFZQcztt0VWMPLfPQGengW7J8aJcedGw9Rg30sRsNOu0N66p5VoJT2wY4J9pj9UHHWSj6c3UN/5qKp0HZqkiV8zhU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by HE1PR04MB3291.eurprd04.prod.outlook.com (2603:10a6:7:18::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Tue, 19 Apr 2022 01:07:44 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387%9]) with mapi id 15.20.5164.026; Tue, 19 Apr 2022 01:07:44 +0000 From: Liu Ying To: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Cc: kishon@ti.com, vkoul@kernel.org, robh+dt@kernel.org, krzk+dt@kernel.org, andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, agx@sigxcpu.org, robert.chiras@nxp.com, martin.kepplinger@puri.sm Subject: [PATCH resend v8 5/5] phy: freescale: phy-fsl-imx8-mipi-dphy: Add i.MX8qxp LVDS PHY mode support Date: Tue, 19 Apr 2022 09:08:52 +0800 Message-Id: <20220419010852.452169-6-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220419010852.452169-1-victor.liu@nxp.com> References: <20220419010852.452169-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2P153CA0023.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::6) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67e2d418-20ee-44ec-7d9d-08da21a1029d X-MS-TrafficTypeDiagnostic: HE1PR04MB3291:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ciWidfrM60jLugOepyDo50oKsRxPwV03piEsDtIKK/I7pF7FtOwUSqJHJh/J1pqDDvgy7VWUCAUdpVRiJZW+aCQaqzwrZw4qvkDVkrj/5Sn4yt0v2IxE9nFqvXuXaVFgGxiHszI5kLOhLOsTbtZU6qXZwUlPZ3L9goIyDcSGiW3sCo8e/SnjFQq40U1PIhuGBfDof1yRtAu/X3+p6XBB0lzuwCJTgE6g7bA6QKVs8frcH1VE11iEgAFYbkcZg1g+nnkv9snilYlAshFc/9BCHlxZgE/truh+oncZFkCNXFatnqs7GXWeVRjbLpZQHVtE+pK22FybvjueoiSpjzMxAeorqLHHGBUtkCjNn6zT395gJlDejx91EUReS8uLiK5KXlfnITL4tIKEzmfAxs+nJIboQdWTOZ6Bo3/Epq1ASYUE7222rdfFkCS4ogPwVROnjaCHSyf5WibK2etZG2N0kZ21UDTeBOMYJaUa7h0wkHBGdE3zxJ8//Zi0REDisPBvFmCnYD1JKai7c5DRGIElYiEBcRKYeuN1/3sXI86C10vGypTfMGUasHLIlhrsoqbzv1ciFPn706IPtwYuBDdxtxwHVaU+ftOwXNdLvSDdYfJSQi1MHoFr1SXib6VO4wigwUJlPIWhk1fxzc4e9uF6LRm0FNAoeBHjEwIDezcz8+oxmPcUPtY5JM8Q7O+i4yXiqh5iNCdGu8+3TC/mNCrwgA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7046.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(66946007)(508600001)(8676002)(4326008)(66574015)(86362001)(6486002)(36756003)(52116002)(6512007)(6506007)(6666004)(316002)(66556008)(66476007)(2906002)(26005)(186003)(83380400001)(2616005)(1076003)(5660300002)(30864003)(7416002)(8936002)(38100700002)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?cVitUYAZUFor7UWbliJBdYpC1fGl?= =?utf-8?q?RrO88e1g/MHA1AbIsPLlnQyQrYPhNWlPgURNJ7OZxk7KELaHxBsw1lDCJKfp2aNMQ?= =?utf-8?q?U3CPbQ0XhkFvEwrSkINJCv6VCKjmw5ThGmLJcKP2WVvgbBrS1YZo9t9LrVzkfboQm?= =?utf-8?q?onkBHQPvrW2xqLLBrZA0FiSBO0e1TiZ0e84nM5ano6jY7g0Bs2bOZd+VFteSKDFw+?= =?utf-8?q?SLzEIq99s5VgAXhhq2+EVjOQsaz2DSXFsCeJlLVWsC7MPSMxOujUHcDGV6kNsnq3Q?= =?utf-8?q?csh9inyeAWObGZa3/qChMvSejXFuAObX2BWEHBE6fh10I+dyU25ioQzSm/MjYkYqa?= =?utf-8?q?jsiKlDKedJWIZtAZp+QxPaf3CbeB56dLqRlu73izH1jZsaOFM75FWQftwJ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VxHR?= =?utf-8?q?72RdUgICr8I7oSFls31YwWyZwnkkHpWFOElmDnzOx/+5s5G1wvcpbY7sZFyjFK1U8?= =?utf-8?q?yTE9osA6G2IUvUA5LrKUS7JRxz696AISfpJ8HR2PAfl+kMps3ktwZd35HCfOdJKf4?= =?utf-8?q?HHJq0r3S1+rOjevFWDIfALHEXtcInt4yRyXYq6rCrNzla9+E9B2OxKkWlTgpTlnuC?= =?utf-8?q?Wu8ZH8NHQXyQupD7agMfVXMXwII9URZsQgrDDu2XULg8+MB8OEW2rBbAuTPyIwQbn?= =?utf-8?q?Gvot8NXNmPSw9rzrzOy6YGSI5+9yDW4/2iqgN76o8cb84XgJHtIcnw4lCfjT7oStR?= =?utf-8?q?66brn5Mw4JJuGqnlrF3d++tGAJ5ggMFDJjAk8S3cnDkbunofD2HZSPz69S2UdISrS?= =?utf-8?q?+fMuV59E8021MctQGHBDWkjJZZpkAQ1g=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67e2d418-20ee-44ec-7d9d-08da21a1029d X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2022 01:07:44.6028 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: e6ftR+U61Br4/ygrcJ3uvkVZoeGHy5BDRhtV4RJKZn1uROFdy8nAwikEFMjvRH/JKkT15b1o292NPZZABoxc5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3291 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_180748_899507_70AF5DF2 X-CRM114-Status: GOOD ( 22.44 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 Reviewed-by: Guido Günther Signed-off-by: Liu Ying --- v7->v8: * No change. v6->v7: * Use marco instead of magic number for CCM and CA values. * Suppress 'checkpatch --strict' warnings. * Check !opts in mixel_dphy_configure(). v5->v6: * No change. v4->v5: * No change. v3->v4: * Add Guido's R-b tag. v2->v3: * Improve readability of mixel_dphy_set_mode(). (Guido) v1->v2: * Print invalid PHY mode in dmesg. (Guido) .../phy/freescale/phy-fsl-imx8-mipi-dphy.c | 276 +++++++++++++++++- 1 file changed, 265 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 a95572b397ca..e625b32889bf 100644 --- a/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c +++ b/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c @@ -4,17 +4,33 @@ * 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 CCM_1_2V 0x5 +#define CA_MASK GENMASK(4, 2) +#define CA_3_51MA 0x4 +#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 +71,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 +88,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 +98,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 +123,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 +349,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 +378,126 @@ 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(CCM_1_2V) | CA(CA_3_51MA) | 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 (!opts) { + dev_err(&phy->dev, "No configuration options\n"); + return -EINVAL; + } + + 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,26 +517,74 @@ 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); @@ -406,16 +598,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 +651,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 +665,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 +697,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);