#include <linux/clk.h>
#include <linux/component.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <linux/seq_file.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_debugfs.h>
#include <drm/drm_device.h>
#include <drm/drm_file.h>
#include <drm/drm_print.h>
#include "sti_crtc.h"
#include "sti_drv.h"
#include "sti_vtg.h"
#define TVO_CSC_MAIN_M0 …
#define TVO_CSC_MAIN_M1 …
#define TVO_CSC_MAIN_M2 …
#define TVO_CSC_MAIN_M3 …
#define TVO_CSC_MAIN_M4 …
#define TVO_CSC_MAIN_M5 …
#define TVO_CSC_MAIN_M6 …
#define TVO_CSC_MAIN_M7 …
#define TVO_MAIN_IN_VID_FORMAT …
#define TVO_CSC_AUX_M0 …
#define TVO_CSC_AUX_M1 …
#define TVO_CSC_AUX_M2 …
#define TVO_CSC_AUX_M3 …
#define TVO_CSC_AUX_M4 …
#define TVO_CSC_AUX_M5 …
#define TVO_CSC_AUX_M6 …
#define TVO_CSC_AUX_M7 …
#define TVO_AUX_IN_VID_FORMAT …
#define TVO_VIP_HDF …
#define TVO_HD_SYNC_SEL …
#define TVO_HD_DAC_CFG_OFF …
#define TVO_VIP_HDMI …
#define TVO_HDMI_FORCE_COLOR_0 …
#define TVO_HDMI_FORCE_COLOR_1 …
#define TVO_HDMI_CLIP_VALUE_B_CB …
#define TVO_HDMI_CLIP_VALUE_Y_G …
#define TVO_HDMI_CLIP_VALUE_R_CR …
#define TVO_HDMI_SYNC_SEL …
#define TVO_HDMI_DFV_OBS …
#define TVO_VIP_DVO …
#define TVO_DVO_SYNC_SEL …
#define TVO_DVO_CONFIG …
#define TVO_IN_FMT_SIGNED …
#define TVO_SYNC_EXT …
#define TVO_VIP_REORDER_R_SHIFT …
#define TVO_VIP_REORDER_G_SHIFT …
#define TVO_VIP_REORDER_B_SHIFT …
#define TVO_VIP_REORDER_MASK …
#define TVO_VIP_REORDER_Y_G_SEL …
#define TVO_VIP_REORDER_CB_B_SEL …
#define TVO_VIP_REORDER_CR_R_SEL …
#define TVO_VIP_CLIP_SHIFT …
#define TVO_VIP_CLIP_MASK …
#define TVO_VIP_CLIP_DISABLED …
#define TVO_VIP_CLIP_EAV_SAV …
#define TVO_VIP_CLIP_LIMITED_RANGE_RGB_Y …
#define TVO_VIP_CLIP_LIMITED_RANGE_CB_CR …
#define TVO_VIP_CLIP_PROG_RANGE …
#define TVO_VIP_RND_SHIFT …
#define TVO_VIP_RND_MASK …
#define TVO_VIP_RND_8BIT_ROUNDED …
#define TVO_VIP_RND_10BIT_ROUNDED …
#define TVO_VIP_RND_12BIT_ROUNDED …
#define TVO_VIP_SEL_INPUT_MASK …
#define TVO_VIP_SEL_INPUT_MAIN …
#define TVO_VIP_SEL_INPUT_AUX …
#define TVO_VIP_SEL_INPUT_FORCE_COLOR …
#define TVO_VIP_SEL_INPUT_BYPASS_MASK …
#define TVO_VIP_SEL_INPUT_BYPASSED …
#define TVO_SYNC_MAIN_VTG_SET_REF …
#define TVO_SYNC_AUX_VTG_SET_REF …
#define TVO_SYNC_HD_DCS_SHIFT …
#define TVO_SYNC_DVO_PAD_HSYNC_SHIFT …
#define TVO_SYNC_DVO_PAD_VSYNC_SHIFT …
#define ENCODER_CRTC_MASK …
#define TVO_MIN_HD_HEIGHT …
enum sti_tvout_video_out_type { … };
struct sti_tvout { … };
struct sti_tvout_encoder { … };
#define to_sti_tvout_encoder(x) …
#define to_sti_tvout(x) …
static const u32 rgb_to_ycbcr_601[8] = …;
static const u32 rgb_to_ycbcr_709[8] = …;
static u32 tvout_read(struct sti_tvout *tvout, int offset)
{ … }
static void tvout_write(struct sti_tvout *tvout, u32 val, int offset)
{ … }
static void tvout_vip_set_color_order(struct sti_tvout *tvout, int reg,
u32 cr_r, u32 y_g, u32 cb_b)
{ … }
static void tvout_vip_set_clip_mode(struct sti_tvout *tvout, int reg, u32 range)
{ … }
static void tvout_vip_set_rnd(struct sti_tvout *tvout, int reg, u32 rnd)
{ … }
static void tvout_vip_set_sel_input(struct sti_tvout *tvout,
int reg,
bool main_path,
enum sti_tvout_video_out_type video_out)
{ … }
static void tvout_vip_set_in_vid_fmt(struct sti_tvout *tvout,
int reg, u32 in_vid_fmt)
{ … }
static void tvout_preformatter_set_matrix(struct sti_tvout *tvout,
struct drm_display_mode *mode)
{ … }
static void tvout_dvo_start(struct sti_tvout *tvout, bool main_path)
{ … }
static void tvout_hdmi_start(struct sti_tvout *tvout, bool main_path)
{ … }
static void tvout_hda_start(struct sti_tvout *tvout, bool main_path)
{ … }
#define DBGFS_DUMP(reg) …
static void tvout_dbg_vip(struct seq_file *s, int val)
{ … }
static void tvout_dbg_hd_dac_cfg(struct seq_file *s, int val)
{ … }
static int tvout_dbg_show(struct seq_file *s, void *data)
{ … }
static struct drm_info_list tvout_debugfs_files[] = …;
static void tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor)
{ … }
static void sti_tvout_encoder_dpms(struct drm_encoder *encoder, int mode)
{ … }
static void sti_tvout_encoder_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{ … }
static void sti_tvout_encoder_destroy(struct drm_encoder *encoder)
{ … }
static int sti_tvout_late_register(struct drm_encoder *encoder)
{ … }
static void sti_tvout_early_unregister(struct drm_encoder *encoder)
{ … }
static const struct drm_encoder_funcs sti_tvout_encoder_funcs = …;
static void sti_dvo_encoder_enable(struct drm_encoder *encoder)
{ … }
static void sti_dvo_encoder_disable(struct drm_encoder *encoder)
{ … }
static const struct drm_encoder_helper_funcs sti_dvo_encoder_helper_funcs = …;
static struct drm_encoder *
sti_tvout_create_dvo_encoder(struct drm_device *dev,
struct sti_tvout *tvout)
{ … }
static void sti_hda_encoder_enable(struct drm_encoder *encoder)
{ … }
static void sti_hda_encoder_disable(struct drm_encoder *encoder)
{ … }
static const struct drm_encoder_helper_funcs sti_hda_encoder_helper_funcs = …;
static struct drm_encoder *sti_tvout_create_hda_encoder(struct drm_device *dev,
struct sti_tvout *tvout)
{ … }
static void sti_hdmi_encoder_enable(struct drm_encoder *encoder)
{ … }
static void sti_hdmi_encoder_disable(struct drm_encoder *encoder)
{ … }
static const struct drm_encoder_helper_funcs sti_hdmi_encoder_helper_funcs = …;
static struct drm_encoder *sti_tvout_create_hdmi_encoder(struct drm_device *dev,
struct sti_tvout *tvout)
{ … }
static void sti_tvout_create_encoders(struct drm_device *dev,
struct sti_tvout *tvout)
{ … }
static void sti_tvout_destroy_encoders(struct sti_tvout *tvout)
{ … }
static int sti_tvout_bind(struct device *dev, struct device *master, void *data)
{ … }
static void sti_tvout_unbind(struct device *dev, struct device *master,
void *data)
{ … }
static const struct component_ops sti_tvout_ops = …;
static int sti_tvout_probe(struct platform_device *pdev)
{ … }
static void sti_tvout_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id tvout_of_match[] = …;
MODULE_DEVICE_TABLE(of, tvout_of_match);
struct platform_driver sti_tvout_driver = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;