diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2011-03-11 01:48:52 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-03-11 01:48:52 -0500 |
commit | 6d2f42cc275ba72a47ce6933b18480163ecf2740 (patch) | |
tree | b986e612edd1d44fa64874601712060970308290 /arch/arm/plat-samsung | |
parent | a9518cde232960875a1f03ba00c112f56872cf60 (diff) | |
parent | 5cd435b4ab881280fb0b8ce6686cfceb005d98c8 (diff) |
Merge branch 'dev/pwm-backlight' into for-next
Conflicts:
arch/arm/mach-s3c64xx/mach-smdk6410.c
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r-- | arch/arm/plat-samsung/Kconfig | 13 | ||||
-rw-r--r-- | arch/arm/plat-samsung/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-samsung/dev-pwm.c | 53 | ||||
-rw-r--r-- | arch/arm/plat-samsung/pwm.c | 33 |
4 files changed, 67 insertions, 33 deletions
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 32be05cf82a3..be72100b81b4 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig | |||
@@ -273,6 +273,19 @@ config SAMSUNG_DEV_KEYPAD | |||
273 | help | 273 | help |
274 | Compile in platform device definitions for keypad | 274 | Compile in platform device definitions for keypad |
275 | 275 | ||
276 | config SAMSUNG_DEV_PWM | ||
277 | bool | ||
278 | default y if ARCH_S3C2410 | ||
279 | help | ||
280 | Compile in platform device definition for PWM Timer | ||
281 | |||
282 | config S3C24XX_PWM | ||
283 | bool "PWM device support" | ||
284 | select HAVE_PWM | ||
285 | help | ||
286 | Support for exporting the PWM timer blocks via the pwm device | ||
287 | system | ||
288 | |||
276 | # DMA | 289 | # DMA |
277 | 290 | ||
278 | config S3C_DMA | 291 | config S3C_DMA |
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index 29932f88a8d6..e9de58a2e294 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile | |||
@@ -59,6 +59,7 @@ obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o | |||
59 | obj-$(CONFIG_SAMSUNG_DEV_IDE) += dev-ide.o | 59 | obj-$(CONFIG_SAMSUNG_DEV_IDE) += dev-ide.o |
60 | obj-$(CONFIG_SAMSUNG_DEV_TS) += dev-ts.o | 60 | obj-$(CONFIG_SAMSUNG_DEV_TS) += dev-ts.o |
61 | obj-$(CONFIG_SAMSUNG_DEV_KEYPAD) += dev-keypad.o | 61 | obj-$(CONFIG_SAMSUNG_DEV_KEYPAD) += dev-keypad.o |
62 | obj-$(CONFIG_SAMSUNG_DEV_PWM) += dev-pwm.o | ||
62 | 63 | ||
63 | # DMA support | 64 | # DMA support |
64 | 65 | ||
diff --git a/arch/arm/plat-samsung/dev-pwm.c b/arch/arm/plat-samsung/dev-pwm.c new file mode 100644 index 000000000000..dab47b0e1900 --- /dev/null +++ b/arch/arm/plat-samsung/dev-pwm.c | |||
@@ -0,0 +1,53 @@ | |||
1 | /* linux/arch/arm/plat-samsung/dev-pwm.c | ||
2 | * | ||
3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | ||
5 | * | ||
6 | * Copyright (c) 2007 Ben Dooks | ||
7 | * Copyright (c) 2008 Simtec Electronics | ||
8 | * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org> | ||
9 | * | ||
10 | * S3C series device definition for the PWM timer | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #include <mach/irqs.h> | ||
21 | |||
22 | #include <plat/devs.h> | ||
23 | |||
24 | #define TIMER_RESOURCE_SIZE (1) | ||
25 | |||
26 | #define TIMER_RESOURCE(_tmr, _irq) \ | ||
27 | (struct resource [TIMER_RESOURCE_SIZE]) { \ | ||
28 | [0] = { \ | ||
29 | .start = _irq, \ | ||
30 | .end = _irq, \ | ||
31 | .flags = IORESOURCE_IRQ \ | ||
32 | } \ | ||
33 | } | ||
34 | |||
35 | #define DEFINE_S3C_TIMER(_tmr_no, _irq) \ | ||
36 | .name = "s3c24xx-pwm", \ | ||
37 | .id = _tmr_no, \ | ||
38 | .num_resources = TIMER_RESOURCE_SIZE, \ | ||
39 | .resource = TIMER_RESOURCE(_tmr_no, _irq), \ | ||
40 | |||
41 | /* | ||
42 | * since we already have an static mapping for the timer, | ||
43 | * we do not bother setting any IO resource for the base. | ||
44 | */ | ||
45 | |||
46 | struct platform_device s3c_device_timer[] = { | ||
47 | [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) }, | ||
48 | [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) }, | ||
49 | [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) }, | ||
50 | [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) }, | ||
51 | [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) }, | ||
52 | }; | ||
53 | EXPORT_SYMBOL(s3c_device_timer); | ||
diff --git a/arch/arm/plat-samsung/pwm.c b/arch/arm/plat-samsung/pwm.c index 2eeb49fa056d..f37457c52064 100644 --- a/arch/arm/plat-samsung/pwm.c +++ b/arch/arm/plat-samsung/pwm.c | |||
@@ -20,10 +20,8 @@ | |||
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/pwm.h> | 21 | #include <linux/pwm.h> |
22 | 22 | ||
23 | #include <mach/irqs.h> | ||
24 | #include <mach/map.h> | 23 | #include <mach/map.h> |
25 | 24 | ||
26 | #include <plat/devs.h> | ||
27 | #include <plat/regs-timer.h> | 25 | #include <plat/regs-timer.h> |
28 | 26 | ||
29 | struct pwm_device { | 27 | struct pwm_device { |
@@ -47,37 +45,6 @@ struct pwm_device { | |||
47 | 45 | ||
48 | static struct clk *clk_scaler[2]; | 46 | static struct clk *clk_scaler[2]; |
49 | 47 | ||
50 | /* Standard setup for a timer block. */ | ||
51 | |||
52 | #define TIMER_RESOURCE_SIZE (1) | ||
53 | |||
54 | #define TIMER_RESOURCE(_tmr, _irq) \ | ||
55 | (struct resource [TIMER_RESOURCE_SIZE]) { \ | ||
56 | [0] = { \ | ||
57 | .start = _irq, \ | ||
58 | .end = _irq, \ | ||
59 | .flags = IORESOURCE_IRQ \ | ||
60 | } \ | ||
61 | } | ||
62 | |||
63 | #define DEFINE_S3C_TIMER(_tmr_no, _irq) \ | ||
64 | .name = "s3c24xx-pwm", \ | ||
65 | .id = _tmr_no, \ | ||
66 | .num_resources = TIMER_RESOURCE_SIZE, \ | ||
67 | .resource = TIMER_RESOURCE(_tmr_no, _irq), \ | ||
68 | |||
69 | /* since we already have an static mapping for the timer, we do not | ||
70 | * bother setting any IO resource for the base. | ||
71 | */ | ||
72 | |||
73 | struct platform_device s3c_device_timer[] = { | ||
74 | [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) }, | ||
75 | [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) }, | ||
76 | [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) }, | ||
77 | [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) }, | ||
78 | [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) }, | ||
79 | }; | ||
80 | |||
81 | static inline int pwm_is_tdiv(struct pwm_device *pwm) | 48 | static inline int pwm_is_tdiv(struct pwm_device *pwm) |
82 | { | 49 | { |
83 | return clk_get_parent(pwm->clk) == pwm->clk_div; | 50 | return clk_get_parent(pwm->clk) == pwm->clk_div; |