aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig1
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c46
2 files changed, 44 insertions, 3 deletions
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index f3a953f02dd6..e4177e22557b 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -143,6 +143,7 @@ config MACH_SMDK6410
143 select S3C_DEV_USB_HSOTG 143 select S3C_DEV_USB_HSOTG
144 select S3C_DEV_WDT 144 select S3C_DEV_WDT
145 select SAMSUNG_DEV_KEYPAD 145 select SAMSUNG_DEV_KEYPAD
146 select SAMSUNG_DEV_PWM
146 select HAVE_S3C2410_WATCHDOG if WATCHDOG 147 select HAVE_S3C2410_WATCHDOG if WATCHDOG
147 select S3C64XX_SETUP_SDHCI 148 select S3C64XX_SETUP_SDHCI
148 select S3C64XX_SETUP_I2C1 149 select S3C64XX_SETUP_I2C1
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index e85192a86fbe..6639cced5f79 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -28,6 +28,7 @@
28#include <linux/delay.h> 28#include <linux/delay.h>
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/pwm_backlight.h>
31 32
32#ifdef CONFIG_SMDK6410_WM1190_EV1 33#ifdef CONFIG_SMDK6410_WM1190_EV1
33#include <linux/mfd/wm8350/core.h> 34#include <linux/mfd/wm8350/core.h>
@@ -48,6 +49,7 @@
48#include <mach/hardware.h> 49#include <mach/hardware.h>
49#include <mach/regs-fb.h> 50#include <mach/regs-fb.h>
50#include <mach/map.h> 51#include <mach/map.h>
52#include <mach/gpio-bank-f.h>
51 53
52#include <asm/irq.h> 54#include <asm/irq.h>
53#include <asm/mach-types.h> 55#include <asm/mach-types.h>
@@ -118,7 +120,6 @@ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
118{ 120{
119 if (power) { 121 if (power) {
120 gpio_direction_output(S3C64XX_GPF(13), 1); 122 gpio_direction_output(S3C64XX_GPF(13), 1);
121 gpio_direction_output(S3C64XX_GPF(15), 1);
122 123
123 /* fire nRESET on power up */ 124 /* fire nRESET on power up */
124 gpio_direction_output(S3C64XX_GPN(5), 0); 125 gpio_direction_output(S3C64XX_GPN(5), 0);
@@ -126,7 +127,6 @@ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
126 gpio_direction_output(S3C64XX_GPN(5), 1); 127 gpio_direction_output(S3C64XX_GPN(5), 1);
127 msleep(1); 128 msleep(1);
128 } else { 129 } else {
129 gpio_direction_output(S3C64XX_GPF(15), 0);
130 gpio_direction_output(S3C64XX_GPF(13), 0); 130 gpio_direction_output(S3C64XX_GPF(13), 0);
131 } 131 }
132} 132}
@@ -269,6 +269,45 @@ static struct samsung_keypad_platdata smdk6410_keypad_data __initdata = {
269 .cols = 8, 269 .cols = 8,
270}; 270};
271 271
272static int smdk6410_backlight_init(struct device *dev)
273{
274 int ret;
275
276 ret = gpio_request(S3C64XX_GPF(15), "Backlight");
277 if (ret) {
278 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
279 return ret;
280 }
281
282 /* Configure GPIO pin with S3C64XX_GPF15_PWM_TOUT1 */
283 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
284
285 return 0;
286}
287
288static void smdk6410_backlight_exit(struct device *dev)
289{
290 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_OUTPUT);
291 gpio_free(S3C64XX_GPF(15));
292}
293
294static struct platform_pwm_backlight_data smdk6410_backlight_data = {
295 .pwm_id = 1,
296 .max_brightness = 255,
297 .dft_brightness = 255,
298 .pwm_period_ns = 78770,
299 .init = smdk6410_backlight_init,
300 .exit = smdk6410_backlight_exit,
301};
302
303static struct platform_device smdk6410_backlight_device = {
304 .name = "pwm-backlight",
305 .dev = {
306 .parent = &s3c_device_timer[1].dev,
307 .platform_data = &smdk6410_backlight_data,
308 },
309};
310
272static struct map_desc smdk6410_iodesc[] = {}; 311static struct map_desc smdk6410_iodesc[] = {};
273 312
274static struct platform_device *smdk6410_devices[] __initdata = { 313static struct platform_device *smdk6410_devices[] __initdata = {
@@ -298,6 +337,8 @@ static struct platform_device *smdk6410_devices[] __initdata = {
298 &s3c_device_rtc, 337 &s3c_device_rtc,
299 &s3c_device_ts, 338 &s3c_device_ts,
300 &s3c_device_wdt, 339 &s3c_device_wdt,
340 &s3c_device_timer[1],
341 &smdk6410_backlight_device,
301}; 342};
302 343
303#ifdef CONFIG_REGULATOR 344#ifdef CONFIG_REGULATOR
@@ -693,7 +734,6 @@ static void __init smdk6410_machine_init(void)
693 734
694 gpio_request(S3C64XX_GPN(5), "LCD power"); 735 gpio_request(S3C64XX_GPN(5), "LCD power");
695 gpio_request(S3C64XX_GPF(13), "LCD power"); 736 gpio_request(S3C64XX_GPF(13), "LCD power");
696 gpio_request(S3C64XX_GPF(15), "LCD power");
697 737
698 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0)); 738 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
699 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); 739 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));