From patchwork Thu Jun 15 01:38:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandor Yu X-Patchwork-Id: 108227 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp338061vqr; Wed, 14 Jun 2023 18:47:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5t4Z00TI3fP4HdkOmHs48F+xvfpP7YanLWGv7f8XRPhOEcurc8302ncoDBlzwmFpzOta3k X-Received: by 2002:aa7:d909:0:b0:514:bcfd:6e2a with SMTP id a9-20020aa7d909000000b00514bcfd6e2amr3436150edr.2.1686793676060; Wed, 14 Jun 2023 18:47:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686793676; cv=pass; d=google.com; s=arc-20160816; b=ykiYfpRR+ajBB/GDxWqJxFmWfXU8ZUlV9zZ7ZzshK0bkQ423sLJ0PT6iiOnqu+PbhA TrbFAwdGbsfHoKznaSNsEy8/mo3lD7LzzaHoaE+djsxJgYb82PkAVD7bG/9wfsfLUVwx RgeIsvkP0+STMyNObDNDnmamvBSXcDGuZ8RujaZV6aG+wXey+3SvW7KRSBRn8BmP2vY1 K9ceSrVw5LbLZiMZwTmipllgMO7mC+9q2Kb8aWOCn16EkmBFiHjrqX9GCciI2AAEWRUa xA0UEbq3UxIOD+0ERVgKQmLIZJ4CinmXPXyRuNAtxdpcjDy/tR75O953hHQK9w4TpSH0 gpKQ== 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=DeoiFXLYhwmAemN/90bvxCShXGEJiwjtDdONCOjk8ts=; b=IAqVwHxs/VSBzT4xhmTdwPVTPMT/w5V37uTeuTIyGu/KSDjAFMdG3QOcAypgBC36fc KJfR+AcoE28T2HiKOHiWmXSKCBi4H62ks0yo3iUL6GQous+BcG+DVfD/gaHGKWc/LEFs nKFdvOHT1r7D7C0xmzPMPvyH7vCDEVH0xXOP62qnEnJ4hpr8bXrzz2Q5K9p38qixik0D RUj7bbAEyKZjWjFsS44zB+qwSKO3YkaNSdRELeS574trYcU23Ytgty33X+EnbisHbd5y jIYESlq/thugJjuP9ZdRLHZO1q1DM5Z9qXLLy0CuCdMURdg2J7blQxs/wnyZFwNYn1ni eU2A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=DDpyPv+i; 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:20 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. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i14-20020a056402054e00b00516a29f61acsi9788911edx.649.2023.06.14.18.47.32; Wed, 14 Jun 2023 18:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=DDpyPv+i; 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:20 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 S237537AbjFOBmu (ORCPT + 99 others); Wed, 14 Jun 2023 21:42:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbjFOBms (ORCPT ); Wed, 14 Jun 2023 21:42:48 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2042.outbound.protection.outlook.com [40.107.15.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CFEF2942; Wed, 14 Jun 2023 18:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U6D7ndkUhLp2sPmhk17djNF9DsqzYqADz7IRMFr7j2RbAZq/lhR/1LH+dCyUjDb5L1VWagbg986uZN6w0bEcLzCV6a678h53HVbYYDZGVtAqfpf6IvvHLBkPnUonFfXtpXVvwyLh08kQ2hYnItWfgEh9t3d9Qk+8+jKaQAaAovZmJeiO9I/UrMzZMplxg82ibAUyCP+i3JQ7/+XJR9MhhnogEWiJDJ0+HNZ3FlEOS4CTP3k6xscvfy3Q1sbk3fPzn0tM68fai8By8OGAxCzHqmu6KuCsRZ214BJ3VW7pqfvGuy5R+3JBXJlabWi/bw5PEKxwb/3hTLuzHE+yepr3jQ== 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=DeoiFXLYhwmAemN/90bvxCShXGEJiwjtDdONCOjk8ts=; b=ZBb+EgsQjgg+9j8jb6gXy6d61TVpUCP0S0hZWzzyJPOJ0mIwfBxDf3r7ViOMogvRzm/VzldrbRswTWOs/l0B1Oev2HtRdBAWLRu5ery/WH1aVr60dqFnnh2mSvJYZpESglpFsZLLTnvfKMTH7jHUnxhI5drq8noKtzfyM/gp83iPXblgCvg98WdqaDygph9V3V0UNZzN2PEoW6DhKB5X27Qx5pGe2nYueu6ri7k5FeIncGpeUWThZIYsr8Hm7Tt/DUCQQVvoW/58piM8XHmxMCQt9WhwSUzvP3HiFTsNZ2abHRdZ3bzEp5GQ4zW/ixRDDXGwUEL82RDGfQ3FFN/N8w== 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=DeoiFXLYhwmAemN/90bvxCShXGEJiwjtDdONCOjk8ts=; b=DDpyPv+i3dD5mjQSNwxfcmFMLIrgE7FIMdjhTUq9NaqwLvgkZfoPtHU54l3zcQXYiYQMEeIvgMTzHvNj1uTmKN7g3XAQyeMioDNdHqLuf2Unw39bSDfVbRbU4TUayVxcpBVmTro/onIh3yyL8lKtbtOoRRpAVWJ6zeEWnAGtLNI= 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 AM8PR04MB8034.eurprd04.prod.outlook.com (2603:10a6:20b:249::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Thu, 15 Jun 2023 01:41:37 +0000 Received: from PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::8af8:59df:c8ab:ff51]) by PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::8af8:59df:c8ab:ff51%5]) with mapi id 15.20.6477.037; Thu, 15 Jun 2023 01:41:37 +0000 From: Sandor Yu To: andrzej.hajda@intel.com, neil.armstrong@linaro.org, robert.foss@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 Cc: kernel@pengutronix.de, linux-imx@nxp.com, Sandor.yu@nxp.com, oliver.brown@nxp.com Subject: [PATCH v6 4/8] phy: Add HDMI configuration options Date: Thu, 15 Jun 2023 09:38:14 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR01CA0176.apcprd01.prod.exchangelabs.com (2603:1096:4:28::32) To PAXPR04MB9448.eurprd04.prod.outlook.com (2603:10a6:102:2b1::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9448:EE_|AM8PR04MB8034:EE_ X-MS-Office365-Filtering-Correlation-Id: bf050f20-0c04-4b94-c47f-08db6d41a8af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dwjcsDvsPmvjX5esgxDhWwQbVWM1sEWdsLL6iPVT3XAMqEEL0Ax+zSrVpHu2fo9DlBqYK91i26DuFAzeRGSDZDDUH4oCqaO6WGk7QmDsdIkAlucBT3Q0YHCESQRKhOt2SIRBRD8jAwY3j+rE5kEx2BOKdV+YPkRnasWWlh6ZLHlp5Tja6OuLmMf4f/FKMNJtXkB73Fej5CMEdXu5AOxmC+h6ANzL2pbXZU8G6oCIJ9qFDZ5h6YVNcRWn9FrGLiBbuy7aCAziGdbX+0q8evLQn0CB23xKvxwSUu7UKsn9w1XbWFIU08wqFIhU7ehJsd7SiL96I2SElgBOF/Y9ftWBjvQbAjItglMpnpQ4GqrOfizcDWKhx7ZPSRK4N7FMZXG7mG8WJ/07pn8C40ra2ZP7fWFXHph2PB/OoFKowm6Keg2++ZURTAi+X4LWNz8LCgDXqUf9nf4VdS/eZG+63Lb6kXeTh5kShdm4G1zj764K22LHKgp/bBrJdA3+jhEOXk4lRUdxDHVhOnSefpUj9vajDUqPkFBcOuXpcq5K3hH8evvX8I+o1xDt4pZ9pW7YBtWdrKohoCuZy2HPg3XsdfjTtRVsNyApPjO+qUBBhUWEY3cPXhZQJCbxqMCM6N5r/jROwG4QTE8oi0k13Lq8syGI1A== 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:(13230028)(4636009)(346002)(39860400002)(376002)(136003)(396003)(366004)(451199021)(2616005)(186003)(2906002)(83380400001)(6666004)(66476007)(66946007)(66556008)(52116002)(316002)(36756003)(8936002)(41300700001)(8676002)(6486002)(86362001)(4326008)(478600001)(26005)(6512007)(6506007)(7416002)(38100700002)(38350700002)(5660300002)(921005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iiPOAeojDtX18yxs4pqg57EiXsJn6+AcbCy/pNkl2EkJdVX0JbN1z+J+fTz7T3jqCGxOoU9/j9SsucdTWkxw12DoA2i9cwFljyFELkDTJa14a6iEu1PD9y26DgYspT6/toBhgNP9Lzd1mrUD1slvoypfsEgCmN9qfYJEkF1MCWBJnxM1+IJGBIltaDi1WjHmRe5n8vNxOU3rxW6IF5YFuT2tBTgQ4tw0vqffxzBQact9U+Vygbkc0Y8dJoqNHGhCr1UNxC+737juuxUuphRJS8ial6a1iGbNDZ3Ws3Z5zMaamv9Vtcf0NFouNDWKBTwijwBFFw6LvAlDGgEsxizO10dsRrIH4P4TLg30IYpEEll2NY3pQaBO2+so5yIOK87+DzS7WPPE5rzGRNv+WfhkHrA11scoLpgTsAPY2HBpKeDM6efjeTrAF615z/9QoUDyL0fVOYsQL2pTeTG3lIqeo6InpDNaCjIvNOIvIpNKBJHJsodasnQ9iuQGgKFZ2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+sj1w8O X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bf050f20-0c04-4b94-c47f-08db6d41a8af X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9448.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2023 01:41:37.5272 (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: N5HJRXUNLv+aKOR/DcCu66BzGKeAmqjX3UUctI0QXYzIg4CKa2mcxfzA7H7SUh5gwR//jmHyLGiZiWVx58eCcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8034 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768731365688198705?= X-GMAIL-MSGID: =?utf-8?q?1768731365688198705?= 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 --- include/linux/phy/phy-hdmi.h | 38 ++++++++++++++++++++++++++++++++++++ include/linux/phy/phy.h | 7 ++++++- 2 files changed, 44 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 000000000000..5765aa5bc175 --- /dev/null +++ b/include/linux/phy/phy-hdmi.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2022 NXP + */ + +#ifndef __PHY_HDMI_H_ +#define __PHY_HDMI_H_ + +/** + * Pixel Encoding as HDMI Specification + * RGB, YUV422, YUV444:HDMI Specification 1.4a Section 6.5 + * YUV420: HDMI Specification 2.a Section 7.1 + */ +enum hdmi_phy_colorspace { + HDMI_PHY_COLORSPACE_RGB, /* RGB 4:4:4 */ + HDMI_PHY_COLORSPACE_YUV422, /* YCbCr 4:2:2 */ + HDMI_PHY_COLORSPACE_YUV444, /* YCbCr 4:4:4 */ + HDMI_PHY_COLORSPACE_YUV420, /* YCbCr 4:2:0 */ + HDMI_PHY_COLORSPACE_RESERVED4, + HDMI_PHY_COLORSPACE_RESERVED5, + HDMI_PHY_COLORSPACE_RESERVED6, +}; + +/** + * struct phy_configure_opts_hdmi - HDMI configuration set + * @pixel_clk_rate: Pixel clock of video modes in KHz. + * @bpc: Maximum bits per color channel. + * @color_space: Colorspace in enum hdmi_phy_colorspace. + * + * This structure is used to represent the configuration state of a HDMI phy. + */ +struct phy_configure_opts_hdmi { + unsigned int pixel_clk_rate; + unsigned int bpc; + enum hdmi_phy_colorspace color_space; +}; + +#endif /* __PHY_HDMI_H_ */ diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 3a570bc59fc7..93d77d45b1d4 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; }; /**