From patchwork Fri Nov 4 06:44:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandor Yu X-Patchwork-Id: 15390 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp210823wru; Thu, 3 Nov 2022 23:48:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6sdrOp6lKvfkRpfu8NuKV4faeuTmnTEptzFOXYNpNiGx1rmNDleWY49rj1TeHCstDRKXAE X-Received: by 2002:a05:6a00:a15:b0:56e:9b2b:60dd with SMTP id p21-20020a056a000a1500b0056e9b2b60ddmr395534pfh.35.1667544492788; Thu, 03 Nov 2022 23:48:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667544492; cv=pass; d=google.com; s=arc-20160816; b=rflcCXZw8RYs+KZCVK90ZeV04FkFof6xS3Z2GGBKMgFfliBTgmHLZ46pRp92UkwJJj KW7MGxUk23WTqlJoctT/sle1k5WH7xDlFypsqq7HYzBgTr29oHfr8hmIdRi8p3Fuuopz wvF+L9rG5Qno4p0pJqQ3ZPldHdSBIdxRXLLRcUDOBuGDLrzX4KC6YajZnxbAM99gvZch yAWxwTE8q6BodMylQuEID9JYkEPA5ZgvM39ECGJyP6GZvX/tjCdINhqn2XFJrDOlh7LR guw8mw6aihqlI8uSyp1p0QDibOQox3ZKXMdlSA/ZWKzbkA7kCtO6ICw6+mSXUXAINh0s qEog== 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=stjJwpGWx8So68eNAyPUNoVCUhP+ee8wCdO5PMqQS/rht31evq2QKhwTM83XPT/9A1 LGaMGWViQrbxkDVtiKJNse/e25vWkXdQQo9klCnvFADYQQ7P9s5WUCNbAXBTbwPAC/d+ 1nbOhfndWPNsgVlVhga1hKDv9KebitFCOfev3kDWzL86Dc9lgm+nSi/5LgeUVY133Y8K 6U/KgIn/DSUXggCT/bO/NwnzCzvPRKXlOzuyqJrFPB8Rk133lvqzExETph0hW2cNNodh kHBGt35xjJXidkEQRqqJ7e7vQlrP5wLR8LVT0s6ZIm+7bP7LroXN3oTjXzBjcJr6MK+q I+DA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=QZOdU51e; 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 y5-20020aa78045000000b0056bb75c96d6si3275638pfm.227.2022.11.03.23.48.00; Thu, 03 Nov 2022 23:48:12 -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=QZOdU51e; 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 S231559AbiKDGr0 (ORCPT + 99 others); Fri, 4 Nov 2022 02:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231378AbiKDGrG (ORCPT ); Fri, 4 Nov 2022 02:47:06 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2074.outbound.protection.outlook.com [40.107.21.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 401972AC71; Thu, 3 Nov 2022 23:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f2YjfSc3CeqhA7ZiKAcZXrlbmfVZim+05J3+3cWNYhpKfO60TszdzX2AIBNTwcbCT9MPbfRZeITPGrB0uzacT4YF4/RvkdYRzVvCfrr7tKg9bt9sUxKhzaGHPfPXPtNxDNl9gz5a73Ib6M//+R1egyOvYcMuGmmrSpeFzIkDqxPVuB05l78A3+qHdQnmGZk+vZ6b96YZTYA/LX3HIT3g/J+UIMD9txyVsfO7tHeDZp6zxCovdz+TuINgUTtlTXZtCjGPkCXLYvrkV+RorPyyqDiZq+W0e5RP37y346q8CrtqpR1HouZBofIUOvOz0h8IMJt+Uk4nTHm7ZwvWWc+8qw== 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=XiCmAOmnO9ai8Az6aLdc95sMbIJsnigYyeyJOuwIo8V7QovV5NMTrHbmcDqprVaJYMEaKLOsgiCKTUrGzVljkCkXzOpCLkm3wMpHBB4lXPltH5pyDpuxNeCxNNuxiHN8nisW/8319A7URqs8QgPFB43i4cqtppsbi909zlZQ+o06CCGwHaG3rF2G97lZGmF0Lm9sQiYG/UNoE0tq+Rkf8I5guH5GHPsV/utR3Xwi3oJdOAH/RHlmaQ1tUvSLRPC1GoeYmINax40wyR5zotmpvN62nkR3jp4x3wGGp9lCAFViJPns4+f8ex1YJAPyMkGfTzncaNcLUIw7wyeE9qrv5Q== 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=QZOdU51eEPZcJ3aX/gY9NJnNJCpALfc+Hv97HjFOfZRw2mOhdNKO6gth6irzx0yNfj+YG4reYpYTY3XSLwhNB+NZH/wISU0Y3X9mWE/PGpFHyH2NpIdNSOoqbWCWDRgLRAf9onCy84B1F2hP+o2AYZL7vgSQLZikfzGCZ2m/Jvg= 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 AM9PR04MB8081.eurprd04.prod.outlook.com (2603:10a6:20b:3e2::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20; Fri, 4 Nov 2022 06:47:02 +0000 Received: from PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::88a0:57d8:2a57:3f4f]) by PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::88a0:57d8:2a57:3f4f%9]) with mapi id 15.20.5791.022; Fri, 4 Nov 2022 06:47:02 +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, kishon@ti.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, p.yadav@ti.com, oliver.brown@nxp.com Subject: [v2 04/10] phy: Add HDMI configuration options Date: Fri, 4 Nov 2022 14:44:54 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR06CA0194.apcprd06.prod.outlook.com (2603:1096:4:1::26) To PAXPR04MB9448.eurprd04.prod.outlook.com (2603:10a6:102:2b1::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9448:EE_|AM9PR04MB8081:EE_ X-MS-Office365-Filtering-Correlation-Id: 8da7e2b4-aa93-4705-62cb-08dabe306112 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tyWFBDkeUi2rRVixL6y0UYXiuiCAl9KXrjUNQoNrNSdbrSZlUvOGkssoNzKdsNpO06UxxiklPipd9GuKLyhoCoqyNtp316ifqBUvYW1ZYh1K+Ns+bexP97gtveNyzCRwPnZEo8pDf4Pw/K/hD1Z58IccgynfgBhjcEy2jQKVj2Bi2Q2juvxYkNb3tz775s9v1g4Fn2RdLkCImcrIzJOrsxKlI2LXSPCSUcGIsXZfGsYq2A8rbtwGXbXn7oCkVF3O6DRZJdpUtCJ1U7mf4lxGGsvuNvTugTvH/5d+38KFk2XRz/fwZSllOlvNI1EBctarn20pP/7UJyNcPbJNhWaSkV06YeimOr0DCZPb+WVmEK5NtDdFWTXs+LCglO7P78qs+R6VDP9/aqmN4MjXel+1uVNMe8PfnqGbnM4onE88lk8je1azDUJybG1kDKpy2/8o2Y1gFzUyI1Os329qOezfBW/bMEuhurDOBoLHq/+twwUibM76hEs0KwXTGDm9/qVzVUgwVdjQ6S4B6oBNYtodReMf64Uz1usNezYO4HZEn41zqtsOXWu8a8GOxnt9xaIyOQVmC7R7eqY+FWT1hGYHDaHt1R2s8isVVKmXjaJw0WjzKmwwfmsqSBIp7y3ZhT9l4orAYERXCHicIxXmgE9Xt17KYPNNrtNHpnSBvCzmMGtlWy+fYEtxK9mT2RfIvshGmuzV78nj/nl/Pq90FOuglI5GOdE/O5kp55TULlbeyW0AwBEaP8y6JrzPLtI3m8T7bBbTSHMT4nXZR+zFQpZ6Egq7j1cwN5Mca7sxsdL1R70= 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)(346002)(376002)(39860400002)(366004)(136003)(396003)(451199015)(316002)(8676002)(38350700002)(7416002)(5660300002)(66556008)(66476007)(38100700002)(4326008)(66946007)(36756003)(8936002)(41300700001)(83380400001)(6666004)(921005)(186003)(2616005)(86362001)(6486002)(26005)(478600001)(6512007)(52116002)(6506007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: U0L+AfLBuGI0T0p+kosqUPYH7vueNmmQ8VuoqBehxtNOWlsU2x+NQDXeq7RSIvjay/uWNkxw80dcCjHnITIrEYTOLuYKmBn5yTyd0kOJ2a/1AeytJ9/RUDAWxZWLda3bqniMcsN/HTAgadK8zP2VMIEOEv8BB5GpzlglaG/fS5Ax1rSFFl30ZTBDvm5Pd6P5CDK4LwW+TBlsYI1vMAU8M5jYaf2b8TkzWJgk7qgJtypdvCJ+wPpm+dtnByt3iKWBd29nItMFASqvHyeuiRZZI0M0qyr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dHhsSA62CQhvJVGVpEVO6fqzMEt/hKNA8Tz7DU6gh2Gv7X4hsitRVaxYKKxE3N+qPKmnEkrWxA2ncuCN81iJEixRcxVJylgpbuH24F2eKg6qrGetpMITfpPcVvDG49ACCLxcvMQvWlXrGlVPTuAMXh6zVAkKVHAL8Rh8djOqmhtUCAj7gtIaXuR+cfKjMmA9niRj7ySfHXonc/yqVZlNIL8DGz0yVG8/nCusvD0/JEDYgUW+UGdsv25w X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8da7e2b4-aa93-4705-62cb-08dabe306112 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9448.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2022 06:47:02.4523 (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: qBUGaY6wTS/etDEsKYDfJWqxkvmq0yaj8KajDWAlhOfYl2doOk8xsalam0ykQsOHFN/EpYjwuRLZppfQalk4pQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8081 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?1748547133827921680?= X-GMAIL-MSGID: =?utf-8?q?1748547133827921680?= 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; }; /**