summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/freescale/mx6q_sabresd/mx6q_sabresd.c27
-rw-r--r--include/configs/mx6dl_sabresd.h4
-rw-r--r--include/configs/mx6q_sabresd.h4
3 files changed, 21 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
diff --git a/include/configs/mx6dl_sabresd.h b/include/configs/mx6dl_sabresd.h
index 1d32ffb..b59bd8b 100644
--- a/include/configs/mx6dl_sabresd.h
+++ b/include/configs/mx6dl_sabresd.h
@@ -346,6 +346,10 @@
#define CONFIG_BMP_8BPP
#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_SYS_WHITE_ON_BLACK
+
+ #define CONFIG_IMX_PWM
+ #define IMX_PWM1_BASE PWM1_BASE_ADDR
+ #define IMX_PWM2_BASE PWM2_BASE_ADDR
#endif
#endif /* CONFIG_SPLASH_SCREEN */
#endif /* __CONFIG_H */
diff --git a/include/configs/mx6q_sabresd.h b/include/configs/mx6q_sabresd.h
index 0cd57d9..5717eec 100644
--- a/include/configs/mx6q_sabresd.h
+++ b/include/configs/mx6q_sabresd.h
@@ -343,5 +343,9 @@
#define CONFIG_FB_BASE (TEXT_BASE + 0x300000)
#define CONFIG_SPLASH_SCREEN_ALIGN
#define CONFIG_SYS_WHITE_ON_BLACK
+
+ #define CONFIG_IMX_PWM
+ #define IMX_PWM1_BASE PWM1_BASE_ADDR
+ #define IMX_PWM2_BASE PWM2_BASE_ADDR
#endif
#endif /* __CONFIG_H */