diff options
Diffstat (limited to 'arch/arm/mach-s3c64xx/mach-smdk6410.c')
-rw-r--r-- | arch/arm/mach-s3c64xx/mach-smdk6410.c | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index a80a3163dd30..686a4f270b12 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/smsc911x.h> | 29 | #include <linux/smsc911x.h> |
30 | #include <linux/regulator/fixed.h> | 30 | #include <linux/regulator/fixed.h> |
31 | #include <linux/regulator/machine.h> | 31 | #include <linux/regulator/machine.h> |
32 | #include <linux/pwm_backlight.h> | ||
32 | 33 | ||
33 | #ifdef CONFIG_SMDK6410_WM1190_EV1 | 34 | #ifdef CONFIG_SMDK6410_WM1190_EV1 |
34 | #include <linux/mfd/wm8350/core.h> | 35 | #include <linux/mfd/wm8350/core.h> |
@@ -49,6 +50,7 @@ | |||
49 | #include <mach/hardware.h> | 50 | #include <mach/hardware.h> |
50 | #include <mach/regs-fb.h> | 51 | #include <mach/regs-fb.h> |
51 | #include <mach/map.h> | 52 | #include <mach/map.h> |
53 | #include <mach/gpio-bank-f.h> | ||
52 | 54 | ||
53 | #include <asm/irq.h> | 55 | #include <asm/irq.h> |
54 | #include <asm/mach-types.h> | 56 | #include <asm/mach-types.h> |
@@ -119,7 +121,6 @@ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd, | |||
119 | { | 121 | { |
120 | if (power) { | 122 | if (power) { |
121 | gpio_direction_output(S3C64XX_GPF(13), 1); | 123 | gpio_direction_output(S3C64XX_GPF(13), 1); |
122 | gpio_direction_output(S3C64XX_GPF(15), 1); | ||
123 | 124 | ||
124 | /* fire nRESET on power up */ | 125 | /* fire nRESET on power up */ |
125 | gpio_direction_output(S3C64XX_GPN(5), 0); | 126 | gpio_direction_output(S3C64XX_GPN(5), 0); |
@@ -127,7 +128,6 @@ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd, | |||
127 | gpio_direction_output(S3C64XX_GPN(5), 1); | 128 | gpio_direction_output(S3C64XX_GPN(5), 1); |
128 | msleep(1); | 129 | msleep(1); |
129 | } else { | 130 | } else { |
130 | gpio_direction_output(S3C64XX_GPF(15), 0); | ||
131 | gpio_direction_output(S3C64XX_GPF(13), 0); | 131 | gpio_direction_output(S3C64XX_GPF(13), 0); |
132 | } | 132 | } |
133 | } | 133 | } |
@@ -270,6 +270,45 @@ static struct samsung_keypad_platdata smdk6410_keypad_data __initdata = { | |||
270 | .cols = 8, | 270 | .cols = 8, |
271 | }; | 271 | }; |
272 | 272 | ||
273 | static int smdk6410_backlight_init(struct device *dev) | ||
274 | { | ||
275 | int ret; | ||
276 | |||
277 | ret = gpio_request(S3C64XX_GPF(15), "Backlight"); | ||
278 | if (ret) { | ||
279 | printk(KERN_ERR "failed to request GPF for PWM-OUT1\n"); | ||
280 | return ret; | ||
281 | } | ||
282 | |||
283 | /* Configure GPIO pin with S3C64XX_GPF15_PWM_TOUT1 */ | ||
284 | s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2)); | ||
285 | |||
286 | return 0; | ||
287 | } | ||
288 | |||
289 | static void smdk6410_backlight_exit(struct device *dev) | ||
290 | { | ||
291 | s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_OUTPUT); | ||
292 | gpio_free(S3C64XX_GPF(15)); | ||
293 | } | ||
294 | |||
295 | static struct platform_pwm_backlight_data smdk6410_backlight_data = { | ||
296 | .pwm_id = 1, | ||
297 | .max_brightness = 255, | ||
298 | .dft_brightness = 255, | ||
299 | .pwm_period_ns = 78770, | ||
300 | .init = smdk6410_backlight_init, | ||
301 | .exit = smdk6410_backlight_exit, | ||
302 | }; | ||
303 | |||
304 | static struct platform_device smdk6410_backlight_device = { | ||
305 | .name = "pwm-backlight", | ||
306 | .dev = { | ||
307 | .parent = &s3c_device_timer[1].dev, | ||
308 | .platform_data = &smdk6410_backlight_data, | ||
309 | }, | ||
310 | }; | ||
311 | |||
273 | static struct map_desc smdk6410_iodesc[] = {}; | 312 | static struct map_desc smdk6410_iodesc[] = {}; |
274 | 313 | ||
275 | static struct platform_device *smdk6410_devices[] __initdata = { | 314 | static struct platform_device *smdk6410_devices[] __initdata = { |
@@ -299,6 +338,8 @@ static struct platform_device *smdk6410_devices[] __initdata = { | |||
299 | &s3c_device_rtc, | 338 | &s3c_device_rtc, |
300 | &s3c_device_ts, | 339 | &s3c_device_ts, |
301 | &s3c_device_wdt, | 340 | &s3c_device_wdt, |
341 | &s3c_device_timer[1], | ||
342 | &smdk6410_backlight_device, | ||
302 | }; | 343 | }; |
303 | 344 | ||
304 | #ifdef CONFIG_REGULATOR | 345 | #ifdef CONFIG_REGULATOR |
@@ -694,7 +735,6 @@ static void __init smdk6410_machine_init(void) | |||
694 | 735 | ||
695 | gpio_request(S3C64XX_GPN(5), "LCD power"); | 736 | gpio_request(S3C64XX_GPN(5), "LCD power"); |
696 | gpio_request(S3C64XX_GPF(13), "LCD power"); | 737 | gpio_request(S3C64XX_GPF(13), "LCD power"); |
697 | gpio_request(S3C64XX_GPF(15), "LCD power"); | ||
698 | 738 | ||
699 | i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0)); | 739 | i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0)); |
700 | i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); | 740 | i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); |