video: rockchip: hdmi: add dts property rockchip,defaultdepth

To modify hdmi default output color depth, use following dts:

&hdmi {
	rockchip,defaultdepth = <10>;
}

rockchip,defaultdepth could be following value:
<0>  auto select color depth, prefer 8bit
<8>  8bit
<10> 10bit

Change-Id: Idce0bd080c042edf3939c5c38b76d4d1860b7a9f
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(cherry picked from commit 905228ba1e)
This commit is contained in:
Zheng Yang
2017-02-07 14:42:50 +08:00
committed by Huang, Tao
parent 03c69056bc
commit eb1056fb41
3 changed files with 9 additions and 1 deletions

View File

@@ -639,7 +639,7 @@ struct hdmi *rockchip_hdmi_register(struct hdmi_property *property,
hdmi->vic = hdmi->property->defaultmode;
}
hdmi->colormode = HDMI_VIDEO_DEFAULT_COLORMODE;
hdmi->colordepth = HDMI_VIDEO_DEFAULT_COLORDEPTH;
hdmi->colordepth = hdmi->property->defaultdepth;
hdmi->colorimetry = HDMI_COLORIMETRY_NO_DATA;
hdmi->mode_3d = HDMI_3D_NONE;
hdmi->audio.type = HDMI_AUDIO_DEFAULT_TYPE;

View File

@@ -440,6 +440,7 @@ struct hdmi_property {
int display;
int feature;
int defaultmode;
int defaultdepth;
void *priv;
};

View File

@@ -528,6 +528,13 @@ static int rockchip_hdmiv2_parse_dt(struct hdmi_dev *hdmi_dev)
} else {
rk_hdmi_property.defaultmode = HDMI_VIDEO_DEFAULT_MODE;
}
if (!of_property_read_u32(np, "rockchip,defaultdepth", &val) &&
(val > 0)) {
pr_info("default depth is %d\n", val);
rk_hdmi_property.defaultdepth = val;
} else {
rk_hdmi_property.defaultdepth = HDMI_VIDEO_DEFAULT_COLORDEPTH;
}
if (of_get_property(np, "rockchip,phy_table", &val)) {
hdmi_dev->phy_table = kmalloc(val, GFP_KERNEL);
if (!hdmi_dev->phy_table) {