diff options
author | Liu Ying <Ying.Liu@freescale.com> | 2012-09-03 15:30:55 +0800 |
---|---|---|
committer | Liu Ying <Ying.Liu@freescale.com> | 2012-09-27 11:10:31 +0800 |
commit | 82d607a727228da0cb333adc7d072e9eb23c26db (patch) | |
tree | 4b111e79ba610ff55850416a1d8eb5fc77576e9e /board | |
parent | ce91cea872f6b8d079d3a54f0d1e0647be07f91b (diff) | |
download | u-boot-imx-82d607a727228da0cb333adc7d072e9eb23c26db.zip u-boot-imx-82d607a727228da0cb333adc7d072e9eb23c26db.tar.gz u-boot-imx-82d607a727228da0cb333adc7d072e9eb23c26db.tar.bz2 |
ENGR00223794 MX6 SabreSD:Enable LVDS panel pwm backlight
This patch enables pwm backlight for LVDS panel and stops
using gpio backlight to align with kernel to avoid unstable
backlight when booting into kernel, as kernel usually uses
pwm backlight instead of gpio backlight. Following items
are done to support this:
1) Add PWM1 and PWM2 controller base addresses.
2) Change PIN SD1_DAT3 mux from GPIO to PWM1_PWMO.
3) Set default backlight density to 50%.
Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/mx6q_sabresd/mx6q_sabresd.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/board/freescale/mx6q_sabresd/mx6q_sabresd.c b/board/freescale/mx6q_sabresd/mx6q_sabresd.c index 3989b23..92e3463 100644 --- a/board/freescale/mx6q_sabresd/mx6q_sabresd.c +++ b/board/freescale/mx6q_sabresd/mx6q_sabresd.c @@ -33,6 +33,7 @@ #endif #if defined(CONFIG_VIDEO_MX5) +#include <asm/imx_pwm.h> #include <linux/list.h> #include <linux/fb.h> #include <linux/mxcfb.h> @@ -99,6 +100,11 @@ unsigned short colormap[65536]; unsigned short colormap[16777216]; #endif +static struct pwm_device pwm0 = { + .pwm_id = 0, + .pwmo_invert = 0, +}; + static int di = 1; extern int ipuv3_fb_init(struct fb_videomode *mode, int di, @@ -1373,31 +1379,24 @@ void lcd_enable(void) */ g_ipu_hw_rev = IPUV3_HW_REV_IPUV3H; + imx_pwm_config(pwm0, 25000, 50000); + imx_pwm_enable(pwm0); + #if defined CONFIG_MX6Q - /* GPIO backlight */ - mxc_iomux_v3_setup_pad(MX6Q_PAD_SD1_DAT3__GPIO_1_21); + /* PWM backlight */ + mxc_iomux_v3_setup_pad(MX6Q_PAD_SD1_DAT3__PWM1_PWMO); /* LVDS panel CABC_EN0 */ mxc_iomux_v3_setup_pad(MX6Q_PAD_NANDF_CS2__GPIO_6_15); /* LVDS panel CABC_EN1 */ mxc_iomux_v3_setup_pad(MX6Q_PAD_NANDF_CS3__GPIO_6_16); #elif defined CONFIG_MX6DL - /* GPIO backlight */ - mxc_iomux_v3_setup_pad(MX6DL_PAD_SD1_DAT3__GPIO_1_21); + /* PWM backlight */ + mxc_iomux_v3_setup_pad(MX6DL_PAD_SD1_DAT3__PWM1_PWMO); /* LVDS panel CABC_EN0 */ mxc_iomux_v3_setup_pad(MX6DL_PAD_NANDF_CS2__GPIO_6_15); /* LVDS panel CABC_EN1 */ mxc_iomux_v3_setup_pad(MX6DL_PAD_NANDF_CS3__GPIO_6_16); #endif - - /* Set GPIO backlight to high. */ - reg = readl(GPIO1_BASE_ADDR + GPIO_GDIR); - reg |= (1 << 21); - writel(reg, GPIO1_BASE_ADDR + GPIO_GDIR); - - reg = readl(GPIO1_BASE_ADDR + GPIO_DR); - reg |= (1 << 21); - writel(reg, GPIO1_BASE_ADDR + GPIO_DR); - /* * Set LVDS panel CABC_EN0 to low to disable * CABC function. This function will turn backlight |