aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rtc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/rtc.h')
-rw-r--r--include/linux/rtc.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 5e22d4510d11..6d5e4a46781e 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -4,7 +4,7 @@
4 * service. It is used with both the legacy mc146818 and also EFI 4 * service. It is used with both the legacy mc146818 and also EFI
5 * Struct rtc_time and first 12 ioctl by Paul Gortmaker, 1996 - separated out 5 * Struct rtc_time and first 12 ioctl by Paul Gortmaker, 1996 - separated out
6 * from <linux/mc146818rtc.h> to this file for 2.4 kernels. 6 * from <linux/mc146818rtc.h> to this file for 2.4 kernels.
7 * 7 *
8 * Copyright (C) 1999 Hewlett-Packard Co. 8 * Copyright (C) 1999 Hewlett-Packard Co.
9 * Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com> 9 * Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com>
10 */ 10 */
@@ -13,7 +13,7 @@
13 13
14/* 14/*
15 * The struct used to pass data via the following ioctl. Similar to the 15 * The struct used to pass data via the following ioctl. Similar to the
16 * struct tm in <time.h>, but it needs to be here so that the kernel 16 * struct tm in <time.h>, but it needs to be here so that the kernel
17 * source is self contained, allowing cross-compiles, etc. etc. 17 * source is self contained, allowing cross-compiles, etc. etc.
18 */ 18 */
19 19
@@ -50,7 +50,7 @@ struct rtc_wkalrm {
50 * pll_value*pll_posmult/pll_clock 50 * pll_value*pll_posmult/pll_clock
51 * -ve pll_value means clock will run slower by 51 * -ve pll_value means clock will run slower by
52 * pll_value*pll_negmult/pll_clock 52 * pll_value*pll_negmult/pll_clock
53 */ 53 */
54 54
55struct rtc_pll_info { 55struct rtc_pll_info {
56 int pll_ctrl; /* placeholder for fancier control */ 56 int pll_ctrl; /* placeholder for fancier control */
@@ -106,7 +106,6 @@ extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year
106extern int rtc_valid_tm(struct rtc_time *tm); 106extern int rtc_valid_tm(struct rtc_time *tm);
107extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); 107extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time);
108extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); 108extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm);
109extern void rtc_merge_alarm(struct rtc_time *now, struct rtc_time *alarm);
110 109
111#include <linux/device.h> 110#include <linux/device.h>
112#include <linux/seq_file.h> 111#include <linux/seq_file.h>
@@ -136,7 +135,7 @@ struct rtc_task;
136 135
137struct rtc_device 136struct rtc_device
138{ 137{
139 struct class_device class_dev; 138 struct device dev;
140 struct module *owner; 139 struct module *owner;
141 140
142 int id; 141 int id;
@@ -145,7 +144,6 @@ struct rtc_device
145 const struct rtc_class_ops *ops; 144 const struct rtc_class_ops *ops;
146 struct mutex ops_lock; 145 struct mutex ops_lock;
147 146
148 struct class_device *rtc_dev;
149 struct cdev char_dev; 147 struct cdev char_dev;
150 struct mutex char_lock; 148 struct mutex char_lock;
151 149
@@ -169,35 +167,34 @@ struct rtc_device
169 unsigned int uie_timer_active:1; 167 unsigned int uie_timer_active:1;
170#endif 168#endif
171}; 169};
172#define to_rtc_device(d) container_of(d, struct rtc_device, class_dev) 170#define to_rtc_device(d) container_of(d, struct rtc_device, dev)
173 171
174extern struct rtc_device *rtc_device_register(const char *name, 172extern struct rtc_device *rtc_device_register(const char *name,
175 struct device *dev, 173 struct device *dev,
176 const struct rtc_class_ops *ops, 174 const struct rtc_class_ops *ops,
177 struct module *owner); 175 struct module *owner);
178extern void rtc_device_unregister(struct rtc_device *rdev); 176extern void rtc_device_unregister(struct rtc_device *rtc);
179extern int rtc_interface_register(struct class_interface *intf);
180 177
181extern int rtc_read_time(struct class_device *class_dev, struct rtc_time *tm); 178extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm);
182extern int rtc_set_time(struct class_device *class_dev, struct rtc_time *tm); 179extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm);
183extern int rtc_set_mmss(struct class_device *class_dev, unsigned long secs); 180extern int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs);
184extern int rtc_read_alarm(struct class_device *class_dev, 181extern int rtc_read_alarm(struct rtc_device *rtc,
185 struct rtc_wkalrm *alrm); 182 struct rtc_wkalrm *alrm);
186extern int rtc_set_alarm(struct class_device *class_dev, 183extern int rtc_set_alarm(struct rtc_device *rtc,
187 struct rtc_wkalrm *alrm); 184 struct rtc_wkalrm *alrm);
188extern void rtc_update_irq(struct class_device *class_dev, 185extern void rtc_update_irq(struct rtc_device *rtc,
189 unsigned long num, unsigned long events); 186 unsigned long num, unsigned long events);
190 187
191extern struct class_device *rtc_class_open(char *name); 188extern struct rtc_device *rtc_class_open(char *name);
192extern void rtc_class_close(struct class_device *class_dev); 189extern void rtc_class_close(struct rtc_device *rtc);
193 190
194extern int rtc_irq_register(struct class_device *class_dev, 191extern int rtc_irq_register(struct rtc_device *rtc,
195 struct rtc_task *task); 192 struct rtc_task *task);
196extern void rtc_irq_unregister(struct class_device *class_dev, 193extern void rtc_irq_unregister(struct rtc_device *rtc,
197 struct rtc_task *task); 194 struct rtc_task *task);
198extern int rtc_irq_set_state(struct class_device *class_dev, 195extern int rtc_irq_set_state(struct rtc_device *rtc,
199 struct rtc_task *task, int enabled); 196 struct rtc_task *task, int enabled);
200extern int rtc_irq_set_freq(struct class_device *class_dev, 197extern int rtc_irq_set_freq(struct rtc_device *rtc,
201 struct rtc_task *task, int freq); 198 struct rtc_task *task, int freq);
202 199
203typedef struct rtc_task { 200typedef struct rtc_task {