From patchwork Tue Dec 1 17:47:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Subhransu S. Prusty" X-Patchwork-Id: 7736681 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 1451CBEEE1 for ; Tue, 1 Dec 2015 12:24:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F006203B5 for ; Tue, 1 Dec 2015 12:24:34 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 49ACE203A4 for ; Tue, 1 Dec 2015 12:24:33 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8CE3F26646E; Tue, 1 Dec 2015 13:24:31 +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=0.4 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_03_06, RCVD_IN_DNSWL_LOW,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CF8B8265D39; Tue, 1 Dec 2015 13:19:29 +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 55362265D4A; Tue, 1 Dec 2015 13:19:28 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by alsa0.perex.cz (Postfix) with ESMTP id E78E8265D3D for ; Tue, 1 Dec 2015 13:16:54 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 01 Dec 2015 04:16:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,368,1444719600"; d="scan'208";a="831772525" Received: from subhransu-desktop.iind.intel.com ([10.223.96.57]) by orsmga001.jf.intel.com with ESMTP; 01 Dec 2015 04:16:51 -0800 From: "Subhransu S. Prusty" To: alsa-devel@alsa-project.org Date: Tue, 1 Dec 2015 23:17:08 +0530 Message-Id: <1448992031-8271-12-git-send-email-subhransu.s.prusty@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448992031-8271-1-git-send-email-subhransu.s.prusty@intel.com> References: <1448991749-8091-1-git-send-email-subhransu.s.prusty@intel.com> <1448992031-8271-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 12/15] 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. So parse the required bits in ELD to find the connection type. Signed-off-by: Subhransu S. Prusty Signed-off-by: Vinod Koul Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Cc: Daniel Vetter --- include/drm/drm_edid.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 2af9769..c7595a5 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -403,6 +403,16 @@ 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 + */ +static inline int drm_eld_get_conn_type(const uint8_t *eld) +{ + return (eld[DRM_ELD_SAD_COUNT_CONN_TYPE] & DRM_ELD_CONN_TYPE_MASK) >> + DRM_ELD_CONN_TYPE_SHIFT; +} + struct edid *drm_do_get_edid(struct drm_connector *connector, int (*get_edid_block)(void *data, u8 *buf, unsigned int block, size_t len),