linux/include/linux/hdmi.h

/*
 * Copyright (C) 2012 Avionic Design GmbH
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sub license,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial portions
 * of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

#ifndef __LINUX_HDMI_H_
#define __LINUX_HDMI_H_

#include <linux/types.h>
#include <linux/device.h>

enum hdmi_packet_type {};

enum hdmi_infoframe_type {};

#define HDMI_IEEE_OUI
#define HDMI_FORUM_IEEE_OUI
#define HDMI_INFOFRAME_HEADER_SIZE
#define HDMI_AVI_INFOFRAME_SIZE
#define HDMI_SPD_INFOFRAME_SIZE
#define HDMI_AUDIO_INFOFRAME_SIZE
#define HDMI_DRM_INFOFRAME_SIZE
#define HDMI_VENDOR_INFOFRAME_SIZE

#define HDMI_INFOFRAME_SIZE(type)

struct hdmi_any_infoframe {};

enum hdmi_colorspace {};

enum hdmi_scan_mode {};

enum hdmi_colorimetry {};

enum hdmi_picture_aspect {};

enum hdmi_active_aspect {};

enum hdmi_extended_colorimetry {};

enum hdmi_quantization_range {};

/* non-uniform picture scaling */
enum hdmi_nups {};

enum hdmi_ycc_quantization_range {};

enum hdmi_content_type {};

enum hdmi_metadata_type {};

enum hdmi_eotf {};

struct hdmi_avi_infoframe {};

/* DRM Infoframe as per CTA 861.G spec */
struct hdmi_drm_infoframe {};

void hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame);
ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer,
				size_t size);
ssize_t hdmi_avi_infoframe_pack_only(const struct hdmi_avi_infoframe *frame,
				     void *buffer, size_t size);
int hdmi_avi_infoframe_check(struct hdmi_avi_infoframe *frame);
int hdmi_drm_infoframe_init(struct hdmi_drm_infoframe *frame);
ssize_t hdmi_drm_infoframe_pack(struct hdmi_drm_infoframe *frame, void *buffer,
				size_t size);
ssize_t hdmi_drm_infoframe_pack_only(const struct hdmi_drm_infoframe *frame,
				     void *buffer, size_t size);
int hdmi_drm_infoframe_check(struct hdmi_drm_infoframe *frame);
int hdmi_drm_infoframe_unpack_only(struct hdmi_drm_infoframe *frame,
				   const void *buffer, size_t size);

enum hdmi_spd_sdi {};

struct hdmi_spd_infoframe {};

int hdmi_spd_infoframe_init(struct hdmi_spd_infoframe *frame,
			    const char *vendor, const char *product);
ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe *frame, void *buffer,
				size_t size);
ssize_t hdmi_spd_infoframe_pack_only(const struct hdmi_spd_infoframe *frame,
				     void *buffer, size_t size);
int hdmi_spd_infoframe_check(struct hdmi_spd_infoframe *frame);

enum hdmi_audio_coding_type {};

enum hdmi_audio_sample_size {};

enum hdmi_audio_sample_frequency {};

enum hdmi_audio_coding_type_ext {};

struct hdmi_audio_infoframe {};

int hdmi_audio_infoframe_init(struct hdmi_audio_infoframe *frame);
ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame,
				  void *buffer, size_t size);
ssize_t hdmi_audio_infoframe_pack_only(const struct hdmi_audio_infoframe *frame,
				       void *buffer, size_t size);
int hdmi_audio_infoframe_check(const struct hdmi_audio_infoframe *frame);

struct dp_sdp;
ssize_t
hdmi_audio_infoframe_pack_for_dp(const struct hdmi_audio_infoframe *frame,
				 struct dp_sdp *sdp, u8 dp_version);

enum hdmi_3d_structure {};


struct hdmi_vendor_infoframe {};

/* HDR Metadata as per 861.G spec */
struct hdr_static_metadata {};

/**
 * struct hdr_sink_metadata - HDR sink metadata
 *
 * Metadata Information read from Sink's EDID
 */
struct hdr_sink_metadata {};

int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame);
ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame,
				   void *buffer, size_t size);
ssize_t hdmi_vendor_infoframe_pack_only(const struct hdmi_vendor_infoframe *frame,
					void *buffer, size_t size);
int hdmi_vendor_infoframe_check(struct hdmi_vendor_infoframe *frame);

hdmi_vendor_any_infoframe;

/**
 * union hdmi_infoframe - overall union of all abstract infoframe representations
 * @any: generic infoframe
 * @avi: avi infoframe
 * @spd: spd infoframe
 * @vendor: union of all vendor infoframes
 * @audio: audio infoframe
 * @drm: Dynamic Range and Mastering infoframe
 *
 * This is used by the generic pack function. This works since all infoframes
 * have the same header which also indicates which type of infoframe should be
 * packed.
 */
hdmi_infoframe;

ssize_t hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer,
			    size_t size);
ssize_t hdmi_infoframe_pack_only(const union hdmi_infoframe *frame,
				 void *buffer, size_t size);
int hdmi_infoframe_check(union hdmi_infoframe *frame);
int hdmi_infoframe_unpack(union hdmi_infoframe *frame,
			  const void *buffer, size_t size);
void hdmi_infoframe_log(const char *level, struct device *dev,
			const union hdmi_infoframe *frame);

#endif /* _DRM_HDMI_H */