diff options
author | Igor Grinberg <grinberg@compulab.co.il> | 2009-11-10 07:18:41 -0500 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-11-30 20:03:13 -0500 |
commit | db205463fd24c0972ad2c4e4fafb1c76e51b4380 (patch) | |
tree | 0be3eea8421b31452675e943ea879dfc6e567d7b /arch/arm/mach-pxa | |
parent | 5fa46fca1c209b9fd1dbfd5bc680a236d9f78d54 (diff) |
[ARM] pxa/cm-x300: add PWM backlight support
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-pxa/cm-x300.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-pxa/devices.c | 1 |
3 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 20e645a6943a..d89c6adbe8bc 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -226,6 +226,7 @@ config MACH_COLIBRI300 | |||
226 | select PXA3xx | 226 | select PXA3xx |
227 | select CPU_PXA300 | 227 | select CPU_PXA300 |
228 | select CPU_PXA310 | 228 | select CPU_PXA310 |
229 | select HAVE_PWM | ||
229 | 230 | ||
230 | config MACH_COLIBRI320 | 231 | config MACH_COLIBRI320 |
231 | bool "Toradex Colibri PXA320" | 232 | bool "Toradex Colibri PXA320" |
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index d564d8ea5a33..d37cfa132a65 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/dm9000.h> | 24 | #include <linux/dm9000.h> |
25 | #include <linux/leds.h> | 25 | #include <linux/leds.h> |
26 | #include <linux/rtc-v3020.h> | 26 | #include <linux/rtc-v3020.h> |
27 | #include <linux/pwm_backlight.h> | ||
27 | 28 | ||
28 | #include <linux/i2c.h> | 29 | #include <linux/i2c.h> |
29 | #include <linux/i2c/pca953x.h> | 30 | #include <linux/i2c/pca953x.h> |
@@ -50,6 +51,7 @@ | |||
50 | #include <asm/mach/map.h> | 51 | #include <asm/mach/map.h> |
51 | 52 | ||
52 | #include "generic.h" | 53 | #include "generic.h" |
54 | #include "devices.h" | ||
53 | 55 | ||
54 | #define CM_X300_ETH_PHYS 0x08000010 | 56 | #define CM_X300_ETH_PHYS 0x08000010 |
55 | 57 | ||
@@ -160,6 +162,9 @@ static mfp_cfg_t cm_x3xx_mfp_cfg[] __initdata = { | |||
160 | /* Standard I2C */ | 162 | /* Standard I2C */ |
161 | GPIO21_I2C_SCL, | 163 | GPIO21_I2C_SCL, |
162 | GPIO22_I2C_SDA, | 164 | GPIO22_I2C_SDA, |
165 | |||
166 | /* PWM Backlight */ | ||
167 | GPIO19_PWM2_OUT, | ||
163 | }; | 168 | }; |
164 | 169 | ||
165 | static mfp_cfg_t cm_x3xx_rev_lt130_mfp_cfg[] __initdata = { | 170 | static mfp_cfg_t cm_x3xx_rev_lt130_mfp_cfg[] __initdata = { |
@@ -290,6 +295,30 @@ static void __init cm_x300_init_lcd(void) | |||
290 | static inline void cm_x300_init_lcd(void) {} | 295 | static inline void cm_x300_init_lcd(void) {} |
291 | #endif | 296 | #endif |
292 | 297 | ||
298 | #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) | ||
299 | static struct platform_pwm_backlight_data cm_x300_backlight_data = { | ||
300 | .pwm_id = 2, | ||
301 | .max_brightness = 100, | ||
302 | .dft_brightness = 100, | ||
303 | .pwm_period_ns = 10000, | ||
304 | }; | ||
305 | |||
306 | static struct platform_device cm_x300_backlight_device = { | ||
307 | .name = "pwm-backlight", | ||
308 | .dev = { | ||
309 | .parent = &pxa27x_device_pwm0.dev, | ||
310 | .platform_data = &cm_x300_backlight_data, | ||
311 | }, | ||
312 | }; | ||
313 | |||
314 | static void cm_x300_init_bl(void) | ||
315 | { | ||
316 | platform_device_register(&cm_x300_backlight_device); | ||
317 | } | ||
318 | #else | ||
319 | static inline void cm_x300_init_bl(void) {} | ||
320 | #endif | ||
321 | |||
293 | #if defined(CONFIG_SPI_GPIO) || defined(CONFIG_SPI_GPIO_MODULE) | 322 | #if defined(CONFIG_SPI_GPIO) || defined(CONFIG_SPI_GPIO_MODULE) |
294 | #define GPIO_LCD_BASE (144) | 323 | #define GPIO_LCD_BASE (144) |
295 | #define GPIO_LCD_DIN (GPIO_LCD_BASE + 8) /* aux_gpio3_0 */ | 324 | #define GPIO_LCD_DIN (GPIO_LCD_BASE + 8) /* aux_gpio3_0 */ |
@@ -654,6 +683,7 @@ static void __init cm_x300_init(void) | |||
654 | cm_x300_init_rtc(); | 683 | cm_x300_init_rtc(); |
655 | cm_x300_init_ac97(); | 684 | cm_x300_init_ac97(); |
656 | cm_x300_init_wi2wi(); | 685 | cm_x300_init_wi2wi(); |
686 | cm_x300_init_bl(); | ||
657 | } | 687 | } |
658 | 688 | ||
659 | static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, | 689 | static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, |
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index d4cc41d04b25..3395463bb5a6 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/platform_device.h> | 4 | #include <linux/platform_device.h> |
5 | #include <linux/dma-mapping.h> | 5 | #include <linux/dma-mapping.h> |
6 | 6 | ||
7 | #include <mach/hardware.h> | ||
7 | #include <mach/udc.h> | 8 | #include <mach/udc.h> |
8 | #include <mach/pxafb.h> | 9 | #include <mach/pxafb.h> |
9 | #include <mach/mmc.h> | 10 | #include <mach/mmc.h> |