From 7a8f84b70aa79121150a1980b25311c85d247e04 Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Tue, 28 May 2013 13:49:06 +0800 Subject: [PATCH] ENGR00264465-3 arm: imx6qdl:Disable Hannstar LVDS panel CABC Hannstar LVDS panel CABC function turns backlight density automatically according to display content. This may introduce annoying unstable backlight when display content changes. So, this patch disables the CABC function if a platform's of device tree provides controlling gpios in lvds_cabc_ctrl node. Signed-off-by: Liu Ying (cherry picked from commit 35048e80235a7e337a35d8747b153bdd0afb621a) --- arch/arm/mach-imx/mach-imx6q.c | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 85ec12ca55c6..09892acf8e7f 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -22,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -282,6 +284,42 @@ static void __init imx6q_axi_init(void) } } +/* + * Disable Hannstar LVDS panel CABC function. + * This function turns the panel's backlight density automatically + * according to the content shown on the panel which may cause + * annoying unstable backlight issue. + */ +static void __init imx6q_lvds_cabc_init(void) +{ + struct device_node *np = NULL; + int ret, lvds0_gpio, lvds1_gpio; + + np = of_find_node_by_name(NULL, "lvds_cabc_ctrl"); + if (!np) + return; + + lvds0_gpio = of_get_named_gpio(np, "lvds0-gpios", 0); + if (gpio_is_valid(lvds0_gpio)) { + ret = gpio_request_one(lvds0_gpio, GPIOF_OUT_INIT_LOW, + "LVDS0 CABC enable"); + if (!ret) { + gpio_set_value(lvds0_gpio, 0); + gpio_free(lvds0_gpio); + } + } + + lvds1_gpio = of_get_named_gpio(np, "lvds1-gpios", 0); + if (gpio_is_valid(lvds1_gpio)) { + ret = gpio_request_one(lvds1_gpio, GPIOF_OUT_INIT_LOW, + "LVDS1 CABC enable"); + if (!ret) { + gpio_set_value(lvds1_gpio, 0); + gpio_free(lvds1_gpio); + } + } +} + static void __init imx6q_init_machine(void) { struct device *parent; @@ -303,6 +341,7 @@ static void __init imx6q_init_machine(void) cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init(); imx6q_1588_init(); imx6q_axi_init(); + imx6q_lvds_cabc_init(); } #define OCOTP_CFG3 0x440 -- 2.39.5