Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp490219pxj; Wed, 2 Jun 2021 04:26:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvLRlrlQ9/9F/if9fLgsDPICR7MwkyuzJ8nhz/LFHe8ZkLPl+BQYFofas24RPeIpKglIdy X-Received: by 2002:a02:6f5e:: with SMTP id b30mr5529809jae.94.1622633185488; Wed, 02 Jun 2021 04:26:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622633185; cv=none; d=google.com; s=arc-20160816; b=PktjgbmD8m3JC3XGRgFwDYavOnYBnAeaHUzt3aUu5J7K9SyEbmV0Lr/lII/ZCupH/k 5rwuY2hN5oyMeGYJfa7zS4RLK55wcww9PVA7r7fGnCWvyK7M9VvgM3pAkVbE35ifWNKa G7PIrT1YDDax1d/qL+XxMSb44IPN6gs7RoVgjIoEVmlfEXkw9lKz+aOLg4KU7XxvF7jI udywX59qY5IsSU2ElXt2hRejaHFl78H0Ogo1VvoOKrGExCVmxt8oVJYS2MkoBUAgWqro oGiQ0XFjRWmAtJn3ltrkwYdfnyyAHT7gcGQ26VK/qtoTbLqVLl1iBNtpFOfIMqXfTQou jIig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pmnbot2lXcdj4n9gtfAqWLRSY1E2F9gZ2cxrceTDJ1E=; b=JcZkvA3HsxgAJJP9tERpQgKKNayjivseVosde0hMBXJSYAxrr/W1xFuLF+fKJDiDeD MGJL6HiFX17duFywR/KbyuGf4Qz9NwPvwtFOrk79s8pgVPWo5F9zuMHYgeh5w8+Jp2JY 5B7bYwnKUubrQmz1VRrRB9RacwVT6H+8aECNzK5LYhyw9f5B7Pr2dUow2gImwsIiJl51 Fu1YbLyNNkZ5aU/EVVHXirH0PEoM3gBW3tOEMKlbnZ9Tyk0gI/RizsVe8JQv4PhRyDDA sUwyQp/J4Ws+JAHaj8m8H+9CERAroP40USM/b7Y0kcjP7qC9XqBeo+QymLBT+ihtdniJ t7tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=JRzwo6X5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si17672013ill.144.2021.06.02.04.26.12; Wed, 02 Jun 2021 04:26:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=JRzwo6X5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230257AbhFBL0i (ORCPT + 99 others); Wed, 2 Jun 2021 07:26:38 -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-kernel@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; }; /** -- 2.7.4