aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2011-08-30 16:36:10 +0800
committerEric Miao <eric.miao@linaro.org>2011-10-14 09:56:58 +0800
commit28bfd379cb4407cc8b6a73bb7037ee764014b4e4 (patch)
tree825d5ba149e0af8cdc2e3406e91546eda85bbe6d
parentf999f78ff3590a03890f764da4e63870cd2de695 (diff)
downloadlinux-linaro-28bfd379cb4407cc8b6a73bb7037ee764014b4e4.tar.gz
ARM: mx53/loco: add pwm backlight device
Signed-off-by: Jason Chen <b02280@freescale.com>
-rw-r--r--arch/arm/mach-mx5/Kconfig1
-rw-r--r--arch/arm/mach-mx5/board-mx53_loco.c11
-rw-r--r--arch/arm/mach-mx5/devices-imx53.h4
3 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index e39a34f4700..61b1b8716c1 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -211,6 +211,7 @@ config MACH_MX53_LOCO
select IMX_HAVE_PLATFORM_IMX_I2C
select IMX_HAVE_PLATFORM_IMX_SRTC
select IMX_HAVE_PLATFORM_IMX_UART
+ select IMX_HAVE_PLATFORM_MXC_PWM
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
select IMX_HAVE_PLATFORM_GPIO_KEYS
select LEDS_GPIO_REGISTER
diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c
index a0c866fd164..5a1c63b77f8 100644
--- a/arch/arm/mach-mx5/board-mx53_loco.c
+++ b/arch/arm/mach-mx5/board-mx53_loco.c
@@ -24,6 +24,7 @@
#include <linux/gpio.h>
#include <linux/fsl_devices.h>
#include <linux/ipu.h>
+#include <linux/pwm_backlight.h>
#include <mach/common.h>
#include <mach/hardware.h>
@@ -377,6 +378,13 @@ static struct mxc_pm_platform_data loco_pm_data = {
extern int __init mx53_loco_init_da9052(void);
extern void da9053_power_off(void);
+static struct platform_pwm_backlight_data loco_pwm_backlight_data = {
+ .pwm_id = 1,
+ .max_brightness = 255,
+ .dft_brightness = 128,
+ .pwm_period_ns = 50000,
+};
+
static void __init mx53_loco_io_init(void)
{
int ret;
@@ -447,6 +455,9 @@ static void __init mx53_loco_board_init(void)
mxc_register_device(&mxc_pm_device, &loco_pm_data);
mx53_loco_init_da9052();
pm_power_off = da9053_power_off;
+
+ imx53_add_mxc_pwm(1);
+ imx53_add_mxc_pwm_backlight(0, &loco_pwm_backlight_data);
}
static void __init mx53_loco_timer_init(void)
diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h
index fba4d23056d..c4b889faf57 100644
--- a/arch/arm/mach-mx5/devices-imx53.h
+++ b/arch/arm/mach-mx5/devices-imx53.h
@@ -68,3 +68,7 @@ extern const struct imx_ldb_data imx53_ldb_data __initconst;
extern const struct imx_mxc_pwm_data imx53_mxc_pwm_data[] __initconst;
#define imx53_add_mxc_pwm(id) \
imx_add_mxc_pwm(&imx53_mxc_pwm_data[id])
+
+#define imx53_add_mxc_pwm_backlight(id, pdata) \
+ platform_device_register_resndata(NULL, "pwm-backlight",\
+ id, NULL, 0, pdata, sizeof(*pdata));