I.MX6 U-boot Kernel backlight setting

简介: /********************************************************************* * I.MX6 U-boot Kernel backlight setting * 说明: * 本文主要记录I.MX6 U-boot、Kernel中如何打开、关闭背光设置。
/*********************************************************************
 *              I.MX6 U-boot Kernel backlight setting
 * 说明:
 *     本文主要记录I.MX6 U-boot、Kernel中如何打开、关闭背光设置。
 * 
 *                                   2016-3-7 深圳 南山平山村 曾剑锋
 ********************************************************************/


1. cat bootable/bootloader/uboot-imx/board/freescale/mx6q_sabresd/mx6q_sabresd.c
    ......
    #ifdef CONFIG_LCD
    void lcd_enable(void)
    {
        ......
        /*
         * Set LVDS panel CABC_EN0 to low to disable
         * CABC function. This function will turn backlight
         * automatically according to display content, so
         * simply disable it to get rid of annoying unstable
         * backlight phenomena.
         * 
         * • GPIO direction register (GPIO_GDIR)
         * • Data register (GPIO_DR)
         *
         * 2015-10-8 zengjf modify fot lvds backlight
         */
        reg = readl(GPIO6_BASE_ADDR + GPIO_GDIR);
        reg |= (1 << 15);
        writel(reg, GPIO6_BASE_ADDR + GPIO_GDIR);
        
        reg = readl(GPIO6_BASE_ADDR + GPIO_DR);
        //reg &= ~(1 << 15);
        reg |= (1 << 15);
        writel(reg, GPIO6_BASE_ADDR + GPIO_DR);
        
        /*
         * Set LVDS panel CABC_EN1 to low to disable
         * CABC function.
         */
        reg = readl(GPIO6_BASE_ADDR + GPIO_GDIR);
        reg |= (1 << 16);
        writel(reg, GPIO6_BASE_ADDR + GPIO_GDIR);
        
        reg = readl(GPIO6_BASE_ADDR + GPIO_DR);
        //reg &= ~(1 << 16);
        reg |= (1 << 16);
        writel(reg, GPIO6_BASE_ADDR + GPIO_DR);
        ......
    }
    ......

2. cat arch/arm/mach-mx6/board-mx6q_sabresd.c
    ......
    /*!
     * Board specific initialization.
     */
    static void __init mx6_sabresd_board_init(void)
    {
        ......
        /*
         * Disable HannStar touch panel CABC function,
         * this function turns the panel's backlight automatically
         * according to the content shown on the panel which
         * may cause annoying unstable backlight issue.
         * 
         * zengjf 2015-10-8 this also has down in uboot 
         */
        gpio_request(SABRESD_CABC_EN0, "cabc-en0");
        gpio_direction_output(SABRESD_CABC_EN0, 1);
        gpio_request(SABRESD_CABC_EN1, "cabc-en1");
        gpio_direction_output(SABRESD_CABC_EN1, 1);
        
        ......
    }
    ......

 

目录
打赏
0
0
0
0
12
分享
相关文章
I.MX6 U-boot lvds display hacking
/*********************************************************************************** * I.MX6 U-boot lvds display hacking * 声明: * 本文主要是为了跟踪I.MX6中的U-boot中显示部分代码,查看是否支持24bit显示。
914 0
I.MX6 Linux kernel LVDS backlight enable
/*************************************************************************** * I.
881 0
Kernel HOWTO 中译版
 http://www.chinalinuxpub.com/doc/howto/Kernel-HOWTO.html
656 0
I.MX6 Ar8031 device register hacking
/***************************************************************************** * I.MX6 Ar8031 device register hacking * 声明: * 主要是为了知道网卡的注册流程,如果需要对网卡中的一些需求进行修改时,能够 * 能够快速的对需求进行分析、修改。
940 0
I.MX6 ar1020 SPI device driver hacking
/************************************************************************************ * I.
818 0
I.MX6 Power off register hacking
/*********************************************************************** * I.MX6 Power off register hacking * 声明: * 本文主要记录I.MX6DL中的Power off按键的注册过程。
700 0
I.MX6 OTG set as slave device hacking
/****************************************************************************** * IMX6 OTG set as slave device hacking * 声明: * 1. 本代码解析使用了倒序的方式跟踪内核驱动代码,从驱动反推需求; * 2. 代码解析的目标是找到OTG设置成Host、Slave设备的宏定义; * 3. 根据2中的宏定义,看make menuconfig中是否存在可直接裁剪的选项。
893 0
OK335xS Linux kernel check clock 24M hacking
/****************************************************************************** * OK335xS Linux kernel check clock 24M hacking * 声明: * 由于需要确认kernel中的时钟和引脚配置的时钟是否一致,于是需要去跟踪内核 * 中的代码是如何对引脚配置时钟进行识别,并对其进行相关配置的额。
758 0
I.MX6 Goodix GT9xx touchscreen driver porting
/************************************************************************ * I.MX6 Goodix GT9xx touchscreen driver porting * 声明: * 本文主要是记录GT9xx电容Touch移植过程中遇到的一些问题。
2440 0
I.MX6 天嵌 E9 U-boot menu hacking
/************************************************************************************ * I.MX6 天嵌 E9 U-boot menu hacking * 说明: * 天嵌在U-boot中添加了自己的选择menu,想看一下怎么实现的。
966 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等