Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp763886pxb; Fri, 22 Apr 2022 10:38:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCl00Qg9wkeL2/GOmfyL/EKx0YEN3IzpPoykvYhjTqqxVAp1Povde0aYnt7kTywvb9akfc X-Received: by 2002:a17:902:b106:b0:159:5c6:cb53 with SMTP id q6-20020a170902b10600b0015905c6cb53mr5692014plr.99.1650649102435; Fri, 22 Apr 2022 10:38:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1650649102; cv=pass; d=google.com; s=arc-20160816; b=EVf8n8v8VgzMGOlZ62lkd4kI93XlPU7uTyKqFOcAywXgizx+Vfr1WHzKKVfRJq9Bb4 raVnq8qIZvyWtEi2RvdAalxXxHbkEU8HXX5b/HB1QUZMi5aCsUJtvnZX/D4uczpOJ2Nl a7wRg2HKWzlHWtAgbgPRJI7YlgA3E2PYNsb94kuK5oxVI3Tq6rIczYnuiymOG0PfL803 WSnyfWg2rtvKW6aV9dbpDJyuEoH2mulMxhmgEarq+mcnFrRao9X6zZF+shLexO1S8vhc MC3pKxfylpOWeIDNKx4Nfc9gft+1vg6SpnblpIF2kte3QLF81ATWEF41kkghak4WWoJ1 W+wQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zikVNYi3cS+FrIsX3tOfjPXYjapqrG9gbDqBXBxuQPQ=; b=bp0LgU/8AY9IQlen0/nilymsunMjKJxP7GPpmHQIMBxOvvmYgC6mCdNRzLMk7vyClI PCcbs+H2ZgY/dZ5G2rVbgtCIj2t0mFNeCOygxGBgpw6YYXcp7T4JAcb0MwMJfAtscEQy IGo21fm5+tm3Qgggjk4rAVxYViJC7wz5gWU3Zs00d4DBp2V56o1PcxcVIYxk2XZHFNLx QvtXorHi/Z3jzU22J4Cex7jdGNaX2T3eWE8a4npPPKigN2U4Kzr/I1v5T6gY09GA43C3 dbgk2LolVX7GPni3uBFsCkL4eswxew7LGXUEBs54bNi2dad6UEkEP8pS3lw8CLDwE3Ow /TKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=AOhFs3fF; 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 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k1-20020a17090ac50100b001cd49fa9153si7392626pjt.18.2022.04.22.10.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 10:38:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=AOhFs3fF; 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 2620:137:e000::1: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: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1507EE41CA; Fri, 22 Apr 2022 10:28:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244642AbiDSBKN (ORCPT + 99 others); Mon, 18 Apr 2022 21:10:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244668AbiDSBKK (ORCPT ); Mon, 18 Apr 2022 21:10:10 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2065.outbound.protection.outlook.com [40.107.21.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 464C929C8D; Mon, 18 Apr 2022 18:07:26 -0700 (PDT) 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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?mdpiAyV7BO6TVzJ8AUCngKK92OL6vdd1J6qz59LCkHYCnxSUzHR8R9RL7hKL?= =?us-ascii?Q?9j3zJ55F+7quTHRG7d5J25mAayMsoZDSJxKEkm9tN8nAXMvx17xpPIal0cMc?= =?us-ascii?Q?KhX+ZV5CthCdaue1ml2fCqfx3kC0Pncsr42qNSkzw5eH6935BhBd1n7kusCm?= =?us-ascii?Q?djaneAfV5cBypHNNk+/deeHcg+KjjqWbOclGttKSLjcJe+G8M+f7vEpvScuX?= =?us-ascii?Q?HMRE1ekNb2Fdf56FT9BjDv9VTJ+jtu+8YQei/FjWlGevFbY54vsbuI+DHIig?= =?us-ascii?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/b7bjFqabRArk5QVjUA?= =?us-ascii?Q?ZLM4g+moBGsYS6rWplYjWb9yk5qFssf7zc3aKzRD7tptej0GsPMjmqfZhoyA?= =?us-ascii?Q?YXIrhmaWOmWz/TJiEy/ZHb3ql+SE5SfVEvew6Nfe3SW1sUWVJdawN9uPtRqG?= =?us-ascii?Q?Yjf4rNv4eQzyAmUMAlKdharqCM5YO2Se2JEIJectTqPh8i/mFXO5pQvnAvUM?= =?us-ascii?Q?Du81XZrebm6HN4ah3JIO0hf3ChqIEhzfuk77/4ZGWGsyyOJ2viIUQ9cXS3pS?= =?us-ascii?Q?sj7HkPILkk6xNom6xRr+SWYx/hO0DJFX68/9s3J8uIp7dyN/+XbGbxgbmGwg?= =?us-ascii?Q?TiYvQNtfIdfAE+LGidOznPty7oB3P/jmvw/QQrQ1J0YJJhlBGusuCYK6ARNQ?= =?us-ascii?Q?DPZsn7d0gDpzwYky9cTwT11pHcuWunXe6xfIvkupJABiHrNtWw576aN/p7gl?= =?us-ascii?Q?fvr455CysUhLCEsJCSM0TlP3ZvEFP6V/7L9y8SI+xWL1TReyTd93ycLtPGnt?= =?us-ascii?Q?Cmcnwlp9PWnoTvxNjVVgll8TO/dTFOGPHZwvPdu85RsaKlI2AOSyoBGnzX/f?= =?us-ascii?Q?XQzrKP+Wjw=3D=3D?= 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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 --- 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; }; /** -- 2.25.1