Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] RTC subsystem: VR41XX driver

This patch updates VR4100 series RTC driver.

* This driver supports new RTC subsystem.
* Simple set time/read time test worked fine.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Yoichi Yuasa and committed by
Linus Torvalds
8417eb7a 2260a25c

+109 -355
-4
drivers/char/Kconfig
··· 805 805 Samsung S3C2410. This can provide periodic interrupt rates 806 806 from 1Hz to 64Hz for user programs, and wakeup from Alarm. 807 807 808 - config RTC_VR41XX 809 - tristate "NEC VR4100 series Real Time Clock Support" 810 - depends on CPU_VR41XX 811 - 812 808 config COBALT_LCD 813 809 bool "Support for Cobalt LCD" 814 810 depends on MIPS_COBALT
-1
drivers/char/Makefile
··· 67 67 obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o 68 68 obj-$(CONFIG_DS1302) += ds1302.o 69 69 obj-$(CONFIG_S3C2410_RTC) += s3c2410-rtc.o 70 - obj-$(CONFIG_RTC_VR41XX) += vr41xx_rtc.o 71 70 ifeq ($(CONFIG_GENERIC_NVRAM),y) 72 71 obj-$(CONFIG_NVRAM) += generic_nvram.o 73 72 else
+104 -350
drivers/char/vr41xx_rtc.c drivers/rtc/rtc-vr41xx.c
··· 1 1 /* 2 - * Driver for NEC VR4100 series Real Time Clock unit. 2 + * Driver for NEC VR4100 series Real Time Clock unit. 3 3 * 4 - * Copyright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 + * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by ··· 17 17 * along with this program; if not, write to the Free Software 18 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 - #include <linux/platform_device.h> 21 20 #include <linux/fs.h> 22 21 #include <linux/init.h> 23 22 #include <linux/ioport.h> 24 23 #include <linux/irq.h> 25 - #include <linux/mc146818rtc.h> 26 - #include <linux/miscdevice.h> 27 24 #include <linux/module.h> 28 - #include <linux/poll.h> 25 + #include <linux/platform_device.h> 29 26 #include <linux/rtc.h> 30 27 #include <linux/spinlock.h> 31 28 #include <linux/types.h> 32 - #include <linux/wait.h> 33 29 34 30 #include <asm/div64.h> 35 31 #include <asm/io.h> 36 - #include <asm/time.h> 37 32 #include <asm/uaccess.h> 38 33 #include <asm/vr41xx/vr41xx.h> 39 34 ··· 94 99 95 100 static unsigned long epoch = 1970; /* Jan 1 1970 00:00:00 */ 96 101 97 - static spinlock_t rtc_task_lock; 98 - static wait_queue_head_t rtc_wait; 99 - static unsigned long rtc_irq_data; 100 - static struct fasync_struct *rtc_async_queue; 101 - static rtc_task_t *rtc_callback; 102 + static spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; 102 103 static char rtc_name[] = "RTC"; 103 104 static unsigned long periodic_frequency; 104 105 static unsigned long periodic_count; 105 - 106 - typedef enum { 107 - RTC_RELEASE, 108 - RTC_OPEN, 109 - } rtc_status_t; 110 - 111 - static rtc_status_t rtc_status; 112 - 113 - typedef enum { 114 - FUNCTION_RTC_IOCTL, 115 - FUNCTION_RTC_CONTROL, 116 - } rtc_callfrom_t; 117 106 118 107 struct resource rtc_resource[2] = { 119 108 { .name = rtc_name, ··· 108 129 109 130 static inline unsigned long read_elapsed_second(void) 110 131 { 132 + 111 133 unsigned long first_low, first_mid, first_high; 134 + 112 135 unsigned long second_low, second_mid, second_high; 113 136 114 137 do { ··· 137 156 spin_unlock_irq(&rtc_lock); 138 157 } 139 158 140 - static void set_alarm(struct rtc_time *time) 159 + static void vr41xx_rtc_release(struct device *dev) 160 + { 161 + 162 + spin_lock_irq(&rtc_lock); 163 + 164 + rtc1_write(ECMPLREG, 0); 165 + rtc1_write(ECMPMREG, 0); 166 + rtc1_write(ECMPHREG, 0); 167 + rtc1_write(RTCL1LREG, 0); 168 + rtc1_write(RTCL1HREG, 0); 169 + 170 + spin_unlock_irq(&rtc_lock); 171 + 172 + disable_irq(ELAPSEDTIME_IRQ); 173 + disable_irq(RTCLONG1_IRQ); 174 + } 175 + 176 + static int vr41xx_rtc_read_time(struct device *dev, struct rtc_time *time) 177 + { 178 + unsigned long epoch_sec, elapsed_sec; 179 + 180 + epoch_sec = mktime(epoch, 1, 1, 0, 0, 0); 181 + elapsed_sec = read_elapsed_second(); 182 + 183 + rtc_time_to_tm(epoch_sec + elapsed_sec, time); 184 + 185 + return 0; 186 + } 187 + 188 + static int vr41xx_rtc_set_time(struct device *dev, struct rtc_time *time) 189 + { 190 + unsigned long epoch_sec, current_sec; 191 + 192 + epoch_sec = mktime(epoch, 1, 1, 0, 0, 0); 193 + current_sec = mktime(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday, 194 + time->tm_hour, time->tm_min, time->tm_sec); 195 + 196 + write_elapsed_second(current_sec - epoch_sec); 197 + 198 + return 0; 199 + } 200 + 201 + static int vr41xx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) 202 + { 203 + unsigned long low, mid, high; 204 + struct rtc_time *time = &wkalrm->time; 205 + 206 + spin_lock_irq(&rtc_lock); 207 + 208 + low = rtc1_read(ECMPLREG); 209 + mid = rtc1_read(ECMPMREG); 210 + high = rtc1_read(ECMPHREG); 211 + 212 + spin_unlock_irq(&rtc_lock); 213 + 214 + rtc_time_to_tm((high << 17) | (mid << 1) | (low >> 15), time); 215 + 216 + return 0; 217 + } 218 + 219 + static int vr41xx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) 141 220 { 142 221 unsigned long alarm_sec; 222 + struct rtc_time *time = &wkalrm->time; 143 223 144 224 alarm_sec = mktime(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday, 145 225 time->tm_hour, time->tm_min, time->tm_sec); ··· 212 170 rtc1_write(ECMPHREG, (uint16_t)(alarm_sec >> 17)); 213 171 214 172 spin_unlock_irq(&rtc_lock); 215 - } 216 - 217 - static void read_alarm(struct rtc_time *time) 218 - { 219 - unsigned long low, mid, high; 220 - 221 - spin_lock_irq(&rtc_lock); 222 - 223 - low = rtc1_read(ECMPLREG); 224 - mid = rtc1_read(ECMPMREG); 225 - high = rtc1_read(ECMPHREG); 226 - 227 - spin_unlock_irq(&rtc_lock); 228 - 229 - to_tm((high << 17) | (mid << 1) | (low >> 15), time); 230 - time->tm_year -= 1900; 231 - } 232 - 233 - static void read_time(struct rtc_time *time) 234 - { 235 - unsigned long epoch_sec, elapsed_sec; 236 - 237 - epoch_sec = mktime(epoch, 1, 1, 0, 0, 0); 238 - elapsed_sec = read_elapsed_second(); 239 - 240 - to_tm(epoch_sec + elapsed_sec, time); 241 - time->tm_year -= 1900; 242 - } 243 - 244 - static void set_time(struct rtc_time *time) 245 - { 246 - unsigned long epoch_sec, current_sec; 247 - 248 - epoch_sec = mktime(epoch, 1, 1, 0, 0, 0); 249 - current_sec = mktime(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday, 250 - time->tm_hour, time->tm_min, time->tm_sec); 251 - 252 - write_elapsed_second(current_sec - epoch_sec); 253 - } 254 - 255 - static ssize_t rtc_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 256 - { 257 - DECLARE_WAITQUEUE(wait, current); 258 - unsigned long irq_data; 259 - int retval = 0; 260 - 261 - if (count != sizeof(unsigned int) && count != sizeof(unsigned long)) 262 - return -EINVAL; 263 - 264 - add_wait_queue(&rtc_wait, &wait); 265 - 266 - do { 267 - __set_current_state(TASK_INTERRUPTIBLE); 268 - 269 - spin_lock_irq(&rtc_lock); 270 - irq_data = rtc_irq_data; 271 - rtc_irq_data = 0; 272 - spin_unlock_irq(&rtc_lock); 273 - 274 - if (irq_data != 0) 275 - break; 276 - 277 - if (file->f_flags & O_NONBLOCK) { 278 - retval = -EAGAIN; 279 - break; 280 - } 281 - 282 - if (signal_pending(current)) { 283 - retval = -ERESTARTSYS; 284 - break; 285 - } 286 - } while (1); 287 - 288 - if (retval == 0) { 289 - if (count == sizeof(unsigned int)) { 290 - retval = put_user(irq_data, (unsigned int __user *)buf); 291 - if (retval == 0) 292 - retval = sizeof(unsigned int); 293 - } else { 294 - retval = put_user(irq_data, (unsigned long __user *)buf); 295 - if (retval == 0) 296 - retval = sizeof(unsigned long); 297 - } 298 - 299 - } 300 - 301 - __set_current_state(TASK_RUNNING); 302 - remove_wait_queue(&rtc_wait, &wait); 303 - 304 - return retval; 305 - } 306 - 307 - static unsigned int rtc_poll(struct file *file, struct poll_table_struct *table) 308 - { 309 - poll_wait(file, &rtc_wait, table); 310 - 311 - if (rtc_irq_data != 0) 312 - return POLLIN | POLLRDNORM; 313 173 314 174 return 0; 315 175 } 316 176 317 - static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, rtc_callfrom_t from) 177 + static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) 318 178 { 319 - struct rtc_time time; 320 179 unsigned long count; 321 180 322 181 switch (cmd) { ··· 233 290 case RTC_PIE_OFF: 234 291 disable_irq(RTCLONG1_IRQ); 235 292 break; 236 - case RTC_ALM_SET: 237 - if (copy_from_user(&time, (struct rtc_time __user *)arg, 238 - sizeof(struct rtc_time))) 239 - return -EFAULT; 240 - 241 - set_alarm(&time); 242 - break; 243 - case RTC_ALM_READ: 244 - memset(&time, 0, sizeof(struct rtc_time)); 245 - read_alarm(&time); 246 - break; 247 - case RTC_RD_TIME: 248 - memset(&time, 0, sizeof(struct rtc_time)); 249 - read_time(&time); 250 - if (copy_to_user((void __user *)arg, &time, sizeof(struct rtc_time))) 251 - return -EFAULT; 252 - break; 253 - case RTC_SET_TIME: 254 - if (capable(CAP_SYS_TIME) == 0) 255 - return -EACCES; 256 - 257 - if (copy_from_user(&time, (struct rtc_time __user *)arg, 258 - sizeof(struct rtc_time))) 259 - return -EFAULT; 260 - 261 - set_time(&time); 262 - break; 263 293 case RTC_IRQP_READ: 264 294 return put_user(periodic_frequency, (unsigned long __user *)arg); 265 295 break; ··· 240 324 if (arg > MAX_PERIODIC_RATE) 241 325 return -EINVAL; 242 326 243 - if (from == FUNCTION_RTC_IOCTL && arg > MAX_USER_PERIODIC_RATE && 244 - capable(CAP_SYS_RESOURCE) == 0) 327 + if (arg > MAX_USER_PERIODIC_RATE && capable(CAP_SYS_RESOURCE) == 0) 245 328 return -EACCES; 246 329 247 330 periodic_frequency = arg; ··· 276 361 return 0; 277 362 } 278 363 279 - static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 280 - unsigned long arg) 281 - { 282 - return rtc_do_ioctl(cmd, arg, FUNCTION_RTC_IOCTL); 283 - } 284 - 285 - static int rtc_open(struct inode *inode, struct file *file) 286 - { 287 - spin_lock_irq(&rtc_lock); 288 - 289 - if (rtc_status == RTC_OPEN) { 290 - spin_unlock_irq(&rtc_lock); 291 - return -EBUSY; 292 - } 293 - 294 - rtc_status = RTC_OPEN; 295 - rtc_irq_data = 0; 296 - 297 - spin_unlock_irq(&rtc_lock); 298 - 299 - return 0; 300 - } 301 - 302 - static int rtc_release(struct inode *inode, struct file *file) 303 - { 304 - if (file->f_flags & FASYNC) 305 - (void)fasync_helper(-1, file, 0, &rtc_async_queue); 306 - 307 - spin_lock_irq(&rtc_lock); 308 - 309 - rtc1_write(ECMPLREG, 0); 310 - rtc1_write(ECMPMREG, 0); 311 - rtc1_write(ECMPHREG, 0); 312 - rtc1_write(RTCL1LREG, 0); 313 - rtc1_write(RTCL1HREG, 0); 314 - 315 - rtc_status = RTC_RELEASE; 316 - 317 - spin_unlock_irq(&rtc_lock); 318 - 319 - disable_irq(ELAPSEDTIME_IRQ); 320 - disable_irq(RTCLONG1_IRQ); 321 - 322 - return 0; 323 - } 324 - 325 - static int rtc_fasync(int fd, struct file *file, int on) 326 - { 327 - return fasync_helper(fd, file, on, &rtc_async_queue); 328 - } 329 - 330 - static struct file_operations rtc_fops = { 331 - .owner = THIS_MODULE, 332 - .llseek = no_llseek, 333 - .read = rtc_read, 334 - .poll = rtc_poll, 335 - .ioctl = rtc_ioctl, 336 - .open = rtc_open, 337 - .release = rtc_release, 338 - .fasync = rtc_fasync, 339 - }; 340 - 341 364 static irqreturn_t elapsedtime_interrupt(int irq, void *dev_id, struct pt_regs *regs) 342 365 { 343 - spin_lock(&rtc_lock); 366 + struct platform_device *pdev = (struct platform_device *)dev_id; 367 + struct rtc_device *rtc = platform_get_drvdata(pdev); 368 + 344 369 rtc2_write(RTCINTREG, ELAPSEDTIME_INT); 345 370 346 - rtc_irq_data += 0x100; 347 - rtc_irq_data &= ~0xff; 348 - rtc_irq_data |= RTC_AF; 349 - spin_unlock(&rtc_lock); 350 - 351 - spin_lock(&rtc_lock); 352 - if (rtc_callback) 353 - rtc_callback->func(rtc_callback->private_data); 354 - spin_unlock(&rtc_lock); 355 - 356 - wake_up_interruptible(&rtc_wait); 357 - 358 - kill_fasync(&rtc_async_queue, SIGIO, POLL_IN); 371 + rtc_update_irq(&rtc->class_dev, 1, RTC_AF); 359 372 360 373 return IRQ_HANDLED; 361 374 } 362 375 363 376 static irqreturn_t rtclong1_interrupt(int irq, void *dev_id, struct pt_regs *regs) 364 377 { 378 + struct platform_device *pdev = (struct platform_device *)dev_id; 379 + struct rtc_device *rtc = platform_get_drvdata(pdev); 365 380 unsigned long count = periodic_count; 366 381 367 - spin_lock(&rtc_lock); 368 382 rtc2_write(RTCINTREG, RTCLONG1_INT); 369 383 370 384 rtc1_write(RTCL1LREG, count); 371 385 rtc1_write(RTCL1HREG, count >> 16); 372 386 373 - rtc_irq_data += 0x100; 374 - rtc_irq_data &= ~0xff; 375 - rtc_irq_data |= RTC_PF; 376 - spin_unlock(&rtc_lock); 377 - 378 - spin_lock(&rtc_task_lock); 379 - if (rtc_callback) 380 - rtc_callback->func(rtc_callback->private_data); 381 - spin_unlock(&rtc_task_lock); 382 - 383 - wake_up_interruptible(&rtc_wait); 384 - 385 - kill_fasync(&rtc_async_queue, SIGIO, POLL_IN); 387 + rtc_update_irq(&rtc->class_dev, 1, RTC_PF); 386 388 387 389 return IRQ_HANDLED; 388 390 } 389 391 390 - int rtc_register(rtc_task_t *task) 391 - { 392 - if (task == NULL || task->func == NULL) 393 - return -EINVAL; 394 - 395 - spin_lock_irq(&rtc_lock); 396 - if (rtc_status == RTC_OPEN) { 397 - spin_unlock_irq(&rtc_lock); 398 - return -EBUSY; 399 - } 400 - 401 - spin_lock(&rtc_task_lock); 402 - if (rtc_callback != NULL) { 403 - spin_unlock(&rtc_task_lock); 404 - spin_unlock_irq(&rtc_task_lock); 405 - return -EBUSY; 406 - } 407 - 408 - rtc_callback = task; 409 - spin_unlock(&rtc_task_lock); 410 - 411 - rtc_status = RTC_OPEN; 412 - 413 - spin_unlock_irq(&rtc_lock); 414 - 415 - return 0; 416 - } 417 - 418 - EXPORT_SYMBOL_GPL(rtc_register); 419 - 420 - int rtc_unregister(rtc_task_t *task) 421 - { 422 - spin_lock_irq(&rtc_task_lock); 423 - if (task == NULL || rtc_callback != task) { 424 - spin_unlock_irq(&rtc_task_lock); 425 - return -ENXIO; 426 - } 427 - 428 - spin_lock(&rtc_lock); 429 - 430 - rtc1_write(ECMPLREG, 0); 431 - rtc1_write(ECMPMREG, 0); 432 - rtc1_write(ECMPHREG, 0); 433 - rtc1_write(RTCL1LREG, 0); 434 - rtc1_write(RTCL1HREG, 0); 435 - 436 - rtc_status = RTC_RELEASE; 437 - 438 - spin_unlock(&rtc_lock); 439 - 440 - rtc_callback = NULL; 441 - 442 - spin_unlock_irq(&rtc_task_lock); 443 - 444 - disable_irq(ELAPSEDTIME_IRQ); 445 - disable_irq(RTCLONG1_IRQ); 446 - 447 - return 0; 448 - } 449 - 450 - EXPORT_SYMBOL_GPL(rtc_unregister); 451 - 452 - int rtc_control(rtc_task_t *task, unsigned int cmd, unsigned long arg) 453 - { 454 - int retval = 0; 455 - 456 - spin_lock_irq(&rtc_task_lock); 457 - 458 - if (rtc_callback != task) 459 - retval = -ENXIO; 460 - else 461 - rtc_do_ioctl(cmd, arg, FUNCTION_RTC_CONTROL); 462 - 463 - spin_unlock_irq(&rtc_task_lock); 464 - 465 - return retval; 466 - } 467 - 468 - EXPORT_SYMBOL_GPL(rtc_control); 469 - 470 - static struct miscdevice rtc_miscdevice = { 471 - .minor = RTC_MINOR, 472 - .name = rtc_name, 473 - .fops = &rtc_fops, 392 + static struct rtc_class_ops vr41xx_rtc_ops = { 393 + .release = vr41xx_rtc_release, 394 + .ioctl = vr41xx_rtc_ioctl, 395 + .read_time = vr41xx_rtc_read_time, 396 + .set_time = vr41xx_rtc_set_time, 397 + .read_alarm = vr41xx_rtc_read_alarm, 398 + .set_alarm = vr41xx_rtc_set_alarm, 474 399 }; 475 400 476 401 static int __devinit rtc_probe(struct platform_device *pdev) 477 402 { 403 + struct rtc_device *rtc; 478 404 unsigned int irq; 479 405 int retval; 480 406 ··· 333 577 return -EBUSY; 334 578 } 335 579 336 - retval = misc_register(&rtc_miscdevice); 337 - if (retval < 0) { 580 + rtc = rtc_device_register(rtc_name, &pdev->dev, &vr41xx_rtc_ops, THIS_MODULE); 581 + if (IS_ERR(rtc)) { 338 582 iounmap(rtc1_base); 339 583 iounmap(rtc2_base); 340 584 rtc1_base = NULL; 341 585 rtc2_base = NULL; 342 - return retval; 586 + return PTR_ERR(rtc); 343 587 } 344 588 345 589 spin_lock_irq(&rtc_lock); ··· 350 594 rtc1_write(RTCL1LREG, 0); 351 595 rtc1_write(RTCL1HREG, 0); 352 596 353 - rtc_status = RTC_RELEASE; 354 - rtc_irq_data = 0; 355 - 356 597 spin_unlock_irq(&rtc_lock); 357 - 358 - init_waitqueue_head(&rtc_wait); 359 598 360 599 irq = ELAPSEDTIME_IRQ; 361 600 retval = request_irq(irq, elapsedtime_interrupt, SA_INTERRUPT, 362 - "elapsed_time", NULL); 601 + "elapsed_time", pdev); 363 602 if (retval == 0) { 364 603 irq = RTCLONG1_IRQ; 365 604 retval = request_irq(irq, rtclong1_interrupt, SA_INTERRUPT, 366 - "rtclong1", NULL); 605 + "rtclong1", pdev); 367 606 } 368 607 369 608 if (retval < 0) { 370 609 printk(KERN_ERR "rtc: IRQ%d is busy\n", irq); 610 + rtc_device_unregister(rtc); 371 611 if (irq == RTCLONG1_IRQ) 372 612 free_irq(ELAPSEDTIME_IRQ, NULL); 373 613 iounmap(rtc1_base); ··· 373 621 return retval; 374 622 } 375 623 624 + platform_set_drvdata(pdev, rtc); 625 + 376 626 disable_irq(ELAPSEDTIME_IRQ); 377 627 disable_irq(RTCLONG1_IRQ); 378 - 379 - spin_lock_init(&rtc_task_lock); 380 628 381 629 printk(KERN_INFO "rtc: Real Time Clock of NEC VR4100 series\n"); 382 630 383 631 return 0; 384 632 } 385 633 386 - static int __devexit rtc_remove(struct platform_device *dev) 634 + static int __devexit rtc_remove(struct platform_device *pdev) 387 635 { 388 - int retval; 636 + struct rtc_device *rtc; 389 637 390 - retval = misc_deregister(&rtc_miscdevice); 391 - if (retval < 0) 392 - return retval; 638 + rtc = platform_get_drvdata(pdev); 639 + if (rtc != NULL) 640 + rtc_device_unregister(rtc); 641 + 642 + platform_set_drvdata(pdev, NULL); 393 643 394 644 free_irq(ELAPSEDTIME_IRQ, NULL); 395 645 free_irq(RTCLONG1_IRQ, NULL); ··· 405 651 406 652 static struct platform_device *rtc_platform_device; 407 653 408 - static struct platform_driver rtc_device_driver = { 654 + static struct platform_driver rtc_platform_driver = { 409 655 .probe = rtc_probe, 410 656 .remove = __devexit_p(rtc_remove), 411 657 .driver = { ··· 440 686 } 441 687 442 688 rtc_platform_device = platform_device_alloc("RTC", -1); 443 - if (!rtc_platform_device) 689 + if (rtc_platform_device == NULL) 444 690 return -ENOMEM; 445 691 446 692 retval = platform_device_add_resources(rtc_platform_device, ··· 454 700 return retval; 455 701 } 456 702 457 - retval = platform_driver_register(&rtc_device_driver); 703 + retval = platform_driver_register(&rtc_platform_driver); 458 704 if (retval < 0) 459 705 platform_device_unregister(rtc_platform_device); 460 706 ··· 463 709 464 710 static void __exit vr41xx_rtc_exit(void) 465 711 { 466 - platform_driver_unregister(&rtc_device_driver); 712 + platform_driver_unregister(&rtc_platform_driver); 467 713 platform_device_unregister(rtc_platform_device); 468 714 } 469 715
+4
drivers/rtc/Kconfig
··· 147 147 To compile this driver as a module, choose M here: the 148 148 module will be called rtc-sa1100. 149 149 150 + config RTC_DRV_VR41XX 151 + tristate "NEC VR4100 series RTC" 152 + depends on RTC_CLASS && CPU_VR41XX 153 + 150 154 config RTC_DRV_TEST 151 155 tristate "Test driver/device" 152 156 depends on RTC_CLASS
+1
drivers/rtc/Makefile
··· 19 19 obj-$(CONFIG_RTC_DRV_M48T86) += rtc-m48t86.o 20 20 obj-$(CONFIG_RTC_DRV_EP93XX) += rtc-ep93xx.o 21 21 obj-$(CONFIG_RTC_DRV_SA1100) += rtc-sa1100.o 22 + obj-$(CONFIG_RTC_DRV_VR41XX) += rtc-vr41xx.o