drm/rockchip: hdmi: Add hdmi drv_data features

Hdmi features vary on different platforms:
1.max_tmdsclk:hdmi max tmds clock.
2.unsupported_yuv_input:hdmi only support rgb input.
3.unsupported_deep_color:deep color mode is unsupported.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I77468b21960c49596c45bfef037fc5bfb3545b61
This commit is contained in:
Algea Cao
2021-07-28 10:56:29 +08:00
parent 83e6a415e8
commit a07b4b5edd
2 changed files with 20 additions and 0 deletions

View File

@@ -85,6 +85,10 @@ struct rockchip_hdmi {
struct clk *hclk_vop;
struct dw_hdmi *hdmi;
struct phy *phy;
u32 max_tmdsclk;
bool unsupported_yuv_input;
bool unsupported_deep_color;
};
#define to_rockchip_hdmi(x) container_of(x, struct rockchip_hdmi, x)
@@ -583,6 +587,7 @@ static const struct dw_hdmi_plat_data rk3228_hdmi_drv_data = {
.phy_ops = &rk3228_hdmi_phy_ops,
.phy_name = "inno_dw_hdmi_phy2",
.phy_force_vendor = true,
.max_tmdsclk = 371250,
};
static struct rockchip_hdmi_chip_data rk3288_chip_data = {
@@ -598,6 +603,7 @@ static const struct dw_hdmi_plat_data rk3288_hdmi_drv_data = {
.phy_config = rockchip_phy_config,
.phy_data = &rk3288_chip_data,
.tmds_n_table = rockchip_werid_tmds_n_table,
.unsupported_yuv_input = true,
};
static const struct dw_hdmi_phy_ops rk3328_hdmi_phy_ops = {
@@ -622,6 +628,7 @@ static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = {
.phy_name = "inno_dw_hdmi_phy2",
.phy_force_vendor = true,
.use_drm_infoframe = true,
.max_tmdsclk = 371250,
};
static struct rockchip_hdmi_chip_data rk3368_chip_data = {
@@ -635,6 +642,8 @@ static const struct dw_hdmi_plat_data rk3368_hdmi_drv_data = {
.cur_ctr = rockchip_cur_ctr,
.phy_config = rockchip_phy_config,
.phy_data = &rk3368_chip_data,
.unsupported_deep_color = true,
.max_tmdsclk = 340000,
};
static struct rockchip_hdmi_chip_data rk3399_chip_data = {
@@ -731,6 +740,14 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
if (encoder->possible_crtcs == 0)
return -EPROBE_DEFER;
if (!plat_data->max_tmdsclk)
hdmi->max_tmdsclk = 594000;
else
hdmi->max_tmdsclk = plat_data->max_tmdsclk;
hdmi->unsupported_yuv_input = plat_data->unsupported_yuv_input;
hdmi->unsupported_deep_color = plat_data->unsupported_deep_color;
ret = rockchip_hdmi_parse_dt(hdmi);
if (ret) {
DRM_DEV_ERROR(hdmi->dev, "Unable to parse OF data\n");

View File

@@ -135,8 +135,11 @@ struct dw_hdmi_plat_data {
unsigned long input_bus_format;
unsigned long input_bus_encoding;
unsigned int max_tmdsclk;
bool use_drm_infoframe;
bool ycbcr_420_allowed;
bool unsupported_yuv_input;
bool unsupported_deep_color;
/*
* Private data passed to all the .mode_valid() and .configure_phy()