diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-27 16:26:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-27 16:26:18 -0500 |
commit | ef1a8de8ea004a689b2aa9f5cefcba2b1a0262f2 (patch) | |
tree | 14324fad5e33c50c7d00646b7f6d2524943e7726 /drivers | |
parent | 1c32fd0c5ac1ccbdc37a1a392a5d75cbe059b401 (diff) | |
parent | 3d98ffbffb16f2a1569b83cb78db0b5100e6c937 (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (88 commits)
powerpc: Fix lwsync feature fixup vs. modules on 64-bit
powerpc: Convert pmc_owner_lock to raw_spinlock
powerpc: Convert die.lock to raw_spinlock
powerpc: Convert tlbivax_lock to raw_spinlock
powerpc: Convert mpic locks to raw_spinlock
powerpc: Convert pmac_pic_lock to raw_spinlock
powerpc: Convert big_irq_lock to raw_spinlock
powerpc: Convert feature_lock to raw_spinlock
powerpc: Convert i8259_lock to raw_spinlock
powerpc: Convert beat_htab_lock to raw_spinlock
powerpc: Convert confirm_error_lock to raw_spinlock
powerpc: Convert ipic_lock to raw_spinlock
powerpc: Convert native_tlbie_lock to raw_spinlock
powerpc: Convert beatic_irq_mask_lock to raw_spinlock
powerpc: Convert nv_lock to raw_spinlock
powerpc: Convert context_lock to raw_spinlock
powerpc/85xx: Add NOR, LEDs and PIB support for MPC8568E-MDS boards
powerpc/86xx: Enable VME driver on the GE SBC610
powerpc/86xx: Enable VME driver on the GE PPC9A
powerpc/86xx: Add MSI section to GE PPC9A DTS
...
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/viodasd.c | 86 | ||||
-rw-r--r-- | drivers/char/hvc_console.c | 6 | ||||
-rw-r--r-- | drivers/char/hvc_console.h | 4 | ||||
-rw-r--r-- | drivers/hwmon/ams/ams-core.c | 11 | ||||
-rw-r--r-- | drivers/hwmon/ams/ams-i2c.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/ams/ams-pmu.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/ams/ams.h | 1 | ||||
-rw-r--r-- | drivers/macintosh/therm_adt746x.c | 36 | ||||
-rw-r--r-- | drivers/ps3/ps3av.c | 2 | ||||
-rw-r--r-- | drivers/rtc/Kconfig | 10 | ||||
-rw-r--r-- | drivers/rtc/Makefile | 1 | ||||
-rw-r--r-- | drivers/rtc/rtc-mpc5121.c | 387 | ||||
-rw-r--r-- | drivers/serial/mpc52xx_uart.c | 251 | ||||
-rw-r--r-- | drivers/video/fsl-diu-fb.c | 5 |
14 files changed, 718 insertions, 86 deletions
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index a8c8b56b275e..1b3def1e8591 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c | |||
@@ -28,6 +28,9 @@ | |||
28 | * All disk operations are performed by sending messages back and forth to | 28 | * All disk operations are performed by sending messages back and forth to |
29 | * the OS/400 partition. | 29 | * the OS/400 partition. |
30 | */ | 30 | */ |
31 | |||
32 | #define pr_fmt(fmt) "viod: " fmt | ||
33 | |||
31 | #include <linux/major.h> | 34 | #include <linux/major.h> |
32 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
33 | #include <linux/module.h> | 36 | #include <linux/module.h> |
@@ -63,9 +66,6 @@ MODULE_LICENSE("GPL"); | |||
63 | 66 | ||
64 | #define VIOD_VERS "1.64" | 67 | #define VIOD_VERS "1.64" |
65 | 68 | ||
66 | #define VIOD_KERN_WARNING KERN_WARNING "viod: " | ||
67 | #define VIOD_KERN_INFO KERN_INFO "viod: " | ||
68 | |||
69 | enum { | 69 | enum { |
70 | PARTITION_SHIFT = 3, | 70 | PARTITION_SHIFT = 3, |
71 | MAX_DISKNO = HVMAXARCHITECTEDVIRTUALDISKS, | 71 | MAX_DISKNO = HVMAXARCHITECTEDVIRTUALDISKS, |
@@ -156,7 +156,7 @@ static int viodasd_open(struct block_device *bdev, fmode_t mode) | |||
156 | ((u64)DEVICE_NO(d) << 48) | ((u64)flags << 32), | 156 | ((u64)DEVICE_NO(d) << 48) | ((u64)flags << 32), |
157 | 0, 0, 0); | 157 | 0, 0, 0); |
158 | if (hvrc != 0) { | 158 | if (hvrc != 0) { |
159 | printk(VIOD_KERN_WARNING "HV open failed %d\n", (int)hvrc); | 159 | pr_warning("HV open failed %d\n", (int)hvrc); |
160 | return -EIO; | 160 | return -EIO; |
161 | } | 161 | } |
162 | 162 | ||
@@ -167,9 +167,8 @@ static int viodasd_open(struct block_device *bdev, fmode_t mode) | |||
167 | const struct vio_error_entry *err = | 167 | const struct vio_error_entry *err = |
168 | vio_lookup_rc(viodasd_err_table, we.sub_result); | 168 | vio_lookup_rc(viodasd_err_table, we.sub_result); |
169 | 169 | ||
170 | printk(VIOD_KERN_WARNING | 170 | pr_warning("bad rc opening disk: %d:0x%04x (%s)\n", |
171 | "bad rc opening disk: %d:0x%04x (%s)\n", | 171 | (int)we.rc, we.sub_result, err->msg); |
172 | (int)we.rc, we.sub_result, err->msg); | ||
173 | return -EIO; | 172 | return -EIO; |
174 | } | 173 | } |
175 | 174 | ||
@@ -195,8 +194,7 @@ static int viodasd_release(struct gendisk *disk, fmode_t mode) | |||
195 | ((u64)DEVICE_NO(d) << 48) /* | ((u64)flags << 32) */, | 194 | ((u64)DEVICE_NO(d) << 48) /* | ((u64)flags << 32) */, |
196 | 0, 0, 0); | 195 | 0, 0, 0); |
197 | if (hvrc != 0) | 196 | if (hvrc != 0) |
198 | printk(VIOD_KERN_WARNING "HV close call failed %d\n", | 197 | pr_warning("HV close call failed %d\n", (int)hvrc); |
199 | (int)hvrc); | ||
200 | return 0; | 198 | return 0; |
201 | } | 199 | } |
202 | 200 | ||
@@ -288,8 +286,7 @@ static int send_request(struct request *req) | |||
288 | bevent = (struct vioblocklpevent *) | 286 | bevent = (struct vioblocklpevent *) |
289 | vio_get_event_buffer(viomajorsubtype_blockio); | 287 | vio_get_event_buffer(viomajorsubtype_blockio); |
290 | if (bevent == NULL) { | 288 | if (bevent == NULL) { |
291 | printk(VIOD_KERN_WARNING | 289 | pr_warning("error allocating disk event buffer\n"); |
292 | "error allocating disk event buffer\n"); | ||
293 | goto error_ret; | 290 | goto error_ret; |
294 | } | 291 | } |
295 | 292 | ||
@@ -333,9 +330,8 @@ static int send_request(struct request *req) | |||
333 | } | 330 | } |
334 | 331 | ||
335 | if (hvrc != HvLpEvent_Rc_Good) { | 332 | if (hvrc != HvLpEvent_Rc_Good) { |
336 | printk(VIOD_KERN_WARNING | 333 | pr_warning("error sending disk event to OS/400 (rc %d)\n", |
337 | "error sending disk event to OS/400 (rc %d)\n", | 334 | (int)hvrc); |
338 | (int)hvrc); | ||
339 | goto error_ret; | 335 | goto error_ret; |
340 | } | 336 | } |
341 | spin_unlock_irqrestore(&viodasd_spinlock, flags); | 337 | spin_unlock_irqrestore(&viodasd_spinlock, flags); |
@@ -402,7 +398,7 @@ retry: | |||
402 | ((u64)dev_no << 48) | ((u64)flags<< 32), | 398 | ((u64)dev_no << 48) | ((u64)flags<< 32), |
403 | 0, 0, 0); | 399 | 0, 0, 0); |
404 | if (hvrc != 0) { | 400 | if (hvrc != 0) { |
405 | printk(VIOD_KERN_WARNING "bad rc on HV open %d\n", (int)hvrc); | 401 | pr_warning("bad rc on HV open %d\n", (int)hvrc); |
406 | return 0; | 402 | return 0; |
407 | } | 403 | } |
408 | 404 | ||
@@ -416,9 +412,8 @@ retry: | |||
416 | goto retry; | 412 | goto retry; |
417 | } | 413 | } |
418 | if (we.max_disk > (MAX_DISKNO - 1)) { | 414 | if (we.max_disk > (MAX_DISKNO - 1)) { |
419 | printk_once(VIOD_KERN_INFO | 415 | printk_once(KERN_INFO pr_fmt("Only examining the first %d of %d disks connected\n"), |
420 | "Only examining the first %d of %d disks connected\n", | 416 | MAX_DISKNO, we.max_disk + 1); |
421 | MAX_DISKNO, we.max_disk + 1); | ||
422 | } | 417 | } |
423 | 418 | ||
424 | /* Send the close event to OS/400. We DON'T expect a response */ | 419 | /* Send the close event to OS/400. We DON'T expect a response */ |
@@ -432,17 +427,15 @@ retry: | |||
432 | ((u64)dev_no << 48) | ((u64)flags << 32), | 427 | ((u64)dev_no << 48) | ((u64)flags << 32), |
433 | 0, 0, 0); | 428 | 0, 0, 0); |
434 | if (hvrc != 0) { | 429 | if (hvrc != 0) { |
435 | printk(VIOD_KERN_WARNING | 430 | pr_warning("bad rc sending event to OS/400 %d\n", (int)hvrc); |
436 | "bad rc sending event to OS/400 %d\n", (int)hvrc); | ||
437 | return 0; | 431 | return 0; |
438 | } | 432 | } |
439 | 433 | ||
440 | if (d->dev == NULL) { | 434 | if (d->dev == NULL) { |
441 | /* this is when we reprobe for new disks */ | 435 | /* this is when we reprobe for new disks */ |
442 | if (vio_create_viodasd(dev_no) == NULL) { | 436 | if (vio_create_viodasd(dev_no) == NULL) { |
443 | printk(VIOD_KERN_WARNING | 437 | pr_warning("cannot allocate virtual device for disk %d\n", |
444 | "cannot allocate virtual device for disk %d\n", | 438 | dev_no); |
445 | dev_no); | ||
446 | return 0; | 439 | return 0; |
447 | } | 440 | } |
448 | /* | 441 | /* |
@@ -457,15 +450,13 @@ retry: | |||
457 | spin_lock_init(&d->q_lock); | 450 | spin_lock_init(&d->q_lock); |
458 | q = blk_init_queue(do_viodasd_request, &d->q_lock); | 451 | q = blk_init_queue(do_viodasd_request, &d->q_lock); |
459 | if (q == NULL) { | 452 | if (q == NULL) { |
460 | printk(VIOD_KERN_WARNING "cannot allocate queue for disk %d\n", | 453 | pr_warning("cannot allocate queue for disk %d\n", dev_no); |
461 | dev_no); | ||
462 | return 0; | 454 | return 0; |
463 | } | 455 | } |
464 | g = alloc_disk(1 << PARTITION_SHIFT); | 456 | g = alloc_disk(1 << PARTITION_SHIFT); |
465 | if (g == NULL) { | 457 | if (g == NULL) { |
466 | printk(VIOD_KERN_WARNING | 458 | pr_warning("cannot allocate disk structure for disk %d\n", |
467 | "cannot allocate disk structure for disk %d\n", | 459 | dev_no); |
468 | dev_no); | ||
469 | blk_cleanup_queue(q); | 460 | blk_cleanup_queue(q); |
470 | return 0; | 461 | return 0; |
471 | } | 462 | } |
@@ -489,13 +480,12 @@ retry: | |||
489 | g->driverfs_dev = d->dev; | 480 | g->driverfs_dev = d->dev; |
490 | set_capacity(g, d->size >> 9); | 481 | set_capacity(g, d->size >> 9); |
491 | 482 | ||
492 | printk(VIOD_KERN_INFO "disk %d: %lu sectors (%lu MB) " | 483 | pr_info("disk %d: %lu sectors (%lu MB) CHS=%d/%d/%d sector size %d%s\n", |
493 | "CHS=%d/%d/%d sector size %d%s\n", | 484 | dev_no, (unsigned long)(d->size >> 9), |
494 | dev_no, (unsigned long)(d->size >> 9), | 485 | (unsigned long)(d->size >> 20), |
495 | (unsigned long)(d->size >> 20), | 486 | (int)d->cylinders, (int)d->tracks, |
496 | (int)d->cylinders, (int)d->tracks, | 487 | (int)d->sectors, (int)d->bytes_per_sector, |
497 | (int)d->sectors, (int)d->bytes_per_sector, | 488 | d->read_only ? " (RO)" : ""); |
498 | d->read_only ? " (RO)" : ""); | ||
499 | 489 | ||
500 | /* register us in the global list */ | 490 | /* register us in the global list */ |
501 | add_disk(g); | 491 | add_disk(g); |
@@ -580,8 +570,8 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent) | |||
580 | if (error) { | 570 | if (error) { |
581 | const struct vio_error_entry *err; | 571 | const struct vio_error_entry *err; |
582 | err = vio_lookup_rc(viodasd_err_table, bevent->sub_result); | 572 | err = vio_lookup_rc(viodasd_err_table, bevent->sub_result); |
583 | printk(VIOD_KERN_WARNING "read/write error %d:0x%04x (%s)\n", | 573 | pr_warning("read/write error %d:0x%04x (%s)\n", |
584 | event->xRc, bevent->sub_result, err->msg); | 574 | event->xRc, bevent->sub_result, err->msg); |
585 | num_sect = blk_rq_sectors(req); | 575 | num_sect = blk_rq_sectors(req); |
586 | } | 576 | } |
587 | qlock = req->q->queue_lock; | 577 | qlock = req->q->queue_lock; |
@@ -606,8 +596,7 @@ static void handle_block_event(struct HvLpEvent *event) | |||
606 | return; | 596 | return; |
607 | /* First, we should NEVER get an int here...only acks */ | 597 | /* First, we should NEVER get an int here...only acks */ |
608 | if (hvlpevent_is_int(event)) { | 598 | if (hvlpevent_is_int(event)) { |
609 | printk(VIOD_KERN_WARNING | 599 | pr_warning("Yikes! got an int in viodasd event handler!\n"); |
610 | "Yikes! got an int in viodasd event handler!\n"); | ||
611 | if (hvlpevent_need_ack(event)) { | 600 | if (hvlpevent_need_ack(event)) { |
612 | event->xRc = HvLpEvent_Rc_InvalidSubtype; | 601 | event->xRc = HvLpEvent_Rc_InvalidSubtype; |
613 | HvCallEvent_ackLpEvent(event); | 602 | HvCallEvent_ackLpEvent(event); |
@@ -650,7 +639,7 @@ static void handle_block_event(struct HvLpEvent *event) | |||
650 | break; | 639 | break; |
651 | 640 | ||
652 | default: | 641 | default: |
653 | printk(VIOD_KERN_WARNING "invalid subtype!"); | 642 | pr_warning("invalid subtype!"); |
654 | if (hvlpevent_need_ack(event)) { | 643 | if (hvlpevent_need_ack(event)) { |
655 | event->xRc = HvLpEvent_Rc_InvalidSubtype; | 644 | event->xRc = HvLpEvent_Rc_InvalidSubtype; |
656 | HvCallEvent_ackLpEvent(event); | 645 | HvCallEvent_ackLpEvent(event); |
@@ -739,29 +728,26 @@ static int __init viodasd_init(void) | |||
739 | vio_set_hostlp(); | 728 | vio_set_hostlp(); |
740 | 729 | ||
741 | if (viopath_hostLp == HvLpIndexInvalid) { | 730 | if (viopath_hostLp == HvLpIndexInvalid) { |
742 | printk(VIOD_KERN_WARNING "invalid hosting partition\n"); | 731 | pr_warning("invalid hosting partition\n"); |
743 | rc = -EIO; | 732 | rc = -EIO; |
744 | goto early_fail; | 733 | goto early_fail; |
745 | } | 734 | } |
746 | 735 | ||
747 | printk(VIOD_KERN_INFO "vers " VIOD_VERS ", hosting partition %d\n", | 736 | pr_info("vers " VIOD_VERS ", hosting partition %d\n", viopath_hostLp); |
748 | viopath_hostLp); | ||
749 | 737 | ||
750 | /* register the block device */ | 738 | /* register the block device */ |
751 | rc = register_blkdev(VIODASD_MAJOR, VIOD_GENHD_NAME); | 739 | rc = register_blkdev(VIODASD_MAJOR, VIOD_GENHD_NAME); |
752 | if (rc) { | 740 | if (rc) { |
753 | printk(VIOD_KERN_WARNING | 741 | pr_warning("Unable to get major number %d for %s\n", |
754 | "Unable to get major number %d for %s\n", | 742 | VIODASD_MAJOR, VIOD_GENHD_NAME); |
755 | VIODASD_MAJOR, VIOD_GENHD_NAME); | ||
756 | goto early_fail; | 743 | goto early_fail; |
757 | } | 744 | } |
758 | /* Actually open the path to the hosting partition */ | 745 | /* Actually open the path to the hosting partition */ |
759 | rc = viopath_open(viopath_hostLp, viomajorsubtype_blockio, | 746 | rc = viopath_open(viopath_hostLp, viomajorsubtype_blockio, |
760 | VIOMAXREQ + 2); | 747 | VIOMAXREQ + 2); |
761 | if (rc) { | 748 | if (rc) { |
762 | printk(VIOD_KERN_WARNING | 749 | pr_warning("error opening path to host partition %d\n", |
763 | "error opening path to host partition %d\n", | 750 | viopath_hostLp); |
764 | viopath_hostLp); | ||
765 | goto unregister_blk; | 751 | goto unregister_blk; |
766 | } | 752 | } |
767 | 753 | ||
@@ -770,7 +756,7 @@ static int __init viodasd_init(void) | |||
770 | 756 | ||
771 | rc = vio_register_driver(&viodasd_driver); | 757 | rc = vio_register_driver(&viodasd_driver); |
772 | if (rc) { | 758 | if (rc) { |
773 | printk(VIOD_KERN_WARNING "vio_register_driver failed\n"); | 759 | pr_warning("vio_register_driver failed\n"); |
774 | goto unset_handler; | 760 | goto unset_handler; |
775 | } | 761 | } |
776 | 762 | ||
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index d8dac5820f0e..4c3b59be286a 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
@@ -748,9 +748,9 @@ static const struct tty_operations hvc_ops = { | |||
748 | .chars_in_buffer = hvc_chars_in_buffer, | 748 | .chars_in_buffer = hvc_chars_in_buffer, |
749 | }; | 749 | }; |
750 | 750 | ||
751 | struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data, | 751 | struct hvc_struct *hvc_alloc(uint32_t vtermno, int data, |
752 | const struct hv_ops *ops, | 752 | const struct hv_ops *ops, |
753 | int outbuf_size) | 753 | int outbuf_size) |
754 | { | 754 | { |
755 | struct hvc_struct *hp; | 755 | struct hvc_struct *hp; |
756 | int i; | 756 | int i; |
diff --git a/drivers/char/hvc_console.h b/drivers/char/hvc_console.h index 52ddf4d3716c..54381eba4e4a 100644 --- a/drivers/char/hvc_console.h +++ b/drivers/char/hvc_console.h | |||
@@ -80,8 +80,8 @@ extern int hvc_instantiate(uint32_t vtermno, int index, | |||
80 | const struct hv_ops *ops); | 80 | const struct hv_ops *ops); |
81 | 81 | ||
82 | /* register a vterm for hvc tty operation (module_init or hotplug add) */ | 82 | /* register a vterm for hvc tty operation (module_init or hotplug add) */ |
83 | extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int data, | 83 | extern struct hvc_struct * hvc_alloc(uint32_t vtermno, int data, |
84 | const struct hv_ops *ops, int outbuf_size); | 84 | const struct hv_ops *ops, int outbuf_size); |
85 | /* remove a vterm from hvc tty operation (module_exit or hotplug remove) */ | 85 | /* remove a vterm from hvc tty operation (module_exit or hotplug remove) */ |
86 | extern int hvc_remove(struct hvc_struct *hp); | 86 | extern int hvc_remove(struct hvc_struct *hp); |
87 | 87 | ||
diff --git a/drivers/hwmon/ams/ams-core.c b/drivers/hwmon/ams/ams-core.c index 6c9ace1b76f6..2ad62c339cd2 100644 --- a/drivers/hwmon/ams/ams-core.c +++ b/drivers/hwmon/ams/ams-core.c | |||
@@ -213,7 +213,7 @@ int __init ams_init(void) | |||
213 | return -ENODEV; | 213 | return -ENODEV; |
214 | } | 214 | } |
215 | 215 | ||
216 | void ams_exit(void) | 216 | void ams_sensor_detach(void) |
217 | { | 217 | { |
218 | /* Remove input device */ | 218 | /* Remove input device */ |
219 | ams_input_exit(); | 219 | ams_input_exit(); |
@@ -221,9 +221,6 @@ void ams_exit(void) | |||
221 | /* Remove attributes */ | 221 | /* Remove attributes */ |
222 | device_remove_file(&ams_info.of_dev->dev, &dev_attr_current); | 222 | device_remove_file(&ams_info.of_dev->dev, &dev_attr_current); |
223 | 223 | ||
224 | /* Shut down implementation */ | ||
225 | ams_info.exit(); | ||
226 | |||
227 | /* Flush interrupt worker | 224 | /* Flush interrupt worker |
228 | * | 225 | * |
229 | * We do this after ams_info.exit(), because an interrupt might | 226 | * We do this after ams_info.exit(), because an interrupt might |
@@ -239,6 +236,12 @@ void ams_exit(void) | |||
239 | pmf_unregister_irq_client(&ams_freefall_client); | 236 | pmf_unregister_irq_client(&ams_freefall_client); |
240 | } | 237 | } |
241 | 238 | ||
239 | static void __exit ams_exit(void) | ||
240 | { | ||
241 | /* Shut down implementation */ | ||
242 | ams_info.exit(); | ||
243 | } | ||
244 | |||
242 | MODULE_AUTHOR("Stelian Pop, Michael Hanselmann"); | 245 | MODULE_AUTHOR("Stelian Pop, Michael Hanselmann"); |
243 | MODULE_DESCRIPTION("Apple Motion Sensor driver"); | 246 | MODULE_DESCRIPTION("Apple Motion Sensor driver"); |
244 | MODULE_LICENSE("GPL"); | 247 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/hwmon/ams/ams-i2c.c b/drivers/hwmon/ams/ams-i2c.c index 2cbf8a6506c7..abeecd27b484 100644 --- a/drivers/hwmon/ams/ams-i2c.c +++ b/drivers/hwmon/ams/ams-i2c.c | |||
@@ -238,6 +238,8 @@ static int ams_i2c_probe(struct i2c_client *client, | |||
238 | static int ams_i2c_remove(struct i2c_client *client) | 238 | static int ams_i2c_remove(struct i2c_client *client) |
239 | { | 239 | { |
240 | if (ams_info.has_device) { | 240 | if (ams_info.has_device) { |
241 | ams_sensor_detach(); | ||
242 | |||
241 | /* Disable interrupts */ | 243 | /* Disable interrupts */ |
242 | ams_i2c_set_irq(AMS_IRQ_ALL, 0); | 244 | ams_i2c_set_irq(AMS_IRQ_ALL, 0); |
243 | 245 | ||
diff --git a/drivers/hwmon/ams/ams-pmu.c b/drivers/hwmon/ams/ams-pmu.c index fb18b3d3162b..4f61b3ee1b08 100644 --- a/drivers/hwmon/ams/ams-pmu.c +++ b/drivers/hwmon/ams/ams-pmu.c | |||
@@ -133,6 +133,8 @@ static void ams_pmu_get_xyz(s8 *x, s8 *y, s8 *z) | |||
133 | 133 | ||
134 | static void ams_pmu_exit(void) | 134 | static void ams_pmu_exit(void) |
135 | { | 135 | { |
136 | ams_sensor_detach(); | ||
137 | |||
136 | /* Disable interrupts */ | 138 | /* Disable interrupts */ |
137 | ams_pmu_set_irq(AMS_IRQ_ALL, 0); | 139 | ams_pmu_set_irq(AMS_IRQ_ALL, 0); |
138 | 140 | ||
diff --git a/drivers/hwmon/ams/ams.h b/drivers/hwmon/ams/ams.h index 5ed387b0bd9a..b28d7e27a031 100644 --- a/drivers/hwmon/ams/ams.h +++ b/drivers/hwmon/ams/ams.h | |||
@@ -61,6 +61,7 @@ extern struct ams ams_info; | |||
61 | 61 | ||
62 | extern void ams_sensors(s8 *x, s8 *y, s8 *z); | 62 | extern void ams_sensors(s8 *x, s8 *y, s8 *z); |
63 | extern int ams_sensor_attach(void); | 63 | extern int ams_sensor_attach(void); |
64 | extern void ams_sensor_detach(void); | ||
64 | 65 | ||
65 | extern int ams_pmu_init(struct device_node *np); | 66 | extern int ams_pmu_init(struct device_node *np); |
66 | extern int ams_i2c_init(struct device_node *np); | 67 | extern int ams_i2c_init(struct device_node *np); |
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 5ff47ba7f2d0..c42eeb43042d 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c | |||
@@ -90,6 +90,8 @@ static struct task_struct *thread_therm = NULL; | |||
90 | 90 | ||
91 | static void write_both_fan_speed(struct thermostat *th, int speed); | 91 | static void write_both_fan_speed(struct thermostat *th, int speed); |
92 | static void write_fan_speed(struct thermostat *th, int speed, int fan); | 92 | static void write_fan_speed(struct thermostat *th, int speed, int fan); |
93 | static void thermostat_create_files(void); | ||
94 | static void thermostat_remove_files(void); | ||
93 | 95 | ||
94 | static int | 96 | static int |
95 | write_reg(struct thermostat* th, int reg, u8 data) | 97 | write_reg(struct thermostat* th, int reg, u8 data) |
@@ -161,6 +163,8 @@ remove_thermostat(struct i2c_client *client) | |||
161 | struct thermostat *th = i2c_get_clientdata(client); | 163 | struct thermostat *th = i2c_get_clientdata(client); |
162 | int i; | 164 | int i; |
163 | 165 | ||
166 | thermostat_remove_files(); | ||
167 | |||
164 | if (thread_therm != NULL) { | 168 | if (thread_therm != NULL) { |
165 | kthread_stop(thread_therm); | 169 | kthread_stop(thread_therm); |
166 | } | 170 | } |
@@ -312,7 +316,7 @@ static void update_fans_speed (struct thermostat *th) | |||
312 | 316 | ||
313 | if (verbose) | 317 | if (verbose) |
314 | printk(KERN_DEBUG "adt746x: Setting fans speed to %d " | 318 | printk(KERN_DEBUG "adt746x: Setting fans speed to %d " |
315 | "(limit exceeded by %d on %s) \n", | 319 | "(limit exceeded by %d on %s)\n", |
316 | new_speed, var, | 320 | new_speed, var, |
317 | sensor_location[fan_number+1]); | 321 | sensor_location[fan_number+1]); |
318 | write_both_fan_speed(th, new_speed); | 322 | write_both_fan_speed(th, new_speed); |
@@ -449,6 +453,8 @@ static int probe_thermostat(struct i2c_client *client, | |||
449 | return -ENOMEM; | 453 | return -ENOMEM; |
450 | } | 454 | } |
451 | 455 | ||
456 | thermostat_create_files(); | ||
457 | |||
452 | return 0; | 458 | return 0; |
453 | } | 459 | } |
454 | 460 | ||
@@ -566,7 +572,6 @@ thermostat_init(void) | |||
566 | struct device_node* np; | 572 | struct device_node* np; |
567 | const u32 *prop; | 573 | const u32 *prop; |
568 | int i = 0, offset = 0; | 574 | int i = 0, offset = 0; |
569 | int err; | ||
570 | 575 | ||
571 | np = of_find_node_by_name(NULL, "fan"); | 576 | np = of_find_node_by_name(NULL, "fan"); |
572 | if (!np) | 577 | if (!np) |
@@ -633,6 +638,17 @@ thermostat_init(void) | |||
633 | return -ENODEV; | 638 | return -ENODEV; |
634 | } | 639 | } |
635 | 640 | ||
641 | #ifndef CONFIG_I2C_POWERMAC | ||
642 | request_module("i2c-powermac"); | ||
643 | #endif | ||
644 | |||
645 | return i2c_add_driver(&thermostat_driver); | ||
646 | } | ||
647 | |||
648 | static void thermostat_create_files(void) | ||
649 | { | ||
650 | int err; | ||
651 | |||
636 | err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature); | 652 | err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature); |
637 | err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature); | 653 | err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature); |
638 | err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit); | 654 | err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit); |
@@ -647,16 +663,9 @@ thermostat_init(void) | |||
647 | if (err) | 663 | if (err) |
648 | printk(KERN_WARNING | 664 | printk(KERN_WARNING |
649 | "Failed to create tempertaure attribute file(s).\n"); | 665 | "Failed to create tempertaure attribute file(s).\n"); |
650 | |||
651 | #ifndef CONFIG_I2C_POWERMAC | ||
652 | request_module("i2c-powermac"); | ||
653 | #endif | ||
654 | |||
655 | return i2c_add_driver(&thermostat_driver); | ||
656 | } | 666 | } |
657 | 667 | ||
658 | static void __exit | 668 | static void thermostat_remove_files(void) |
659 | thermostat_exit(void) | ||
660 | { | 669 | { |
661 | if (of_dev) { | 670 | if (of_dev) { |
662 | device_remove_file(&of_dev->dev, &dev_attr_sensor1_temperature); | 671 | device_remove_file(&of_dev->dev, &dev_attr_sensor1_temperature); |
@@ -673,9 +682,14 @@ thermostat_exit(void) | |||
673 | device_remove_file(&of_dev->dev, | 682 | device_remove_file(&of_dev->dev, |
674 | &dev_attr_sensor2_fan_speed); | 683 | &dev_attr_sensor2_fan_speed); |
675 | 684 | ||
676 | of_device_unregister(of_dev); | ||
677 | } | 685 | } |
686 | } | ||
687 | |||
688 | static void __exit | ||
689 | thermostat_exit(void) | ||
690 | { | ||
678 | i2c_del_driver(&thermostat_driver); | 691 | i2c_del_driver(&thermostat_driver); |
692 | of_device_unregister(of_dev); | ||
679 | } | 693 | } |
680 | 694 | ||
681 | module_init(thermostat_init); | 695 | module_init(thermostat_init); |
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c index e82d8c9c6cda..95a689befc84 100644 --- a/drivers/ps3/ps3av.c +++ b/drivers/ps3/ps3av.c | |||
@@ -532,7 +532,7 @@ static void ps3av_set_videomode_packet(u32 id) | |||
532 | res = ps3av_cmd_avb_param(&avb_param, len); | 532 | res = ps3av_cmd_avb_param(&avb_param, len); |
533 | if (res == PS3AV_STATUS_NO_SYNC_HEAD) | 533 | if (res == PS3AV_STATUS_NO_SYNC_HEAD) |
534 | printk(KERN_WARNING | 534 | printk(KERN_WARNING |
535 | "%s: Command failed. Please try your request again. \n", | 535 | "%s: Command failed. Please try your request again.\n", |
536 | __func__); | 536 | __func__); |
537 | else if (res) | 537 | else if (res) |
538 | dev_dbg(&ps3av->dev->core, "ps3av_cmd_avb_param failed\n"); | 538 | dev_dbg(&ps3av->dev->core, "ps3av_cmd_avb_param failed\n"); |
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 8167e9e6827a..2bb8a8b7ffaf 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig | |||
@@ -868,4 +868,14 @@ config RTC_DRV_MC13783 | |||
868 | help | 868 | help |
869 | This enables support for the Freescale MC13783 PMIC RTC | 869 | This enables support for the Freescale MC13783 PMIC RTC |
870 | 870 | ||
871 | config RTC_DRV_MPC5121 | ||
872 | tristate "Freescale MPC5121 built-in RTC" | ||
873 | depends on PPC_MPC512x && RTC_CLASS | ||
874 | help | ||
875 | If you say yes here you will get support for the | ||
876 | built-in RTC MPC5121. | ||
877 | |||
878 | This driver can also be built as a module. If so, the module | ||
879 | will be called rtc-mpc5121. | ||
880 | |||
871 | endif # RTC_CLASS | 881 | endif # RTC_CLASS |
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index e5160fddc446..b7148afb8f55 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile | |||
@@ -55,6 +55,7 @@ obj-$(CONFIG_RTC_DRV_MAX6900) += rtc-max6900.o | |||
55 | obj-$(CONFIG_RTC_DRV_MAX6902) += rtc-max6902.o | 55 | obj-$(CONFIG_RTC_DRV_MAX6902) += rtc-max6902.o |
56 | obj-$(CONFIG_RTC_DRV_MC13783) += rtc-mc13783.o | 56 | obj-$(CONFIG_RTC_DRV_MC13783) += rtc-mc13783.o |
57 | obj-$(CONFIG_RTC_DRV_MSM6242) += rtc-msm6242.o | 57 | obj-$(CONFIG_RTC_DRV_MSM6242) += rtc-msm6242.o |
58 | obj-$(CONFIG_RTC_DRV_MPC5121) += rtc-mpc5121.o | ||
58 | obj-$(CONFIG_RTC_DRV_MV) += rtc-mv.o | 59 | obj-$(CONFIG_RTC_DRV_MV) += rtc-mv.o |
59 | obj-$(CONFIG_RTC_DRV_NUC900) += rtc-nuc900.o | 60 | obj-$(CONFIG_RTC_DRV_NUC900) += rtc-nuc900.o |
60 | obj-$(CONFIG_RTC_DRV_OMAP) += rtc-omap.o | 61 | obj-$(CONFIG_RTC_DRV_OMAP) += rtc-omap.o |
diff --git a/drivers/rtc/rtc-mpc5121.c b/drivers/rtc/rtc-mpc5121.c new file mode 100644 index 000000000000..4313ca03a96d --- /dev/null +++ b/drivers/rtc/rtc-mpc5121.c | |||
@@ -0,0 +1,387 @@ | |||
1 | /* | ||
2 | * Real-time clock driver for MPC5121 | ||
3 | * | ||
4 | * Copyright 2007, Domen Puncer <domen.puncer@telargo.com> | ||
5 | * Copyright 2008, Freescale Semiconductor, Inc. All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/init.h> | ||
13 | #include <linux/module.h> | ||
14 | #include <linux/rtc.h> | ||
15 | #include <linux/of_device.h> | ||
16 | #include <linux/of_platform.h> | ||
17 | #include <linux/io.h> | ||
18 | |||
19 | struct mpc5121_rtc_regs { | ||
20 | u8 set_time; /* RTC + 0x00 */ | ||
21 | u8 hour_set; /* RTC + 0x01 */ | ||
22 | u8 minute_set; /* RTC + 0x02 */ | ||
23 | u8 second_set; /* RTC + 0x03 */ | ||
24 | |||
25 | u8 set_date; /* RTC + 0x04 */ | ||
26 | u8 month_set; /* RTC + 0x05 */ | ||
27 | u8 weekday_set; /* RTC + 0x06 */ | ||
28 | u8 date_set; /* RTC + 0x07 */ | ||
29 | |||
30 | u8 write_sw; /* RTC + 0x08 */ | ||
31 | u8 sw_set; /* RTC + 0x09 */ | ||
32 | u16 year_set; /* RTC + 0x0a */ | ||
33 | |||
34 | u8 alm_enable; /* RTC + 0x0c */ | ||
35 | u8 alm_hour_set; /* RTC + 0x0d */ | ||
36 | u8 alm_min_set; /* RTC + 0x0e */ | ||
37 | u8 int_enable; /* RTC + 0x0f */ | ||
38 | |||
39 | u8 reserved1; | ||
40 | u8 hour; /* RTC + 0x11 */ | ||
41 | u8 minute; /* RTC + 0x12 */ | ||
42 | u8 second; /* RTC + 0x13 */ | ||
43 | |||
44 | u8 month; /* RTC + 0x14 */ | ||
45 | u8 wday_mday; /* RTC + 0x15 */ | ||
46 | u16 year; /* RTC + 0x16 */ | ||
47 | |||
48 | u8 int_alm; /* RTC + 0x18 */ | ||
49 | u8 int_sw; /* RTC + 0x19 */ | ||
50 | u8 alm_status; /* RTC + 0x1a */ | ||
51 | u8 sw_minute; /* RTC + 0x1b */ | ||
52 | |||
53 | u8 bus_error_1; /* RTC + 0x1c */ | ||
54 | u8 int_day; /* RTC + 0x1d */ | ||
55 | u8 int_min; /* RTC + 0x1e */ | ||
56 | u8 int_sec; /* RTC + 0x1f */ | ||
57 | |||
58 | /* | ||
59 | * target_time: | ||
60 | * intended to be used for hibernation but hibernation | ||
61 | * does not work on silicon rev 1.5 so use it for non-volatile | ||
62 | * storage of offset between the actual_time register and linux | ||
63 | * time | ||
64 | */ | ||
65 | u32 target_time; /* RTC + 0x20 */ | ||
66 | /* | ||
67 | * actual_time: | ||
68 | * readonly time since VBAT_RTC was last connected | ||
69 | */ | ||
70 | u32 actual_time; /* RTC + 0x24 */ | ||
71 | u32 keep_alive; /* RTC + 0x28 */ | ||
72 | }; | ||
73 | |||
74 | struct mpc5121_rtc_data { | ||
75 | unsigned irq; | ||
76 | unsigned irq_periodic; | ||
77 | struct mpc5121_rtc_regs __iomem *regs; | ||
78 | struct rtc_device *rtc; | ||
79 | struct rtc_wkalrm wkalarm; | ||
80 | }; | ||
81 | |||
82 | /* | ||
83 | * Update second/minute/hour registers. | ||
84 | * | ||
85 | * This is just so alarm will work. | ||
86 | */ | ||
87 | static void mpc5121_rtc_update_smh(struct mpc5121_rtc_regs __iomem *regs, | ||
88 | struct rtc_time *tm) | ||
89 | { | ||
90 | out_8(®s->second_set, tm->tm_sec); | ||
91 | out_8(®s->minute_set, tm->tm_min); | ||
92 | out_8(®s->hour_set, tm->tm_hour); | ||
93 | |||
94 | /* set time sequence */ | ||
95 | out_8(®s->set_time, 0x1); | ||
96 | out_8(®s->set_time, 0x3); | ||
97 | out_8(®s->set_time, 0x1); | ||
98 | out_8(®s->set_time, 0x0); | ||
99 | } | ||
100 | |||
101 | static int mpc5121_rtc_read_time(struct device *dev, struct rtc_time *tm) | ||
102 | { | ||
103 | struct mpc5121_rtc_data *rtc = dev_get_drvdata(dev); | ||
104 | struct mpc5121_rtc_regs __iomem *regs = rtc->regs; | ||
105 | unsigned long now; | ||
106 | |||
107 | /* | ||
108 | * linux time is actual_time plus the offset saved in target_time | ||
109 | */ | ||
110 | now = in_be32(®s->actual_time) + in_be32(®s->target_time); | ||
111 | |||
112 | rtc_time_to_tm(now, tm); | ||
113 | |||
114 | /* | ||
115 | * update second minute hour registers | ||
116 | * so alarms will work | ||
117 | */ | ||
118 | mpc5121_rtc_update_smh(regs, tm); | ||
119 | |||
120 | return rtc_valid_tm(tm); | ||
121 | } | ||
122 | |||
123 | static int mpc5121_rtc_set_time(struct device *dev, struct rtc_time *tm) | ||
124 | { | ||
125 | struct mpc5121_rtc_data *rtc = dev_get_drvdata(dev); | ||
126 | struct mpc5121_rtc_regs __iomem *regs = rtc->regs; | ||
127 | int ret; | ||
128 | unsigned long now; | ||
129 | |||
130 | /* | ||
131 | * The actual_time register is read only so we write the offset | ||
132 | * between it and linux time to the target_time register. | ||
133 | */ | ||
134 | ret = rtc_tm_to_time(tm, &now); | ||
135 | if (ret == 0) | ||
136 | out_be32(®s->target_time, now - in_be32(®s->actual_time)); | ||
137 | |||
138 | /* | ||
139 | * update second minute hour registers | ||
140 | * so alarms will work | ||
141 | */ | ||
142 | mpc5121_rtc_update_smh(regs, tm); | ||
143 | |||
144 | return 0; | ||
145 | } | ||
146 | |||
147 | static int mpc5121_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) | ||
148 | { | ||
149 | struct mpc5121_rtc_data *rtc = dev_get_drvdata(dev); | ||
150 | struct mpc5121_rtc_regs __iomem *regs = rtc->regs; | ||
151 | |||
152 | *alarm = rtc->wkalarm; | ||
153 | |||
154 | alarm->pending = in_8(®s->alm_status); | ||
155 | |||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | static int mpc5121_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) | ||
160 | { | ||
161 | struct mpc5121_rtc_data *rtc = dev_get_drvdata(dev); | ||
162 | struct mpc5121_rtc_regs __iomem *regs = rtc->regs; | ||
163 | |||
164 | /* | ||
165 | * the alarm has no seconds so deal with it | ||
166 | */ | ||
167 | if (alarm->time.tm_sec) { | ||
168 | alarm->time.tm_sec = 0; | ||
169 | alarm->time.tm_min++; | ||
170 | if (alarm->time.tm_min >= 60) { | ||
171 | alarm->time.tm_min = 0; | ||
172 | alarm->time.tm_hour++; | ||
173 | if (alarm->time.tm_hour >= 24) | ||
174 | alarm->time.tm_hour = 0; | ||
175 | } | ||
176 | } | ||
177 | |||
178 | alarm->time.tm_mday = -1; | ||
179 | alarm->time.tm_mon = -1; | ||
180 | alarm->time.tm_year = -1; | ||
181 | |||
182 | out_8(®s->alm_min_set, alarm->time.tm_min); | ||
183 | out_8(®s->alm_hour_set, alarm->time.tm_hour); | ||
184 | |||
185 | out_8(®s->alm_enable, alarm->enabled); | ||
186 | |||
187 | rtc->wkalarm = *alarm; | ||
188 | return 0; | ||
189 | } | ||
190 | |||
191 | static irqreturn_t mpc5121_rtc_handler(int irq, void *dev) | ||
192 | { | ||
193 | struct mpc5121_rtc_data *rtc = dev_get_drvdata((struct device *)dev); | ||
194 | struct mpc5121_rtc_regs __iomem *regs = rtc->regs; | ||
195 | |||
196 | if (in_8(®s->int_alm)) { | ||
197 | /* acknowledge and clear status */ | ||
198 | out_8(®s->int_alm, 1); | ||
199 | out_8(®s->alm_status, 1); | ||
200 | |||
201 | rtc_update_irq(rtc->rtc, 1, RTC_IRQF | RTC_AF); | ||
202 | return IRQ_HANDLED; | ||
203 | } | ||
204 | |||
205 | return IRQ_NONE; | ||
206 | } | ||
207 | |||
208 | static irqreturn_t mpc5121_rtc_handler_upd(int irq, void *dev) | ||
209 | { | ||
210 | struct mpc5121_rtc_data *rtc = dev_get_drvdata((struct device *)dev); | ||
211 | struct mpc5121_rtc_regs __iomem *regs = rtc->regs; | ||
212 | |||
213 | if (in_8(®s->int_sec) && (in_8(®s->int_enable) & 0x1)) { | ||
214 | /* acknowledge */ | ||
215 | out_8(®s->int_sec, 1); | ||
216 | |||
217 | rtc_update_irq(rtc->rtc, 1, RTC_IRQF | RTC_UF); | ||
218 | return IRQ_HANDLED; | ||
219 | } | ||
220 | |||
221 | return IRQ_NONE; | ||
222 | } | ||
223 | |||
224 | static int mpc5121_rtc_alarm_irq_enable(struct device *dev, | ||
225 | unsigned int enabled) | ||
226 | { | ||
227 | struct mpc5121_rtc_data *rtc = dev_get_drvdata(dev); | ||
228 | struct mpc5121_rtc_regs __iomem *regs = rtc->regs; | ||
229 | int val; | ||
230 | |||
231 | if (enabled) | ||
232 | val = 1; | ||
233 | else | ||
234 | val = 0; | ||
235 | |||
236 | out_8(®s->alm_enable, val); | ||
237 | rtc->wkalarm.enabled = val; | ||
238 | |||
239 | return 0; | ||
240 | } | ||
241 | |||
242 | static int mpc5121_rtc_update_irq_enable(struct device *dev, | ||
243 | unsigned int enabled) | ||
244 | { | ||
245 | struct mpc5121_rtc_data *rtc = dev_get_drvdata(dev); | ||
246 | struct mpc5121_rtc_regs __iomem *regs = rtc->regs; | ||
247 | int val; | ||
248 | |||
249 | val = in_8(®s->int_enable); | ||
250 | |||
251 | if (enabled) | ||
252 | val = (val & ~0x8) | 0x1; | ||
253 | else | ||
254 | val &= ~0x1; | ||
255 | |||
256 | out_8(®s->int_enable, val); | ||
257 | |||
258 | return 0; | ||
259 | } | ||
260 | |||
261 | static const struct rtc_class_ops mpc5121_rtc_ops = { | ||
262 | .read_time = mpc5121_rtc_read_time, | ||
263 | .set_time = mpc5121_rtc_set_time, | ||
264 | .read_alarm = mpc5121_rtc_read_alarm, | ||
265 | .set_alarm = mpc5121_rtc_set_alarm, | ||
266 | .alarm_irq_enable = mpc5121_rtc_alarm_irq_enable, | ||
267 | .update_irq_enable = mpc5121_rtc_update_irq_enable, | ||
268 | }; | ||
269 | |||
270 | static int __devinit mpc5121_rtc_probe(struct of_device *op, | ||
271 | const struct of_device_id *match) | ||
272 | { | ||
273 | struct mpc5121_rtc_data *rtc; | ||
274 | int err = 0; | ||
275 | u32 ka; | ||
276 | |||
277 | rtc = kzalloc(sizeof(*rtc), GFP_KERNEL); | ||
278 | if (!rtc) | ||
279 | return -ENOMEM; | ||
280 | |||
281 | rtc->regs = of_iomap(op->node, 0); | ||
282 | if (!rtc->regs) { | ||
283 | dev_err(&op->dev, "%s: couldn't map io space\n", __func__); | ||
284 | err = -ENOSYS; | ||
285 | goto out_free; | ||
286 | } | ||
287 | |||
288 | device_init_wakeup(&op->dev, 1); | ||
289 | |||
290 | dev_set_drvdata(&op->dev, rtc); | ||
291 | |||
292 | rtc->irq = irq_of_parse_and_map(op->node, 1); | ||
293 | err = request_irq(rtc->irq, mpc5121_rtc_handler, IRQF_DISABLED, | ||
294 | "mpc5121-rtc", &op->dev); | ||
295 | if (err) { | ||
296 | dev_err(&op->dev, "%s: could not request irq: %i\n", | ||
297 | __func__, rtc->irq); | ||
298 | goto out_dispose; | ||
299 | } | ||
300 | |||
301 | rtc->irq_periodic = irq_of_parse_and_map(op->node, 0); | ||
302 | err = request_irq(rtc->irq_periodic, mpc5121_rtc_handler_upd, | ||
303 | IRQF_DISABLED, "mpc5121-rtc_upd", &op->dev); | ||
304 | if (err) { | ||
305 | dev_err(&op->dev, "%s: could not request irq: %i\n", | ||
306 | __func__, rtc->irq_periodic); | ||
307 | goto out_dispose2; | ||
308 | } | ||
309 | |||
310 | ka = in_be32(&rtc->regs->keep_alive); | ||
311 | if (ka & 0x02) { | ||
312 | dev_warn(&op->dev, | ||
313 | "mpc5121-rtc: Battery or oscillator failure!\n"); | ||
314 | out_be32(&rtc->regs->keep_alive, ka); | ||
315 | } | ||
316 | |||
317 | rtc->rtc = rtc_device_register("mpc5121-rtc", &op->dev, | ||
318 | &mpc5121_rtc_ops, THIS_MODULE); | ||
319 | if (IS_ERR(rtc->rtc)) { | ||
320 | err = PTR_ERR(rtc->rtc); | ||
321 | goto out_free_irq; | ||
322 | } | ||
323 | |||
324 | return 0; | ||
325 | |||
326 | out_free_irq: | ||
327 | free_irq(rtc->irq_periodic, &op->dev); | ||
328 | out_dispose2: | ||
329 | irq_dispose_mapping(rtc->irq_periodic); | ||
330 | free_irq(rtc->irq, &op->dev); | ||
331 | out_dispose: | ||
332 | irq_dispose_mapping(rtc->irq); | ||
333 | iounmap(rtc->regs); | ||
334 | out_free: | ||
335 | kfree(rtc); | ||
336 | |||
337 | return err; | ||
338 | } | ||
339 | |||
340 | static int __devexit mpc5121_rtc_remove(struct of_device *op) | ||
341 | { | ||
342 | struct mpc5121_rtc_data *rtc = dev_get_drvdata(&op->dev); | ||
343 | struct mpc5121_rtc_regs __iomem *regs = rtc->regs; | ||
344 | |||
345 | /* disable interrupt, so there are no nasty surprises */ | ||
346 | out_8(®s->alm_enable, 0); | ||
347 | out_8(®s->int_enable, in_8(®s->int_enable) & ~0x1); | ||
348 | |||
349 | rtc_device_unregister(rtc->rtc); | ||
350 | iounmap(rtc->regs); | ||
351 | free_irq(rtc->irq, &op->dev); | ||
352 | free_irq(rtc->irq_periodic, &op->dev); | ||
353 | irq_dispose_mapping(rtc->irq); | ||
354 | irq_dispose_mapping(rtc->irq_periodic); | ||
355 | dev_set_drvdata(&op->dev, NULL); | ||
356 | kfree(rtc); | ||
357 | |||
358 | return 0; | ||
359 | } | ||
360 | |||
361 | static struct of_device_id mpc5121_rtc_match[] __devinitdata = { | ||
362 | { .compatible = "fsl,mpc5121-rtc", }, | ||
363 | {}, | ||
364 | }; | ||
365 | |||
366 | static struct of_platform_driver mpc5121_rtc_driver = { | ||
367 | .owner = THIS_MODULE, | ||
368 | .name = "mpc5121-rtc", | ||
369 | .match_table = mpc5121_rtc_match, | ||
370 | .probe = mpc5121_rtc_probe, | ||
371 | .remove = __devexit_p(mpc5121_rtc_remove), | ||
372 | }; | ||
373 | |||
374 | static int __init mpc5121_rtc_init(void) | ||
375 | { | ||
376 | return of_register_platform_driver(&mpc5121_rtc_driver); | ||
377 | } | ||
378 | module_init(mpc5121_rtc_init); | ||
379 | |||
380 | static void __exit mpc5121_rtc_exit(void) | ||
381 | { | ||
382 | of_unregister_platform_driver(&mpc5121_rtc_driver); | ||
383 | } | ||
384 | module_exit(mpc5121_rtc_exit); | ||
385 | |||
386 | MODULE_LICENSE("GPL"); | ||
387 | MODULE_AUTHOR("John Rigby <jcrigby@gmail.com>"); | ||
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 7ce9e9f567a3..3119fddaedb5 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
@@ -74,6 +74,7 @@ | |||
74 | #include <linux/io.h> | 74 | #include <linux/io.h> |
75 | #include <linux/of.h> | 75 | #include <linux/of.h> |
76 | #include <linux/of_platform.h> | 76 | #include <linux/of_platform.h> |
77 | #include <linux/clk.h> | ||
77 | 78 | ||
78 | #include <asm/mpc52xx.h> | 79 | #include <asm/mpc52xx.h> |
79 | #include <asm/mpc52xx_psc.h> | 80 | #include <asm/mpc52xx_psc.h> |
@@ -113,6 +114,7 @@ static void mpc52xx_uart_of_enumerate(void); | |||
113 | 114 | ||
114 | /* Forward declaration of the interruption handling routine */ | 115 | /* Forward declaration of the interruption handling routine */ |
115 | static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id); | 116 | static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id); |
117 | static irqreturn_t mpc5xxx_uart_process_int(struct uart_port *port); | ||
116 | 118 | ||
117 | 119 | ||
118 | /* Simple macro to test if a port is console or not. This one is taken | 120 | /* Simple macro to test if a port is console or not. This one is taken |
@@ -145,6 +147,11 @@ struct psc_ops { | |||
145 | void (*cw_disable_ints)(struct uart_port *port); | 147 | void (*cw_disable_ints)(struct uart_port *port); |
146 | void (*cw_restore_ints)(struct uart_port *port); | 148 | void (*cw_restore_ints)(struct uart_port *port); |
147 | unsigned long (*getuartclk)(void *p); | 149 | unsigned long (*getuartclk)(void *p); |
150 | int (*clock)(struct uart_port *port, int enable); | ||
151 | int (*fifoc_init)(void); | ||
152 | void (*fifoc_uninit)(void); | ||
153 | void (*get_irq)(struct uart_port *, struct device_node *); | ||
154 | irqreturn_t (*handle_irq)(struct uart_port *port); | ||
148 | }; | 155 | }; |
149 | 156 | ||
150 | #ifdef CONFIG_PPC_MPC52xx | 157 | #ifdef CONFIG_PPC_MPC52xx |
@@ -256,6 +263,18 @@ static unsigned long mpc52xx_getuartclk(void *p) | |||
256 | return mpc5xxx_get_bus_frequency(p) / 2; | 263 | return mpc5xxx_get_bus_frequency(p) / 2; |
257 | } | 264 | } |
258 | 265 | ||
266 | static void mpc52xx_psc_get_irq(struct uart_port *port, struct device_node *np) | ||
267 | { | ||
268 | port->irqflags = IRQF_DISABLED; | ||
269 | port->irq = irq_of_parse_and_map(np, 0); | ||
270 | } | ||
271 | |||
272 | /* 52xx specific interrupt handler. The caller holds the port lock */ | ||
273 | static irqreturn_t mpc52xx_psc_handle_irq(struct uart_port *port) | ||
274 | { | ||
275 | return mpc5xxx_uart_process_int(port); | ||
276 | } | ||
277 | |||
259 | static struct psc_ops mpc52xx_psc_ops = { | 278 | static struct psc_ops mpc52xx_psc_ops = { |
260 | .fifo_init = mpc52xx_psc_fifo_init, | 279 | .fifo_init = mpc52xx_psc_fifo_init, |
261 | .raw_rx_rdy = mpc52xx_psc_raw_rx_rdy, | 280 | .raw_rx_rdy = mpc52xx_psc_raw_rx_rdy, |
@@ -273,14 +292,32 @@ static struct psc_ops mpc52xx_psc_ops = { | |||
273 | .cw_disable_ints = mpc52xx_psc_cw_disable_ints, | 292 | .cw_disable_ints = mpc52xx_psc_cw_disable_ints, |
274 | .cw_restore_ints = mpc52xx_psc_cw_restore_ints, | 293 | .cw_restore_ints = mpc52xx_psc_cw_restore_ints, |
275 | .getuartclk = mpc52xx_getuartclk, | 294 | .getuartclk = mpc52xx_getuartclk, |
295 | .get_irq = mpc52xx_psc_get_irq, | ||
296 | .handle_irq = mpc52xx_psc_handle_irq, | ||
276 | }; | 297 | }; |
277 | 298 | ||
278 | #endif /* CONFIG_MPC52xx */ | 299 | #endif /* CONFIG_MPC52xx */ |
279 | 300 | ||
280 | #ifdef CONFIG_PPC_MPC512x | 301 | #ifdef CONFIG_PPC_MPC512x |
281 | #define FIFO_512x(port) ((struct mpc512x_psc_fifo __iomem *)(PSC(port)+1)) | 302 | #define FIFO_512x(port) ((struct mpc512x_psc_fifo __iomem *)(PSC(port)+1)) |
303 | |||
304 | /* PSC FIFO Controller for mpc512x */ | ||
305 | struct psc_fifoc { | ||
306 | u32 fifoc_cmd; | ||
307 | u32 fifoc_int; | ||
308 | u32 fifoc_dma; | ||
309 | u32 fifoc_axe; | ||
310 | u32 fifoc_debug; | ||
311 | }; | ||
312 | |||
313 | static struct psc_fifoc __iomem *psc_fifoc; | ||
314 | static unsigned int psc_fifoc_irq; | ||
315 | |||
282 | static void mpc512x_psc_fifo_init(struct uart_port *port) | 316 | static void mpc512x_psc_fifo_init(struct uart_port *port) |
283 | { | 317 | { |
318 | /* /32 prescaler */ | ||
319 | out_be16(&PSC(port)->mpc52xx_psc_clock_select, 0xdd00); | ||
320 | |||
284 | out_be32(&FIFO_512x(port)->txcmd, MPC512x_PSC_FIFO_RESET_SLICE); | 321 | out_be32(&FIFO_512x(port)->txcmd, MPC512x_PSC_FIFO_RESET_SLICE); |
285 | out_be32(&FIFO_512x(port)->txcmd, MPC512x_PSC_FIFO_ENABLE_SLICE); | 322 | out_be32(&FIFO_512x(port)->txcmd, MPC512x_PSC_FIFO_ENABLE_SLICE); |
286 | out_be32(&FIFO_512x(port)->txalarm, 1); | 323 | out_be32(&FIFO_512x(port)->txalarm, 1); |
@@ -393,6 +430,160 @@ static unsigned long mpc512x_getuartclk(void *p) | |||
393 | return mpc5xxx_get_bus_frequency(p); | 430 | return mpc5xxx_get_bus_frequency(p); |
394 | } | 431 | } |
395 | 432 | ||
433 | #define DEFAULT_FIFO_SIZE 16 | ||
434 | |||
435 | static unsigned int __init get_fifo_size(struct device_node *np, | ||
436 | char *fifo_name) | ||
437 | { | ||
438 | const unsigned int *fp; | ||
439 | |||
440 | fp = of_get_property(np, fifo_name, NULL); | ||
441 | if (fp) | ||
442 | return *fp; | ||
443 | |||
444 | pr_warning("no %s property in %s node, defaulting to %d\n", | ||
445 | fifo_name, np->full_name, DEFAULT_FIFO_SIZE); | ||
446 | |||
447 | return DEFAULT_FIFO_SIZE; | ||
448 | } | ||
449 | |||
450 | #define FIFOC(_base) ((struct mpc512x_psc_fifo __iomem *) \ | ||
451 | ((u32)(_base) + sizeof(struct mpc52xx_psc))) | ||
452 | |||
453 | /* Init PSC FIFO Controller */ | ||
454 | static int __init mpc512x_psc_fifoc_init(void) | ||
455 | { | ||
456 | struct device_node *np; | ||
457 | void __iomem *psc; | ||
458 | unsigned int tx_fifo_size; | ||
459 | unsigned int rx_fifo_size; | ||
460 | int fifobase = 0; /* current fifo address in 32 bit words */ | ||
461 | |||
462 | np = of_find_compatible_node(NULL, NULL, | ||
463 | "fsl,mpc5121-psc-fifo"); | ||
464 | if (!np) { | ||
465 | pr_err("%s: Can't find FIFOC node\n", __func__); | ||
466 | return -ENODEV; | ||
467 | } | ||
468 | |||
469 | psc_fifoc = of_iomap(np, 0); | ||
470 | if (!psc_fifoc) { | ||
471 | pr_err("%s: Can't map FIFOC\n", __func__); | ||
472 | return -ENODEV; | ||
473 | } | ||
474 | |||
475 | psc_fifoc_irq = irq_of_parse_and_map(np, 0); | ||
476 | of_node_put(np); | ||
477 | if (psc_fifoc_irq == NO_IRQ) { | ||
478 | pr_err("%s: Can't get FIFOC irq\n", __func__); | ||
479 | iounmap(psc_fifoc); | ||
480 | return -ENODEV; | ||
481 | } | ||
482 | |||
483 | for_each_compatible_node(np, NULL, "fsl,mpc5121-psc-uart") { | ||
484 | tx_fifo_size = get_fifo_size(np, "fsl,tx-fifo-size"); | ||
485 | rx_fifo_size = get_fifo_size(np, "fsl,rx-fifo-size"); | ||
486 | |||
487 | /* size in register is in 4 byte units */ | ||
488 | tx_fifo_size /= 4; | ||
489 | rx_fifo_size /= 4; | ||
490 | if (!tx_fifo_size) | ||
491 | tx_fifo_size = 1; | ||
492 | if (!rx_fifo_size) | ||
493 | rx_fifo_size = 1; | ||
494 | |||
495 | psc = of_iomap(np, 0); | ||
496 | if (!psc) { | ||
497 | pr_err("%s: Can't map %s device\n", | ||
498 | __func__, np->full_name); | ||
499 | continue; | ||
500 | } | ||
501 | |||
502 | /* FIFO space is 4KiB, check if requested size is available */ | ||
503 | if ((fifobase + tx_fifo_size + rx_fifo_size) > 0x1000) { | ||
504 | pr_err("%s: no fifo space available for %s\n", | ||
505 | __func__, np->full_name); | ||
506 | iounmap(psc); | ||
507 | /* | ||
508 | * chances are that another device requests less | ||
509 | * fifo space, so we continue. | ||
510 | */ | ||
511 | continue; | ||
512 | } | ||
513 | /* set tx and rx fifo size registers */ | ||
514 | out_be32(&FIFOC(psc)->txsz, (fifobase << 16) | tx_fifo_size); | ||
515 | fifobase += tx_fifo_size; | ||
516 | out_be32(&FIFOC(psc)->rxsz, (fifobase << 16) | rx_fifo_size); | ||
517 | fifobase += rx_fifo_size; | ||
518 | |||
519 | /* reset and enable the slices */ | ||
520 | out_be32(&FIFOC(psc)->txcmd, 0x80); | ||
521 | out_be32(&FIFOC(psc)->txcmd, 0x01); | ||
522 | out_be32(&FIFOC(psc)->rxcmd, 0x80); | ||
523 | out_be32(&FIFOC(psc)->rxcmd, 0x01); | ||
524 | |||
525 | iounmap(psc); | ||
526 | } | ||
527 | |||
528 | return 0; | ||
529 | } | ||
530 | |||
531 | static void __exit mpc512x_psc_fifoc_uninit(void) | ||
532 | { | ||
533 | iounmap(psc_fifoc); | ||
534 | } | ||
535 | |||
536 | /* 512x specific interrupt handler. The caller holds the port lock */ | ||
537 | static irqreturn_t mpc512x_psc_handle_irq(struct uart_port *port) | ||
538 | { | ||
539 | unsigned long fifoc_int; | ||
540 | int psc_num; | ||
541 | |||
542 | /* Read pending PSC FIFOC interrupts */ | ||
543 | fifoc_int = in_be32(&psc_fifoc->fifoc_int); | ||
544 | |||
545 | /* Check if it is an interrupt for this port */ | ||
546 | psc_num = (port->mapbase & 0xf00) >> 8; | ||
547 | if (test_bit(psc_num, &fifoc_int) || | ||
548 | test_bit(psc_num + 16, &fifoc_int)) | ||
549 | return mpc5xxx_uart_process_int(port); | ||
550 | |||
551 | return IRQ_NONE; | ||
552 | } | ||
553 | |||
554 | static int mpc512x_psc_clock(struct uart_port *port, int enable) | ||
555 | { | ||
556 | struct clk *psc_clk; | ||
557 | int psc_num; | ||
558 | char clk_name[10]; | ||
559 | |||
560 | if (uart_console(port)) | ||
561 | return 0; | ||
562 | |||
563 | psc_num = (port->mapbase & 0xf00) >> 8; | ||
564 | snprintf(clk_name, sizeof(clk_name), "psc%d_clk", psc_num); | ||
565 | psc_clk = clk_get(port->dev, clk_name); | ||
566 | if (IS_ERR(psc_clk)) { | ||
567 | dev_err(port->dev, "Failed to get PSC clock entry!\n"); | ||
568 | return -ENODEV; | ||
569 | } | ||
570 | |||
571 | dev_dbg(port->dev, "%s %sable\n", clk_name, enable ? "en" : "dis"); | ||
572 | |||
573 | if (enable) | ||
574 | clk_enable(psc_clk); | ||
575 | else | ||
576 | clk_disable(psc_clk); | ||
577 | |||
578 | return 0; | ||
579 | } | ||
580 | |||
581 | static void mpc512x_psc_get_irq(struct uart_port *port, struct device_node *np) | ||
582 | { | ||
583 | port->irqflags = IRQF_SHARED; | ||
584 | port->irq = psc_fifoc_irq; | ||
585 | } | ||
586 | |||
396 | static struct psc_ops mpc512x_psc_ops = { | 587 | static struct psc_ops mpc512x_psc_ops = { |
397 | .fifo_init = mpc512x_psc_fifo_init, | 588 | .fifo_init = mpc512x_psc_fifo_init, |
398 | .raw_rx_rdy = mpc512x_psc_raw_rx_rdy, | 589 | .raw_rx_rdy = mpc512x_psc_raw_rx_rdy, |
@@ -410,6 +601,11 @@ static struct psc_ops mpc512x_psc_ops = { | |||
410 | .cw_disable_ints = mpc512x_psc_cw_disable_ints, | 601 | .cw_disable_ints = mpc512x_psc_cw_disable_ints, |
411 | .cw_restore_ints = mpc512x_psc_cw_restore_ints, | 602 | .cw_restore_ints = mpc512x_psc_cw_restore_ints, |
412 | .getuartclk = mpc512x_getuartclk, | 603 | .getuartclk = mpc512x_getuartclk, |
604 | .clock = mpc512x_psc_clock, | ||
605 | .fifoc_init = mpc512x_psc_fifoc_init, | ||
606 | .fifoc_uninit = mpc512x_psc_fifoc_uninit, | ||
607 | .get_irq = mpc512x_psc_get_irq, | ||
608 | .handle_irq = mpc512x_psc_handle_irq, | ||
413 | }; | 609 | }; |
414 | #endif | 610 | #endif |
415 | 611 | ||
@@ -519,10 +715,15 @@ mpc52xx_uart_startup(struct uart_port *port) | |||
519 | struct mpc52xx_psc __iomem *psc = PSC(port); | 715 | struct mpc52xx_psc __iomem *psc = PSC(port); |
520 | int ret; | 716 | int ret; |
521 | 717 | ||
718 | if (psc_ops->clock) { | ||
719 | ret = psc_ops->clock(port, 1); | ||
720 | if (ret) | ||
721 | return ret; | ||
722 | } | ||
723 | |||
522 | /* Request IRQ */ | 724 | /* Request IRQ */ |
523 | ret = request_irq(port->irq, mpc52xx_uart_int, | 725 | ret = request_irq(port->irq, mpc52xx_uart_int, |
524 | IRQF_DISABLED | IRQF_SAMPLE_RANDOM, | 726 | port->irqflags, "mpc52xx_psc_uart", port); |
525 | "mpc52xx_psc_uart", port); | ||
526 | if (ret) | 727 | if (ret) |
527 | return ret; | 728 | return ret; |
528 | 729 | ||
@@ -553,6 +754,9 @@ mpc52xx_uart_shutdown(struct uart_port *port) | |||
553 | port->read_status_mask = 0; | 754 | port->read_status_mask = 0; |
554 | out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask); | 755 | out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask); |
555 | 756 | ||
757 | if (psc_ops->clock) | ||
758 | psc_ops->clock(port, 0); | ||
759 | |||
556 | /* Release interrupt */ | 760 | /* Release interrupt */ |
557 | free_irq(port->irq, port); | 761 | free_irq(port->irq, port); |
558 | } | 762 | } |
@@ -851,15 +1055,12 @@ mpc52xx_uart_int_tx_chars(struct uart_port *port) | |||
851 | } | 1055 | } |
852 | 1056 | ||
853 | static irqreturn_t | 1057 | static irqreturn_t |
854 | mpc52xx_uart_int(int irq, void *dev_id) | 1058 | mpc5xxx_uart_process_int(struct uart_port *port) |
855 | { | 1059 | { |
856 | struct uart_port *port = dev_id; | ||
857 | unsigned long pass = ISR_PASS_LIMIT; | 1060 | unsigned long pass = ISR_PASS_LIMIT; |
858 | unsigned int keepgoing; | 1061 | unsigned int keepgoing; |
859 | u8 status; | 1062 | u8 status; |
860 | 1063 | ||
861 | spin_lock(&port->lock); | ||
862 | |||
863 | /* While we have stuff to do, we continue */ | 1064 | /* While we have stuff to do, we continue */ |
864 | do { | 1065 | do { |
865 | /* If we don't find anything to do, we stop */ | 1066 | /* If we don't find anything to do, we stop */ |
@@ -886,11 +1087,23 @@ mpc52xx_uart_int(int irq, void *dev_id) | |||
886 | 1087 | ||
887 | } while (keepgoing); | 1088 | } while (keepgoing); |
888 | 1089 | ||
889 | spin_unlock(&port->lock); | ||
890 | |||
891 | return IRQ_HANDLED; | 1090 | return IRQ_HANDLED; |
892 | } | 1091 | } |
893 | 1092 | ||
1093 | static irqreturn_t | ||
1094 | mpc52xx_uart_int(int irq, void *dev_id) | ||
1095 | { | ||
1096 | struct uart_port *port = dev_id; | ||
1097 | irqreturn_t ret; | ||
1098 | |||
1099 | spin_lock(&port->lock); | ||
1100 | |||
1101 | ret = psc_ops->handle_irq(port); | ||
1102 | |||
1103 | spin_unlock(&port->lock); | ||
1104 | |||
1105 | return ret; | ||
1106 | } | ||
894 | 1107 | ||
895 | /* ======================================================================== */ | 1108 | /* ======================================================================== */ |
896 | /* Console ( if applicable ) */ | 1109 | /* Console ( if applicable ) */ |
@@ -1152,7 +1365,7 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1152 | return -EINVAL; | 1365 | return -EINVAL; |
1153 | } | 1366 | } |
1154 | 1367 | ||
1155 | port->irq = irq_of_parse_and_map(op->node, 0); | 1368 | psc_ops->get_irq(port, op->node); |
1156 | if (port->irq == NO_IRQ) { | 1369 | if (port->irq == NO_IRQ) { |
1157 | dev_dbg(&op->dev, "Could not get irq\n"); | 1370 | dev_dbg(&op->dev, "Could not get irq\n"); |
1158 | return -EINVAL; | 1371 | return -EINVAL; |
@@ -1163,10 +1376,8 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1163 | 1376 | ||
1164 | /* Add the port to the uart sub-system */ | 1377 | /* Add the port to the uart sub-system */ |
1165 | ret = uart_add_one_port(&mpc52xx_uart_driver, port); | 1378 | ret = uart_add_one_port(&mpc52xx_uart_driver, port); |
1166 | if (ret) { | 1379 | if (ret) |
1167 | irq_dispose_mapping(port->irq); | ||
1168 | return ret; | 1380 | return ret; |
1169 | } | ||
1170 | 1381 | ||
1171 | dev_set_drvdata(&op->dev, (void *)port); | 1382 | dev_set_drvdata(&op->dev, (void *)port); |
1172 | return 0; | 1383 | return 0; |
@@ -1178,10 +1389,8 @@ mpc52xx_uart_of_remove(struct of_device *op) | |||
1178 | struct uart_port *port = dev_get_drvdata(&op->dev); | 1389 | struct uart_port *port = dev_get_drvdata(&op->dev); |
1179 | dev_set_drvdata(&op->dev, NULL); | 1390 | dev_set_drvdata(&op->dev, NULL); |
1180 | 1391 | ||
1181 | if (port) { | 1392 | if (port) |
1182 | uart_remove_one_port(&mpc52xx_uart_driver, port); | 1393 | uart_remove_one_port(&mpc52xx_uart_driver, port); |
1183 | irq_dispose_mapping(port->irq); | ||
1184 | } | ||
1185 | 1394 | ||
1186 | return 0; | 1395 | return 0; |
1187 | } | 1396 | } |
@@ -1288,6 +1497,15 @@ mpc52xx_uart_init(void) | |||
1288 | 1497 | ||
1289 | mpc52xx_uart_of_enumerate(); | 1498 | mpc52xx_uart_of_enumerate(); |
1290 | 1499 | ||
1500 | /* | ||
1501 | * Map the PSC FIFO Controller and init if on MPC512x. | ||
1502 | */ | ||
1503 | if (psc_ops->fifoc_init) { | ||
1504 | ret = psc_ops->fifoc_init(); | ||
1505 | if (ret) | ||
1506 | return ret; | ||
1507 | } | ||
1508 | |||
1291 | ret = of_register_platform_driver(&mpc52xx_uart_of_driver); | 1509 | ret = of_register_platform_driver(&mpc52xx_uart_of_driver); |
1292 | if (ret) { | 1510 | if (ret) { |
1293 | printk(KERN_ERR "%s: of_register_platform_driver failed (%i)\n", | 1511 | printk(KERN_ERR "%s: of_register_platform_driver failed (%i)\n", |
@@ -1302,6 +1520,9 @@ mpc52xx_uart_init(void) | |||
1302 | static void __exit | 1520 | static void __exit |
1303 | mpc52xx_uart_exit(void) | 1521 | mpc52xx_uart_exit(void) |
1304 | { | 1522 | { |
1523 | if (psc_ops->fifoc_uninit) | ||
1524 | psc_ops->fifoc_uninit(); | ||
1525 | |||
1305 | of_unregister_platform_driver(&mpc52xx_uart_of_driver); | 1526 | of_unregister_platform_driver(&mpc52xx_uart_of_driver); |
1306 | uart_unregister_driver(&mpc52xx_uart_driver); | 1527 | uart_unregister_driver(&mpc52xx_uart_driver); |
1307 | } | 1528 | } |
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index 72d68b3dc478..4637bcbe03a4 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
@@ -1633,6 +1633,11 @@ static int __init fsl_diu_setup(char *options) | |||
1633 | #endif | 1633 | #endif |
1634 | 1634 | ||
1635 | static struct of_device_id fsl_diu_match[] = { | 1635 | static struct of_device_id fsl_diu_match[] = { |
1636 | #ifdef CONFIG_PPC_MPC512x | ||
1637 | { | ||
1638 | .compatible = "fsl,mpc5121-diu", | ||
1639 | }, | ||
1640 | #endif | ||
1636 | { | 1641 | { |
1637 | .compatible = "fsl,diu", | 1642 | .compatible = "fsl,diu", |
1638 | }, | 1643 | }, |