diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-01 11:51:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-01 11:51:25 -0400 |
commit | b904d7131d116900524bd36ec170dcd97846bfd3 (patch) | |
tree | acd97b3f0027a8dd8659181a316677ee9f578bcc /arch/cris/arch-v10 | |
parent | 2e8949f09e3097c629f33323eaf280cf5c88c81a (diff) | |
parent | 4150764fbba03ce4675b02b10872c665bb05a8aa (diff) |
Merge branch 'for-linus' of git://www.jni.nu/cris
* 'for-linus' of git://www.jni.nu/cris:
CRIS: Don't use mask_irq as symbol name
CRIS: Simplify param.h by simply including <asm-generic/param.h>
CRISv10: Whitespace fixes for hw_settings.S
CRISv10: Trivial fixes.
CRISv32: Fix RS485 port 4 CD Kconfig item.
CRISv32: Remove duplicated Kconfig items.
cris: push down BKL into some device drivers
Diffstat (limited to 'arch/cris/arch-v10')
-rw-r--r-- | arch/cris/arch-v10/drivers/ds1302.c | 20 | ||||
-rw-r--r-- | arch/cris/arch-v10/drivers/pcf8563.c | 19 | ||||
-rw-r--r-- | arch/cris/arch-v10/kernel/irq.c | 8 | ||||
-rw-r--r-- | arch/cris/arch-v10/lib/dmacopy.c | 15 | ||||
-rw-r--r-- | arch/cris/arch-v10/lib/hw_settings.S | 14 |
5 files changed, 47 insertions, 29 deletions
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c index 77630df94343..884275629ef7 100644 --- a/arch/cris/arch-v10/drivers/ds1302.c +++ b/arch/cris/arch-v10/drivers/ds1302.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/miscdevice.h> | 20 | #include <linux/miscdevice.h> |
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/smp_lock.h> | ||
22 | #include <linux/bcd.h> | 23 | #include <linux/bcd.h> |
23 | #include <linux/capability.h> | 24 | #include <linux/capability.h> |
24 | 25 | ||
@@ -238,9 +239,7 @@ static unsigned char days_in_mo[] = | |||
238 | 239 | ||
239 | /* ioctl that supports RTC_RD_TIME and RTC_SET_TIME (read and set time/date). */ | 240 | /* ioctl that supports RTC_RD_TIME and RTC_SET_TIME (read and set time/date). */ |
240 | 241 | ||
241 | static int | 242 | static int rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
242 | rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | ||
243 | unsigned long arg) | ||
244 | { | 243 | { |
245 | unsigned long flags; | 244 | unsigned long flags; |
246 | 245 | ||
@@ -354,6 +353,17 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
354 | } | 353 | } |
355 | } | 354 | } |
356 | 355 | ||
356 | static long rtc_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
357 | { | ||
358 | int ret; | ||
359 | |||
360 | lock_kernel(); | ||
361 | ret = rtc_ioctl(file, cmd, arg); | ||
362 | unlock_kernel(); | ||
363 | |||
364 | return ret; | ||
365 | } | ||
366 | |||
357 | static void | 367 | static void |
358 | print_rtc_status(void) | 368 | print_rtc_status(void) |
359 | { | 369 | { |
@@ -375,8 +385,8 @@ print_rtc_status(void) | |||
375 | /* The various file operations we support. */ | 385 | /* The various file operations we support. */ |
376 | 386 | ||
377 | static const struct file_operations rtc_fops = { | 387 | static const struct file_operations rtc_fops = { |
378 | .owner = THIS_MODULE, | 388 | .owner = THIS_MODULE, |
379 | .ioctl = rtc_ioctl, | 389 | .unlocked_ioctl = rtc_unlocked_ioctl, |
380 | }; | 390 | }; |
381 | 391 | ||
382 | /* Probe for the chip by writing something to its RAM and try reading it back. */ | 392 | /* Probe for the chip by writing something to its RAM and try reading it back. */ |
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c index 1e90c1a9c849..7dcb1f85f42b 100644 --- a/arch/cris/arch-v10/drivers/pcf8563.c +++ b/arch/cris/arch-v10/drivers/pcf8563.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/bcd.h> | 28 | #include <linux/bcd.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | #include <linux/smp_lock.h> | ||
30 | 31 | ||
31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
32 | #include <asm/system.h> | 33 | #include <asm/system.h> |
@@ -53,7 +54,7 @@ static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ | |||
53 | static const unsigned char days_in_month[] = | 54 | static const unsigned char days_in_month[] = |
54 | { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; | 55 | { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; |
55 | 56 | ||
56 | int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | 57 | static long pcf8563_unlocked_ioctl(struct file *, unsigned int, unsigned long); |
57 | 58 | ||
58 | /* Cache VL bit value read at driver init since writing the RTC_SECOND | 59 | /* Cache VL bit value read at driver init since writing the RTC_SECOND |
59 | * register clears the VL status. | 60 | * register clears the VL status. |
@@ -62,7 +63,7 @@ static int voltage_low; | |||
62 | 63 | ||
63 | static const struct file_operations pcf8563_fops = { | 64 | static const struct file_operations pcf8563_fops = { |
64 | .owner = THIS_MODULE, | 65 | .owner = THIS_MODULE, |
65 | .ioctl = pcf8563_ioctl, | 66 | .unlocked_ioctl = pcf8563_unlocked_ioctl, |
66 | }; | 67 | }; |
67 | 68 | ||
68 | unsigned char | 69 | unsigned char |
@@ -212,8 +213,7 @@ pcf8563_exit(void) | |||
212 | * ioctl calls for this driver. Why return -ENOTTY upon error? Because | 213 | * ioctl calls for this driver. Why return -ENOTTY upon error? Because |
213 | * POSIX says so! | 214 | * POSIX says so! |
214 | */ | 215 | */ |
215 | int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | 216 | static int pcf8563_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
216 | unsigned long arg) | ||
217 | { | 217 | { |
218 | /* Some sanity checks. */ | 218 | /* Some sanity checks. */ |
219 | if (_IOC_TYPE(cmd) != RTC_MAGIC) | 219 | if (_IOC_TYPE(cmd) != RTC_MAGIC) |
@@ -339,6 +339,17 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
339 | return 0; | 339 | return 0; |
340 | } | 340 | } |
341 | 341 | ||
342 | static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | ||
343 | { | ||
344 | int ret; | ||
345 | |||
346 | lock_kernel(); | ||
347 | return pcf8563_ioctl(filp, cmd, arg); | ||
348 | unlock_kernel(); | ||
349 | |||
350 | return ret; | ||
351 | } | ||
352 | |||
342 | static int __init pcf8563_register(void) | 353 | static int __init pcf8563_register(void) |
343 | { | 354 | { |
344 | if (pcf8563_init() < 0) { | 355 | if (pcf8563_init() < 0) { |
diff --git a/arch/cris/arch-v10/kernel/irq.c b/arch/cris/arch-v10/kernel/irq.c index 1a61efc13982..a0c0df8be9c8 100644 --- a/arch/cris/arch-v10/kernel/irq.c +++ b/arch/cris/arch-v10/kernel/irq.c | |||
@@ -17,8 +17,8 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | 19 | ||
20 | #define mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr)); | 20 | #define crisv10_mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr)); |
21 | #define unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr)); | 21 | #define crisv10_unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr)); |
22 | 22 | ||
23 | /* don't use set_int_vector, it bypasses the linux interrupt handlers. it is | 23 | /* don't use set_int_vector, it bypasses the linux interrupt handlers. it is |
24 | * global just so that the kernel gdb can use it. | 24 | * global just so that the kernel gdb can use it. |
@@ -116,12 +116,12 @@ static unsigned int startup_crisv10_irq(unsigned int irq) | |||
116 | 116 | ||
117 | static void enable_crisv10_irq(unsigned int irq) | 117 | static void enable_crisv10_irq(unsigned int irq) |
118 | { | 118 | { |
119 | unmask_irq(irq); | 119 | crisv10_unmask_irq(irq); |
120 | } | 120 | } |
121 | 121 | ||
122 | static void disable_crisv10_irq(unsigned int irq) | 122 | static void disable_crisv10_irq(unsigned int irq) |
123 | { | 123 | { |
124 | mask_irq(irq); | 124 | crisv10_mask_irq(irq); |
125 | } | 125 | } |
126 | 126 | ||
127 | static void ack_crisv10_irq(unsigned int irq) | 127 | static void ack_crisv10_irq(unsigned int irq) |
diff --git a/arch/cris/arch-v10/lib/dmacopy.c b/arch/cris/arch-v10/lib/dmacopy.c index e5fb44f505c5..49f5b8ca5b47 100644 --- a/arch/cris/arch-v10/lib/dmacopy.c +++ b/arch/cris/arch-v10/lib/dmacopy.c | |||
@@ -1,5 +1,4 @@ | |||
1 | /* $Id: dmacopy.c,v 1.1 2001/12/17 13:59:27 bjornw Exp $ | 1 | /* |
2 | * | ||
3 | * memcpy for large blocks, using memory-memory DMA channels 6 and 7 in Etrax | 2 | * memcpy for large blocks, using memory-memory DMA channels 6 and 7 in Etrax |
4 | */ | 3 | */ |
5 | 4 | ||
@@ -13,11 +12,11 @@ void *dma_memcpy(void *pdst, | |||
13 | unsigned int pn) | 12 | unsigned int pn) |
14 | { | 13 | { |
15 | static etrax_dma_descr indma, outdma; | 14 | static etrax_dma_descr indma, outdma; |
16 | 15 | ||
17 | D(printk("dma_memcpy %d bytes... ", pn)); | 16 | D(printk(KERN_DEBUG "dma_memcpy %d bytes... ", pn)); |
18 | 17 | ||
19 | #if 0 | 18 | #if 0 |
20 | *R_GEN_CONFIG = genconfig_shadow = | 19 | *R_GEN_CONFIG = genconfig_shadow = |
21 | (genconfig_shadow & ~0x3c0000) | | 20 | (genconfig_shadow & ~0x3c0000) | |
22 | IO_STATE(R_GEN_CONFIG, dma6, intdma7) | | 21 | IO_STATE(R_GEN_CONFIG, dma6, intdma7) | |
23 | IO_STATE(R_GEN_CONFIG, dma7, intdma6); | 22 | IO_STATE(R_GEN_CONFIG, dma7, intdma6); |
@@ -32,11 +31,11 @@ void *dma_memcpy(void *pdst, | |||
32 | *R_DMA_CH7_FIRST = &outdma; | 31 | *R_DMA_CH7_FIRST = &outdma; |
33 | *R_DMA_CH6_CMD = IO_STATE(R_DMA_CH6_CMD, cmd, start); | 32 | *R_DMA_CH6_CMD = IO_STATE(R_DMA_CH6_CMD, cmd, start); |
34 | *R_DMA_CH7_CMD = IO_STATE(R_DMA_CH7_CMD, cmd, start); | 33 | *R_DMA_CH7_CMD = IO_STATE(R_DMA_CH7_CMD, cmd, start); |
35 | |||
36 | while(*R_DMA_CH7_CMD == 1) /* wait for completion */ ; | ||
37 | 34 | ||
38 | D(printk("done\n")); | 35 | while (*R_DMA_CH7_CMD == 1) |
36 | /* wait for completion */; | ||
39 | 37 | ||
38 | D(printk(KERN_DEBUG "done\n")); | ||
40 | } | 39 | } |
41 | 40 | ||
42 | 41 | ||
diff --git a/arch/cris/arch-v10/lib/hw_settings.S b/arch/cris/arch-v10/lib/hw_settings.S index 56905aaa7b6e..c09f19f478a5 100644 --- a/arch/cris/arch-v10/lib/hw_settings.S +++ b/arch/cris/arch-v10/lib/hw_settings.S | |||
@@ -1,13 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: hw_settings.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $ | ||
3 | * | ||
4 | * This table is used by some tools to extract hardware parameters. | 2 | * This table is used by some tools to extract hardware parameters. |
5 | * The table should be included in the kernel and the decompressor. | 3 | * The table should be included in the kernel and the decompressor. |
6 | * Don't forget to update the tools if you change this table. | 4 | * Don't forget to update the tools if you change this table. |
7 | * | 5 | * |
8 | * Copyright (C) 2001 Axis Communications AB | 6 | * Copyright (C) 2001 Axis Communications AB |
9 | * | 7 | * |
10 | * Authors: Mikael Starvik (starvik@axis.com) | 8 | * Authors: Mikael Starvik (starvik@axis.com) |
11 | */ | 9 | */ |
12 | 10 | ||
13 | #define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \ | 11 | #define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \ |
@@ -15,13 +13,13 @@ | |||
15 | #define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \ | 13 | #define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \ |
16 | (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \ | 14 | (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \ |
17 | (CONFIG_ETRAX_DEF_R_PORT_PB_DATA)) | 15 | (CONFIG_ETRAX_DEF_R_PORT_PB_DATA)) |
18 | 16 | ||
19 | .ascii "HW_PARAM_MAGIC" ; Magic number | 17 | .ascii "HW_PARAM_MAGIC" ; Magic number |
20 | .dword 0xc0004000 ; Kernel start address | 18 | .dword 0xc0004000 ; Kernel start address |
21 | 19 | ||
22 | ; Debug port | 20 | ; Debug port |
23 | #ifdef CONFIG_ETRAX_DEBUG_PORT0 | 21 | #ifdef CONFIG_ETRAX_DEBUG_PORT0 |
24 | .dword 0 | 22 | .dword 0 |
25 | #elif defined(CONFIG_ETRAX_DEBUG_PORT1) | 23 | #elif defined(CONFIG_ETRAX_DEBUG_PORT1) |
26 | .dword 1 | 24 | .dword 1 |
27 | #elif defined(CONFIG_ETRAX_DEBUG_PORT2) | 25 | #elif defined(CONFIG_ETRAX_DEBUG_PORT2) |
@@ -30,7 +28,7 @@ | |||
30 | .dword 3 | 28 | .dword 3 |
31 | #else | 29 | #else |
32 | .dword 4 ; No debug | 30 | .dword 4 ; No debug |
33 | #endif | 31 | #endif |
34 | 32 | ||
35 | ; SDRAM or EDO DRAM? | 33 | ; SDRAM or EDO DRAM? |
36 | #ifdef CONFIG_ETRAX_SDRAM | 34 | #ifdef CONFIG_ETRAX_SDRAM |
@@ -39,7 +37,7 @@ | |||
39 | .dword 0 | 37 | .dword 0 |
40 | #endif | 38 | #endif |
41 | 39 | ||
42 | ; Register values | 40 | ; Register values |
43 | .dword R_WAITSTATES | 41 | .dword R_WAITSTATES |
44 | .dword CONFIG_ETRAX_DEF_R_WAITSTATES | 42 | .dword CONFIG_ETRAX_DEF_R_WAITSTATES |
45 | .dword R_BUS_CONFIG | 43 | .dword R_BUS_CONFIG |
@@ -56,7 +54,7 @@ | |||
56 | .dword CONFIG_ETRAX_DEF_R_DRAM_TIMING | 54 | .dword CONFIG_ETRAX_DEF_R_DRAM_TIMING |
57 | #endif | 55 | #endif |
58 | .dword R_PORT_PA_SET | 56 | .dword R_PORT_PA_SET |
59 | .dword PA_SET_VALUE | 57 | .dword PA_SET_VALUE |
60 | .dword R_PORT_PB_SET | 58 | .dword R_PORT_PB_SET |
61 | .dword PB_SET_VALUE | 59 | .dword PB_SET_VALUE |
62 | .dword 0 ; No more register values | 60 | .dword 0 ; No more register values |