rtc-m41t80.c (4e73e0eb633f8a1b5cbf20e7f42c6dbfec1d1ca7) | rtc-m41t80.c (55929332c92e5d34d65a8f784604c92677ea3e15) |
---|---|
1/* 2 * I2C client/driver for the ST M41T80 family of i2c rtc chips. 3 * 4 * Author: Alexander Bigga <ab@mycable.de> 5 * 6 * Based on m41t00.c by Mark A. Greer <mgreer@mvista.com> 7 * 8 * 2006 (c) mycable GmbH --- 609 unchanged lines hidden (view full) --- 618 * @file: file handle to the device 619 * @cmd: watchdog command 620 * @arg: argument pointer 621 * 622 * The watchdog API defines a common set of functions for all watchdogs 623 * according to their available features. We only actually usefully support 624 * querying capabilities and current status. 625 */ | 1/* 2 * I2C client/driver for the ST M41T80 family of i2c rtc chips. 3 * 4 * Author: Alexander Bigga <ab@mycable.de> 5 * 6 * Based on m41t00.c by Mark A. Greer <mgreer@mvista.com> 7 * 8 * 2006 (c) mycable GmbH --- 609 unchanged lines hidden (view full) --- 618 * @file: file handle to the device 619 * @cmd: watchdog command 620 * @arg: argument pointer 621 * 622 * The watchdog API defines a common set of functions for all watchdogs 623 * according to their available features. We only actually usefully support 624 * querying capabilities and current status. 625 */ |
626static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 626static int wdt_ioctl(struct file *file, unsigned int cmd, |
627 unsigned long arg) 628{ 629 int new_margin, rv; 630 static struct watchdog_info ident = { 631 .options = WDIOF_POWERUNDER | WDIOF_KEEPALIVEPING | 632 WDIOF_SETTIMEOUT, 633 .firmware_version = 1, 634 .identity = "M41T80 WTD" --- 36 unchanged lines hidden (view full) --- 671 wdt_ping(); 672 } 673 674 return -EINVAL; 675 } 676 return -ENOTTY; 677} 678 | 627 unsigned long arg) 628{ 629 int new_margin, rv; 630 static struct watchdog_info ident = { 631 .options = WDIOF_POWERUNDER | WDIOF_KEEPALIVEPING | 632 WDIOF_SETTIMEOUT, 633 .firmware_version = 1, 634 .identity = "M41T80 WTD" --- 36 unchanged lines hidden (view full) --- 671 wdt_ping(); 672 } 673 674 return -EINVAL; 675 } 676 return -ENOTTY; 677} 678 |
679static long wdt_unlocked_ioctl(struct file *file, unsigned int cmd, 680 unsigned long arg) 681{ 682 int ret; 683 684 lock_kernel(); 685 ret = wdt_ioctl(file, cmd, arg); 686 unlock_kernel(); 687 688 return ret; 689} 690 |
|
679/** 680 * wdt_open: 681 * @inode: inode of device 682 * @file: file handle to device 683 * 684 */ 685static int wdt_open(struct inode *inode, struct file *file) 686{ --- 44 unchanged lines hidden (view full) --- 731 /* Disable Watchdog */ 732 wdt_disable(); 733 return NOTIFY_DONE; 734} 735 736static const struct file_operations wdt_fops = { 737 .owner = THIS_MODULE, 738 .read = wdt_read, | 691/** 692 * wdt_open: 693 * @inode: inode of device 694 * @file: file handle to device 695 * 696 */ 697static int wdt_open(struct inode *inode, struct file *file) 698{ --- 44 unchanged lines hidden (view full) --- 743 /* Disable Watchdog */ 744 wdt_disable(); 745 return NOTIFY_DONE; 746} 747 748static const struct file_operations wdt_fops = { 749 .owner = THIS_MODULE, 750 .read = wdt_read, |
739 .ioctl = wdt_ioctl, | 751 .unlocked_ioctl = wdt_unlocked_ioctl, |
740 .write = wdt_write, 741 .open = wdt_open, 742 .release = wdt_release, 743}; 744 745static struct miscdevice wdt_dev = { 746 .minor = WATCHDOG_MINOR, 747 .name = "watchdog", --- 166 unchanged lines hidden --- | 752 .write = wdt_write, 753 .open = wdt_open, 754 .release = wdt_release, 755}; 756 757static struct miscdevice wdt_dev = { 758 .minor = WATCHDOG_MINOR, 759 .name = "watchdog", --- 166 unchanged lines hidden --- |