#include <linux/cpu.h>
#include <linux/delay.h>
#include <linux/export.h>
+#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
+#include <linux/of_gpio.h>
#include <linux/of_platform.h>
#include <linux/pm_opp.h>
#include <linux/pci.h>
}
}
+/*
+ * 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;
cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init();
imx6q_1588_init();
imx6q_axi_init();
+ imx6q_lvds_cabc_init();
}
#define OCOTP_CFG3 0x440