From patchwork Wed Jun 2 11:24:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nelson Costa X-Patchwork-Id: 452863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E5E6C47083 for ; Wed, 2 Jun 2021 11:24:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8951F613D2 for ; Wed, 2 Jun 2021 11:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232587AbhFBL01 (ORCPT ); Wed, 2 Jun 2021 07:26:27 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:59166 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232322AbhFBL0W (ORCPT ); Wed, 2 Jun 2021 07:26:22 -0400 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 895BAC043D; Wed, 2 Jun 2021 11:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1622633079; bh=Cjwofvyx7tHITwroONobhD5qV5HclCkCWYemv1jIgWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=JRzwo6X5wD2eGf3ut07wX48KnCGO79T1WetxnNRkp3aBD07ZBNq3DdaNrPQEeQwb6 YJdv3rs/pA44sQfwsmqXPMTTWGSVPTYs12GdaNBjzXtNUm9iOiuFRmL30xIHzPx7SI xDn8bt85dW60Ib5J/Cn1+bTyEVRu3W1NuaeCI4XvgEJ2xKRdmx2ygwMY16fZEv6K5Z 2lrNc4SKwE0CPaVZ3vfIP0+guJS4GHNqEUyxDdDvvTaSaMaWeaAzT6WPV4yCLEEzr2 pX6sGrV2f26rmjfMEgUID6H0/JLVDS/1xO24dGaHgU1BDqdN0Bt7p9N1ITsGaUpIOc ibLiAr1V/Kddg== Received: from de02dwvm009.internal.synopsys.com (de02dwvm009.internal.synopsys.com [10.225.17.73]) by mailhost.synopsys.com (Postfix) with ESMTP id 427A5A006E; Wed, 2 Jun 2021 11:24:37 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Nelson Costa To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Jose Abreu , Nelson Costa Subject: [PATCH 4/9] phy: Add PHY standard HDMI opts to the PHY API Date: Wed, 2 Jun 2021 13:24:22 +0200 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This adds the new options to give support for HDMI PHYs in a standard way. This is mainly useful when the HDMI PHY requires parameters to be passed by "phy_configure" function. For this, the new struct phy_configure_opts_hdmi was added with the required generic and standard parameters. Signed-off-by: Nelson Costa --- include/linux/phy/phy-hdmi.h | 102 +++++++++++++++++++++++++++++++++++++++++++ include/linux/phy/phy.h | 7 ++- 2 files changed, 108 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 0000000..62334f4 --- /dev/null +++ b/include/linux/phy/phy-hdmi.h @@ -0,0 +1,102 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2021 - present Synopsys, Inc. and/or its affiliates. + * HDMI generic PHY options. + * + * Author: Nelson Costa + */ +#ifndef __PHY_HDMI_H_ +#define __PHY_HDMI_H_ + +#include + +/** + * struct phy_configure_opts_hdmi - HDMI PHY configuration set + * + * This structure is used to represent the configuration state of an + * HDMI PHY. + */ +struct phy_configure_opts_hdmi { + /** + * @color_depth: + * + * Color depth, as specified by HDMI specification, represents the + * number of bits per pixel. + * + * Allowed values: 24, 30, 36, 48 + * + */ + u8 color_depth; + + /** + * @tmds_bit_clock_ratio: + * + * Flag indicating, as specified by HDMI specification, the relation + * between TMDS Clock Rate and TMDS Character Rate. + * + * As specified by HDMI specification: + * + * tmds_bit_clock_ratio = 0, for TMDS Character Rates <= 340 Mcsc + * (TMDS Clock Rate = TMDS Character Rate) + * + * tmds_bit_clock_ratio = 1, for TMDS Character Rates > 340 Mcsc + * (TMDS Clock Rate = TMDS Character Rate / 4) + * + */ + u8 tmds_bit_clock_ratio; + + /** + * @scrambling: + * + * Scrambling, as specified by HDMI specification, enables the technique + * to reduce the EMI/RFI. + * + */ + u8 scrambling; + + /** + * @calibration_acq: + * + * Calibration acquisitions number for the calibration algorithm. + * + */ + unsigned int calibration_acq; + + /** + * @calibration_force: + * + * Flag indicating, to force calibration algorithm even if the MPLL + * status didn't change from previous run calibration. + * + */ + u8 calibration_force; + + /** + * @set_color_depth: + * + * Flag indicating, whether or not reconfigure deep_color + * to requested values. + * + */ + u8 set_color_depth : 1; + + /** + * @set_tmds_bit_clock_ratio: + * + * Flag indicating, whether or not reconfigure tmds_bit_clock_ratio + * to requested values. + * + */ + u8 set_tmds_bit_clock_ratio : 1; + + /** + * @set_scrambling: + * + * Flag indicating, whether or not reconfigure scrambling + * to requested values. + * + */ + u8 set_scrambling : 1; +}; + +#endif /* __PHY_HDMI_H_ */ diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index e435bdb..8b1aaa4 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -18,6 +18,7 @@ #include #include +#include struct phy; @@ -41,7 +42,8 @@ enum phy_mode { PHY_MODE_MIPI_DPHY, PHY_MODE_SATA, PHY_MODE_LVDS, - PHY_MODE_DP + PHY_MODE_DP, + PHY_MODE_HDMI }; /** @@ -51,10 +53,13 @@ enum phy_mode { * the MIPI_DPHY phy mode. * @dp: Configuration set applicable for phys supporting * the DisplayPort protocol. + * @hdmi Configuration set applicable for phys supporting + * the HDMI protocol. */ union phy_configure_opts { struct phy_configure_opts_mipi_dphy mipi_dphy; struct phy_configure_opts_dp dp; + struct phy_configure_opts_hdmi hdmi; }; /**