diff options
Diffstat (limited to 'arch/arm/mach-s5p64x0/mach-smdk6450.c')
-rw-r--r-- | arch/arm/mach-s5p64x0/mach-smdk6450.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c index 3a20de0a9264..d19c4690ee97 100644 --- a/arch/arm/mach-s5p64x0/mach-smdk6450.c +++ b/arch/arm/mach-s5p64x0/mach-smdk6450.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 SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | 50 | #define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ |
48 | S3C2410_UCON_RXILEVEL | \ | 51 | S3C2410_UCON_RXILEVEL | \ |
@@ -106,6 +109,45 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = { | |||
106 | #endif | 109 | #endif |
107 | }; | 110 | }; |
108 | 111 | ||
112 | static int smdk6450_backlight_init(struct device *dev) | ||
113 | { | ||
114 | int ret; | ||
115 | |||
116 | ret = gpio_request(S5P6450_GPF(15), "Backlight"); | ||
117 | if (ret) { | ||
118 | printk(KERN_ERR "failed to request GPF for PWM-OUT1\n"); | ||
119 | return ret; | ||
120 | } | ||
121 | |||
122 | /* Configure GPIO pin with S5P6450_GPF15_PWM_TOUT1 */ | ||
123 | s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_SFN(2)); | ||
124 | |||
125 | return 0; | ||
126 | } | ||
127 | |||
128 | static void smdk6450_backlight_exit(struct device *dev) | ||
129 | { | ||
130 | s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_OUTPUT); | ||
131 | gpio_free(S5P6450_GPF(15)); | ||
132 | } | ||
133 | |||
134 | static struct platform_pwm_backlight_data smdk6450_backlight_data = { | ||
135 | .pwm_id = 1, | ||
136 | .max_brightness = 255, | ||
137 | .dft_brightness = 255, | ||
138 | .pwm_period_ns = 78770, | ||
139 | .init = smdk6450_backlight_init, | ||
140 | .exit = smdk6450_backlight_exit, | ||
141 | }; | ||
142 | |||
143 | static struct platform_device smdk6450_backlight_device = { | ||
144 | .name = "pwm-backlight", | ||
145 | .dev = { | ||
146 | .parent = &s3c_device_timer[1].dev, | ||
147 | .platform_data = &smdk6450_backlight_data, | ||
148 | }, | ||
149 | }; | ||
150 | |||
109 | static struct platform_device *smdk6450_devices[] __initdata = { | 151 | static struct platform_device *smdk6450_devices[] __initdata = { |
110 | &s3c_device_adc, | 152 | &s3c_device_adc, |
111 | &s3c_device_rtc, | 153 | &s3c_device_rtc, |
@@ -115,6 +157,8 @@ static struct platform_device *smdk6450_devices[] __initdata = { | |||
115 | &s3c_device_wdt, | 157 | &s3c_device_wdt, |
116 | &samsung_asoc_dma, | 158 | &samsung_asoc_dma, |
117 | &s5p6450_device_iis0, | 159 | &s5p6450_device_iis0, |
160 | &s3c_device_timer[1], | ||
161 | &smdk6450_backlight_device, | ||
118 | /* s5p6450_device_spi0 will be added */ | 162 | /* s5p6450_device_spi0 will be added */ |
119 | }; | 163 | }; |
120 | 164 | ||
@@ -155,6 +199,7 @@ static void __init smdk6450_map_io(void) | |||
155 | s5p_init_io(NULL, 0, S5P64X0_SYS_ID); | 199 | s5p_init_io(NULL, 0, S5P64X0_SYS_ID); |
156 | s3c24xx_init_clocks(19200000); | 200 | s3c24xx_init_clocks(19200000); |
157 | s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs)); | 201 | s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs)); |
202 | s5p_set_timer_source(S5P_PWM3, S5P_PWM4); | ||
158 | } | 203 | } |
159 | 204 | ||
160 | static void __init smdk6450_machine_init(void) | 205 | static void __init smdk6450_machine_init(void) |
@@ -178,5 +223,5 @@ MACHINE_START(SMDK6450, "SMDK6450") | |||
178 | .init_irq = s5p6450_init_irq, | 223 | .init_irq = s5p6450_init_irq, |
179 | .map_io = smdk6450_map_io, | 224 | .map_io = smdk6450_map_io, |
180 | .init_machine = smdk6450_machine_init, | 225 | .init_machine = smdk6450_machine_init, |
181 | .timer = &s3c24xx_timer, | 226 | .timer = &s5p_timer, |
182 | MACHINE_END | 227 | MACHINE_END |