]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux/openslug-kernel-2.6.11/x1205-rtc.c
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux / openslug-kernel-2.6.11 / x1205-rtc.c
1 /*
2     x1205 - an 12c driver for the Xicor X1205 RTC
3     Copyright 2004 Karen Spearel
4
5     please send all reports to:
6         kas11 at tampabay dot rr dot com
7       
8     based on linux/drivers/acron/char/pcf8583.h
9     Copyright (C) 2000 Russell King
10     
11     This program is free software; you can redistribute it and/or modify
12     it under the terms of the GNU General Public License as published by
13     the Free Software Foundation; either version 2 of the License, or
14     (at your option) any later version.
15
16     This program is distributed in the hope that it will be useful,
17     but WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19     GNU General Public License for more details.
20
21     You should have received a copy of the GNU General Public License
22     along with this program; if not, write to the Free Software
23     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25 /*
26
27  * i2c_adapter is the structure used to identify a physical i2c bus along
28  * with the access algorithms necessary to access it.
29
30 struct i2c_adapter {
31         struct module *owner;
32         unsigned int id;  == is algo->id | hwdep.struct->id, for registered values see below
33         unsigned int class;
34         struct i2c_algorithm *algo; the algorithm to access the bus
35         void *algo_data;
36
37         --- administration stuff.
38         int (*client_register)(struct i2c_client *);
39         int (*client_unregister)(struct i2c_client *);
40
41          data fields that are valid for all devices
42         struct semaphore bus_lock;
43         struct semaphore clist_lock;
44
45         int timeout;
46         int retries;
47         struct device dev;              the adapter device 
48         struct class_device class_dev;  the class device
49
50 #ifdef CONFIG_PROC_FS 
51         No need to set this when you initialize the adapter
52         int inode;
53 #endif def CONFIG_PROC_FS
54
55         int nr;
56         struct list_head clients;
57         struct list_head list;
58         char name[I2C_NAME_SIZE];
59         struct completion dev_released;
60         struct completion class_dev_released;
61 };
62 */
63
64
65 /*========== Driver for the X1205 on the Linksys NSLU2 ==================*/
66
67 #include <linux/init.h>
68 #include <linux/i2c.h>
69 #include <linux/slab.h>
70 #include <linux/string.h>
71 #include <linux/errno.h>
72 #include <linux/bcd.h>
73 #include <linux/rtc.h>
74 #include <linux/fs.h>
75 #include <linux/proc_fs.h>
76 #include <linux/miscdevice.h>
77 #include <linux/device.h>
78 #include <asm/uaccess.h>
79 #include <asm/system.h>
80 #include <linux/moduleparam.h>
81
82 #define         RTC_GETDATETIME         0
83 #define         RTC_SETTIME             1
84 #define         RTC_SETDATETIME         2
85
86 #define         I2C_M_WR                0       // just for consistancy
87
88 //  offsets into read buf - add 2 for write buf
89 #define         CCR_SEC                 0
90 #define         CCR_MIN                 1
91 #define         CCR_HOUR                2
92 #define         CCR_MDAY                3
93 #define         CCR_MONTH               4
94 #define         CCR_YEAR                5
95 #define         CCR_WDAY                6
96 #define         CCR_Y2K                 7
97
98 #define         X1205_I2C_BUS_ADDR      0x6f    // hardwired into x1205
99 #define         X1205_ALM0_BASE         0x00    // Base address of the ALM0
100 #define         X1205_CCR_BASE          0x30    // Base address of the CCR
101 #define         X1205_SR_ADDR           0x3f    // Status Register
102 #define         X1205_SR_WEL            0x02    // Write Enable Latch bit
103 #define         X1205_SR_RWEL           0x04    // Register Write Enable Bit
104 #define         X1205_MILBIT            0x80    // this bit set in ccr.hour for 24 hr mode
105 #define         NOERR                   0
106 #define         RTC_NODATE              0
107 #define         RTC_DATETOO             1
108
109 // comment out next line is your x1205 can't do page writes
110 //#define       X1205PAGEWRITE          1
111 #ifdef X1205PAGEWRITE
112 #define         DRIVERNAME              "Xicor x1205 RTC Driver v0.9.3.3"
113 #else
114 #define         DRIVERNAME              "Xicor x1205 RTC Dvr v0.9.3.3NPW"
115 #endif
116
117 #define         DEBUG                   KERN_DEBUG
118
119
120 static int x1205_get_datetime(struct i2c_client *client, struct rtc_time *tm, u8 reg_base);
121 static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm, int datetoo, u8 reg_base);
122 static int x1205_attach(struct i2c_adapter *adapter);
123 static int x1205_detach(struct i2c_client *client);
124 static int x1205_validate_tm(struct rtc_time *tm);
125 static int x1205_command(struct i2c_client *client, unsigned int cmd, void *arg);
126 static int x1205_sync_rtc(void);
127 static int x1205_read(struct file *file, char *buf, size_t count, loff_t *ptr);
128 static int x1205_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
129 static int x1205_read_proc(char *buf, char **start, off_t off, int len, int *eof, void *data);
130
131 static struct i2c_driver x1205_driver = {
132         .owner          = THIS_MODULE,
133         .name           = DRIVERNAME,
134         .id             = I2C_DRIVERID_X1205,
135         .flags          = I2C_DF_NOTIFY,
136         .attach_adapter = &x1205_attach,                //we don't need to probe...x1205 is hardwired @ 0x6f
137         .detach_client  = &x1205_detach,
138         .command        = &x1205_command,               //this prolly never gets called...used internally tho
139 };
140
141 static struct i2c_client x1205_i2c_client = {
142         .id             =       I2C_DRIVERID_X1205,
143         .flags          =       0,
144         .addr           =       X1205_I2C_BUS_ADDR,     // chip address - NOTE: 7bit
145         .adapter        =       NULL,                   // the adapter we sit on assigned in attach
146         .driver         =       &x1205_driver,          // and our access routines
147         .usage_count    =       0,                      // How many accesses currently to this client
148         .dev            =       {},                     // the device structure
149         .list           =       {},
150         .name           =       DRIVERNAME,
151         .released       =       {},
152 };
153
154 static struct file_operations rtc_fops = {
155         owner:          THIS_MODULE,
156         ioctl:          x1205_ioctl,
157         read:           x1205_read,
158 };
159
160 static struct miscdevice x1205_miscdev = {
161         .minor          = RTC_MINOR,
162         .name           = "rtc",
163         .fops           = &rtc_fops,
164 };
165 extern int (*set_rtc)(void);
166 static unsigned epoch = 1900;           //coresponds to year 0
167 static unsigned  rtc_epoch = 2000;
168 static const unsigned char days_in_mo[] = 
169 {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
170
171 //===================================CODE======================================
172 // in the routines that deal directly with the x1205 hardware, we use
173 // rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch
174 // Epoch is inited as 2000. Time is set to UT
175 //=============================================================================   
176 static int x1205_get_datetime(struct i2c_client *client, struct rtc_time *tm, u8 reg_base)
177 {
178         static unsigned char addr[2] = { 0,} ;
179         unsigned char buf[8];   
180         struct i2c_msg msgs[2] = {
181                 { client->addr, I2C_M_WR, 2, addr },    //msg 1 = send base address
182                 { client->addr, I2C_M_RD, 8, buf },     //msg 2 = read sequential data
183         };
184         addr[1] = reg_base;
185         if ((i2c_transfer(client->adapter, msgs, 2)) == 2) {    //did we read 2 messages?
186                 printk(KERN_DEBUG "raw x1205 read data  - sec-%02x min-%02x hr-%02x mday-%02x mon-%02x year-%02x wday-%02x y2k-%02x\n", 
187                         buf[0],buf[1],buf[2],buf[3],buf[4],buf[5],buf[6], buf[7]);
188                 tm->tm_sec  = BCD2BIN(buf[CCR_SEC]);
189                 tm->tm_min  = BCD2BIN(buf[CCR_MIN]);
190                 buf[CCR_HOUR] &= ~X1205_MILBIT;
191                 tm->tm_hour = BCD2BIN(buf[CCR_HOUR]);           //hr is 0-23
192                 tm->tm_mday = BCD2BIN(buf[CCR_MDAY]);
193                 tm->tm_mon  = BCD2BIN(buf[CCR_MONTH]);
194                 rtc_epoch   = BCD2BIN(buf[CCR_Y2K]) * 100;
195                 tm->tm_year = BCD2BIN(buf[CCR_YEAR]) + rtc_epoch - epoch;
196                 tm->tm_wday = buf[CCR_WDAY];
197                 printk(KERN_DEBUG "rtc_time output data - sec-%02d min-%02d hr-%02d mday-%02d mon-%02d year-%02d wday-%02d epoch-%d rtc_epoch-%d\n",
198                         tm->tm_sec,tm->tm_min,tm->tm_hour,tm->tm_mday,tm->tm_mon,tm->tm_year,tm->tm_wday,epoch, rtc_epoch);
199         } else {
200                 printk(KERN_DEBUG "i2c_transfer Read Error\n");
201                 return -EIO;
202         }               
203         
204         return NOERR;
205 }
206 // x1205pagewrite allows writing a block of registers in msg3 even though the x1205 says
207 // nothing about this in its spec. 
208 // it needs more testing as it is possible some x1205s are actually not-completely-
209 // functional x1226s and there is a reason for the multiple write to not be in the spec.
210 // anyhow, it is enabled for the time being...and we even push out luck by sending 10 bytes
211
212 static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm, int datetoo, u8 reg_base)
213 {
214         static unsigned char wel[3]   = { 0, X1205_SR_ADDR, X1205_SR_WEL };
215         static unsigned char rwel[3]  = { 0, X1205_SR_ADDR, X1205_SR_WEL | X1205_SR_RWEL };
216         static unsigned char diswe[3] = { 0, X1205_SR_ADDR, 0 };
217
218 #ifdef X1205PAGEWRITE
219
220         static unsigned char buf[10]   = { 0, X1205_CCR_BASE, };                
221         struct i2c_msg msgs[4] = {
222                 { client->addr, I2C_M_WR, 3, wel   },   //msg 1 = write WEL to to ccr sr
223                 { client->addr, I2C_M_WR, 3, rwel  },   //msg 2 = write RWEL to ccr sr
224                 { client->addr, I2C_M_WR, 10, buf   },  //msg 3 = write ccr base addr +seq data
225                 { client->addr, I2C_M_WR, 3, diswe },   //msg 4 = 0 to ccr sr to disable writes
226         };
227
228         msgs[2].len = 5;                                        // 5 bytes + addr to set time only
229         buf [1] = reg_base;
230         buf[CCR_SEC+2]  = BIN2BCD(tm->tm_sec);
231         buf[CCR_MIN+2]  = BIN2BCD(tm->tm_min);
232         buf[CCR_HOUR+2] = BIN2BCD(tm->tm_hour) | X1205_MILBIT; // set 24 hour format
233         if (datetoo == 1) {
234                 buf[CCR_MDAY+2]  = BIN2BCD(tm->tm_mday);
235                 buf[CCR_MONTH+2] = BIN2BCD(tm->tm_mon);         // input is 0-11        
236                 buf[CCR_YEAR+2]  = BIN2BCD((tm->tm_year + epoch - rtc_epoch));  // input is yrs since 1900
237                 buf[CCR_WDAY+2]  = tm->tm_wday & 7;
238                 buf[CCR_Y2K+2]   = BIN2BCD((rtc_epoch/100));
239                 msgs[2].len += 5;                               //5 more bytes to set date
240         }
241         printk(KERN_DEBUG "rtc_time input - sec-%02d min-%02d hour-%02d mday-%02d mon-%02d year-%02d wday-%02d epoch-%d rtc_epoch-%d\n",
242                 tm->tm_sec,tm->tm_min,tm->tm_hour,tm->tm_mday,tm->tm_mon,tm->tm_year,tm->tm_wday, epoch, rtc_epoch);
243         printk(KERN_DEBUG "BCD write data - sec-%02x min-%02x hour-%02x mday-%02x mon-%02x year-%02x wday-%02x y2k-%02x\n",
244                 buf[2],buf[3],buf[4],buf[5],buf[6], buf[7], buf[8], buf[9]);
245
246         if ((i2c_transfer(client->adapter, msgs, 4)) != 4)
247                 return -EIO;
248         return NOERR;
249         
250 #else           //do this if page writes aren't working
251
252         int i,xfer;
253         static unsigned char data[3]  = { 0,};
254         static unsigned char buf[8];
255
256         buf[CCR_SEC]  = BIN2BCD(tm->tm_sec);
257         buf[CCR_MIN]  = BIN2BCD(tm->tm_min);
258         buf[CCR_HOUR] = BIN2BCD(tm->tm_hour) | X1205_MILBIT; // set 24 hour format
259         if (datetoo == 1) {
260                 buf[CCR_MDAY]  = BIN2BCD(tm->tm_mday);
261                 buf[CCR_MONTH] = BIN2BCD(tm->tm_mon);           // input is 0-11        
262                 buf[CCR_YEAR]  = BIN2BCD((tm->tm_year + epoch - rtc_epoch));    // input is yrs since 1900
263                 buf[CCR_WDAY]  = tm->tm_wday & 7;
264                 buf[CCR_Y2K]   = BIN2BCD((rtc_epoch/100));
265         }
266         printk(KERN_DEBUG "rtc_time input - sec-%02d min-%02d hour-%02d mday-%02d mon-%02d year-%02d wday-%02d epoch-%d rtc_epoch-%d\n",
267                 tm->tm_sec,tm->tm_min,tm->tm_hour,tm->tm_mday,tm->tm_mon,tm->tm_year,tm->tm_wday, epoch, rtc_epoch);
268
269         xfer = i2c_master_send(client, wel, 3);
270         printk(KERN_DEBUG "wen - %x\n", xfer);
271         if (xfer != 3)
272                 return -EIO;
273
274         xfer = i2c_master_send(client, rwel, 3);
275         printk(KERN_DEBUG "wenb - %x\n", xfer);
276         if (xfer != 3)
277                 return -EIO;
278
279         for (i = 0; i < 8; i++) {
280                 data[1] = i + reg_base;
281                 data[2] =  buf[i];
282                 xfer = i2c_master_send(client, data, 3);
283                 printk(KERN_DEBUG "xfer - %d addr - %02x  data - %02x\n", xfer, data[1], data[2]);
284                 if (xfer != 3)
285                         return -EIO;
286         };
287
288         xfer = i2c_master_send(client, diswe, 3);
289         printk(KERN_DEBUG "wdis - %x\n", xfer);
290         if (xfer != 3)
291                 return -EIO;            
292         return NOERR;
293 #endif
294 }
295 //=============================================================================
296
297 static int x1205_attach(struct i2c_adapter *adapter)
298 {
299         struct rtc_time tm;
300         struct timespec tv;
301         int errno;
302                 
303         x1205_i2c_client.adapter = adapter;
304         x1205_i2c_client.id++;
305
306         if ((x1205_get_datetime(&x1205_i2c_client, &tm, X1205_CCR_BASE)) != NOERR)      //test for functional driver 
307                 return -EIO;
308         
309         if ((errno = i2c_attach_client(&x1205_i2c_client)) != NOERR)
310                 return errno;
311
312         tv.tv_nsec = tm.tm_sec * 10000000;
313         tv.tv_sec  = mktime(tm.tm_year+epoch, tm.tm_mon, tm.tm_mday, tm.tm_hour,
314                                                 tm.tm_min, tm.tm_sec);
315         do_settimeofday(&tv);
316         set_rtc = x1205_sync_rtc;
317         
318         printk(KERN_DEBUG "%s attached on adapter %s\n",x1205_i2c_client.name,
319                 x1205_i2c_client.adapter->name); //why is this name a null string?
320
321         return NOERR;
322 }
323
324 static int x1205_detach(struct i2c_client *client)
325 {
326         int errno;
327         
328         if ((errno = i2c_detach_client(client)) != 0) {
329                 printk(KERN_DEBUG "i2c_detach failed - errno = %d\n", errno);
330                 return errno;
331         }
332
333         return NOERR;
334 }
335
336 // make sure the rtc_time values are in bounds
337 static int x1205_validate_tm(struct rtc_time *tm)
338 {
339         tm->tm_year += 1900;
340
341         if (tm->tm_year < 1970)
342                 return -EINVAL;
343
344         if ((tm->tm_mon > 11) || (tm->tm_mday == 0))
345                 return -EINVAL;
346
347         if (tm->tm_mday > (days_in_mo[tm->tm_mon] + ( (tm->tm_mon == 1) && 
348                 ((!(tm->tm_year % 4) && (tm->tm_year % 100) ) || !(tm->tm_year % 400)))))
349                 return -EINVAL;
350
351         if ((tm->tm_year -= epoch) > 255)
352                 return -EINVAL;
353                         
354         if ((tm->tm_hour >= 24) || (tm->tm_min >= 60) || (tm->tm_sec >= 60))
355                 return -EINVAL;
356         return NOERR;
357 }
358
359 static int x1205_command(struct i2c_client *client, unsigned int cmd, void *tm)
360 {
361         int errno, dodate = RTC_DATETOO;
362
363         if (client == NULL || tm == NULL)
364                 return -EINVAL;
365         if (!capable(CAP_SYS_TIME))
366                 return -EACCES;
367
368         printk(KERN_DEBUG "x1205_command %d\n", cmd);
369
370         switch (cmd) {
371         case RTC_GETDATETIME:
372                 return x1205_get_datetime(client, tm, X1205_CCR_BASE);
373
374         case RTC_SETTIME:               // note fall thru
375                 dodate = RTC_NODATE;
376         case RTC_SETDATETIME:
377                 if ((errno = x1205_validate_tm(tm)) < NOERR)
378                         return errno;
379                 return x1205_set_datetime(client, tm, dodate, X1205_CCR_BASE);
380
381         default:
382                 return -EINVAL;
383         }
384 }
385
386 static int x1205_sync_rtc(void)
387 {
388         struct rtc_time new_tm, old_tm;
389         unsigned long cur_secs = xtime.tv_sec;
390
391         printk(KERN_DEBUG "x1205_sync_rtc entry\n");
392
393         if (x1205_command(&x1205_i2c_client, RTC_GETDATETIME, &old_tm))
394                 return 0;
395
396 //      xtime.tv_nsec = old_tm.tm_sec * 10000000;   //FIXME:
397         new_tm.tm_sec  = cur_secs % 60;
398         cur_secs /= 60;
399         new_tm.tm_min  = cur_secs % 60;
400         cur_secs /= 60;
401         new_tm.tm_hour = cur_secs % 24;
402
403         /*
404          * avoid writing when we're going to change the day
405          * of the month.  We will retry in the next minute.
406          * This basically means that if the RTC must not drift
407          * by more than 1 minute in 11 minutes.
408          */
409         if ((old_tm.tm_hour == 23 && old_tm.tm_min == 59) ||
410             (new_tm.tm_hour == 23 && new_tm.tm_min == 59))
411                 return 1;
412         printk(KERN_DEBUG "x1205_sync_rtc exit\n");
413
414         return x1205_command(&x1205_i2c_client, RTC_SETTIME, &new_tm);
415 }
416
417 static int x1205_read(struct file *file, char *buf, size_t count, loff_t *ptr)
418 {
419         struct rtc_time tm;
420
421         if ((x1205_get_datetime(&x1205_i2c_client, &tm, X1205_CCR_BASE)) < NOERR)
422                 return -EIO;
423         return copy_to_user(buf, &tm, sizeof(tm)) ? -EFAULT : NOERR;
424 }
425
426 //==============================================================================
427
428 static int x1205_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
429                      unsigned long arg)
430 {
431         struct rtc_time tm;
432         int errno;
433
434         printk(KERN_DEBUG "ioctl = %x\n", cmd);
435         
436         switch (cmd) {
437         case RTC_RD_TIME:
438                 if ((x1205_get_datetime(&x1205_i2c_client, &tm, X1205_CCR_BASE)) < NOERR)
439                         return -EIO;
440                 break;
441                 
442         case RTC_SET_TIME:
443                 if (!capable(CAP_SYS_TIME))
444                         return -EACCES;
445
446                 if (copy_from_user(&tm, (struct rtc_time *) arg, sizeof(struct rtc_time))) 
447                         return -EFAULT;
448                 if ((errno = x1205_validate_tm(&tm)) < NOERR)
449                         return errno;
450                 return x1205_set_datetime(&x1205_i2c_client, &tm, RTC_DATETOO, X1205_CCR_BASE);
451
452         case RTC_ALM_SET:                                               //FIXME: set Control Regs
453                 if (copy_from_user(&tm, (struct rtc_time *) arg, sizeof(struct rtc_time))) 
454                         return -EFAULT;
455                 return x1205_set_datetime(&x1205_i2c_client, &tm, RTC_DATETOO, X1205_ALM0_BASE);
456
457         case RTC_ALM_READ:
458                 if ((x1205_get_datetime(&x1205_i2c_client, &tm, X1205_ALM0_BASE)) < NOERR)
459                         return -EIO;
460                 break;
461
462         case RTC_EPOCH_READ:
463
464                 return put_user (epoch, (unsigned long __user *)arg);
465
466         case RTC_EPOCH_SET:
467                 if (arg < 1900)
468                         return -EINVAL;
469
470                 if (!capable(CAP_SYS_TIME))
471                         return -EACCES;
472
473                 epoch = arg;
474                 return 0;
475
476         default:
477                 return -ENOTTY;
478         }
479         return copy_to_user((void __user *)arg, &tm, sizeof tm) ? -EFAULT : 0;
480
481 }
482
483 static int x1205_read_proc(char *buf, char **start, off_t off, int len, int *eof, void *data)
484 {
485         struct rtc_time tm;
486         int slen, errno;
487
488         if ((errno = x1205_get_datetime(&x1205_i2c_client, &tm, X1205_CCR_BASE)) < NOERR)
489                 return errno;
490
491 //      here we return the real year and the month as 1-12 since it is human-readable
492         slen = sprintf(buf, "rtc_time\t: %02d:%02d:%02d\nrtc_date\t: %04d-%02d-%02d\n",
493                 tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_year + 1900, tm.tm_mon+1, tm.tm_mday);
494         printk(KERN_DEBUG "raw rtc_time\t: %02d:%02d:%02d\nraw rtc_date\t: %04d-%02d-%02d\n",
495                 tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_year, tm.tm_mon, tm.tm_mday);
496
497         if (slen <= off + len)
498                 *eof = 1;
499         *start = buf + off;
500         slen -= off;
501         if (slen > len)
502                 slen = len;
503         if ( slen < 0 )
504                 slen = 0;
505
506         return slen;
507 }
508
509 static int __init x1205_init(void)
510 {
511         struct  rtc_time tm;
512         int errno;
513         printk(KERN_INFO "LOADED %s\n", DRIVERNAME);
514
515         if ((errno = i2c_add_driver(&x1205_driver)) != NOERR) {
516                 dev_dbg(x1205_i2c_client.dev, "x1205_init failed - errno = %d\n", errno);
517                 return (errno);
518         }
519         if ((errno = misc_register(&x1205_miscdev)) != NOERR) {
520                 dev_dbg(x1205_i2c_client.dev, "Register Misc Driver failed - errno = %d\n", errno);
521                 i2c_del_driver(&x1205_driver);
522                 return errno; 
523         }
524         if (create_proc_read_entry("driver/rtc", 0, NULL, x1205_read_proc, NULL) < NOERR)
525                 return -ENOMEM;
526         if ((x1205_get_datetime(&x1205_i2c_client, &tm, X1205_CCR_BASE)) != NOERR)      //test for functionality
527                 return -EIO;
528
529         return NOERR;   
530 }
531
532 static void __exit x1205_exit(void)
533 {
534         remove_proc_entry("driver/rtc", NULL);
535         misc_deregister(&x1205_miscdev);
536         i2c_del_driver(&x1205_driver);
537         set_rtc = NULL;
538 }
539
540 MODULE_AUTHOR("Karen Spearel <kas11@tampabay.rr.com>");
541 MODULE_DESCRIPTION("Xicor X1205-RTC Driver");
542 MODULE_LICENSE("GPL");
543 static int debug = 7;
544 module_param(debug, bool, 0644);
545 MODULE_PARM_DESC(debug, "Debugging enabled = 1");
546
547 module_init(x1205_init);
548 module_exit(x1205_exit);