mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
drm/rockchip: dw_hdmi: Add property to show whether sink is DVI
Add property output_type_capacity: enums: DVI=0 HDMI=1 Signed-off-by: Algea Cao <algea.cao@rock-chips.com> Change-Id: Iad09b386b55c52e21b01f98e81fadfd5aa1a42d3
This commit is contained in:
@@ -3087,6 +3087,12 @@ bool dw_hdmi_get_output_whether_hdmi(struct dw_hdmi *hdmi)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dw_hdmi_get_output_whether_hdmi);
|
||||
|
||||
int dw_hdmi_get_output_type_cap(struct dw_hdmi *hdmi)
|
||||
{
|
||||
return hdmi->support_hdmi;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dw_hdmi_get_output_type_cap);
|
||||
|
||||
static void dw_hdmi_connector_force(struct drm_connector *connector)
|
||||
{
|
||||
struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,
|
||||
|
||||
@@ -131,6 +131,7 @@ struct rockchip_hdmi {
|
||||
struct drm_property *quant_range;
|
||||
struct drm_property *hdr_panel_metadata_property;
|
||||
struct drm_property *output_hdmi_dvi;
|
||||
struct drm_property *output_type_capacity;
|
||||
|
||||
struct drm_property_blob *hdr_panel_blob_ptr;
|
||||
|
||||
@@ -953,6 +954,11 @@ static const struct drm_prop_enum_list output_hdmi_dvi_enum_list[] = {
|
||||
{ 2, "force_dvi" },
|
||||
};
|
||||
|
||||
static const struct drm_prop_enum_list output_type_cap_list[] = {
|
||||
{ 0, "DVI" },
|
||||
{ 1, "HDMI" },
|
||||
};
|
||||
|
||||
static void
|
||||
dw_hdmi_rockchip_attach_properties(struct drm_connector *connector,
|
||||
unsigned int color, int version,
|
||||
@@ -1082,6 +1088,15 @@ dw_hdmi_rockchip_attach_properties(struct drm_connector *connector,
|
||||
drm_object_attach_property(&connector->base, prop, 0);
|
||||
}
|
||||
|
||||
prop = drm_property_create_enum(connector->dev, 0,
|
||||
"output_type_capacity",
|
||||
output_type_cap_list,
|
||||
ARRAY_SIZE(output_type_cap_list));
|
||||
if (prop) {
|
||||
hdmi->output_type_capacity = prop;
|
||||
drm_object_attach_property(&connector->base, prop, 0);
|
||||
}
|
||||
|
||||
prop = connector->dev->mode_config.hdr_output_metadata_property;
|
||||
if (version >= 0x211a)
|
||||
drm_object_attach_property(&connector->base, prop, 0);
|
||||
@@ -1141,6 +1156,12 @@ dw_hdmi_rockchip_destroy_properties(struct drm_connector *connector,
|
||||
hdmi->output_hdmi_dvi);
|
||||
hdmi->output_hdmi_dvi = NULL;
|
||||
}
|
||||
|
||||
if (hdmi->output_type_capacity) {
|
||||
drm_property_destroy(connector->dev,
|
||||
hdmi->output_type_capacity);
|
||||
hdmi->output_type_capacity = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1251,6 +1272,9 @@ dw_hdmi_rockchip_get_property(struct drm_connector *connector,
|
||||
} else if (property == hdmi->output_hdmi_dvi) {
|
||||
*val = hdmi->force_output;
|
||||
return 0;
|
||||
} else if (property == hdmi->output_type_capacity) {
|
||||
*val = dw_hdmi_get_output_type_cap(hdmi->hdmi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
DRM_ERROR("failed to get rockchip hdmi connector property\n");
|
||||
|
||||
@@ -243,6 +243,7 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data);
|
||||
void dw_hdmi_set_quant_range(struct dw_hdmi *hdmi);
|
||||
void dw_hdmi_set_output_type(struct dw_hdmi *hdmi, u64 val);
|
||||
bool dw_hdmi_get_output_whether_hdmi(struct dw_hdmi *hdmi);
|
||||
int dw_hdmi_get_output_type_cap(struct dw_hdmi *hdmi);
|
||||
void dw_hdmi_set_cec_adap(struct dw_hdmi *hdmi, struct cec_adapter *adap);
|
||||
|
||||
#endif /* __IMX_HDMI_H__ */
|
||||
|
||||
Reference in New Issue
Block a user