zoukankan      html  css  js  c++  java
  • I.MX6 U-boot Kernel backlight setting

    /*********************************************************************
     *              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);
            
            ......
        }
        ......
  • 相关阅读:
    对dedecms、php168,phpcms、VeryCMS、DiyPage五款开源整站系统的简单评点(
    [转+总结]Linux虚拟系统安装VMware Tools总结
    VMware虚拟机的联网(图)
    自己动手架设linux下Web服务器(图)4
    免费三个月的美国vps:JUMPLINE,速度不错
    中文 CentOS 攻略
    linux不能上网如何配置
    格式化字符串
    gitlab在push代码的时候报错
    运行ntpdate报错:Temporary failure in name resolution
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/5249437.html
Copyright © 2011-2022 走看看