Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp215072pxf; Thu, 25 Mar 2021 02:16:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEvPiVCXW0oF4Gt4DgLn2AWaoiHrVRO/PsUZsodEGVePAjv37W8O4wMNwQvP5QvYNqIsLN X-Received: by 2002:aa7:c353:: with SMTP id j19mr7844757edr.263.1616663798355; Thu, 25 Mar 2021 02:16:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1616663798; cv=pass; d=google.com; s=arc-20160816; b=l40TbwKK4//G8TejgCIhaOV3TKliRpIqGzcWplZHANrAF/4Eqhs14m88PPC+YcxWoR fu/r6MbLFS1CAGdKEJTZjMqQVBFZUG/uoYaeaFReD+MDitcyqyzrt6jWih1S9afs2ffW wxyifXmJ/thS48AMj/8Z6UIu85gcLhEZ6b0p7po+W/fp5JaPh6XXmiW61duvHWXviBG1 dPfyx38VV0eVjmIiMhS1SaqmM+g9paXnRjmrnLgbX2hRdOQBNBhaIxg/O4W8X/FTRDVI 2gVwna+dPI4CNxAYxPwmHgblh8XdCMX2fTk45BN9BGw6xn8hXQm/wwpsfqdF1i/08Phx s5Mg== 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=S0X0hGtFCmE49bYvnLzSjWVHNNUFZN+x5SMGrSVlXew=; b=PwDSoCdD++CNkZkH1e0+0Q5wfEirrYtyIDxa1ZEJCL67RsNS842KVa1sA6ZZ+8Jk+O GR6gH3T9I8i8sYRZkNFYMzrGTrRZrtW71vNJDEiboV94jNjmLLlDahL3Sama4Fma3eWP 1PssmPWKlJgY4x2G+MF0PGJvqXhVy4x+Q+8MEmG07sA5qMwJ3M4VgHL8evtRZJlTUM3o Y0RRBxTXTuJ/GEjvI42BKBBDRLQMTXYaVQkCcQPlEACk9/DZKe8Ng+Ck9yzmH9kcViwO BhPUelVs/ob7iGalVLxtHSBO+Vl3FI8Y8rpKBnsXeFvex+RXGUKVTQIbY4DJ3WFc0MqG spDQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Q0vDyy6G; 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 d5si3724306ejt.487.2021.03.25.02.16.15; Thu, 25 Mar 2021 02:16:38 -0700 (PDT) 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=Q0vDyy6G; 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 S229738AbhCYJPI (ORCPT + 99 others); Thu, 25 Mar 2021 05:15:08 -0400 Received: from mail-eopbgr00083.outbound.protection.outlook.com ([40.107.0.83]:36071 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229508AbhCYJPC (ORCPT ); Thu, 25 Mar 2021 05:15:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RWMFZ66iwBQtjVyzRgQRjFgZc/U5DEq/kpG9JIb4eU3quESEep1WMldJ4chKsi5EM/4YDtajMndhwd77ReQIC7nvvcekRsOh2anv4vc2lhVSkotd+R8hbZU89Ztu1BZDZxUKpwTj2stUf7KZeMXJEPf9avh9ecfO0jqHPpanKtjCgy20myYnl0ZiGvFYMiWUYxkpEpTVcpKuzW0RIm/YFviz+oVhE8wyX09JwjZguKloIUg6fMesnetzF/R1oiWkovWOD0pgsbNv8p0EFpSGDivRFZbz3uuQ0xeP7OfQP87tNMzWvhlyR+ql3aAOj0hcaJogdnrkhHBHfQzB/4oSGw== 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=S0X0hGtFCmE49bYvnLzSjWVHNNUFZN+x5SMGrSVlXew=; b=dd17JITGsmAHVygNw7tLDpL6iGEYrZMKb1E2RUUljyg4bhAM8Enng6VIl36v0UUKxXOUB4I3kFX1t4EXGq25DSglUWhgHuypHaTwzYHH3mIFFZYh9Xhg9/X4lw1ErO6QzRVSoMRWzWTXkQO/FIvIMjU3FhMPLArudem9lB7Rvi1UbFKJJsOBT+I6ENPN97n7psJ9pnU2i7ShUSfn9iIze+9MVot3tFYvpzN+X35niBd6y42zv/woWp56oWO/HhrF3XICdmSHt8yWT69WEschwct41tH+DDIMN2VKyq6UBp8HKy2DBZph8/aExn5LqlPQaBA2kQqlsuaNqniUGZehJg== 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=S0X0hGtFCmE49bYvnLzSjWVHNNUFZN+x5SMGrSVlXew=; b=Q0vDyy6GzyUnWlBYtKJw4zeDJ3RiFRlOGlIcg4gWR3POpDllSd1WNdCl1bGxovcLTGWNrG7aJ9kWQpc1p3q/A3R3XlgzIEq76PseDM70iqimfPQQKwnDO21Gfo6UfLe/GemRJQUc3QEOEWEP5BSKhdV6MQqjKYpLhGynbg5qAo8= 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 VI1PR04MB2976.eurprd04.prod.outlook.com (2603:10a6:802:8::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Thu, 25 Mar 2021 09:14:57 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c%5]) with mapi id 15.20.3977.026; Thu, 25 Mar 2021 09:14:57 +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 v5 2/5] phy: Add LVDS configuration options Date: Thu, 25 Mar 2021 17:00:29 +0800 Message-Id: <1616662832-27048-3-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1616662832-27048-1-git-send-email-victor.liu@nxp.com> References: <1616662832-27048-1-git-send-email-victor.liu@nxp.com> Content-Type: text/plain X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2PR02CA0164.apcprd02.prod.outlook.com (2603:1096:201:1f::24) 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 HK2PR02CA0164.apcprd02.prod.outlook.com (2603:1096:201:1f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3977.25 via Frontend Transport; Thu, 25 Mar 2021 09:14:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7a738156-5a53-49dc-00af-08d8ef6e7541 X-MS-TrafficTypeDiagnostic: VI1PR04MB2976: 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: YA0le0HiLyYm0nIWLbYXJhCU6+agQ/f0se5dgs1ZrB1GezsM8xCnvtn1C4996wVDZLgUHtqb6jMiAwjATMUppWV2BzTepbpBnywAduC3E3WqNqBn9a22nUi4/OwDtD4vU4/0m27ja0JXv3GhHUwox72X8g9v5ZjR6j3uV4qVaFZuwWFagA55d2gZyXr68bECONzkfineITpmEBPKJ6rCH1LC10iR+TZFChguA/sHi8zR/w28E9rP5jy4TJOJYqbPZfquWcn9d6DD6vgC3RFrXhzvxRATLTdCbrqN00O+P70fU3SPmof+vcxhNikGrSenCPDoQro8LNkIEaEQ4mdxDL/dgLtuoEpD06aCJWr76oCk+Mf48znDrh++5egk4XV2VeQA6v1vD4CXIAmlEF1oC6RFPVa2+Wh3HpFSfjXwwXwgp6d7pih6QbWS2nhbpJB/0mQ9drvhP/ihKpYYvjy3/Qnw/77unhEDoPtCq0TCK6ZwYXlW8eIfezDkd9QuOtcXlVZbkceF75vuyNCdPyty4X+Ltxlo3wCoIedYyBpdTCuQaGNqPBnN2mwFyqerrcByKXptzP3kwMuiFpwKwvoKvo/jRQ/ouglHh8AJ6iUrBesKeJZHwFXYPsOozTtYgHJP6GHHX9QXNsZE/BmamwzQHXx19SnSoHKB5/30tcsCA8RYcJ6gA6s7b8fGCG53V6jX 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)(376002)(346002)(136003)(39860400002)(396003)(366004)(66556008)(86362001)(16526019)(26005)(316002)(7416002)(66476007)(5660300002)(186003)(6666004)(478600001)(956004)(2906002)(2616005)(6506007)(66946007)(38100700001)(8936002)(6512007)(6486002)(69590400012)(83380400001)(52116002)(8676002)(36756003)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?RB6PMISqmZYwhvEJRdtKQbX2c3wbzyrPYu8EmIoza3v+lTE7kZdXSscFIrs8?= =?us-ascii?Q?Qq6S5dCE54u70KwAq0ZcFoE+WKyd6GC+R3jWsLjH/1bIVkCgJjDdJQV6nwwq?= =?us-ascii?Q?eW/QBIlK3ea9PjL2cHgnm6rRbE5yZvVZxyk3O6h8rxzLAykg1xj5T1M1IF9s?= =?us-ascii?Q?pGcoPczwpcORWmpR/+wHqlBKqAzxYRDnbvWbWw5VORfbRAmo5Rha4GmsfTbm?= =?us-ascii?Q?pkYgUr7j2O/TYUCSrhlvdmaw2OtzttW8Ksnz6FcT4DA0B5WlP+8LCDYyj8Du?= =?us-ascii?Q?s0rIsojA8evqobLLl4u6lv5j1pLCMnDX/tpn+lrtvDZWYYGwrffLdMEe7S/U?= =?us-ascii?Q?3h6hEIGZaQbCdT+npehu4ItiH/HUmqZa2akEzgSlM6vu3KLCIKrHUEw8nkv1?= =?us-ascii?Q?+HDHCRZPB5sGR9ohI67m0cIM0nS7Kh3Iji0sxn6TetMGVZ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7LTtaxfjYXmeK?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a738156-5a53-49dc-00af-08d8ef6e7541 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2021 09:14:56.9388 (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: vb3cmfVewCPtbCcOs5rqwEt2RCEgdY41RzcTqBs2KWKr6YauGo6iYEEzGRYc9HQa8fiSbkiFoHn9VU5K1RzCTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB2976 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 Signed-off-by: Liu Ying --- 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 00000000..7a2f474 --- /dev/null +++ b/include/linux/phy/phy-lvds.h @@ -0,0 +1,32 @@ +/* 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 + * @bits_per_lane_and_dclk_cycle: Number of bits per data lane and + * 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 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