aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210/mach-smdkv210.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s5pv210/mach-smdkv210.c')
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c57
1 files changed, 15 insertions, 42 deletions
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index c6a9e86c2d5c..5e011fc6720d 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -29,7 +29,6 @@
29 29
30#include <mach/map.h> 30#include <mach/map.h>
31#include <mach/regs-clock.h> 31#include <mach/regs-clock.h>
32#include <mach/regs-fb.h>
33 32
34#include <plat/regs-serial.h> 33#include <plat/regs-serial.h>
35#include <plat/regs-srom.h> 34#include <plat/regs-srom.h>
@@ -45,6 +44,8 @@
45#include <plat/pm.h> 44#include <plat/pm.h>
46#include <plat/fb.h> 45#include <plat/fb.h>
47#include <plat/s5p-time.h> 46#include <plat/s5p-time.h>
47#include <plat/backlight.h>
48#include <plat/regs-fb-v4.h>
48 49
49/* Following are default values for UCON, ULCON and UFCON UART registers */ 50/* Following are default values for UCON, ULCON and UFCON UART registers */
50#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 51#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -210,45 +211,6 @@ static struct s3c_fb_platdata smdkv210_lcd0_pdata __initdata = {
210 .setup_gpio = s5pv210_fb_gpio_setup_24bpp, 211 .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
211}; 212};
212 213
213static int smdkv210_backlight_init(struct device *dev)
214{
215 int ret;
216
217 ret = gpio_request(S5PV210_GPD0(3), "Backlight");
218 if (ret) {
219 printk(KERN_ERR "failed to request GPD for PWM-OUT 3\n");
220 return ret;
221 }
222
223 /* Configure GPIO pin with S5PV210_GPD_0_3_TOUT_3 */
224 s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_SFN(2));
225
226 return 0;
227}
228
229static void smdkv210_backlight_exit(struct device *dev)
230{
231 s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_OUTPUT);
232 gpio_free(S5PV210_GPD0(3));
233}
234
235static struct platform_pwm_backlight_data smdkv210_backlight_data = {
236 .pwm_id = 3,
237 .max_brightness = 255,
238 .dft_brightness = 255,
239 .pwm_period_ns = 78770,
240 .init = smdkv210_backlight_init,
241 .exit = smdkv210_backlight_exit,
242};
243
244static struct platform_device smdkv210_backlight_device = {
245 .name = "pwm-backlight",
246 .dev = {
247 .parent = &s3c_device_timer[3].dev,
248 .platform_data = &smdkv210_backlight_data,
249 },
250};
251
252static struct platform_device *smdkv210_devices[] __initdata = { 214static struct platform_device *smdkv210_devices[] __initdata = {
253 &s3c_device_adc, 215 &s3c_device_adc,
254 &s3c_device_cfcon, 216 &s3c_device_cfcon,
@@ -267,11 +229,10 @@ static struct platform_device *smdkv210_devices[] __initdata = {
267 &s5pv210_device_iis0, 229 &s5pv210_device_iis0,
268 &s5pv210_device_spdif, 230 &s5pv210_device_spdif,
269 &samsung_asoc_dma, 231 &samsung_asoc_dma,
232 &samsung_asoc_idma,
270 &samsung_device_keypad, 233 &samsung_device_keypad,
271 &smdkv210_dm9000, 234 &smdkv210_dm9000,
272 &smdkv210_lcd_lte480wv, 235 &smdkv210_lcd_lte480wv,
273 &s3c_device_timer[3],
274 &smdkv210_backlight_device,
275}; 236};
276 237
277static void __init smdkv210_dm9000_init(void) 238static void __init smdkv210_dm9000_init(void)
@@ -310,6 +271,16 @@ static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
310 .oversampling_shift = 2, 271 .oversampling_shift = 2,
311}; 272};
312 273
274/* LCD Backlight data */
275static struct samsung_bl_gpio_info smdkv210_bl_gpio_info = {
276 .no = S5PV210_GPD0(3),
277 .func = S3C_GPIO_SFN(2),
278};
279
280static struct platform_pwm_backlight_data smdkv210_bl_data = {
281 .pwm_id = 3,
282};
283
313static void __init smdkv210_map_io(void) 284static void __init smdkv210_map_io(void)
314{ 285{
315 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 286 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -341,6 +312,8 @@ static void __init smdkv210_machine_init(void)
341 312
342 s3c_fb_set_platdata(&smdkv210_lcd0_pdata); 313 s3c_fb_set_platdata(&smdkv210_lcd0_pdata);
343 314
315 samsung_bl_set(&smdkv210_bl_gpio_info, &smdkv210_bl_data);
316
344 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); 317 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
345} 318}
346 319