From patchwork Tue Nov 8 13:00:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandor Yu X-Patchwork-Id: 17030 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2692327wru; Tue, 8 Nov 2022 05:06:46 -0800 (PST) X-Google-Smtp-Source: AMsMyM7vSMe2moXPZ27QdOyEOkV36jWvycT5G5kyW0qiewmYfGJRjD1wKzSK+u5meB+emZPsXTuk X-Received: by 2002:a05:6a00:1ad0:b0:56d:5fdb:a29b with SMTP id f16-20020a056a001ad000b0056d5fdba29bmr47927904pfv.76.1667912805862; Tue, 08 Nov 2022 05:06:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1667912805; cv=pass; d=google.com; s=arc-20160816; b=cEIIDU4/b4mKz+ENDRbbY+6zbvcT/w0x67ezqRzDDbtexgA4iqwqESDTG1MlNfZD1c b28scY2Dtn321bfAFMXeNmnZlz2OaGfet6han7dLRT75nuy/osxc7k69q8EKEr4+ZKSa ohmb6a66HJNsKGBTff9E+/usPlvQo2qc2ehtBU9CjdtSCde3ej0ekoeAkFPHopDT+Jng G2RTRk/yGa7WGU0tRX6BX3FAVZJlg9XBYK7jLZv4tFzJXWA3aIk4SQKTXzkw1+GbIdl3 t2v313k5hKaJN5S+ZAcRYQBLgQpssTSv3cYf8TxylOwm6rRJlX0Gois9pr8pTHKFkajn cHGw== 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=VoMObaoHu8KTKmQ88r6WUD/O/qGZeHbzp5rnpj1bqBg=; b=eoD93HXUUOOo93hiPEcUDfNjeOftmKTGJxXChcDd8ljeWF12qg3HwpLfU7kQHkiCi7 PWv3J7SFV2ADcLmWSQiktO7xFOGpzfIYvBUI3OaDN1zgaDJFV20nJsIW+Dq0ACeM6k9e KKZ6NFgEQWzGuRV7utJp9td2pOrVVpnTxDLeZVrJyGhb9BHPjy/4gnSEy6MooY2hW9LQ 5x1xpeI7HWtNvreUFXvYqkZz8XNzpAcqxD/mCls9Suv1HwmPsgAi8f6EGu5A3qy6STJ8 UQfsQCULOLxrdnpwqAD+X3AIXHer5u3AU7kQHeIAUkw2TK6qpqx+p2FWIc+aCdTm5vRV 4mcQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=fcLSxBIy; 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 t16-20020a170902e85000b00179ec1d9eb4si18102174plg.112.2022.11.08.05.06.30; Tue, 08 Nov 2022 05:06:45 -0800 (PST) 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=fcLSxBIy; 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 S234363AbiKHNCG (ORCPT + 99 others); Tue, 8 Nov 2022 08:02:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234341AbiKHNCB (ORCPT ); Tue, 8 Nov 2022 08:02:01 -0500 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2087.outbound.protection.outlook.com [40.107.105.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A52F3554E2; Tue, 8 Nov 2022 05:01:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BKyl+4MIBdlj3+QuSffFaMAnyMzAVEXxf4w9RwHjLINuNN78Pgj3CF310OyWzbn3VC7TJwGX1hHk1PrmrhxGvfjvK5oFCKxs1QNxcDfwwAEJDz8++xeCnh1VWGnZt7F5UiKS7rExvsibwupsDfnuZksIdst1eA6VnDRDzDE5SmgPK8D9JcFPfXnq2uPyQ8yG4hsshiFFgmuPwyrY2Tv/GimiEwpekd9p8PoO9lWr1dbGKUYqXIZzyVBvIou0UpA9dO6lwAierNDAzR0PHDwq47zLark28f7gKu9sYznKS9KFYeb+cOW88w8eGIyL3Bn+/La0i1/LXn+JrJss5CUCmA== 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=VoMObaoHu8KTKmQ88r6WUD/O/qGZeHbzp5rnpj1bqBg=; b=BZVsClp3Nlwz/EvTeL5XADTJRE7cfUrj1Emo4xJSaNGQNbFP5vlmMJKfKtGFT/+fcbqmGMbe7epfmuySf0l01iQZw1MDL8BtvjdudCPJo/DOaBcFHcH6oI6HR9wTfxZ139nftVATb7UWL9qNDaWdGZuyALLMe9wBk2RSGqX16eaPdv/gufc7cEYmpSpafUgctWJlwMePzzNf/ipzz4lXSiCq7Dog7iK2uRXaKy4KGkjDRbrHHA6f3DCimGEMJ5QgABVMNxmUw0P5867sScc/lEH5tLnF1zXVudviP/bRBh5QfYcxm08A/gOThTkKd8UptfUyjgrlnjcHDiAmMhexjA== 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=VoMObaoHu8KTKmQ88r6WUD/O/qGZeHbzp5rnpj1bqBg=; b=fcLSxBIyHqSiAgYWTXSNiOsc07jtpsIyqsCwvxARkg1XDMvyCf6TUhTrORk7gXs9iDi536Y91473bF4invwXks7gM58WYYuEPqCgob80Yuy0H+p6nsYcYbodhbpyMnNvMqKLPPTdkKJ6AOU7LtLS0ApHUf12mg9YySBEtDz7N9M= 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 AM0PR04MB7059.eurprd04.prod.outlook.com (2603:10a6:208:192::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Tue, 8 Nov 2022 13:01:57 +0000 Received: from PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::60b2:4bec:7707:e196]) by PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::60b2:4bec:7707:e196%4]) with mapi id 15.20.5791.025; Tue, 8 Nov 2022 13:01:57 +0000 From: Sandor Yu To: 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, andrzej.hajda@intel.com, neil.armstrong@linaro.org, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, vkoul@kernel.org Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, linux-imx@nxp.com, tzimmermann@suse.de, lyude@redhat.com, Sandor.yu@nxp.com, javierm@redhat.com, ville.syrjala@linux.intel.com, sam@ravnborg.org, jani.nikula@intel.com, maxime@cerno.tech, penguin-kernel@I-love.SAKURA.ne.jp, oliver.brown@nxp.com Subject: [PATCH v3 04/10] phy: Add HDMI configuration options Date: Tue, 8 Nov 2022 21:00:07 +0800 Message-Id: <3edf9db8261e7f59dcd84a61a492d2483b1e9970.1667911321.git.Sandor.yu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0136.apcprd02.prod.outlook.com (2603:1096:4:188::16) To PAXPR04MB9448.eurprd04.prod.outlook.com (2603:10a6:102:2b1::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9448:EE_|AM0PR04MB7059:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f7c65f3-8894-4a09-e373-08dac1896a91 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6Ft3WMGaGB2BrKqx/eyvYAVUj933PRROlW7BnDLrdDgXBcSnkJ1OXIdPsww/X1kJVlA9xVoQcGSeTUPDHKHbgxsZWsI55a0HdeE0dEZvszFlk2HLVGqSQq8OQ1L9nS4rWyI5TJ08C71RJTYswRoatSyrHhzICl4qKEakXqYQadvhyuZkmXzRycQVYpKesLzg7+25wxE9rBhxnt2pG8Xyx9DJbEFXBrzFQxi0khQ4LkfZVWSZ4dFqJRhl1OxrCQk4nwSvb39sXCQZGTAyGIhtKOw8jJ8kloZcwbe50OJNGyZ1ifjkluhrIeNbYJPvh1m/+nSJDKQuKpAKHwkEPEVsWtH29OAEHSKRkAqC8dZJJWVgVKRaH9PJNkbBhH5zEHzKJHYyQcCuUXthYW2ywqEAcpINuXJv09d2NI7EXrniL2OFScGNCXbWpxzFr1L0wtrd767SeBeTm9juoDJJeAzUlCWuvGYuKah+MqvFzHJT9e/+4z6Q0Hl6FOtPUmoK8/yMTxfQQBNLY+D3VoytaAP7nQLTRTZZtzFwfMS2cwrIy2htNSnZNkfpPWpAOqYtWmqRCJt1N3CmUOxN0QkzUwpzgEgknbp7u52PiqJqh6XYjZa0VbAJg0F6jB2IoSJ3PU5mGs0u9knawrKSCGUc2+W2AuJMbWz4YkmarHPsGg7oNfBGVvlBN6NTlBspKQDzkr94c187XFJP1D8MXjORx/jUyut6wqt+q2GuhlcULnqBnnkO4rqbYfSIyXCYbmf9WPnmGoFwJHFq3CaTFZ1cc1+EOVrhiCg/us4rRNaHKxtYItw= 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:(13230022)(4636009)(376002)(346002)(136003)(366004)(396003)(39860400002)(451199015)(86362001)(921005)(26005)(6512007)(41300700001)(6666004)(478600001)(38350700002)(2906002)(38100700002)(36756003)(2616005)(8936002)(186003)(7416002)(5660300002)(8676002)(66556008)(6486002)(4326008)(316002)(66476007)(83380400001)(52116002)(6506007)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sdECa8tKrKKin4iP+uDMZCN77+SgmdZCggW/aUK9+kmlKDM35Je1ioFMLlx4idNSz5A9i3uEj+PSQECz/vHTr5YAd+k+NOrwgOrj8uJ9bWBfEpHbDai9xVYM/+Ld1J+0uq8ZNhKrCmwAjnSy9ZnJWU8QCGugIlvSqpHLmM9EOYIU1AmKgmWtew38Lh5qRV9n236Ky8DkuE29cl3hiVbYW7TWeZkayV7uFPqn6FLuAtlpRwePgW4//18oW/KjEUlZ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svMAkGvGvXYMTFK242YiESks3XD7CtC/6z/alJ8oD/ElftTvM/xThYV+bIe3xy1KMsY6JuZEzAzlr6fvHq9fe9ps+DwIG2jrEWDIFpi0bAvg6FInC6HhUsQRMdjktn1eclDBJUzbusrcrXgVdlD/ZU7jrlgt/2yw/+uO6zLDpYalyTyu8+EzXAkXnx5xADz4+xqFCcA9KC2fSSsUPtFV40yh1/6pWVygGN0nt0iSP4XFOYvv1mnDX6vb0OWS+VnLVG2cP+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f7c65f3-8894-4a09-e373-08dac1896a91 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9448.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2022 13:01:57.1784 (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: 0A9iF78pauRBZrbD2XEfFfhjU8XxeAIjQ7eL83C8n03el7gM23MBgvuVwtItGXwGRrn8NXtuFso0bvHfw/+RQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7059 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 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?1748933338330103341?= X-GMAIL-MSGID: =?utf-8?q?1748933338330103341?= 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 | 33 +++++++++++++++++++++++++++++++++ include/linux/phy/phy.h | 7 ++++++- 2 files changed, 39 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..73a32eb535b0 --- /dev/null +++ b/include/linux/phy/phy-hdmi.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2022 NXP + */ + +#ifndef __PHY_HDMI_H_ +#define __PHY_HDMI_H_ + +enum hdmi_phy_colorspace { + HDMI_PHY_COLORSPACE_RGB, + HDMI_PHY_COLORSPACE_YUV422, + HDMI_PHY_COLORSPACE_YUV444, + HDMI_PHY_COLORSPACE_YUV420, + 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 b1413757fcc3..6f6873ea7270 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; }; /**