diff options
Diffstat (limited to 'arch/cris/arch-v32/drivers')
-rw-r--r-- | arch/cris/arch-v32/drivers/Kconfig | 16 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/i2c.c | 22 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/pcf8563.c | 21 |
3 files changed, 31 insertions, 28 deletions
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig index b9e328e688be..a2dd740c5907 100644 --- a/arch/cris/arch-v32/drivers/Kconfig +++ b/arch/cris/arch-v32/drivers/Kconfig | |||
@@ -360,24 +360,10 @@ config ETRAX_SER4_DSR_BIT | |||
360 | string "Ser 4 DSR bit (empty = not used)" | 360 | string "Ser 4 DSR bit (empty = not used)" |
361 | depends on ETRAX_SERIAL_PORT4 | 361 | depends on ETRAX_SERIAL_PORT4 |
362 | 362 | ||
363 | config ETRAX_SER3_CD_BIT | 363 | config ETRAX_SER4_CD_BIT |
364 | string "Ser 4 CD bit (empty = not used)" | 364 | string "Ser 4 CD bit (empty = not used)" |
365 | depends on ETRAX_SERIAL_PORT4 | 365 | depends on ETRAX_SERIAL_PORT4 |
366 | 366 | ||
367 | config ETRAX_RS485 | ||
368 | bool "RS-485 support" | ||
369 | depends on ETRAXFS_SERIAL | ||
370 | help | ||
371 | Enables support for RS-485 serial communication. For a primer on | ||
372 | RS-485, see <http://www.hw.cz/english/docs/rs485/rs485.html>. | ||
373 | |||
374 | config ETRAX_RS485_DISABLE_RECEIVER | ||
375 | bool "Disable serial receiver" | ||
376 | depends on ETRAX_RS485 | ||
377 | help | ||
378 | It is necessary to disable the serial receiver to avoid serial | ||
379 | loopback. Not all products are able to do this in software only. | ||
380 | |||
381 | config ETRAX_SYNCHRONOUS_SERIAL | 367 | config ETRAX_SYNCHRONOUS_SERIAL |
382 | bool "Synchronous serial-port support" | 368 | bool "Synchronous serial-port support" |
383 | depends on ETRAX_ARCH_V32 | 369 | depends on ETRAX_ARCH_V32 |
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c index 506826399ae7..2fd6a740d895 100644 --- a/arch/cris/arch-v32/drivers/i2c.c +++ b/arch/cris/arch-v32/drivers/i2c.c | |||
@@ -649,10 +649,10 @@ i2c_release(struct inode *inode, struct file *filp) | |||
649 | /* Main device API. ioctl's to write or read to/from i2c registers. | 649 | /* Main device API. ioctl's to write or read to/from i2c registers. |
650 | */ | 650 | */ |
651 | 651 | ||
652 | static int | 652 | static long |
653 | i2c_ioctl(struct inode *inode, struct file *file, | 653 | i2c_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
654 | unsigned int cmd, unsigned long arg) | ||
655 | { | 654 | { |
655 | int ret; | ||
656 | if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) { | 656 | if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) { |
657 | return -ENOTTY; | 657 | return -ENOTTY; |
658 | } | 658 | } |
@@ -665,9 +665,13 @@ i2c_ioctl(struct inode *inode, struct file *file, | |||
665 | I2C_ARGREG(arg), | 665 | I2C_ARGREG(arg), |
666 | I2C_ARGVALUE(arg))); | 666 | I2C_ARGVALUE(arg))); |
667 | 667 | ||
668 | return i2c_writereg(I2C_ARGSLAVE(arg), | 668 | lock_kernel(); |
669 | ret = i2c_writereg(I2C_ARGSLAVE(arg), | ||
669 | I2C_ARGREG(arg), | 670 | I2C_ARGREG(arg), |
670 | I2C_ARGVALUE(arg)); | 671 | I2C_ARGVALUE(arg)); |
672 | unlock_kernel(); | ||
673 | return ret; | ||
674 | |||
671 | case I2C_READREG: | 675 | case I2C_READREG: |
672 | { | 676 | { |
673 | unsigned char val; | 677 | unsigned char val; |
@@ -675,7 +679,9 @@ i2c_ioctl(struct inode *inode, struct file *file, | |||
675 | D(printk("i2cr %d %d ", | 679 | D(printk("i2cr %d %d ", |
676 | I2C_ARGSLAVE(arg), | 680 | I2C_ARGSLAVE(arg), |
677 | I2C_ARGREG(arg))); | 681 | I2C_ARGREG(arg))); |
682 | lock_kernel(); | ||
678 | val = i2c_readreg(I2C_ARGSLAVE(arg), I2C_ARGREG(arg)); | 683 | val = i2c_readreg(I2C_ARGSLAVE(arg), I2C_ARGREG(arg)); |
684 | unlock_kernel(); | ||
679 | D(printk("= %d\n", val)); | 685 | D(printk("= %d\n", val)); |
680 | return val; | 686 | return val; |
681 | } | 687 | } |
@@ -688,10 +694,10 @@ i2c_ioctl(struct inode *inode, struct file *file, | |||
688 | } | 694 | } |
689 | 695 | ||
690 | static const struct file_operations i2c_fops = { | 696 | static const struct file_operations i2c_fops = { |
691 | .owner = THIS_MODULE, | 697 | .owner = THIS_MODULE, |
692 | .ioctl = i2c_ioctl, | 698 | .unlocked_ioctl = i2c_ioctl, |
693 | .open = i2c_open, | 699 | .open = i2c_open, |
694 | .release = i2c_release, | 700 | .release = i2c_release, |
695 | }; | 701 | }; |
696 | 702 | ||
697 | static int __init i2c_init(void) | 703 | static int __init i2c_init(void) |
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c index f4478506e52c..bef6eb53b153 100644 --- a/arch/cris/arch-v32/drivers/pcf8563.c +++ b/arch/cris/arch-v32/drivers/pcf8563.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | #include <linux/smp_lock.h> | ||
27 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
28 | #include <linux/bcd.h> | 29 | #include <linux/bcd.h> |
29 | #include <linux/mutex.h> | 30 | #include <linux/mutex.h> |
@@ -49,7 +50,7 @@ static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ | |||
49 | static const unsigned char days_in_month[] = | 50 | static const unsigned char days_in_month[] = |
50 | { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; | 51 | { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; |
51 | 52 | ||
52 | int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | 53 | static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |
53 | 54 | ||
54 | /* Cache VL bit value read at driver init since writing the RTC_SECOND | 55 | /* Cache VL bit value read at driver init since writing the RTC_SECOND |
55 | * register clears the VL status. | 56 | * register clears the VL status. |
@@ -57,8 +58,8 @@ int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | |||
57 | static int voltage_low; | 58 | static int voltage_low; |
58 | 59 | ||
59 | static const struct file_operations pcf8563_fops = { | 60 | static const struct file_operations pcf8563_fops = { |
60 | .owner = THIS_MODULE, | 61 | .owner = THIS_MODULE, |
61 | .ioctl = pcf8563_ioctl | 62 | .unlocked_ioctl = pcf8563_unlocked_ioctl, |
62 | }; | 63 | }; |
63 | 64 | ||
64 | unsigned char | 65 | unsigned char |
@@ -208,8 +209,7 @@ pcf8563_exit(void) | |||
208 | * ioctl calls for this driver. Why return -ENOTTY upon error? Because | 209 | * ioctl calls for this driver. Why return -ENOTTY upon error? Because |
209 | * POSIX says so! | 210 | * POSIX says so! |
210 | */ | 211 | */ |
211 | int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | 212 | static int pcf8563_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
212 | unsigned long arg) | ||
213 | { | 213 | { |
214 | /* Some sanity checks. */ | 214 | /* Some sanity checks. */ |
215 | if (_IOC_TYPE(cmd) != RTC_MAGIC) | 215 | if (_IOC_TYPE(cmd) != RTC_MAGIC) |
@@ -335,6 +335,17 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
335 | return 0; | 335 | return 0; |
336 | } | 336 | } |
337 | 337 | ||
338 | static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | ||
339 | { | ||
340 | int ret; | ||
341 | |||
342 | lock_kernel(); | ||
343 | return pcf8563_ioctl(filp, cmd, arg); | ||
344 | unlock_kernel(); | ||
345 | |||
346 | return ret; | ||
347 | } | ||
348 | |||
338 | static int __init pcf8563_register(void) | 349 | static int __init pcf8563_register(void) |
339 | { | 350 | { |
340 | if (pcf8563_init() < 0) { | 351 | if (pcf8563_init() < 0) { |