diff options
author | lars <lars@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-04-13 20:52:41 +0000 |
---|---|---|
committer | lars <lars@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-04-13 20:52:41 +0000 |
commit | e690b9d312ea684170aeb6e92e6b025be95e51d9 (patch) | |
tree | 3b520896cdae602a4878807168f122622acc7a38 /target/linux/mx2/files/arch | |
parent | cb83430c062604bbd8c3418d3a8b9537753f0883 (diff) |
[mx2] vp6500: Add backlight device
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20843 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mx2/files/arch')
-rw-r--r-- | target/linux/mx2/files/arch/arm/mach-mx2/mach-vp6500.c | 40 | ||||
-rw-r--r-- | target/linux/mx2/files/arch/arm/plat-mxc/include/mach/board-vp6500.h | 18 |
2 files changed, 50 insertions, 8 deletions
diff --git a/target/linux/mx2/files/arch/arm/mach-mx2/mach-vp6500.c b/target/linux/mx2/files/arch/arm/mach-mx2/mach-vp6500.c index 4ca5c0fd9..fb4464eb8 100644 --- a/target/linux/mx2/files/arch/arm/mach-mx2/mach-vp6500.c +++ b/target/linux/mx2/files/arch/arm/mach-mx2/mach-vp6500.c @@ -20,9 +20,9 @@ #include <linux/input.h> #include <linux/input/matrix_keypad.h> #include <linux/gpio_keys.h> +#include <linux/pwm_backlight.h> static unsigned int vp6500_pins[] = { - /* UART1 */ PE12_PF_UART1_TXD, PE13_PF_UART1_RXD, @@ -52,8 +52,14 @@ static unsigned int vp6500_pins[] = { PA30_PF_CONTRAST, PA31_PF_OE_ACD, #endif + + /* LCD Backlight */ + PE5_PF_PWMO, + VP6500_GPIO_BACKLIGHT_EN | GPIO_GPIO | GPIO_OUT, }; +/* Flash */ + static struct physmap_flash_data vp6500_flash_data = { .width = 2, }; @@ -74,6 +80,8 @@ static struct platform_device vp6500_nor_mtd_device = { .resource = &vp6500_flash_resource, }; +/* LEDs */ + static struct gpio_led vp6500_leds[] = { { .name = "vp6500:orange:keypad", @@ -108,6 +116,8 @@ static struct platform_device vp6500_leds_device = { }, }; +/* Keypad */ + static const uint32_t vp6500_keypad_keys[] = { KEY(0, 3, KEY_F2), KEY(0, 4, KEY_RIGHT), @@ -180,11 +190,38 @@ static struct platform_device vp6500_key_device = { }, }; +/* LCD backlight */ + +static int vp6500_backlight_notify(struct device *dev, int brightness) +{ + gpio_set_value(VP6500_GPIO_BACKLIGHT_EN, !!brightness); + + return brightness; +} + +static struct platform_pwm_backlight_data vp6500_backlight_data = { + .max_brightness = 255, + .dft_brightness = 100, + .pwm_period_ns = 15000000, + .notify = vp6500_backlight_notify, +}; + +static struct platform_device vp6500_backlight_device = { + .name = "pwm-backlight", + .id = -1, + .dev = { + .parent = &mxc_pwm_device.dev, + .platform_data = &vp6500_backlight_data, + }, +}; + + static struct platform_device *platform_devices[] __initdata = { &vp6500_nor_mtd_device, &vp6500_leds_device, &vp6500_keypad_device, &vp6500_key_device, + &vp6500_backlight_device, }; static void __init vp6500_board_init(void) @@ -193,6 +230,7 @@ static void __init vp6500_board_init(void) "vp6500"); mxc_register_device(&mxc_uart_device0, NULL); + mxc_register_device(&mxc_pwm_device, NULL); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); } diff --git a/target/linux/mx2/files/arch/arm/plat-mxc/include/mach/board-vp6500.h b/target/linux/mx2/files/arch/arm/plat-mxc/include/mach/board-vp6500.h index 700f9c101..c11d053a5 100644 --- a/target/linux/mx2/files/arch/arm/plat-mxc/include/mach/board-vp6500.h +++ b/target/linux/mx2/files/arch/arm/plat-mxc/include/mach/board-vp6500.h @@ -2,12 +2,16 @@ #ifndef __BOARD_VP6500__ #define __BOARD_VP6500__ -#define VP6500_GPIO_POWER_KEY 39 -#define VP6500_GPIO_CAMERA_DIRECTION 45 -#define VP6500_GPIO_LED_KEYPAD 82 -#define VP6500_GPIO_AMP_ENABLE 89 -#define VP6500_GPIO_LED_RED 91 -#define VP6500_GPIO_LED_GREEN 92 -#define VP6500_GPIO_LED_CAMERA 93 +#define VP6500_GPIO_POWER_KEY GPIO_PORTB | 5 +#define VP6500_GPIO_CAMERA_DIRECTION GPIO_PORTB | 13 +#define VP6500_GPIO_LED_KEYPAD GPIO_PORTC | 18 +#define VP6500_GPIO_AMP_ENABLE GPIO_PORTC | 25 +#define VP6500_GPIO_LED_RED GPIO_PORTC | 27 +#define VP6500_GPIO_LED_GREEN GPIO_PORTC | 28 +#define VP6500_GPIO_LED_CAMERA GPIO_PORTC | 29 +#define VP6500_GPIO_BACKLIGHT_EN GPIO_PORTE | 10 + +#define VP6500_GPIO_TLV_RESET GPIO_PORTB | 27 +#define VP6500_GPIO_TLV_ENABLE GPIO_PORTC | 25 #endif |