From patchwork Thu Dec 17 09:59:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 11979475 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=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CAADC2BB40 for ; Thu, 17 Dec 2020 10:10:11 +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 DB38723741 for ; Thu, 17 Dec 2020 10:10:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB38723741 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=SbrqW6jknj9h/LtwfYoRS7CnmUUtXeHJjFv2x3rCYxg=; b=l94SOmIZRdbAdURtoFvrhuFNj pEC+LNQRqvTwMe0TkJ+4sKqOh/KwlYV9jP5tfo7xeNc07KrdvD0OFd9Iq5hoJ3CIUeY3A0cO4U7Rb wAALx3DxgO0Q2TIchlq9MGE8/L9HRoe4MUzBEpRSCgaoKZ0XlOYh1kMrFvozYMTZ6ik46xFhJxgE+ 0gdoE6NKk2mmgiDAmeT78X5fKxANEa+hidcsNsSGWcOEuNf3Zdry2AKFxG/Bpmd7bf+d8t8PR/j0A s/GtyKNZ0Zn4N/A+U6QPkTa8mfr5fAIQUKKlcdnUjcnPaIjI0BVArHI8FaBfFQKcqq1nz9u56O9M3 elkXHpaLg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpqD5-0005G4-Ov; Thu, 17 Dec 2020 10:08:35 +0000 Received: from mail-eopbgr150044.outbound.protection.outlook.com ([40.107.15.44] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpqD0-0005D4-FE for linux-arm-kernel@lists.infradead.org; Thu, 17 Dec 2020 10:08:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jeeqc1mxca9P5KjSfySyeZM9BvzLvLtIOqTqRnWykhZ0akwseeIxVZ1zTZbG/lmixcP197Tg6OTqyp07SanRVd6eywhMx2BW+w981LySErHkj/5m1O/IZY1NDwn/21rELUWAH19mhlgQjkMVU3nyidNVcdsWi7YkIkxzQ88UhLftlJEcd6L/OOqO3j6gIEqFOzRaGoau9L9JnC5uXdaJFTnyvC2pHO16/dlsK+Xxqk7IRzJ7m3WRQPI/Jw3YCRYqPxYHKYW+dsx96Jz65MtDOplNqHO12pv71sm9oblLgslcXiXBTBHdrb3Oc9xgyK7yJQyAogBR+R1uWiYF3X4Qhw== 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=HI+Ebi45WdhiJY2d1M40KZF1kYf+MdtNIQ6Q0eAOXHk=; b=MxnBlIOepf3UZRpj5KF98di6/6/u+/esBs0bX6HGF9E4w6sP2Mo+xVWtTnlemAuav1KPMVmelJ3kdbU48mWd2YrBxCMRbhzY2ul5N/kF5yA1gsPSaOr/84wpWfNDeBayDee9cZNd+u8A2bfl0pp+GL5/dy/OzhH44OiL65qIi2gCU3q3ddb5IniS2QGhuJ6PhyigItedY3P8d7aM2+sQiJpsPX1caeB+RWlIgrnEM/Qve8QbuTffNjQIXFiiNhUVuKXBmKUhguXxXmScCC2lD7Zmn0vcQ4dC9XXFy30DP1YXTHWg/cAFlRfhio2eyvJ6VADHXz/m+j9ta39QaSk3XA== 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=HI+Ebi45WdhiJY2d1M40KZF1kYf+MdtNIQ6Q0eAOXHk=; b=nb1NrBU05l4DoOZXqjkHheiXTTmvBojXpEZ6w4gi79V0qV15kQJAIsRJB1v2MhjrhB8v2jf1aVZiganW4TUaYxHDQmUxS2Bb9t+vAKg36mDpUAw+Ea3/O02P4u/+9EG6XCjGHnlzvmCTSI+uK8I9p+hW5YMsLEs8SRlFJaK3190= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VE1PR04MB7312.eurprd04.prod.outlook.com (2603:10a6:800:1a5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.14; Thu, 17 Dec 2020 10:08:26 +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.3654.024; Thu, 17 Dec 2020 10:08:26 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 01/14] phy: Add LVDS configuration options Date: Thu, 17 Dec 2020 17:59:20 +0800 Message-Id: <1608199173-28760-2-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1608199173-28760-1-git-send-email-victor.liu@nxp.com> References: <1608199173-28760-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2P153CA0012.APCP153.PROD.OUTLOOK.COM (2603:1096::22) 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 SG2P153CA0012.APCP153.PROD.OUTLOOK.COM (2603:1096::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3700.2 via Frontend Transport; Thu, 17 Dec 2020 10:08:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 77b17eca-180d-4309-d403-08d8a273b1ee X-MS-TrafficTypeDiagnostic: VE1PR04MB7312: 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: qNvdpCAFvnGW+c9hcj2sDv9waTmrjSxrl+UaMoU8a963NKXtOi7xAXuBRoX74ZK14+G6zeG9SwKaeO2sJ2F8L484/RhZNQnO3txd4AMgAzO01dKNH/MZwN3qpPHs90+SPGZmIgkIPBC++K/TSq5e8sx6MGihHoylLQkmu5PkrnznurzJB1qOjf9u8R2rotmiB1KZO7rbFyPV9E+eebzuINadXrd4NMZqprbsNgRf6r7rTZftt5A6PMlMympJsqN+nXw7X/mHcJuTzyUBQsB3sioqkapBzgB/Nufn3ZM+ElyolB8zLAVwYkdrCc+QqDojbef6dCh+KSna1H5bN1kxa63lpO7b7/oxrhekXI34nRPjcnS2EXeMbZ7098L3g2lS 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)(39860400002)(376002)(396003)(136003)(346002)(316002)(86362001)(6486002)(2906002)(8676002)(6506007)(4326008)(52116002)(26005)(16526019)(8936002)(7416002)(478600001)(2616005)(186003)(956004)(83380400001)(66946007)(5660300002)(6512007)(69590400008)(66476007)(36756003)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: zypsYH6mnC1vdBVIbzWMkqHcI+ncy84HKyX/qVpM/Dod2ecNxCjz0RnSq78qCQpeb+TVdYg3sJwV1MG8BPAa5/1YQsYqWe0Xf2rmB3jHg0mzvVaVd5Gsxhmi1S/VbrJrVV8tD0Axq+xm1qzV0dW6utrJRtVJWPEPbPcAlwAEEwUM7h7qJbiWmfpfbPrAcz9WfJ5cw/7io8d7o3nSog6bxMgO/wJ58utpCiT5LIVgpI/6PYckzpnh7Z/6H64AQ8K/SbygbkLaQzDcJASV3BXw2H58QvYjILdegfxDkyzDHCK53z7JXB2R8rnmqAX+EV+mjk9/TxAb20bYZmzZXb9h1gI6Ezrx6pCxyBUaMAmQrBGkpakoOCkQf0ZWc1OZ57Yii8zN4GROVfUSHBm09QU9LW0hH3/5mp83iY/ntb+Ga5PdstFDe4RDiD7mYnFDQ1zTZrCbS1jdJOkUQHo464D2R5dmF+7C2Iir6jiUyikz0m1DKsFm32r/t9Ftt+X6DYuLffLDvGoJ8WHdoeh+43+rL2r27EzygJE4vmVE/k8Oiyc3KnRnG7eYe2n4vGfH7O7aRz0QzDU3qKDsJJ6aJWiDhcA5AzmKzV2sZc6n+LH4RHzV06P/tpMpSP771It9DNFdPx8I1n+c5RSvYrAAp/CFi85H5GB4Sh3jjVIN8O7gkk6xQ8pHrX9SkcwddPik8HV/xjspxADue0fEXXqYbIIR8S4GN2G5OA6oMb5QegLHNmhbLAevp2GnhmlD7ZHiARAGgxE2uK2jbUalP0bKxA0bgOZK7S8sicuKko2P6EUfS2dFjTrH3b1IRBhWVTFcZNzV0kj/cDxQNTXHrJKGRGk9PXdKJcSV8Lv1ZGMSq+z2CES7WuDMCxjBpUL8DbH90nf22TWq/Afz6It/xVeBG8+x7+ZmCkyeBHZ8mu2Z6EO5OQTkpU3qzxODAsAHg8C1cdtxQ/lm3lqAO6CYWhaWXs2OSVQcl6+sGTLN3qIdO19xaKzs92bwI7ayWAAdhgkW5lxj 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: 17 Dec 2020 10:08:26.1953 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 77b17eca-180d-4309-d403-08d8a273b1ee X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IXOc55oIV0pOlboZwotaQz8mLo/xnebcCP0+YF433kAb72PKrVtkDyX0WXg1hcwRhxQnNapdmwhkHiFU6dwQVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7312 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201217_050830_567470_59C01975 X-CRM114-Status: GOOD ( 21.98 ) 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: jernej.skrabec@siol.net, daniel@ffwll.ch, 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, linux-imx@nxp.com, kernel@pengutronix.de, mchehab@kernel.org, shawnguo@kernel.org, Laurent.pinchart@ideasonboard.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 --- 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; }; /**