linux/include/drm/drm_eld.h

/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2023 Intel Corporation
 */

#ifndef __DRM_ELD_H__
#define __DRM_ELD_H__

#include <linux/types.h>

struct cea_sad;

/* ELD Header Block */
#define DRM_ELD_HEADER_BLOCK_SIZE

#define DRM_ELD_VER
#define DRM_ELD_VER_SHIFT
#define DRM_ELD_VER_MASK
#define DRM_ELD_VER_CEA861D
#define DRM_ELD_VER_CANNED

#define DRM_ELD_BASELINE_ELD_LEN

/* ELD Baseline Block for ELD_Ver == 2 */
#define DRM_ELD_CEA_EDID_VER_MNL
#define DRM_ELD_CEA_EDID_VER_SHIFT
#define DRM_ELD_CEA_EDID_VER_MASK
#define DRM_ELD_CEA_EDID_VER_NONE
#define DRM_ELD_CEA_EDID_VER_CEA861
#define DRM_ELD_CEA_EDID_VER_CEA861A
#define DRM_ELD_CEA_EDID_VER_CEA861BCD
#define DRM_ELD_MNL_SHIFT
#define DRM_ELD_MNL_MASK

#define DRM_ELD_SAD_COUNT_CONN_TYPE
#define DRM_ELD_SAD_COUNT_SHIFT
#define DRM_ELD_SAD_COUNT_MASK
#define DRM_ELD_CONN_TYPE_SHIFT
#define DRM_ELD_CONN_TYPE_MASK
#define DRM_ELD_CONN_TYPE_HDMI
#define DRM_ELD_CONN_TYPE_DP
#define DRM_ELD_SUPPORTS_AI
#define DRM_ELD_SUPPORTS_HDCP

#define DRM_ELD_AUD_SYNCH_DELAY
#define DRM_ELD_AUD_SYNCH_DELAY_MAX

#define DRM_ELD_SPEAKER
#define DRM_ELD_SPEAKER_MASK
#define DRM_ELD_SPEAKER_RLRC
#define DRM_ELD_SPEAKER_FLRC
#define DRM_ELD_SPEAKER_RC
#define DRM_ELD_SPEAKER_RLR
#define DRM_ELD_SPEAKER_FC
#define DRM_ELD_SPEAKER_LFE
#define DRM_ELD_SPEAKER_FLR

#define DRM_ELD_PORT_ID
#define DRM_ELD_PORT_ID_LEN

#define DRM_ELD_MANUFACTURER_NAME0
#define DRM_ELD_MANUFACTURER_NAME1

#define DRM_ELD_PRODUCT_CODE0
#define DRM_ELD_PRODUCT_CODE1

#define DRM_ELD_MONITOR_NAME_STRING

#define DRM_ELD_CEA_SAD(mnl, sad)

/**
 * drm_eld_mnl - Get ELD monitor name length in bytes.
 * @eld: pointer to an eld memory structure with mnl set
 */
static inline int drm_eld_mnl(const u8 *eld)
{}

int drm_eld_sad_get(const u8 *eld, int sad_index, struct cea_sad *cta_sad);
int drm_eld_sad_set(u8 *eld, int sad_index, const struct cea_sad *cta_sad);

/**
 * drm_eld_sad - Get ELD SAD structures.
 * @eld: pointer to an eld memory structure with sad_count set
 */
static inline const u8 *drm_eld_sad(const u8 *eld)
{}

/**
 * drm_eld_sad_count - Get ELD SAD count.
 * @eld: pointer to an eld memory structure with sad_count set
 */
static inline int drm_eld_sad_count(const u8 *eld)
{}

/**
 * drm_eld_calc_baseline_block_size - Calculate baseline block size in bytes
 * @eld: pointer to an eld memory structure with mnl and sad_count set
 *
 * This is a helper for determining the payload size of the baseline block, in
 * bytes, for e.g. setting the Baseline_ELD_Len field in the ELD header block.
 */
static inline int drm_eld_calc_baseline_block_size(const u8 *eld)
{}

/**
 * drm_eld_size - Get ELD size in bytes
 * @eld: pointer to a complete eld memory structure
 *
 * The returned value does not include the vendor block. It's vendor specific,
 * and comprises of the remaining bytes in the ELD memory buffer after
 * drm_eld_size() bytes of header and baseline block.
 *
 * The returned value is guaranteed to be a multiple of 4.
 */
static inline int drm_eld_size(const u8 *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 u8 *eld)
{}

/**
 * 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 u8 *eld)
{}

#endif /* __DRM_ELD_H__ */