linux/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
 */

#include <linux/clk.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/phy/phy.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>

#include <drm/bridge/dw_hdmi.h>
#include <drm/drm_edid.h>
#include <drm/drm_of.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>

#include "rockchip_drm_drv.h"

#define RK3228_GRF_SOC_CON2
#define RK3228_HDMI_SDAIN_MSK
#define RK3228_HDMI_SCLIN_MSK
#define RK3228_GRF_SOC_CON6
#define RK3228_HDMI_HPD_VSEL
#define RK3228_HDMI_SDA_VSEL
#define RK3228_HDMI_SCL_VSEL

#define RK3288_GRF_SOC_CON6
#define RK3288_HDMI_LCDC_SEL
#define RK3328_GRF_SOC_CON2

#define RK3328_HDMI_SDAIN_MSK
#define RK3328_HDMI_SCLIN_MSK
#define RK3328_HDMI_HPD_IOE
#define RK3328_GRF_SOC_CON3
/* need to be unset if hdmi or i2c should control voltage */
#define RK3328_HDMI_SDA5V_GRF
#define RK3328_HDMI_SCL5V_GRF
#define RK3328_HDMI_HPD5V_GRF
#define RK3328_HDMI_CEC5V_GRF
#define RK3328_GRF_SOC_CON4
#define RK3328_HDMI_HPD_SARADC
#define RK3328_HDMI_CEC_5V
#define RK3328_HDMI_SDA_5V
#define RK3328_HDMI_SCL_5V
#define RK3328_HDMI_HPD_5V

#define RK3399_GRF_SOC_CON20
#define RK3399_HDMI_LCDC_SEL

#define RK3568_GRF_VO_CON1
#define RK3568_HDMI_SDAIN_MSK
#define RK3568_HDMI_SCLIN_MSK

#define HIWORD_UPDATE(val, mask)

/**
 * struct rockchip_hdmi_chip_data - splite the grf setting of kind of chips
 * @lcdsel_grf_reg: grf register offset of lcdc select
 * @lcdsel_big: reg value of selecting vop big for HDMI
 * @lcdsel_lit: reg value of selecting vop little for HDMI
 */
struct rockchip_hdmi_chip_data {};

struct rockchip_hdmi {};

static struct rockchip_hdmi *to_rockchip_hdmi(struct drm_encoder *encoder)
{}

static const struct dw_hdmi_mpll_config rockchip_mpll_cfg[] =;

static const struct dw_hdmi_curr_ctrl rockchip_cur_ctr[] =;

static const struct dw_hdmi_phy_config rockchip_phy_config[] =;

static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi)
{}

static enum drm_mode_status
dw_hdmi_rockchip_mode_valid(struct dw_hdmi *dw_hdmi, void *data,
			    const struct drm_display_info *info,
			    const struct drm_display_mode *mode)
{}

static void dw_hdmi_rockchip_encoder_disable(struct drm_encoder *encoder)
{}

static bool
dw_hdmi_rockchip_encoder_mode_fixup(struct drm_encoder *encoder,
				    const struct drm_display_mode *mode,
				    struct drm_display_mode *adj_mode)
{}

static void dw_hdmi_rockchip_encoder_mode_set(struct drm_encoder *encoder,
					      struct drm_display_mode *mode,
					      struct drm_display_mode *adj_mode)
{}

static void dw_hdmi_rockchip_encoder_enable(struct drm_encoder *encoder)
{}

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

static const struct drm_encoder_helper_funcs dw_hdmi_rockchip_encoder_helper_funcs =;

static int dw_hdmi_rockchip_genphy_init(struct dw_hdmi *dw_hdmi, void *data,
					const struct drm_display_info *display,
					const struct drm_display_mode *mode)
{}

static void dw_hdmi_rockchip_genphy_disable(struct dw_hdmi *dw_hdmi, void *data)
{}

static void dw_hdmi_rk3228_setup_hpd(struct dw_hdmi *dw_hdmi, void *data)
{}

static enum drm_connector_status
dw_hdmi_rk3328_read_hpd(struct dw_hdmi *dw_hdmi, void *data)
{}

static void dw_hdmi_rk3328_setup_hpd(struct dw_hdmi *dw_hdmi, void *data)
{}

static const struct dw_hdmi_phy_ops rk3228_hdmi_phy_ops =;

static struct rockchip_hdmi_chip_data rk3228_chip_data =;

static const struct dw_hdmi_plat_data rk3228_hdmi_drv_data =;

static struct rockchip_hdmi_chip_data rk3288_chip_data =;

static const struct dw_hdmi_plat_data rk3288_hdmi_drv_data =;

static const struct dw_hdmi_phy_ops rk3328_hdmi_phy_ops =;

static struct rockchip_hdmi_chip_data rk3328_chip_data =;

static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data =;

static struct rockchip_hdmi_chip_data rk3399_chip_data =;

static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data =;

static struct rockchip_hdmi_chip_data rk3568_chip_data =;

static const struct dw_hdmi_plat_data rk3568_hdmi_drv_data =;

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

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

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

static const struct component_ops dw_hdmi_rockchip_ops =;

static int dw_hdmi_rockchip_probe(struct platform_device *pdev)
{}

static void dw_hdmi_rockchip_remove(struct platform_device *pdev)
{}

static int __maybe_unused dw_hdmi_rockchip_resume(struct device *dev)
{}

static const struct dev_pm_ops dw_hdmi_rockchip_pm =;

struct platform_driver dw_hdmi_rockchip_pltfm_driver =;