diff options
-rw-r--r-- | arch/arm/configs/clps711x_defconfig | 4 | ||||
-rw-r--r-- | arch/arm/mach-clps711x/board-edb7211.c | 37 |
2 files changed, 25 insertions, 16 deletions
diff --git a/arch/arm/configs/clps711x_defconfig b/arch/arm/configs/clps711x_defconfig index 0facf9da047c..fc105c9178cc 100644 --- a/arch/arm/configs/clps711x_defconfig +++ b/arch/arm/configs/clps711x_defconfig | |||
@@ -68,8 +68,8 @@ CONFIG_GPIO_GENERIC_PLATFORM=y | |||
68 | # CONFIG_HWMON is not set | 68 | # CONFIG_HWMON is not set |
69 | CONFIG_FB=y | 69 | CONFIG_FB=y |
70 | CONFIG_FB_CLPS711X=y | 70 | CONFIG_FB_CLPS711X=y |
71 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
72 | CONFIG_LCD_PLATFORM=y | 71 | CONFIG_LCD_PLATFORM=y |
72 | CONFIG_BACKLIGHT_PWM=y | ||
73 | # CONFIG_USB_SUPPORT is not set | 73 | # CONFIG_USB_SUPPORT is not set |
74 | CONFIG_NEW_LEDS=y | 74 | CONFIG_NEW_LEDS=y |
75 | CONFIG_LEDS_CLASS=y | 75 | CONFIG_LEDS_CLASS=y |
@@ -77,6 +77,8 @@ CONFIG_LEDS_GPIO=y | |||
77 | CONFIG_LEDS_TRIGGERS=y | 77 | CONFIG_LEDS_TRIGGERS=y |
78 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 78 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
79 | # CONFIG_IOMMU_SUPPORT is not set | 79 | # CONFIG_IOMMU_SUPPORT is not set |
80 | CONFIG_PWM=y | ||
81 | CONFIG_PWM_CLPS711X=y | ||
80 | CONFIG_EXT2_FS=y | 82 | CONFIG_EXT2_FS=y |
81 | CONFIG_CRAMFS=y | 83 | CONFIG_CRAMFS=y |
82 | CONFIG_MINIX_FS=y | 84 | CONFIG_MINIX_FS=y |
diff --git a/arch/arm/mach-clps711x/board-edb7211.c b/arch/arm/mach-clps711x/board-edb7211.c index fdf54d40909a..f33979784f38 100644 --- a/arch/arm/mach-clps711x/board-edb7211.c +++ b/arch/arm/mach-clps711x/board-edb7211.c | |||
@@ -14,8 +14,9 @@ | |||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/i2c-gpio.h> | 15 | #include <linux/i2c-gpio.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/backlight.h> | ||
18 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/pwm.h> | ||
19 | #include <linux/pwm_backlight.h> | ||
19 | #include <linux/memblock.h> | 20 | #include <linux/memblock.h> |
20 | 21 | ||
21 | #include <linux/mtd/physmap.h> | 22 | #include <linux/mtd/physmap.h> |
@@ -108,23 +109,23 @@ static struct plat_lcd_data edb7211_lcd_power_pdata = { | |||
108 | .set_power = edb7211_lcd_power_set, | 109 | .set_power = edb7211_lcd_power_set, |
109 | }; | 110 | }; |
110 | 111 | ||
111 | static void edb7211_lcd_backlight_set_intensity(int intensity) | 112 | static struct pwm_lookup edb7211_pwm_lookup[] = { |
112 | { | 113 | PWM_LOOKUP("clps711x-pwm", 0, "pwm-backlight.0", NULL, |
113 | gpio_set_value(EDB7211_LCDBL, !!intensity); | 114 | 0, PWM_POLARITY_NORMAL), |
114 | clps_writel((clps_readl(PMPCON) & 0xf0ff) | (intensity << 8), PMPCON); | 115 | }; |
115 | } | ||
116 | 116 | ||
117 | static struct generic_bl_info edb7211_lcd_backlight_pdata = { | 117 | static struct platform_pwm_backlight_data pwm_bl_pdata = { |
118 | .name = "lcd-backlight.0", | 118 | .dft_brightness = 0x01, |
119 | .default_intensity = 0x01, | 119 | .max_brightness = 0x0f, |
120 | .max_intensity = 0x0f, | 120 | .enable_gpio = EDB7211_LCDBL, |
121 | .set_bl_intensity = edb7211_lcd_backlight_set_intensity, | ||
122 | }; | 121 | }; |
123 | 122 | ||
123 | static struct resource clps711x_pwm_res = | ||
124 | DEFINE_RES_MEM(CLPS711X_PHYS_BASE + PMPCON, SZ_4); | ||
125 | |||
124 | static struct gpio edb7211_gpios[] __initconst = { | 126 | static struct gpio edb7211_gpios[] __initconst = { |
125 | { EDB7211_LCD_DC_DC_EN, GPIOF_OUT_INIT_LOW, "LCD DC-DC" }, | 127 | { EDB7211_LCD_DC_DC_EN, GPIOF_OUT_INIT_LOW, "LCD DC-DC" }, |
126 | { EDB7211_LCDEN, GPIOF_OUT_INIT_LOW, "LCD POWER" }, | 128 | { EDB7211_LCDEN, GPIOF_OUT_INIT_LOW, "LCD POWER" }, |
127 | { EDB7211_LCDBL, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT" }, | ||
128 | }; | 129 | }; |
129 | 130 | ||
130 | /* Reserve screen memory region at the start of main system memory. */ | 131 | /* Reserve screen memory region at the start of main system memory. */ |
@@ -153,12 +154,18 @@ static void __init edb7211_init_late(void) | |||
153 | gpio_request_array(edb7211_gpios, ARRAY_SIZE(edb7211_gpios)); | 154 | gpio_request_array(edb7211_gpios, ARRAY_SIZE(edb7211_gpios)); |
154 | 155 | ||
155 | platform_device_register(&edb7211_flash_pdev); | 156 | platform_device_register(&edb7211_flash_pdev); |
157 | |||
156 | platform_device_register_data(NULL, "platform-lcd", 0, | 158 | platform_device_register_data(NULL, "platform-lcd", 0, |
157 | &edb7211_lcd_power_pdata, | 159 | &edb7211_lcd_power_pdata, |
158 | sizeof(edb7211_lcd_power_pdata)); | 160 | sizeof(edb7211_lcd_power_pdata)); |
159 | platform_device_register_data(NULL, "generic-bl", 0, | 161 | |
160 | &edb7211_lcd_backlight_pdata, | 162 | platform_device_register_simple("clps711x-pwm", PLATFORM_DEVID_NONE, |
161 | sizeof(edb7211_lcd_backlight_pdata)); | 163 | &clps711x_pwm_res, 1); |
164 | pwm_add_table(edb7211_pwm_lookup, ARRAY_SIZE(edb7211_pwm_lookup)); | ||
165 | |||
166 | platform_device_register_data(&platform_bus, "pwm-backlight", 0, | ||
167 | &pwm_bl_pdata, sizeof(pwm_bl_pdata)); | ||
168 | |||
162 | platform_device_register_simple("video-clps711x", 0, NULL, 0); | 169 | platform_device_register_simple("video-clps711x", 0, NULL, 0); |
163 | platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, | 170 | platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, |
164 | ARRAY_SIZE(edb7211_cs8900_resource)); | 171 | ARRAY_SIZE(edb7211_cs8900_resource)); |