linux/drivers/gpu/drm/imx/ipuv3/imx-tve.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * i.MX drm driver - Television Encoder (TVEv2)
 *
 * Copyright (C) 2013 Philipp Zabel, Pengutronix
 */

#include <linux/clk-provider.h>
#include <linux/clk.h>
#include <linux/component.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/videodev2.h>

#include <video/imx-ipu-v3.h>

#include <drm/drm_atomic_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_managed.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>

#include "imx-drm.h"

#define TVE_COM_CONF_REG
#define TVE_TVDAC0_CONT_REG
#define TVE_TVDAC1_CONT_REG
#define TVE_TVDAC2_CONT_REG
#define TVE_CD_CONT_REG
#define TVE_INT_CONT_REG
#define TVE_STAT_REG
#define TVE_TST_MODE_REG
#define TVE_MV_CONT_REG

/* TVE_COM_CONF_REG */
#define TVE_SYNC_CH_2_EN
#define TVE_SYNC_CH_1_EN
#define TVE_SYNC_CH_0_EN
#define TVE_TV_OUT_MODE_MASK
#define TVE_TV_OUT_DISABLE
#define TVE_TV_OUT_CVBS_0
#define TVE_TV_OUT_CVBS_2
#define TVE_TV_OUT_CVBS_0_2
#define TVE_TV_OUT_SVIDEO_0_1
#define TVE_TV_OUT_SVIDEO_0_1_CVBS2_2
#define TVE_TV_OUT_YPBPR
#define TVE_TV_OUT_RGB
#define TVE_TV_STAND_MASK
#define TVE_TV_STAND_HD_1080P30
#define TVE_P2I_CONV_EN
#define TVE_INP_VIDEO_FORM
#define TVE_INP_YCBCR_422
#define TVE_INP_YCBCR_444
#define TVE_DATA_SOURCE_MASK
#define TVE_DATA_SOURCE_BUS1
#define TVE_DATA_SOURCE_BUS2
#define TVE_DATA_SOURCE_EXT
#define TVE_DATA_SOURCE_TESTGEN
#define TVE_IPU_CLK_EN_OFS
#define TVE_IPU_CLK_EN
#define TVE_DAC_SAMP_RATE_OFS
#define TVE_DAC_SAMP_RATE_WIDTH
#define TVE_DAC_SAMP_RATE_MASK
#define TVE_DAC_FULL_RATE
#define TVE_DAC_DIV2_RATE
#define TVE_DAC_DIV4_RATE
#define TVE_EN

/* TVE_TVDACx_CONT_REG */
#define TVE_TVDAC_GAIN_MASK

/* TVE_CD_CONT_REG */
#define TVE_CD_CH_2_SM_EN
#define TVE_CD_CH_1_SM_EN
#define TVE_CD_CH_0_SM_EN
#define TVE_CD_CH_2_LM_EN
#define TVE_CD_CH_1_LM_EN
#define TVE_CD_CH_0_LM_EN
#define TVE_CD_CH_2_REF_LVL
#define TVE_CD_CH_1_REF_LVL
#define TVE_CD_CH_0_REF_LVL
#define TVE_CD_EN

/* TVE_INT_CONT_REG */
#define TVE_FRAME_END_IEN
#define TVE_CD_MON_END_IEN
#define TVE_CD_SM_IEN
#define TVE_CD_LM_IEN

/* TVE_TST_MODE_REG */
#define TVE_TVDAC_TEST_MODE_MASK

#define IMX_TVE_DAC_VOLTAGE

enum {};

struct imx_tve_encoder {};

struct imx_tve {};

static inline struct imx_tve *con_to_tve(struct drm_connector *c)
{}

static inline struct imx_tve *enc_to_tve(struct drm_encoder *e)
{}

static void tve_enable(struct imx_tve *tve)
{}

static void tve_disable(struct imx_tve *tve)
{}

static int tve_setup_tvout(struct imx_tve *tve)
{}

static int tve_setup_vga(struct imx_tve *tve)
{}

static int imx_tve_connector_get_modes(struct drm_connector *connector)
{}

static enum drm_mode_status
imx_tve_connector_mode_valid(struct drm_connector *connector,
			     struct drm_display_mode *mode)
{}

static void imx_tve_encoder_mode_set(struct drm_encoder *encoder,
				     struct drm_display_mode *orig_mode,
				     struct drm_display_mode *mode)
{}

static void imx_tve_encoder_enable(struct drm_encoder *encoder)
{}

static void imx_tve_encoder_disable(struct drm_encoder *encoder)
{}

static int imx_tve_atomic_check(struct drm_encoder *encoder,
				struct drm_crtc_state *crtc_state,
				struct drm_connector_state *conn_state)
{}

static const struct drm_connector_funcs imx_tve_connector_funcs =;

static const struct drm_connector_helper_funcs imx_tve_connector_helper_funcs =;

static const struct drm_encoder_helper_funcs imx_tve_encoder_helper_funcs =;

static irqreturn_t imx_tve_irq_handler(int irq, void *data)
{}

static unsigned long clk_tve_di_recalc_rate(struct clk_hw *hw,
					    unsigned long parent_rate)
{}

static long clk_tve_di_round_rate(struct clk_hw *hw, unsigned long rate,
				  unsigned long *prate)
{}

static int clk_tve_di_set_rate(struct clk_hw *hw, unsigned long rate,
			       unsigned long parent_rate)
{}

static const struct clk_ops clk_tve_di_ops =;

static int tve_clk_init(struct imx_tve *tve, void __iomem *base)
{}

static void imx_tve_disable_regulator(void *data)
{}

static bool imx_tve_readable_reg(struct device *dev, unsigned int reg)
{}

static struct regmap_config tve_regmap_config =;

static const char * const imx_tve_modes[] =;

static int of_get_tve_mode(struct device_node *np)
{}

static int imx_tve_bind(struct device *dev, struct device *master, void *data)
{}

static const struct component_ops imx_tve_ops =;

static int imx_tve_probe(struct platform_device *pdev)
{}

static void imx_tve_remove(struct platform_device *pdev)
{}

static const struct of_device_id imx_tve_dt_ids[] =;
MODULE_DEVICE_TABLE(of, imx_tve_dt_ids);

static struct platform_driver imx_tve_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_ALIAS();