aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/Kconfig12
-rw-r--r--drivers/rtc/rtc-m41t80.c14
-rw-r--r--drivers/rtc/rtc-nuc900.c2
3 files changed, 15 insertions, 13 deletions
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 48ca7132cc05..2785a0f16c9f 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -765,15 +765,15 @@ config RTC_DRV_AT32AP700X
765 AT32AP700x family processors. 765 AT32AP700x family processors.
766 766
767config RTC_DRV_AT91RM9200 767config RTC_DRV_AT91RM9200
768 tristate "AT91RM9200 or AT91SAM9RL" 768 tristate "AT91RM9200 or some AT91SAM9 RTC"
769 depends on ARCH_AT91RM9200 || ARCH_AT91SAM9RL 769 depends on ARCH_AT91RM9200 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45
770 help 770 help
771 Driver for the internal RTC (Realtime Clock) module found on 771 Driver for the internal RTC (Realtime Clock) module found on
772 Atmel AT91RM9200's and AT91SAM9RL chips. On SAM9RL chips 772 Atmel AT91RM9200's and some AT91SAM9 chips. On AT91SAM9 chips
773 this is powered by the backup power supply. 773 this is powered by the backup power supply.
774 774
775config RTC_DRV_AT91SAM9 775config RTC_DRV_AT91SAM9
776 tristate "AT91SAM9x/AT91CAP9" 776 tristate "AT91SAM9x/AT91CAP9 RTT as RTC"
777 depends on ARCH_AT91 && !(ARCH_AT91RM9200 || ARCH_AT91X40) 777 depends on ARCH_AT91 && !(ARCH_AT91RM9200 || ARCH_AT91X40)
778 help 778 help
779 RTC driver for the Atmel AT91SAM9x and AT91CAP9 internal RTT 779 RTC driver for the Atmel AT91SAM9x and AT91CAP9 internal RTT
@@ -781,8 +781,8 @@ config RTC_DRV_AT91SAM9
781 supply (such as a small coin cell battery), but do not need to 781 supply (such as a small coin cell battery), but do not need to
782 be used as RTCs. 782 be used as RTCs.
783 783
784 (On AT91SAM9rl chips you probably want to use the dedicated RTC 784 (On AT91SAM9rl and AT91SAM9G45 chips you probably want to use the
785 module and leave the RTT available for other uses.) 785 dedicated RTC module and leave the RTT available for other uses.)
786 786
787config RTC_DRV_AT91SAM9_RTT 787config RTC_DRV_AT91SAM9_RTT
788 int 788 int
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index d60557cae8ef..5a8daa358066 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -20,7 +20,7 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/rtc.h> 21#include <linux/rtc.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/smp_lock.h> 23#include <linux/mutex.h>
24#include <linux/string.h> 24#include <linux/string.h>
25#ifdef CONFIG_RTC_DRV_M41T80_WDT 25#ifdef CONFIG_RTC_DRV_M41T80_WDT
26#include <linux/fs.h> 26#include <linux/fs.h>
@@ -68,6 +68,7 @@
68 68
69#define DRV_VERSION "0.05" 69#define DRV_VERSION "0.05"
70 70
71static DEFINE_MUTEX(m41t80_rtc_mutex);
71static const struct i2c_device_id m41t80_id[] = { 72static const struct i2c_device_id m41t80_id[] = {
72 { "m41t62", M41T80_FEATURE_SQ | M41T80_FEATURE_SQ_ALT }, 73 { "m41t62", M41T80_FEATURE_SQ | M41T80_FEATURE_SQ_ALT },
73 { "m41t65", M41T80_FEATURE_HT | M41T80_FEATURE_WD }, 74 { "m41t65", M41T80_FEATURE_HT | M41T80_FEATURE_WD },
@@ -677,9 +678,9 @@ static long wdt_unlocked_ioctl(struct file *file, unsigned int cmd,
677{ 678{
678 int ret; 679 int ret;
679 680
680 lock_kernel(); 681 mutex_lock(&m41t80_rtc_mutex);
681 ret = wdt_ioctl(file, cmd, arg); 682 ret = wdt_ioctl(file, cmd, arg);
682 unlock_kernel(); 683 mutex_unlock(&m41t80_rtc_mutex);
683 684
684 return ret; 685 return ret;
685} 686}
@@ -693,16 +694,16 @@ static long wdt_unlocked_ioctl(struct file *file, unsigned int cmd,
693static int wdt_open(struct inode *inode, struct file *file) 694static int wdt_open(struct inode *inode, struct file *file)
694{ 695{
695 if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) { 696 if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) {
696 lock_kernel(); 697 mutex_lock(&m41t80_rtc_mutex);
697 if (test_and_set_bit(0, &wdt_is_open)) { 698 if (test_and_set_bit(0, &wdt_is_open)) {
698 unlock_kernel(); 699 mutex_unlock(&m41t80_rtc_mutex);
699 return -EBUSY; 700 return -EBUSY;
700 } 701 }
701 /* 702 /*
702 * Activate 703 * Activate
703 */ 704 */
704 wdt_is_open = 1; 705 wdt_is_open = 1;
705 unlock_kernel(); 706 mutex_unlock(&m41t80_rtc_mutex);
706 return nonseekable_open(inode, file); 707 return nonseekable_open(inode, file);
707 } 708 }
708 return -ENODEV; 709 return -ENODEV;
@@ -748,6 +749,7 @@ static const struct file_operations wdt_fops = {
748 .write = wdt_write, 749 .write = wdt_write,
749 .open = wdt_open, 750 .open = wdt_open,
750 .release = wdt_release, 751 .release = wdt_release,
752 .llseek = no_llseek,
751}; 753};
752 754
753static struct miscdevice wdt_dev = { 755static struct miscdevice wdt_dev = {
diff --git a/drivers/rtc/rtc-nuc900.c b/drivers/rtc/rtc-nuc900.c
index 62de66af0a68..ddb0857e15a4 100644
--- a/drivers/rtc/rtc-nuc900.c
+++ b/drivers/rtc/rtc-nuc900.c
@@ -274,7 +274,7 @@ static int __devinit nuc900_rtc_probe(struct platform_device *pdev)
274 nuc900_rtc->rtcdev = rtc_device_register(pdev->name, &pdev->dev, 274 nuc900_rtc->rtcdev = rtc_device_register(pdev->name, &pdev->dev,
275 &nuc900_rtc_ops, THIS_MODULE); 275 &nuc900_rtc_ops, THIS_MODULE);
276 if (IS_ERR(nuc900_rtc->rtcdev)) { 276 if (IS_ERR(nuc900_rtc->rtcdev)) {
277 dev_err(&pdev->dev, "rtc device register faild\n"); 277 dev_err(&pdev->dev, "rtc device register failed\n");
278 err = PTR_ERR(nuc900_rtc->rtcdev); 278 err = PTR_ERR(nuc900_rtc->rtcdev);
279 goto fail3; 279 goto fail3;
280 } 280 }