|
|
@ -52,6 +52,7 @@ |
|
|
|
#include <linux/rtc.h> |
|
|
|
#include <linux/rtc.h> |
|
|
|
#include <linux/delay.h> |
|
|
|
#include <linux/delay.h> |
|
|
|
#include <linux/version.h> |
|
|
|
#include <linux/version.h> |
|
|
|
|
|
|
|
#include <linux/smp_lock.h> |
|
|
|
|
|
|
|
|
|
|
|
#include <asm/uaccess.h> |
|
|
|
#include <asm/uaccess.h> |
|
|
|
#include <asm/system.h> |
|
|
|
#include <asm/system.h> |
|
|
@ -461,8 +462,7 @@ static ssize_t rtc_read(UNUSED struct file *filp, char *buf, size_t count, |
|
|
|
return len; |
|
|
|
return len; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int rtc_ioctl(UNUSED struct inode *inode, UNUSED struct file *filp, |
|
|
|
static int rtc_do_ioctl(unsigned int cmd, unsigned long arg) |
|
|
|
unsigned int cmd, unsigned long arg) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
struct rtc_time rtc_tm; |
|
|
|
struct rtc_time rtc_tm; |
|
|
|
|
|
|
|
|
|
|
@ -492,14 +492,23 @@ static int rtc_ioctl(UNUSED struct inode *inode, UNUSED struct file *filp, |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static struct file_operations rtc_fops = { |
|
|
|
static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
|
|
|
.owner = THIS_MODULE, |
|
|
|
{ |
|
|
|
.llseek = no_llseek, |
|
|
|
long ret; |
|
|
|
.read = rtc_read, |
|
|
|
lock_kernel(); |
|
|
|
.write = rtc_write, |
|
|
|
ret = rtc_do_ioctl(cmd, arg); |
|
|
|
.ioctl = rtc_ioctl, |
|
|
|
unlock_kernel(); |
|
|
|
.open = rtc_open, |
|
|
|
return ret; |
|
|
|
.release = rtc_release, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const struct file_operations rtc_fops = { |
|
|
|
|
|
|
|
.owner = THIS_MODULE, |
|
|
|
|
|
|
|
.llseek = no_llseek, |
|
|
|
|
|
|
|
.read = rtc_read, |
|
|
|
|
|
|
|
.write = rtc_write, |
|
|
|
|
|
|
|
.unlocked_ioctl = rtc_ioctl, |
|
|
|
|
|
|
|
.open = rtc_open, |
|
|
|
|
|
|
|
.release = rtc_release, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
static struct miscdevice rtc_dev = { |
|
|
|
static struct miscdevice rtc_dev = { |
|
|
|