diff options
Diffstat (limited to 'arch/arm/mach-s5p64x0/mach-smdk6440.c')
-rw-r--r-- | arch/arm/mach-s5p64x0/mach-smdk6440.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c index e5beb84e2393..2d559f10fd47 100644 --- a/arch/arm/mach-s5p64x0/mach-smdk6440.c +++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/pwm_backlight.h> | ||
25 | 26 | ||
26 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
@@ -32,6 +33,7 @@ | |||
32 | #include <mach/map.h> | 33 | #include <mach/map.h> |
33 | #include <mach/regs-clock.h> | 34 | #include <mach/regs-clock.h> |
34 | #include <mach/i2c.h> | 35 | #include <mach/i2c.h> |
36 | #include <mach/regs-gpio.h> | ||
35 | 37 | ||
36 | #include <plat/regs-serial.h> | 38 | #include <plat/regs-serial.h> |
37 | #include <plat/gpio-cfg.h> | 39 | #include <plat/gpio-cfg.h> |
@@ -43,6 +45,7 @@ | |||
43 | #include <plat/pll.h> | 45 | #include <plat/pll.h> |
44 | #include <plat/adc.h> | 46 | #include <plat/adc.h> |
45 | #include <plat/ts.h> | 47 | #include <plat/ts.h> |
48 | #include <plat/s5p-time.h> | ||
46 | 49 | ||
47 | #define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | 50 | #define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
48 | S3C2410_UCON_RXILEVEL | \ | 51 | S3C2410_UCON_RXILEVEL | \ |
@@ -88,6 +91,45 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = { | |||
88 | }, | 91 | }, |
89 | }; | 92 | }; |
90 | 93 | ||
94 | static int smdk6440_backlight_init(struct device *dev) | ||
95 | { | ||
96 | int ret; | ||
97 | |||
98 | ret = gpio_request(S5P6440_GPF(15), "Backlight"); | ||
99 | if (ret) { | ||
100 | printk(KERN_ERR "failed to request GPF for PWM-OUT1\n"); | ||
101 | return ret; | ||
102 | } | ||
103 | |||
104 | /* Configure GPIO pin with S5P6440_GPF15_PWM_TOUT1 */ | ||
105 | s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_SFN(2)); | ||
106 | |||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static void smdk6440_backlight_exit(struct device *dev) | ||
111 | { | ||
112 | s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_OUTPUT); | ||
113 | gpio_free(S5P6440_GPF(15)); | ||
114 | } | ||
115 | |||
116 | static struct platform_pwm_backlight_data smdk6440_backlight_data = { | ||
117 | .pwm_id = 1, | ||
118 | .max_brightness = 255, | ||
119 | .dft_brightness = 255, | ||
120 | .pwm_period_ns = 78770, | ||
121 | .init = smdk6440_backlight_init, | ||
122 | .exit = smdk6440_backlight_exit, | ||
123 | }; | ||
124 | |||
125 | static struct platform_device smdk6440_backlight_device = { | ||
126 | .name = "pwm-backlight", | ||
127 | .dev = { | ||
128 | .parent = &s3c_device_timer[1].dev, | ||
129 | .platform_data = &smdk6440_backlight_data, | ||
130 | }, | ||
131 | }; | ||
132 | |||
91 | static struct platform_device *smdk6440_devices[] __initdata = { | 133 | static struct platform_device *smdk6440_devices[] __initdata = { |
92 | &s3c_device_adc, | 134 | &s3c_device_adc, |
93 | &s3c_device_rtc, | 135 | &s3c_device_rtc, |
@@ -97,6 +139,8 @@ static struct platform_device *smdk6440_devices[] __initdata = { | |||
97 | &s3c_device_wdt, | 139 | &s3c_device_wdt, |
98 | &samsung_asoc_dma, | 140 | &samsung_asoc_dma, |
99 | &s5p6440_device_iis, | 141 | &s5p6440_device_iis, |
142 | &s3c_device_timer[1], | ||
143 | &smdk6440_backlight_device, | ||
100 | }; | 144 | }; |
101 | 145 | ||
102 | static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = { | 146 | static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = { |
@@ -136,6 +180,7 @@ static void __init smdk6440_map_io(void) | |||
136 | s5p_init_io(NULL, 0, S5P64X0_SYS_ID); | 180 | s5p_init_io(NULL, 0, S5P64X0_SYS_ID); |
137 | s3c24xx_init_clocks(12000000); | 181 | s3c24xx_init_clocks(12000000); |
138 | s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs)); | 182 | s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs)); |
183 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); | ||
139 | } | 184 | } |
140 | 185 | ||
141 | static void __init smdk6440_machine_init(void) | 186 | static void __init smdk6440_machine_init(void) |
@@ -159,5 +204,5 @@ MACHINE_START(SMDK6440, "SMDK6440") | |||
159 | .init_irq = s5p6440_init_irq, | 204 | .init_irq = s5p6440_init_irq, |
160 | .map_io = smdk6440_map_io, | 205 | .map_io = smdk6440_map_io, |
161 | .init_machine = smdk6440_machine_init, | 206 | .init_machine = smdk6440_machine_init, |
162 | .timer = &s3c24xx_timer, | 207 | .timer = &s5p_timer, |
163 | MACHINE_END | 208 | MACHINE_END |