aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2011-03-11 01:48:52 -0500
committerKukjin Kim <kgene.kim@samsung.com>2011-03-11 01:48:52 -0500
commit6d2f42cc275ba72a47ce6933b18480163ecf2740 (patch)
treeb986e612edd1d44fa64874601712060970308290 /arch/arm/mach-s5pv210
parenta9518cde232960875a1f03ba00c112f56872cf60 (diff)
parent5cd435b4ab881280fb0b8ce6686cfceb005d98c8 (diff)
Merge branch 'dev/pwm-backlight' into for-next
Conflicts: arch/arm/mach-s3c64xx/mach-smdk6410.c
Diffstat (limited to 'arch/arm/mach-s5pv210')
-rw-r--r--arch/arm/mach-s5pv210/Kconfig1
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c43
2 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 53aabef1e9ce..d7fd031f6015 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -130,6 +130,7 @@ config MACH_SMDKV210
130 select SAMSUNG_DEV_ADC 130 select SAMSUNG_DEV_ADC
131 select SAMSUNG_DEV_IDE 131 select SAMSUNG_DEV_IDE
132 select SAMSUNG_DEV_KEYPAD 132 select SAMSUNG_DEV_KEYPAD
133 select SAMSUNG_DEV_PWM
133 select SAMSUNG_DEV_TS 134 select SAMSUNG_DEV_TS
134 select S5PV210_SETUP_FB_24BPP 135 select S5PV210_SETUP_FB_24BPP
135 select S5PV210_SETUP_I2C1 136 select S5PV210_SETUP_I2C1
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index bc9fdb52a020..2b5f48806c57 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -18,6 +18,7 @@
18#include <linux/fb.h> 18#include <linux/fb.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/pwm_backlight.h>
21 22
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 24#include <asm/mach/map.h>
@@ -43,6 +44,7 @@
43#include <plat/keypad.h> 44#include <plat/keypad.h>
44#include <plat/pm.h> 45#include <plat/pm.h>
45#include <plat/fb.h> 46#include <plat/fb.h>
47#include <plat/gpio-cfg.h>
46 48
47/* Following are default values for UCON, ULCON and UFCON UART registers */ 49/* Following are default values for UCON, ULCON and UFCON UART registers */
48#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 50#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -208,6 +210,45 @@ static struct s3c_fb_platdata smdkv210_lcd0_pdata __initdata = {
208 .setup_gpio = s5pv210_fb_gpio_setup_24bpp, 210 .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
209}; 211};
210 212
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
211static struct platform_device *smdkv210_devices[] __initdata = { 252static struct platform_device *smdkv210_devices[] __initdata = {
212 &s3c_device_adc, 253 &s3c_device_adc,
213 &s3c_device_cfcon, 254 &s3c_device_cfcon,
@@ -229,6 +270,8 @@ static struct platform_device *smdkv210_devices[] __initdata = {
229 &samsung_device_keypad, 270 &samsung_device_keypad,
230 &smdkv210_dm9000, 271 &smdkv210_dm9000,
231 &smdkv210_lcd_lte480wv, 272 &smdkv210_lcd_lte480wv,
273 &s3c_device_timer[3],
274 &smdkv210_backlight_device,
232}; 275};
233 276
234static void __init smdkv210_dm9000_init(void) 277static void __init smdkv210_dm9000_init(void)