From: Zheng Yang Date: Tue, 7 Feb 2017 06:42:50 +0000 (+0800) Subject: video: rockchip: hdmi: add dts property rockchip,defaultdepth X-Git-Tag: firefly_0821_release~629 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=eb1056fb41259fd96e2fad5b196686b9c7342302;p=firefly-linux-kernel-4.4.55.git 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 (cherry picked from commit 905228ba1e43c24b3048820a7f1047a4ed5ef185) --- diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmi-core.c b/drivers/video/rockchip/hdmi/rockchip-hdmi-core.c index cf6933bc3fbc..074f6d21626e 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmi-core.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmi-core.c @@ -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; diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmi.h b/drivers/video/rockchip/hdmi/rockchip-hdmi.h index 1e788b9dae3e..08e1f9b47ee9 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmi.h +++ b/drivers/video/rockchip/hdmi/rockchip-hdmi.h @@ -440,6 +440,7 @@ struct hdmi_property { int display; int feature; int defaultmode; + int defaultdepth; void *priv; }; diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c index d8c1f1e4c02f..09dcedb8df9a 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2.c @@ -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) {