X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Frtc.h;fp=include%2Flinux%2Frtc.h;h=b739ac1f7ca03f2371e16f52afe20f0c1adaf062;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=5371e4e745958f37e67cba09db7eaa9e49a2ada0;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 5371e4e74..b739ac1f7 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -34,8 +34,8 @@ struct rtc_time { * alarm API. */ struct rtc_wkalrm { - unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */ - unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */ + unsigned char enabled; /* 0 = alarm disable, 1 = alarm disabled */ + unsigned char pending; /* 0 = alarm pending, 1 = alarm not pending */ struct rtc_time time; /* time the alarm is set to */ }; @@ -91,114 +91,10 @@ struct rtc_pll_info { #define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */ #define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */ -/* interrupt flags */ -#define RTC_IRQF 0x80 /* any of the following is active */ -#define RTC_PF 0x40 -#define RTC_AF 0x20 -#define RTC_UF 0x10 - #ifdef __KERNEL__ #include -extern int rtc_month_days(unsigned int month, unsigned int year); -extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year); -extern int rtc_valid_tm(struct rtc_time *tm); -extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); -extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); - -#include -#include -#include -#include -#include - -extern struct class *rtc_class; - -struct rtc_class_ops { - int (*open)(struct device *); - void (*release)(struct device *); - int (*ioctl)(struct device *, unsigned int, unsigned long); - int (*read_time)(struct device *, struct rtc_time *); - int (*set_time)(struct device *, struct rtc_time *); - int (*read_alarm)(struct device *, struct rtc_wkalrm *); - int (*set_alarm)(struct device *, struct rtc_wkalrm *); - int (*proc)(struct device *, struct seq_file *); - int (*set_mmss)(struct device *, unsigned long secs); - int (*irq_set_state)(struct device *, int enabled); - int (*irq_set_freq)(struct device *, int freq); - int (*read_callback)(struct device *, int data); -}; - -#define RTC_DEVICE_NAME_SIZE 20 -struct rtc_task; - -struct rtc_device -{ - struct class_device class_dev; - struct module *owner; - - int id; - char name[RTC_DEVICE_NAME_SIZE]; - - struct rtc_class_ops *ops; - struct mutex ops_lock; - - struct class_device *rtc_dev; - struct cdev char_dev; - struct mutex char_lock; - - unsigned long irq_data; - spinlock_t irq_lock; - wait_queue_head_t irq_queue; - struct fasync_struct *async_queue; - - struct rtc_task *irq_task; - spinlock_t irq_task_lock; - int irq_freq; - int max_user_freq; -#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL - struct work_struct uie_task; - struct timer_list uie_timer; - /* Those fields are protected by rtc->irq_lock */ - unsigned int oldsecs; - unsigned int irq_active:1; - unsigned int stop_uie_polling:1; - unsigned int uie_task_active:1; - unsigned int uie_timer_active:1; -#endif -}; -#define to_rtc_device(d) container_of(d, struct rtc_device, class_dev) - -extern struct rtc_device *rtc_device_register(const char *name, - struct device *dev, - struct rtc_class_ops *ops, - struct module *owner); -extern void rtc_device_unregister(struct rtc_device *rdev); -extern int rtc_interface_register(struct class_interface *intf); - -extern int rtc_read_time(struct class_device *class_dev, struct rtc_time *tm); -extern int rtc_set_time(struct class_device *class_dev, struct rtc_time *tm); -extern int rtc_set_mmss(struct class_device *class_dev, unsigned long secs); -extern int rtc_read_alarm(struct class_device *class_dev, - struct rtc_wkalrm *alrm); -extern int rtc_set_alarm(struct class_device *class_dev, - struct rtc_wkalrm *alrm); -extern void rtc_update_irq(struct class_device *class_dev, - unsigned long num, unsigned long events); - -extern struct class_device *rtc_class_open(char *name); -extern void rtc_class_close(struct class_device *class_dev); - -extern int rtc_irq_register(struct class_device *class_dev, - struct rtc_task *task); -extern void rtc_irq_unregister(struct class_device *class_dev, - struct rtc_task *task); -extern int rtc_irq_set_state(struct class_device *class_dev, - struct rtc_task *task, int enabled); -extern int rtc_irq_set_freq(struct class_device *class_dev, - struct rtc_task *task, int freq); - typedef struct rtc_task { void (*func)(void *private_data); void *private_data;