diff options
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/Kconfig | 11 | ||||
-rw-r--r-- | arch/blackfin/include/asm/unistd.h | 1 | ||||
-rw-r--r-- | arch/blackfin/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/blackfin/kernel/pwm.c | 100 | ||||
-rw-r--r-- | arch/blackfin/kernel/setup.c | 1 |
5 files changed, 1 insertions, 113 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index 9b765107e15c..f34861920634 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -33,6 +33,7 @@ config BLACKFIN | |||
33 | select HAVE_PERF_EVENTS | 33 | select HAVE_PERF_EVENTS |
34 | select ARCH_HAVE_CUSTOM_GPIO_H | 34 | select ARCH_HAVE_CUSTOM_GPIO_H |
35 | select ARCH_WANT_OPTIONAL_GPIOLIB | 35 | select ARCH_WANT_OPTIONAL_GPIOLIB |
36 | select ARCH_WANT_IPC_PARSE_VERSION | ||
36 | select HAVE_GENERIC_HARDIRQS | 37 | select HAVE_GENERIC_HARDIRQS |
37 | select GENERIC_ATOMIC64 | 38 | select GENERIC_ATOMIC64 |
38 | select GENERIC_IRQ_PROBE | 39 | select GENERIC_IRQ_PROBE |
@@ -1002,16 +1003,6 @@ config BFIN_GPTIMERS | |||
1002 | To compile this driver as a module, choose M here: the module | 1003 | To compile this driver as a module, choose M here: the module |
1003 | will be called gptimers. | 1004 | will be called gptimers. |
1004 | 1005 | ||
1005 | config HAVE_PWM | ||
1006 | tristate "Enable PWM API support" | ||
1007 | depends on BFIN_GPTIMERS | ||
1008 | help | ||
1009 | Enable support for the Pulse Width Modulation framework (as | ||
1010 | found in linux/pwm.h). | ||
1011 | |||
1012 | To compile this driver as a module, choose M here: the module | ||
1013 | will be called pwm. | ||
1014 | |||
1015 | choice | 1006 | choice |
1016 | prompt "Uncached DMA region" | 1007 | prompt "Uncached DMA region" |
1017 | default DMA_UNCACHED_1M | 1008 | default DMA_UNCACHED_1M |
diff --git a/arch/blackfin/include/asm/unistd.h b/arch/blackfin/include/asm/unistd.h index 3287222cba34..5b2a0748d7d3 100644 --- a/arch/blackfin/include/asm/unistd.h +++ b/arch/blackfin/include/asm/unistd.h | |||
@@ -434,7 +434,6 @@ | |||
434 | #define __IGNORE_getcpu | 434 | #define __IGNORE_getcpu |
435 | 435 | ||
436 | #ifdef __KERNEL__ | 436 | #ifdef __KERNEL__ |
437 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
438 | #define __ARCH_WANT_STAT64 | 437 | #define __ARCH_WANT_STAT64 |
439 | #define __ARCH_WANT_SYS_ALARM | 438 | #define __ARCH_WANT_SYS_ALARM |
440 | #define __ARCH_WANT_SYS_GETHOSTNAME | 439 | #define __ARCH_WANT_SYS_GETHOSTNAME |
diff --git a/arch/blackfin/kernel/Makefile b/arch/blackfin/kernel/Makefile index 08e6625106be..735f24e07425 100644 --- a/arch/blackfin/kernel/Makefile +++ b/arch/blackfin/kernel/Makefile | |||
@@ -21,7 +21,6 @@ obj-$(CONFIG_FUNCTION_TRACER) += ftrace-entry.o | |||
21 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o | 21 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o |
22 | CFLAGS_REMOVE_ftrace.o = -pg | 22 | CFLAGS_REMOVE_ftrace.o = -pg |
23 | 23 | ||
24 | obj-$(CONFIG_HAVE_PWM) += pwm.o | ||
25 | obj-$(CONFIG_IPIPE) += ipipe.o | 24 | obj-$(CONFIG_IPIPE) += ipipe.o |
26 | obj-$(CONFIG_BFIN_GPTIMERS) += gptimers.o | 25 | obj-$(CONFIG_BFIN_GPTIMERS) += gptimers.o |
27 | obj-$(CONFIG_CPLB_INFO) += cplbinfo.o | 26 | obj-$(CONFIG_CPLB_INFO) += cplbinfo.o |
diff --git a/arch/blackfin/kernel/pwm.c b/arch/blackfin/kernel/pwm.c deleted file mode 100644 index 33f5942733bd..000000000000 --- a/arch/blackfin/kernel/pwm.c +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | /* | ||
2 | * Blackfin Pulse Width Modulation (PWM) core | ||
3 | * | ||
4 | * Copyright (c) 2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/pwm.h> | ||
11 | #include <linux/slab.h> | ||
12 | |||
13 | #include <asm/gptimers.h> | ||
14 | #include <asm/portmux.h> | ||
15 | |||
16 | struct pwm_device { | ||
17 | unsigned id; | ||
18 | unsigned short pin; | ||
19 | }; | ||
20 | |||
21 | static const unsigned short pwm_to_gptimer_per[] = { | ||
22 | P_TMR0, P_TMR1, P_TMR2, P_TMR3, P_TMR4, P_TMR5, | ||
23 | P_TMR6, P_TMR7, P_TMR8, P_TMR9, P_TMR10, P_TMR11, | ||
24 | }; | ||
25 | |||
26 | struct pwm_device *pwm_request(int pwm_id, const char *label) | ||
27 | { | ||
28 | struct pwm_device *pwm; | ||
29 | int ret; | ||
30 | |||
31 | /* XXX: pwm_id really should be unsigned */ | ||
32 | if (pwm_id < 0) | ||
33 | return NULL; | ||
34 | |||
35 | pwm = kzalloc(sizeof(*pwm), GFP_KERNEL); | ||
36 | if (!pwm) | ||
37 | return pwm; | ||
38 | |||
39 | pwm->id = pwm_id; | ||
40 | if (pwm->id >= ARRAY_SIZE(pwm_to_gptimer_per)) | ||
41 | goto err; | ||
42 | |||
43 | pwm->pin = pwm_to_gptimer_per[pwm->id]; | ||
44 | ret = peripheral_request(pwm->pin, label); | ||
45 | if (ret) | ||
46 | goto err; | ||
47 | |||
48 | return pwm; | ||
49 | err: | ||
50 | kfree(pwm); | ||
51 | return NULL; | ||
52 | } | ||
53 | EXPORT_SYMBOL(pwm_request); | ||
54 | |||
55 | void pwm_free(struct pwm_device *pwm) | ||
56 | { | ||
57 | peripheral_free(pwm->pin); | ||
58 | kfree(pwm); | ||
59 | } | ||
60 | EXPORT_SYMBOL(pwm_free); | ||
61 | |||
62 | int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) | ||
63 | { | ||
64 | unsigned long period, duty; | ||
65 | unsigned long long val; | ||
66 | |||
67 | if (duty_ns < 0 || duty_ns > period_ns) | ||
68 | return -EINVAL; | ||
69 | |||
70 | val = (unsigned long long)get_sclk() * period_ns; | ||
71 | do_div(val, NSEC_PER_SEC); | ||
72 | period = val; | ||
73 | |||
74 | val = (unsigned long long)period * duty_ns; | ||
75 | do_div(val, period_ns); | ||
76 | duty = period - val; | ||
77 | |||
78 | if (duty >= period) | ||
79 | duty = period - 1; | ||
80 | |||
81 | set_gptimer_config(pwm->id, TIMER_MODE_PWM | TIMER_PERIOD_CNT); | ||
82 | set_gptimer_pwidth(pwm->id, duty); | ||
83 | set_gptimer_period(pwm->id, period); | ||
84 | |||
85 | return 0; | ||
86 | } | ||
87 | EXPORT_SYMBOL(pwm_config); | ||
88 | |||
89 | int pwm_enable(struct pwm_device *pwm) | ||
90 | { | ||
91 | enable_gptimer(pwm->id); | ||
92 | return 0; | ||
93 | } | ||
94 | EXPORT_SYMBOL(pwm_enable); | ||
95 | |||
96 | void pwm_disable(struct pwm_device *pwm) | ||
97 | { | ||
98 | disable_gptimer(pwm->id); | ||
99 | } | ||
100 | EXPORT_SYMBOL(pwm_disable); | ||
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index ada8f0fc71e4..fb96e607adcf 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c | |||
@@ -52,7 +52,6 @@ EXPORT_SYMBOL(reserved_mem_dcache_on); | |||
52 | #ifdef CONFIG_MTD_UCLINUX | 52 | #ifdef CONFIG_MTD_UCLINUX |
53 | extern struct map_info uclinux_ram_map; | 53 | extern struct map_info uclinux_ram_map; |
54 | unsigned long memory_mtd_end, memory_mtd_start, mtd_size; | 54 | unsigned long memory_mtd_end, memory_mtd_start, mtd_size; |
55 | unsigned long _ebss; | ||
56 | EXPORT_SYMBOL(memory_mtd_end); | 55 | EXPORT_SYMBOL(memory_mtd_end); |
57 | EXPORT_SYMBOL(memory_mtd_start); | 56 | EXPORT_SYMBOL(memory_mtd_start); |
58 | EXPORT_SYMBOL(mtd_size); | 57 | EXPORT_SYMBOL(mtd_size); |