diff options
author | Arnaud Pouliquen <arnaud.pouliquen@st.com> | 2017-01-03 16:52:50 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-01-20 15:16:23 +0000 |
commit | c82dbe5c055e4d246bd07c4d7b24801c9445c241 (patch) | |
tree | a645eaba54392948fc1f4f078445ce3a6f4f4a30 /include/drm/drm_edid.h | |
parent | a5de5b74a50113564a1e0850e2da96c37c35e55d (diff) | |
download | linux-c82dbe5c055e4d246bd07c4d7b24801c9445c241.tar.bz2 |
DRM: add help to get ELD speaker allocation
Add helper to allow users to retrieve the speaker allocations without
knowledge of the ELD structure.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/drm/drm_edid.h')
-rw-r--r-- | include/drm/drm_edid.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index c3a7d440bc11..de93543d1218 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -248,6 +248,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) @@ -415,6 +416,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 * |