From patchwork Mon Jan 4 05:41:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Subhransu S. Prusty" X-Patchwork-Id: 7945861 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 647F8BEEE5 for ; Mon, 4 Jan 2016 05:46:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E8E620384 for ; Mon, 4 Jan 2016 05:46:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0C90220374 for ; Mon, 4 Jan 2016 05:45:57 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3DB0D260715; Mon, 4 Jan 2016 06:45:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CFC13260592; Mon, 4 Jan 2016 06:41:06 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C3824260599; Mon, 4 Jan 2016 06:41:05 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by alsa0.perex.cz (Postfix) with ESMTP id 5A0E526058A for ; Mon, 4 Jan 2016 06:39:07 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 03 Jan 2016 21:39:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,519,1444719600"; d="scan'208";a="23094196" Received: from subhransu-desktop.iind.intel.com ([10.223.96.24]) by fmsmga004.fm.intel.com with ESMTP; 03 Jan 2016 21:39:03 -0800 From: "Subhransu S. Prusty" To: alsa-devel@alsa-project.org Date: Mon, 4 Jan 2016 11:11:00 +0530 Message-Id: <1451886064-30792-11-git-send-email-subhransu.s.prusty@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451886064-30792-1-git-send-email-subhransu.s.prusty@intel.com> References: <1451886064-30792-1-git-send-email-subhransu.s.prusty@intel.com> Cc: tiwai@suse.de, David Airlie , lgirdwood@gmail.com, dri-devel@lists.freedesktop.org, patches.audio@intel.com, broonie@kernel.org, Daniel Vetter , Vinod Koul , "Subhransu S. Prusty" Subject: [alsa-devel] [PATCH v4 REPOST 10/14] drm/edid: Add API to help find connection type X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP To fill the audio infoframe it is required to identify the connection type as DP or HDMI. This patch adds an API which parses ELD and returns the display type of connected. Signed-off-by: Subhransu S. Prusty Signed-off-by: Vinod Koul Reviewed-by: Jani Nikula Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Cc: Daniel Vetter --- include/drm/drm_edid.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 2af9769..8c537a0 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -403,6 +403,18 @@ static inline int drm_eld_size(const uint8_t *eld) return DRM_ELD_HEADER_BLOCK_SIZE + eld[DRM_ELD_BASELINE_ELD_LEN] * 4; } +/** + * drm_eld_get_conn_type - Get device type hdmi/dp connected + * @eld: pointer to an eld memory structure + * + * The caller need to use %DRM_ELD_CONN_TYPE_HDMI or %DRM_ELD_CONN_TYPE_DP to + * identify the display type connected. + */ +static inline u8 drm_eld_get_conn_type(const uint8_t *eld) +{ + return eld[DRM_ELD_SAD_COUNT_CONN_TYPE] & DRM_ELD_CONN_TYPE_MASK; +} + struct edid *drm_do_get_edid(struct drm_connector *connector, int (*get_edid_block)(void *data, u8 *buf, unsigned int block, size_t len),