Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1578975pxb; Mon, 8 Mar 2021 00:41:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAA/wgjkI1SlDQ0HHUkS36cUEl7Zn282hYQU8PZI4cL8vgm5nPDuH9dcChoWcr3/OnqIJD X-Received: by 2002:a05:6402:1517:: with SMTP id f23mr21478452edw.272.1615192875933; Mon, 08 Mar 2021 00:41:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1615192875; cv=pass; d=google.com; s=arc-20160816; b=LT7Fepzghnit6dZpHgXLypT2DdFw7omkgJ1t1Tyl341OjppAwGgF+2hwABb4UR0iKt Io6J5v8yjVrhdJuZcn3PHma3bKP/1QJQfoR3U5OnH4Ih1LktXZBHcCQfNOKOofkmDRV5 P2eCcqJd6k9T+1QX5Hpvr7V48R1qnifP5HaixeK5L1wxlPfhfEmaPPI2BIKhs6KmzUA8 /RL7poiOVvLg3TBSV63Gl/2O5uYzJ9cX9V1eVyZe7KUZiE+z5xZhLBSp86ni0bZ0iS1P uGJ8uD9n2gHnLazSNWZHp8MrtkTQdm8KhMzq4KZgC7A3TTd5jinPyxJKRCc4zsKRC10m uS1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3sA3nQ+OEULqsdeLnZgSzuNU567QUWAi8xpQWAby/mg=; b=ioVZUNqV4kRJsCOlRJQ4Xqaa+CLDV/48u1N2cvElPPMDFwQzR+Szw9Wg7ywJkHjsx7 jYSF3X0jGIwgu4Zf7jD6sdwgLAOEu6BjvCVkvxWj2fMwo/uA9gaf8WCQXqWyHJhVQ3iN KfatXuWTSuHlUrPQhsqJ5x1JkFSZ7/QKUC/OCzG+MxpGHblYPGN0ldh1QlcfydmcKnPM YOOLokG/qjf+J9V1jY62mUkYLraRoiaecsHl1GH3Jdq2HYH1ZEjVlESi3yHmO9o53DdU 5EQoKt/ZA2mjGmfS1yjdxOl5cj72JqB8/baRcgLuE6S83IXwXs/PxY5mzqa8xFNb+ces t0Mg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=cH0KD1iu; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si6274783ejd.543.2021.03.08.00.40.51; Mon, 08 Mar 2021 00:41:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=cH0KD1iu; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234141AbhCHEGV (ORCPT + 99 others); Sun, 7 Mar 2021 23:06:21 -0500 Received: from mail-eopbgr70044.outbound.protection.outlook.com ([40.107.7.44]:24274 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234100AbhCHEGC (ORCPT ); Sun, 7 Mar 2021 23:06:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QclwA73kUEWh1LEokA7HHR0QlezMxSy0qu2zF8BbUD3rICXnoMagM8N+mAd/hqH7GdbLeNDyI2NTb8GrUVpssw6jxUj4yFA0CZkf1bffNF5JHgSqup74q8WIkbQmOL1ye+f2m4CB6svs0X3VyWjEtjEpCdK3nRhLKCf71+ZLxQbUq2q/dXa1J3+L8rZkSoTUPSFxojan7Zio87I40yzvQJbihl/jYMw63EyYnZksRLQk6n4mqhxrJULhlSEp6cMMc6D6ps4ddqrkyUakYtM2Rr6srTgiCGlIifqqJ/brsOjqMG7p+JP8JsWI8UP5mW7f4WG+X3fQjBjNC6sxQtD+CA== 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=3sA3nQ+OEULqsdeLnZgSzuNU567QUWAi8xpQWAby/mg=; b=Gp4JucST5mSKwfXPN7BBs2BPkW0kHhuEzcv+O/H8rhuRAcQwOrKlCPFGPHE9z3vOv2/xbgqEvc7PvbuEsazUN2YGqTgyhoOi8yB/QNrJck4d6+XNWjfsyogSCX8bTr7IgCgMA5yZC0CRVUCFg7aN69T2x7Nd4SDDINyJoDPe7ER4tndNrYwkOUrrvhVS/wBjCF4t+ag71G0CqMcOX4bgliPqRG0/IX3xdzTZ9Vy4Zg4SllILMVLDk0PvY0vD+YRvkRpDEHhaE+LHdezVZn+R4x3XjBqCReRPdT+QWssa1FfT5GrVvkF/E5mkn1cu/8+bDzQbqr+LRmcRO9VoyaHmYw== 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=3sA3nQ+OEULqsdeLnZgSzuNU567QUWAi8xpQWAby/mg=; b=cH0KD1iurQfAQQQi+yIWXWMXkjQPh5oNBatoLftfrTidc6XKVm/SOnl679EV+26OG6831/gGMwKigml5brI2dSeq7SRlofqVjNFH8CsF7a+4VEurlJUavQ6veGKPT9PW7cRzQjw8GZ3ekxhbQtN+MVruSFZIgVXVIgzV/Afri2c= 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 VI1PR04MB3310.eurprd04.prod.outlook.com (2603:10a6:802:11::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.27; Mon, 8 Mar 2021 04:05:55 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::2564:cacc:2da5:52d0%5]) with mapi id 15.20.3912.027; Mon, 8 Mar 2021 04:05:55 +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 Cc: kishon@ti.com, vkoul@kernel.org, robh+dt@kernel.org, a.hajda@samsung.com, narmstrong@baylibre.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, 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, robert.foss@linaro.org Subject: [PATCH v4 2/5] phy: Add LVDS configuration options Date: Mon, 8 Mar 2021 11:52:18 +0800 Message-Id: <1615175541-29009-3-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615175541-29009-1-git-send-email-victor.liu@nxp.com> References: <1615175541-29009-1-git-send-email-victor.liu@nxp.com> Content-Type: text/plain X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR04CA0088.apcprd04.prod.outlook.com (2603:1096:202:15::32) 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 HK2PR04CA0088.apcprd04.prod.outlook.com (2603:1096:202:15::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3912.17 via Frontend Transport; Mon, 8 Mar 2021 04:05:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 82291bbf-4b22-4058-0fd1-08d8e1e778f1 X-MS-TrafficTypeDiagnostic: VI1PR04MB3310: 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: iS2RltSlJjMbtfOX5W4Dygme2wjaCGIwc56g/Xy7FarqeVskQ4Mr+Y/xEkGYnU+XUmrKGD06qQy3LU8rrWvZxTvKafzaKifJF8vH1THkOyRI3FhNsBz1BoHndSuVaJHV68EdKjydnTPOvH5e5/9gXN5lrZ4YbR2E2+KVofEgy3dcgLfxmSqnXf7Hm0Hj7k5WQpwZbvuj1VrgdosYG3ry76ap/oqe9Pe6Y9F6XLhHaIAQ0LNm8A0yz36HqmnK3pvaEQu0nV20Q2w7KsiPF/hMWYDa2/jUCMmUUwp5c39tVlHSd3066coo24oLyOKZa9Ev78kVOnTu7gGDYz/UUXpi23b51YNRNK0WgH6wkLD11ZKIRyHtSUw8JQeSt8HKkc6C8jq/LCf+Jo16T01bJcRtiWu/Uhlkyhy4hdVej/tR1rG24s9KBgZyc3KPnTT1vjfgQtY5LbzLodjEp7hXp47Io8XIUkmZljmC1rulnHAvX3Mt8VLEJg1OkCxBR42HxYUgM542bGZBVC90R9cNoiC0wKobNDDxx6Ewt7UezEm/TflIJIe+ljgjaBbB7fh00plbhuBQxu+8GvJrGBR/WkQT3g== 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)(39860400002)(376002)(136003)(396003)(366004)(346002)(66556008)(186003)(16526019)(478600001)(66946007)(2906002)(316002)(66476007)(26005)(5660300002)(52116002)(8936002)(6666004)(6486002)(36756003)(8676002)(6512007)(7416002)(4326008)(956004)(6506007)(83380400001)(2616005)(86362001)(69590400012);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?HrMS1JpsRDgA8E+qPQdGCtWfXCGQTW1Be38KgvoNuEp/tIG8RD51i11yG8Nn?= =?us-ascii?Q?8funcKbJYzVC4clQJQNRJgB12Mo3scqXx7E48UMpEXsUE+UQyUaFzBO4Ppxs?= =?us-ascii?Q?91//pF/FPUcMMr6si8vKaNnq5pIbsnckRa8hgTT7uBnjaqfTjJfnn7CBjDWy?= =?us-ascii?Q?6CacbyJv1XoPo8Z7Q01zC1Gk1FgNHMI/JQvkVuEypjyPv0GmC3UgLmUMxijz?= =?us-ascii?Q?cJih2PffpBYgSFyardIit5LplV42VkTRnALh2HN7RP/U1yNgUwJG+GXegW7M?= =?us-ascii?Q?8Ru1auzA6nljQvS2VIMI8aX5LcY5iqekiW9FLH5554VwqI6fBQGe3eSlROCI?= =?us-ascii?Q?P98lIervUxd4UZg7opBJLTX6ddmToB5kAxe+QLbFgjXhCtjCOiqNT/JDCQBr?= =?us-ascii?Q?N5inxfUSemriApCh6+IAoTk+hve7ZNXIGhUJh+nz8+TGFbHysa2pLRNTOcji?= =?us-ascii?Q?PZkV+ViQ57N3ZbBdMcfuluVrOFFxTu/CYFGgC3TqCKAXjKXc5DYBZR98ejjO?= =?us-ascii?Q?szn/gn6Dy9pDZP+daYnVmczLYCFTFn4HN3antZdUhatrqx+WG/XDwkkCjO7i?= =?us-ascii?Q?en/49E9snggz5Nd2hUYYVHMYPn1Ud79UmhUHOsYPglefl0r3a4HUbLAe7zEM?= =?us-ascii?Q?UImguHJwBtLldL1wE0jX4U2ReIsLYYgy5oyG3qiqYr87/+RJ0IPdpr4YSOAr?= =?us-ascii?Q?wJlLFPezj5GXY8NGkBNLsvQsdGRD5jgdZG1rPqQPyuS30Es6apVZsv8Mh6EZ?= =?us-ascii?Q?o1gz08bhjtUQjdhXxoLepE2k/bnd0Y4OA67SadW1wnRNOaGrEx5Wv281+AOs?= =?us-ascii?Q?b487y7WWeeiuNqbbgmJoxxqXL0oNXb7Bfp0oAMslHeEsfYqleNk/9uhwqDVc?= =?us-ascii?Q?pteZFZIDtlG8zaGHvvs9kDo2yhHm4M8BabwFvJJaZfwRAons2zfzs/HCS9aw?= =?us-ascii?Q?/RyhOcu7K2mzghHRXuGVz5wRqbrZoWiDmJ/LTr9SNxLxvbLFQIux+r6levRN?= =?us-ascii?Q?dZQDLOINqIS3B/+sbEVxMKkSSgfMrnuUog+AjX/9985FY5PayIadidqITQU6?= =?us-ascii?Q?rJPi+EFZuXdeTQoRFH3AQlhD8wEBYdTQ9ps0eMKnv4nKlpvpx8PiMtfBilma?= =?us-ascii?Q?t6LSk/pajguKgX3MP9VDLJRMV8oMfgwkCPU+W5BJ7ObzqtRbyA74WgNlqU1k?= =?us-ascii?Q?sJ4qfUpMRvxF87KHIS/HV2y2vEyEFdvwh22zScHnazX+wicDgenomjx/qrfY?= =?us-ascii?Q?BDtJ03fCtGyjJXZX/vB3IEM/94rY2uqHdObrESIOitwMC+WIb6ROVQC8nkjJ?= =?us-ascii?Q?op7IVSoLTG8Yb/VislozDErR?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82291bbf-4b22-4058-0fd1-08d8e1e778f1 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2021 04:05:55.8272 (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: 2RFNxla6cilHc4h2X7EgxYohR7gIw2d0J0ya/OeOe9bElmepZ82feqEGofjNPUEP5D+7Fy7LWwLPEPy6Xn0uoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3310 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 Reviewed-by: Robert Foss Signed-off-by: Liu Ying --- v3->v4: * Add Robert's R-b tag. v2->v3: * No change. v1->v2: * No change. include/linux/phy/phy-lvds.h | 48 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/phy/phy.h | 4 ++++ 2 files changed, 52 insertions(+) create mode 100644 include/linux/phy/phy-lvds.h diff --git a/include/linux/phy/phy-lvds.h b/include/linux/phy/phy-lvds.h new file mode 100644 index 00000000..1b5b9d6 --- /dev/null +++ b/include/linux/phy/phy-lvds.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2020 NXP + */ + +#ifndef __PHY_LVDS_H_ +#define __PHY_LVDS_H_ + +/** + * struct phy_configure_opts_lvds - LVDS configuration set + * + * This structure is used to represent the configuration state of a + * LVDS phy. + */ +struct phy_configure_opts_lvds { + /** + * @bits_per_lane_and_dclk_cycle: + * + * Number of bits per data lane and differential clock cycle. + */ + unsigned int bits_per_lane_and_dclk_cycle; + + /** + * @differential_clk_rate: + * + * Clock rate, in Hertz, of the LVDS differential clock. + */ + unsigned long differential_clk_rate; + + /** + * @lanes: + * + * Number of active, consecutive, data lanes, starting from + * lane 0, used for the transmissions. + */ + unsigned int lanes; + + /** + * @is_slave: + * + * Boolean, true if the phy is a slave which works together + * with a master phy to support dual link transmission, + * otherwise a regular phy or a master phy. + */ + bool is_slave; +}; + +#endif /* __PHY_LVDS_H_ */ diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index e435bdb..d450b44 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -17,6 +17,7 @@ #include #include +#include #include struct phy; @@ -51,10 +52,13 @@ enum phy_mode { * the MIPI_DPHY phy mode. * @dp: Configuration set applicable for phys supporting * the DisplayPort protocol. + * @lvds: Configuration set applicable for phys supporting + * the LVDS phy mode. */ union phy_configure_opts { struct phy_configure_opts_mipi_dphy mipi_dphy; struct phy_configure_opts_dp dp; + struct phy_configure_opts_lvds lvds; }; /** -- 2.7.4