From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaud Pouliquen Subject: [PATCH v2 1/4] DRM: add help to get ELD speaker allocation Date: Wed, 14 Dec 2016 16:16:42 +0100 Message-ID: <1481728605-22781-2-git-send-email-arnaud.pouliquen@st.com> References: <1481728605-22781-1-git-send-email-arnaud.pouliquen@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by alsa0.perex.cz (Postfix) with ESMTP id 6F16A266FDE for ; Wed, 14 Dec 2016 16:17:20 +0100 (CET) In-Reply-To: <1481728605-22781-1-git-send-email-arnaud.pouliquen@st.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org Cc: kernel@stlinux.com, Takashi Iwai , lgirdwood@gmail.com, Jyri Sarha , Takashi Sakamoto , David Airlie , broonie@kernel.org, Daniel Vetter List-Id: alsa-devel@alsa-project.org Add helper to allow users to retrieve the speaker allocations without knowledge of the ELD structure. Signed-off-by: Arnaud Pouliquen --- include/drm/drm_edid.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 919933d..0706cc6 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -245,6 +245,7 @@ struct detailed_timing { # define DRM_ELD_AUD_SYNCH_DELAY_MAX 0xfa /* 500 ms */ #define DRM_ELD_SPEAKER 7 +# define DRM_ELD_SPEAKER_MASK 0x7f # define DRM_ELD_SPEAKER_RLRC (1 << 6) # define DRM_ELD_SPEAKER_FLRC (1 << 5) # define DRM_ELD_SPEAKER_RC (1 << 4) @@ -412,6 +413,18 @@ static inline int drm_eld_size(const uint8_t *eld) } /** + * drm_eld_get_spk_alloc - Get speaker allocation + * @eld: pointer to an ELD memory structure + * + * The returned value is the speakers mask. User has to use %DRM_ELD_SPEAKER + * field definitions to identify speakers. + */ +static inline u8 drm_eld_get_spk_alloc(const uint8_t *eld) +{ + return eld[DRM_ELD_SPEAKER] & DRM_ELD_SPEAKER_MASK; +} + +/** * drm_eld_get_conn_type - Get device type hdmi/dp connected * @eld: pointer to an ELD memory structure * -- 1.9.1