From patchwork Wed Apr 28 15:25:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nelson Costa X-Patchwork-Id: 428799 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, 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 32A42C43617 for ; Wed, 28 Apr 2021 15:25:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1625361451 for ; Wed, 28 Apr 2021 15:25:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240085AbhD1P0N (ORCPT ); Wed, 28 Apr 2021 11:26:13 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]:56574 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236545AbhD1P0D (ORCPT ); Wed, 28 Apr 2021 11:26:03 -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)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 05465404AD; Wed, 28 Apr 2021 15:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1619623518; bh=Cjwofvyx7tHITwroONobhD5qV5HclCkCWYemv1jIgWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=Mj2u2xrc7wgTqKRzRT1hlYVqy230P9RUVCGoI0Z3j57KPSW6fkaMPWR23y+OmTIKM c8uGZPvjedHn0tOK4XEkoNifnsTI6QM01Athb59tRTwTA4eLiGbTBC7nN87qe936xF 4+6f3XigseBZf+8oIxdD+6AYSvk5dOy79xsjWOJqFO+HLS8kgEEZaN7zOg/9Z/Zcg3 HxP1AVWIkgJLhMZST3g2m6OPWsFsxindnK353XBQy2i/lPgfgatbhI9SLtShDDq08Z d5lPitQ3ga3j6jUyG5pFY5/SMgHjxzSNXAM+SBW2Q2ZyBuiaceRNfgWd20VVQ3vHc4 kL40ll0g2ZOzQ== Received: from de02dwvm009.internal.synopsys.com (de02dwvm009.internal.synopsys.com [10.225.17.73]) by mailhost.synopsys.com (Postfix) with ESMTP id 72F70A006E; Wed, 28 Apr 2021 15:25:16 +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: [RFC 3/8] phy: Add PHY standard HDMI opts to the PHY API Date: Wed, 28 Apr 2021 17:25:06 +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; }; /**