From patchwork Tue Sep 24 07:36:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandor Yu X-Patchwork-Id: 13810442 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 78032CF9C6B for ; Tue, 24 Sep 2024 07:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding: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=JVNVwOXVWFzOeVbw/bwP+iE1CpBdSXlA14FEA0vxGWo=; b=enGtbCYPI821R/bzTTt17GgkzJ x3jL4CSEwCakMcpSRdDUuASghUIc1eJGzdQ/k8WKRdAOxpPBxLMlByHKkmwVWTNgdr1ttJjeBf/Gg SUT+1xLsrQEFwG0inXSTTLq5ivHJXBEtMNFf8Q1CyBo/RZ5ENXscFuwbXrFPc9LNuJyrrg8ibizkb 9DRVIGuGDtvuz6as6cIymULrv3ref/AYjMXyeLdQwF8Yd3X9RkX/uSCoipTBGI4JfPjV442UbgdBY mLRNDELXmb64oSNMLAIQFdnjAHklASFembPnRuFLxAR/HCDEPjEU5ql8LA88cO2HChZyIAL+12fIn EOBoA5xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1st0BF-00000001SRv-03rg; Tue, 24 Sep 2024 07:41:53 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1st07m-00000001RF4-0pjv; Tue, 24 Sep 2024 07:38:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FzeeuteDLxd4hbN1VBLUgyg5fLQ0a+liP5d+qJox6aerLbW6/+4jXpaRLQqeNpQ6Ml1CNZswXBaPI6pMQrywOYYCf15FKSdXv0MdBwnSENPQwcunO936CVqjF7auERn0ToWsNXtw0RquvPLW6xTn92NJM4fM/1ibOyGu80pU2aonWGieP8V2PkgPJxygT4C+rte91S2hZtcM+7YiErUZXcsJGDZpSmMoUjHRHH69Pb+kd1i/kR81VoItlBOL11I2vVG//MM2uyAheJM15/MvigI+xmdXm5Tb8VKDupp70MV0WGsGz8IbACz80+AuL7GrW53oBslxdxMXns6gpV7v+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JVNVwOXVWFzOeVbw/bwP+iE1CpBdSXlA14FEA0vxGWo=; b=jbqVRkU3RV+/8xBx8Q8Ekq1ikUPKyeHIZfUg6a8ID1AnSxoQbM37B0mkBmlN2ACcT/qaKZMxqeYxKmojdxACCDnor3Rlfqf1cM4z/VKn5aoTytIwiVpXDDSqoYykfXWqHXnS40F+wLt0Kj8RLkY3LV/o8ru1ox2kyRgsXWipyLTwBwNpl43NEfAE+2eDR6RnpykIZn1ObyP7yEEHTUyv8nGhahclkDPD+X7WM3K6D9CL1HI5dSPjx+9qkQYBrkMittnjSmuVMrpOCrIM6BfJ/qrqzjwyRo0vqqkyTIy6J1ycY5gQt0p7LY0aU1XzBTvIaLa9/PoPnkGrf+8UP7kUtQ== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JVNVwOXVWFzOeVbw/bwP+iE1CpBdSXlA14FEA0vxGWo=; b=k0u1Sko1QD4Jc/X43uD9aARMi6/1kSS9orqqJwn2hE7dQsl3UMd4Uy3m/pOkdKbZnkH5eDhz7lCLx4YOIgbYNNLJ+a7/wUGsmn33O1qMZGQpp7SfyiRf4+C8MPHuhbMS1iN4QkNXI4R9gl5s8XCMt4dGs0WATJCJVQA3sikDqPx01bXuuQr+mCttMzK3TNjj7XVdpTMKcYTA85WJWyfCTk/U9IT19C0Dx0tYaGe6CJ/Iyg7DeTWEiZLkejtlNHvhIrkFnWuct758nAeBJO+W1vLYMbroNzKkwuKsTM7phBzWCFmVmGzfdnvVKHwD/A31kJsY7E09YE7A2dKSoU71bw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9448.eurprd04.prod.outlook.com (2603:10a6:102:2b1::21) by AM0PR04MB6881.eurprd04.prod.outlook.com (2603:10a6:208:18b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.27; Tue, 24 Sep 2024 07:38:12 +0000 Received: from PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::51ae:5f12:9744:1abc]) by PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::51ae:5f12:9744:1abc%6]) with mapi id 15.20.7982.022; Tue, 24 Sep 2024 07:38:12 +0000 From: Sandor Yu To: dmitry.baryshkov@linaro.org, andrzej.hajda@intel.com, neil.armstrong@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@gmail.com, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, vkoul@kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, mripard@kernel.org Cc: kernel@pengutronix.de, linux-imx@nxp.com, Sandor.yu@nxp.com, oliver.brown@nxp.com, alexander.stein@ew.tq-group.com, sam@ravnborg.org Subject: [PATCH v17 2/8] phy: Add HDMI configuration options Date: Tue, 24 Sep 2024 15:36:47 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: SGBP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::20) To PAXPR04MB9448.eurprd04.prod.outlook.com (2603:10a6:102:2b1::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9448:EE_|AM0PR04MB6881:EE_ X-MS-Office365-Filtering-Correlation-Id: 20e59403-4671-4530-cbd5-08dcdc6bd7e4 X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: pGtkiy18pPys2xRkF30tNzio/Wkebo+aSLLvpDH/Knkv4nV0b5P0njPkoAgKy9+0h2R3ikZYRAw26ALlUZyGHlV3Jq1lLWO9kSgSem9UgNEGdePlSFnKbsylcJEQqp3oLQQ34OhzVzmiNoRL/4iu6ISvBImSNY7nBzifMELf6X7Azv2riQJXEplx+1CtHqX8H6ZLgLMZTCcfVwYdZahAmS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JVx01oJCTXv0twhV2w9XOBJfGijWovCrqWAUvgO2ZHDdwwxBN2BSMV6Syte/ueQ8V5+2chV5/aqDKIRt0dTkklzto373pghMrmfA7FhcR9POfyYkP0t2Z8rgMscteknMuEMBovOa+SVguz29Hp0SKvS4UAjSzy7lVfpc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9448.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wP2grfh4WT3GKwlCPL2rWkYnMriypqvhN8wzEZ1VdGZBaebRnNV3AXd78tDCs23vTtzLDDUoi2W5vtmV/ZcfXcsLPJRRUGIEf4ovamwIkYYbl1nVFMCfo5HEMTd7hfDHas2B9Ty2SDkIzClH6G2NOXdtFEXsGYOJqRwvqXaYWaruXyDbmQc7w9KfWVNciicnJLyjHJNjVWucUcw+8cvq5zuvKvDyutsD9ik328wQDcMSOIymz8w/J2qJdKOjlEow3ZdF666rt+8/tOPyDcbaO4EPe4XCsKMt3YK5meWZ/k/DBuYc1WgVyOpttoHBvKxqu2P3O2pys7M/dDINGF4ZN7AeoaSqqazfm8cBGKF90QOTGMEJmBXE1+dwfJb0nMI+R0XozxozHDF+O+vUemJHj8UgSGu/Glu8bQTrQE3GCgGh6I725IoFM0CHP24+41bGsFCIzB1mgu/m2bHw/OmgLwUIP4wa811B3bniaIAuDsVjvNaYM8Ch7GCMCb5MgNdUdf8v95YW2Fclqz8KQ3c3HhrJCDo2szJmNfK436pydBYPfwV5Jzz/fHKmnu0nl1cDsT3n/Hwjzkw+KH9ZqSgMQF5x4OMN7ZFOcPJ1OnfD/GwneY3/GDpv0/a5dQFAHP5krXe4ykEwjAIGXeCVAn7eSzl56ZsRnbsRVASA0T5+Q8uVLySJ3LK1EghC+Dmlyzl6T+qKU/lZd/zkRrEwtgoOBGpZ++KlnwnLacPP/1j6v7fRcc4ryUOeMl0It/QVvHBek8egZvWMiI0fSqlumbcSYO/rGTfyZzf1Pxt9WT1i/mj7abcnzSdXU2E+UOdprYPauKApO7COtFoPVRVqGMgiAvKzxkmFfQAhny60Zg+Mkvpv/iyyV6tVOrco/4lyK6F74qGv/zSQLSexDUStBy7+5/sdRKlMCxIqjafjsyUrhGqVEVajvdYNNJ1d5MbWBU4fCosjkK4nsxiR7PMp4x7Gi4k0q7fmkK4JkZ5hKMGoS3+YkadQtlGJVic1sDiIzrnrOBuxyoGDy165hXwhlPVtf4zk/QBlJstyn1wYUStXDsmAWKODcmTPkLCkktwF5jMOxms8zfsk6yfJs71AphjwjHV4xjUveFBCfCLHwi5ywx9xxH0Yut+tNzwLH4M8K9AyPx4hMFagUoO/ZMs1D83BlZp6lIk/9hBq1LSfZbOtXkThJ6cAg3tmwSx5YrgNQG6hrxtcG/zfQWO7x6CeaoXvrl+GJM6Y1mPUvCOSO0T6gWHYscNH9ks7t4Fwipb7TgfnhVL2yLorCepvKL/N/BAhtROD6Vhw7VE0lR6Gze7oYR285Yvm+Xr4sUGiPefRTSl/ZF5Q+uLeWsiF+pt/WuAMsRdX1DUbaaIytaEPFG1iQLyFuidELac+eLX+c+mKiiiQEOCuRKL2/CV8+QUcSTkFvWWQtHOoUuJZLHiLrj4aNc8iDPkOcszZ/Q+mCtHGRauyVgiLby56BHqK9w4Wahf5LP9FDJ7591g1mZ7UmvCBcUk1XSqLSTEzuSaDTM6ReWbqEGPP7TT8mY7GlvUeaWFAQAvU+0dyEo1PpfXTeFj6hctyi1xMGEhAd52CvLjJ7fRv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20e59403-4671-4530-cbd5-08dcdc6bd7e4 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9448.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2024 07:38:12.3475 (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: VQa97ULIAx28pa0XOtu6ISFAz/0OXQ83I2zyAA1nslkyGxgkgzMMPrd9lSUjJowb49ynSXyjVBgbHnzz7TCMuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6881 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240924_003818_277077_2752D6A4 X-CRM114-Status: GOOD ( 17.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Allow HDMI PHYs to be configured through the generic functions through a custom structure added to the generic union. The parameters added here are based on HDMI PHY implementation practices. The current set of parameters should cover the potential users. Signed-off-by: Sandor Yu Reviewed-by: Dmitry Baryshkov Reviewed-by: Maxime Ripard --- v16->v17: - remove headfile hdmi.h - add 2024 year to copyright - Add r-b tag. v15->v16: - Remove pixel_clk_rate, bpc and color_space fields from struct phy_configure_opts_hdmi, they were replaced by unsigned long long tmds_char_rate. - Remove r-b and a-c tags because this patch have important change. v9->v15: *No change. include/linux/phy/phy-hdmi.h | 19 +++++++++++++++++++ include/linux/phy/phy.h | 7 ++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 include/linux/phy/phy-hdmi.h diff --git a/include/linux/phy/phy-hdmi.h b/include/linux/phy/phy-hdmi.h new file mode 100644 index 0000000000000..6a696922bc7f2 --- /dev/null +++ b/include/linux/phy/phy-hdmi.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2022,2024 NXP + */ + +#ifndef __PHY_HDMI_H_ +#define __PHY_HDMI_H_ + +/** + * struct phy_configure_opts_hdmi - HDMI configuration set + * @tmds_char_rate: HDMI TMDS Character Rate in Hertz. + * + * This structure is used to represent the configuration state of a HDMI phy. + */ +struct phy_configure_opts_hdmi { + unsigned long long tmds_char_rate; +}; + +#endif /* __PHY_HDMI_H_ */ diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 03cd5bae92d3f..4ac486b101fe4 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -42,7 +43,8 @@ enum phy_mode { PHY_MODE_MIPI_DPHY, PHY_MODE_SATA, PHY_MODE_LVDS, - PHY_MODE_DP + PHY_MODE_DP, + PHY_MODE_HDMI, }; enum phy_media { @@ -60,11 +62,14 @@ enum phy_media { * the DisplayPort protocol. * @lvds: Configuration set applicable for phys supporting * the LVDS phy mode. + * @hdmi: Configuration set applicable for phys supporting + * the HDMI 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; + struct phy_configure_opts_hdmi hdmi; }; /**