diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/mfd/tc6393xb.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/mfd/tc6393xb.c')
-rw-r--r-- | drivers/mfd/tc6393xb.c | 74 |
1 files changed, 29 insertions, 45 deletions
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c index ef6c42c8917a..9612264f0e6d 100644 --- a/drivers/mfd/tc6393xb.c +++ b/drivers/mfd/tc6393xb.c | |||
@@ -155,7 +155,7 @@ static struct resource __devinitdata tc6393xb_nand_resources[] = { | |||
155 | }, | 155 | }, |
156 | }; | 156 | }; |
157 | 157 | ||
158 | static struct resource __devinitdata tc6393xb_mmc_resources[] = { | 158 | static struct resource tc6393xb_mmc_resources[] = { |
159 | { | 159 | { |
160 | .start = 0x800, | 160 | .start = 0x800, |
161 | .end = 0x9ff, | 161 | .end = 0x9ff, |
@@ -393,7 +393,8 @@ static struct mfd_cell __devinitdata tc6393xb_cells[] = { | |||
393 | .name = "tmio-mmc", | 393 | .name = "tmio-mmc", |
394 | .enable = tc6393xb_mmc_enable, | 394 | .enable = tc6393xb_mmc_enable, |
395 | .resume = tc6393xb_mmc_resume, | 395 | .resume = tc6393xb_mmc_resume, |
396 | .driver_data = &tc6393xb_mmc_data, | 396 | .platform_data = &tc6393xb_mmc_data, |
397 | .pdata_size = sizeof(tc6393xb_mmc_data), | ||
397 | .num_resources = ARRAY_SIZE(tc6393xb_mmc_resources), | 398 | .num_resources = ARRAY_SIZE(tc6393xb_mmc_resources), |
398 | .resources = tc6393xb_mmc_resources, | 399 | .resources = tc6393xb_mmc_resources, |
399 | }, | 400 | }, |
@@ -513,7 +514,7 @@ static int tc6393xb_register_gpio(struct tc6393xb *tc6393xb, int gpio_base) | |||
513 | static void | 514 | static void |
514 | tc6393xb_irq(unsigned int irq, struct irq_desc *desc) | 515 | tc6393xb_irq(unsigned int irq, struct irq_desc *desc) |
515 | { | 516 | { |
516 | struct tc6393xb *tc6393xb = get_irq_data(irq); | 517 | struct tc6393xb *tc6393xb = irq_get_handler_data(irq); |
517 | unsigned int isr; | 518 | unsigned int isr; |
518 | unsigned int i, irq_base; | 519 | unsigned int i, irq_base; |
519 | 520 | ||
@@ -527,41 +528,41 @@ tc6393xb_irq(unsigned int irq, struct irq_desc *desc) | |||
527 | } | 528 | } |
528 | } | 529 | } |
529 | 530 | ||
530 | static void tc6393xb_irq_ack(unsigned int irq) | 531 | static void tc6393xb_irq_ack(struct irq_data *data) |
531 | { | 532 | { |
532 | } | 533 | } |
533 | 534 | ||
534 | static void tc6393xb_irq_mask(unsigned int irq) | 535 | static void tc6393xb_irq_mask(struct irq_data *data) |
535 | { | 536 | { |
536 | struct tc6393xb *tc6393xb = get_irq_chip_data(irq); | 537 | struct tc6393xb *tc6393xb = irq_data_get_irq_chip_data(data); |
537 | unsigned long flags; | 538 | unsigned long flags; |
538 | u8 imr; | 539 | u8 imr; |
539 | 540 | ||
540 | spin_lock_irqsave(&tc6393xb->lock, flags); | 541 | spin_lock_irqsave(&tc6393xb->lock, flags); |
541 | imr = tmio_ioread8(tc6393xb->scr + SCR_IMR); | 542 | imr = tmio_ioread8(tc6393xb->scr + SCR_IMR); |
542 | imr |= 1 << (irq - tc6393xb->irq_base); | 543 | imr |= 1 << (data->irq - tc6393xb->irq_base); |
543 | tmio_iowrite8(imr, tc6393xb->scr + SCR_IMR); | 544 | tmio_iowrite8(imr, tc6393xb->scr + SCR_IMR); |
544 | spin_unlock_irqrestore(&tc6393xb->lock, flags); | 545 | spin_unlock_irqrestore(&tc6393xb->lock, flags); |
545 | } | 546 | } |
546 | 547 | ||
547 | static void tc6393xb_irq_unmask(unsigned int irq) | 548 | static void tc6393xb_irq_unmask(struct irq_data *data) |
548 | { | 549 | { |
549 | struct tc6393xb *tc6393xb = get_irq_chip_data(irq); | 550 | struct tc6393xb *tc6393xb = irq_data_get_irq_chip_data(data); |
550 | unsigned long flags; | 551 | unsigned long flags; |
551 | u8 imr; | 552 | u8 imr; |
552 | 553 | ||
553 | spin_lock_irqsave(&tc6393xb->lock, flags); | 554 | spin_lock_irqsave(&tc6393xb->lock, flags); |
554 | imr = tmio_ioread8(tc6393xb->scr + SCR_IMR); | 555 | imr = tmio_ioread8(tc6393xb->scr + SCR_IMR); |
555 | imr &= ~(1 << (irq - tc6393xb->irq_base)); | 556 | imr &= ~(1 << (data->irq - tc6393xb->irq_base)); |
556 | tmio_iowrite8(imr, tc6393xb->scr + SCR_IMR); | 557 | tmio_iowrite8(imr, tc6393xb->scr + SCR_IMR); |
557 | spin_unlock_irqrestore(&tc6393xb->lock, flags); | 558 | spin_unlock_irqrestore(&tc6393xb->lock, flags); |
558 | } | 559 | } |
559 | 560 | ||
560 | static struct irq_chip tc6393xb_chip = { | 561 | static struct irq_chip tc6393xb_chip = { |
561 | .name = "tc6393xb", | 562 | .name = "tc6393xb", |
562 | .ack = tc6393xb_irq_ack, | 563 | .irq_ack = tc6393xb_irq_ack, |
563 | .mask = tc6393xb_irq_mask, | 564 | .irq_mask = tc6393xb_irq_mask, |
564 | .unmask = tc6393xb_irq_unmask, | 565 | .irq_unmask = tc6393xb_irq_unmask, |
565 | }; | 566 | }; |
566 | 567 | ||
567 | static void tc6393xb_attach_irq(struct platform_device *dev) | 568 | static void tc6393xb_attach_irq(struct platform_device *dev) |
@@ -572,15 +573,14 @@ static void tc6393xb_attach_irq(struct platform_device *dev) | |||
572 | irq_base = tc6393xb->irq_base; | 573 | irq_base = tc6393xb->irq_base; |
573 | 574 | ||
574 | for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) { | 575 | for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) { |
575 | set_irq_chip(irq, &tc6393xb_chip); | 576 | irq_set_chip_and_handler(irq, &tc6393xb_chip, handle_edge_irq); |
576 | set_irq_chip_data(irq, tc6393xb); | 577 | irq_set_chip_data(irq, tc6393xb); |
577 | set_irq_handler(irq, handle_edge_irq); | ||
578 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 578 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); |
579 | } | 579 | } |
580 | 580 | ||
581 | set_irq_type(tc6393xb->irq, IRQ_TYPE_EDGE_FALLING); | 581 | irq_set_irq_type(tc6393xb->irq, IRQ_TYPE_EDGE_FALLING); |
582 | set_irq_data(tc6393xb->irq, tc6393xb); | 582 | irq_set_handler_data(tc6393xb->irq, tc6393xb); |
583 | set_irq_chained_handler(tc6393xb->irq, tc6393xb_irq); | 583 | irq_set_chained_handler(tc6393xb->irq, tc6393xb_irq); |
584 | } | 584 | } |
585 | 585 | ||
586 | static void tc6393xb_detach_irq(struct platform_device *dev) | 586 | static void tc6393xb_detach_irq(struct platform_device *dev) |
@@ -588,15 +588,15 @@ static void tc6393xb_detach_irq(struct platform_device *dev) | |||
588 | struct tc6393xb *tc6393xb = platform_get_drvdata(dev); | 588 | struct tc6393xb *tc6393xb = platform_get_drvdata(dev); |
589 | unsigned int irq, irq_base; | 589 | unsigned int irq, irq_base; |
590 | 590 | ||
591 | set_irq_chained_handler(tc6393xb->irq, NULL); | 591 | irq_set_chained_handler(tc6393xb->irq, NULL); |
592 | set_irq_data(tc6393xb->irq, NULL); | 592 | irq_set_handler_data(tc6393xb->irq, NULL); |
593 | 593 | ||
594 | irq_base = tc6393xb->irq_base; | 594 | irq_base = tc6393xb->irq_base; |
595 | 595 | ||
596 | for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) { | 596 | for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) { |
597 | set_irq_flags(irq, 0); | 597 | set_irq_flags(irq, 0); |
598 | set_irq_chip(irq, NULL); | 598 | irq_set_chip(irq, NULL); |
599 | set_irq_chip_data(irq, NULL); | 599 | irq_set_chip_data(irq, NULL); |
600 | } | 600 | } |
601 | } | 601 | } |
602 | 602 | ||
@@ -693,27 +693,11 @@ static int __devinit tc6393xb_probe(struct platform_device *dev) | |||
693 | goto err_setup; | 693 | goto err_setup; |
694 | } | 694 | } |
695 | 695 | ||
696 | tc6393xb_cells[TC6393XB_CELL_NAND].driver_data = tcpd->nand_data; | 696 | tc6393xb_cells[TC6393XB_CELL_NAND].platform_data = tcpd->nand_data; |
697 | tc6393xb_cells[TC6393XB_CELL_NAND].platform_data = | 697 | tc6393xb_cells[TC6393XB_CELL_NAND].pdata_size = |
698 | &tc6393xb_cells[TC6393XB_CELL_NAND]; | 698 | sizeof(*tcpd->nand_data); |
699 | tc6393xb_cells[TC6393XB_CELL_NAND].data_size = | 699 | tc6393xb_cells[TC6393XB_CELL_FB].platform_data = tcpd->fb_data; |
700 | sizeof(tc6393xb_cells[TC6393XB_CELL_NAND]); | 700 | tc6393xb_cells[TC6393XB_CELL_FB].pdata_size = sizeof(*tcpd->fb_data); |
701 | |||
702 | tc6393xb_cells[TC6393XB_CELL_MMC].platform_data = | ||
703 | &tc6393xb_cells[TC6393XB_CELL_MMC]; | ||
704 | tc6393xb_cells[TC6393XB_CELL_MMC].data_size = | ||
705 | sizeof(tc6393xb_cells[TC6393XB_CELL_MMC]); | ||
706 | |||
707 | tc6393xb_cells[TC6393XB_CELL_OHCI].platform_data = | ||
708 | &tc6393xb_cells[TC6393XB_CELL_OHCI]; | ||
709 | tc6393xb_cells[TC6393XB_CELL_OHCI].data_size = | ||
710 | sizeof(tc6393xb_cells[TC6393XB_CELL_OHCI]); | ||
711 | |||
712 | tc6393xb_cells[TC6393XB_CELL_FB].driver_data = tcpd->fb_data; | ||
713 | tc6393xb_cells[TC6393XB_CELL_FB].platform_data = | ||
714 | &tc6393xb_cells[TC6393XB_CELL_FB]; | ||
715 | tc6393xb_cells[TC6393XB_CELL_FB].data_size = | ||
716 | sizeof(tc6393xb_cells[TC6393XB_CELL_FB]); | ||
717 | 701 | ||
718 | ret = mfd_add_devices(&dev->dev, dev->id, | 702 | ret = mfd_add_devices(&dev->dev, dev->id, |
719 | tc6393xb_cells, ARRAY_SIZE(tc6393xb_cells), | 703 | tc6393xb_cells, ARRAY_SIZE(tc6393xb_cells), |