diff options
Diffstat (limited to 'arch/blackfin/mach-common/ints-priority.c')
-rw-r--r-- | arch/blackfin/mach-common/ints-priority.c | 92 |
1 files changed, 48 insertions, 44 deletions
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index 2d9720ca916c..8e9d3cc30885 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c | |||
@@ -567,16 +567,17 @@ extern void bfin_gpio_irq_prepare(unsigned gpio); | |||
567 | 567 | ||
568 | #if !defined(CONFIG_BF54x) | 568 | #if !defined(CONFIG_BF54x) |
569 | 569 | ||
570 | static void bfin_gpio_ack_irq(unsigned int irq) | 570 | static void bfin_gpio_ack_irq(struct irq_data *d) |
571 | { | 571 | { |
572 | /* AFAIK ack_irq in case mask_ack is provided | 572 | /* AFAIK ack_irq in case mask_ack is provided |
573 | * get's only called for edge sense irqs | 573 | * get's only called for edge sense irqs |
574 | */ | 574 | */ |
575 | set_gpio_data(irq_to_gpio(irq), 0); | 575 | set_gpio_data(irq_to_gpio(d->irq), 0); |
576 | } | 576 | } |
577 | 577 | ||
578 | static void bfin_gpio_mask_ack_irq(unsigned int irq) | 578 | static void bfin_gpio_mask_ack_irq(struct irq_data *d) |
579 | { | 579 | { |
580 | unsigned int irq = d->irq; | ||
580 | struct irq_desc *desc = irq_to_desc(irq); | 581 | struct irq_desc *desc = irq_to_desc(irq); |
581 | u32 gpionr = irq_to_gpio(irq); | 582 | u32 gpionr = irq_to_gpio(irq); |
582 | 583 | ||
@@ -586,39 +587,40 @@ static void bfin_gpio_mask_ack_irq(unsigned int irq) | |||
586 | set_gpio_maska(gpionr, 0); | 587 | set_gpio_maska(gpionr, 0); |
587 | } | 588 | } |
588 | 589 | ||
589 | static void bfin_gpio_mask_irq(unsigned int irq) | 590 | static void bfin_gpio_mask_irq(struct irq_data *d) |
590 | { | 591 | { |
591 | set_gpio_maska(irq_to_gpio(irq), 0); | 592 | set_gpio_maska(irq_to_gpio(d->irq), 0); |
592 | } | 593 | } |
593 | 594 | ||
594 | static void bfin_gpio_unmask_irq(unsigned int irq) | 595 | static void bfin_gpio_unmask_irq(struct irq_data *d) |
595 | { | 596 | { |
596 | set_gpio_maska(irq_to_gpio(irq), 1); | 597 | set_gpio_maska(irq_to_gpio(d->irq), 1); |
597 | } | 598 | } |
598 | 599 | ||
599 | static unsigned int bfin_gpio_irq_startup(unsigned int irq) | 600 | static unsigned int bfin_gpio_irq_startup(struct irq_data *d) |
600 | { | 601 | { |
601 | u32 gpionr = irq_to_gpio(irq); | 602 | u32 gpionr = irq_to_gpio(d->irq); |
602 | 603 | ||
603 | if (__test_and_set_bit(gpionr, gpio_enabled)) | 604 | if (__test_and_set_bit(gpionr, gpio_enabled)) |
604 | bfin_gpio_irq_prepare(gpionr); | 605 | bfin_gpio_irq_prepare(gpionr); |
605 | 606 | ||
606 | bfin_gpio_unmask_irq(irq); | 607 | bfin_gpio_unmask_irq(d); |
607 | 608 | ||
608 | return 0; | 609 | return 0; |
609 | } | 610 | } |
610 | 611 | ||
611 | static void bfin_gpio_irq_shutdown(unsigned int irq) | 612 | static void bfin_gpio_irq_shutdown(struct irq_data *d) |
612 | { | 613 | { |
613 | u32 gpionr = irq_to_gpio(irq); | 614 | u32 gpionr = irq_to_gpio(d->irq); |
614 | 615 | ||
615 | bfin_gpio_mask_irq(irq); | 616 | bfin_gpio_mask_irq(d); |
616 | __clear_bit(gpionr, gpio_enabled); | 617 | __clear_bit(gpionr, gpio_enabled); |
617 | bfin_gpio_irq_free(gpionr); | 618 | bfin_gpio_irq_free(gpionr); |
618 | } | 619 | } |
619 | 620 | ||
620 | static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) | 621 | static int bfin_gpio_irq_type(struct irq_data *d, unsigned int type) |
621 | { | 622 | { |
623 | unsigned int irq = d->irq; | ||
622 | int ret; | 624 | int ret; |
623 | char buf[16]; | 625 | char buf[16]; |
624 | u32 gpionr = irq_to_gpio(irq); | 626 | u32 gpionr = irq_to_gpio(irq); |
@@ -679,9 +681,9 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) | |||
679 | } | 681 | } |
680 | 682 | ||
681 | #ifdef CONFIG_PM | 683 | #ifdef CONFIG_PM |
682 | int bfin_gpio_set_wake(unsigned int irq, unsigned int state) | 684 | int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) |
683 | { | 685 | { |
684 | return gpio_pm_wakeup_ctrl(irq_to_gpio(irq), state); | 686 | return gpio_pm_wakeup_ctrl(irq_to_gpio(d->irq), state); |
685 | } | 687 | } |
686 | #endif | 688 | #endif |
687 | 689 | ||
@@ -833,10 +835,10 @@ void init_pint_lut(void) | |||
833 | } | 835 | } |
834 | } | 836 | } |
835 | 837 | ||
836 | static void bfin_gpio_ack_irq(unsigned int irq) | 838 | static void bfin_gpio_ack_irq(struct irq_data *d) |
837 | { | 839 | { |
838 | struct irq_desc *desc = irq_to_desc(irq); | 840 | struct irq_desc *desc = irq_to_desc(d->irq); |
839 | u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; | 841 | u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; |
840 | u32 pintbit = PINT_BIT(pint_val); | 842 | u32 pintbit = PINT_BIT(pint_val); |
841 | u32 bank = PINT_2_BANK(pint_val); | 843 | u32 bank = PINT_2_BANK(pint_val); |
842 | 844 | ||
@@ -850,10 +852,10 @@ static void bfin_gpio_ack_irq(unsigned int irq) | |||
850 | 852 | ||
851 | } | 853 | } |
852 | 854 | ||
853 | static void bfin_gpio_mask_ack_irq(unsigned int irq) | 855 | static void bfin_gpio_mask_ack_irq(struct irq_data *d) |
854 | { | 856 | { |
855 | struct irq_desc *desc = irq_to_desc(irq); | 857 | struct irq_desc *desc = irq_to_desc(d->irq); |
856 | u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; | 858 | u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; |
857 | u32 pintbit = PINT_BIT(pint_val); | 859 | u32 pintbit = PINT_BIT(pint_val); |
858 | u32 bank = PINT_2_BANK(pint_val); | 860 | u32 bank = PINT_2_BANK(pint_val); |
859 | 861 | ||
@@ -868,24 +870,25 @@ static void bfin_gpio_mask_ack_irq(unsigned int irq) | |||
868 | pint[bank]->mask_clear = pintbit; | 870 | pint[bank]->mask_clear = pintbit; |
869 | } | 871 | } |
870 | 872 | ||
871 | static void bfin_gpio_mask_irq(unsigned int irq) | 873 | static void bfin_gpio_mask_irq(struct irq_data *d) |
872 | { | 874 | { |
873 | u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; | 875 | u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; |
874 | 876 | ||
875 | pint[PINT_2_BANK(pint_val)]->mask_clear = PINT_BIT(pint_val); | 877 | pint[PINT_2_BANK(pint_val)]->mask_clear = PINT_BIT(pint_val); |
876 | } | 878 | } |
877 | 879 | ||
878 | static void bfin_gpio_unmask_irq(unsigned int irq) | 880 | static void bfin_gpio_unmask_irq(struct irq_data *d) |
879 | { | 881 | { |
880 | u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; | 882 | u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; |
881 | u32 pintbit = PINT_BIT(pint_val); | 883 | u32 pintbit = PINT_BIT(pint_val); |
882 | u32 bank = PINT_2_BANK(pint_val); | 884 | u32 bank = PINT_2_BANK(pint_val); |
883 | 885 | ||
884 | pint[bank]->mask_set = pintbit; | 886 | pint[bank]->mask_set = pintbit; |
885 | } | 887 | } |
886 | 888 | ||
887 | static unsigned int bfin_gpio_irq_startup(unsigned int irq) | 889 | static unsigned int bfin_gpio_irq_startup(struct irq_data *d) |
888 | { | 890 | { |
891 | unsigned int irq = d->irq; | ||
889 | u32 gpionr = irq_to_gpio(irq); | 892 | u32 gpionr = irq_to_gpio(irq); |
890 | u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; | 893 | u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; |
891 | 894 | ||
@@ -899,22 +902,23 @@ static unsigned int bfin_gpio_irq_startup(unsigned int irq) | |||
899 | if (__test_and_set_bit(gpionr, gpio_enabled)) | 902 | if (__test_and_set_bit(gpionr, gpio_enabled)) |
900 | bfin_gpio_irq_prepare(gpionr); | 903 | bfin_gpio_irq_prepare(gpionr); |
901 | 904 | ||
902 | bfin_gpio_unmask_irq(irq); | 905 | bfin_gpio_unmask_irq(d); |
903 | 906 | ||
904 | return 0; | 907 | return 0; |
905 | } | 908 | } |
906 | 909 | ||
907 | static void bfin_gpio_irq_shutdown(unsigned int irq) | 910 | static void bfin_gpio_irq_shutdown(struct irq_data *d) |
908 | { | 911 | { |
909 | u32 gpionr = irq_to_gpio(irq); | 912 | u32 gpionr = irq_to_gpio(d->irq); |
910 | 913 | ||
911 | bfin_gpio_mask_irq(irq); | 914 | bfin_gpio_mask_irq(d); |
912 | __clear_bit(gpionr, gpio_enabled); | 915 | __clear_bit(gpionr, gpio_enabled); |
913 | bfin_gpio_irq_free(gpionr); | 916 | bfin_gpio_irq_free(gpionr); |
914 | } | 917 | } |
915 | 918 | ||
916 | static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) | 919 | static int bfin_gpio_irq_type(struct irq_data *d, unsigned int type) |
917 | { | 920 | { |
921 | unsigned int irq = d->irq; | ||
918 | int ret; | 922 | int ret; |
919 | char buf[16]; | 923 | char buf[16]; |
920 | u32 gpionr = irq_to_gpio(irq); | 924 | u32 gpionr = irq_to_gpio(irq); |
@@ -976,10 +980,10 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) | |||
976 | u32 pint_saved_masks[NR_PINT_SYS_IRQS]; | 980 | u32 pint_saved_masks[NR_PINT_SYS_IRQS]; |
977 | u32 pint_wakeup_masks[NR_PINT_SYS_IRQS]; | 981 | u32 pint_wakeup_masks[NR_PINT_SYS_IRQS]; |
978 | 982 | ||
979 | int bfin_gpio_set_wake(unsigned int irq, unsigned int state) | 983 | int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) |
980 | { | 984 | { |
981 | u32 pint_irq; | 985 | u32 pint_irq; |
982 | u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; | 986 | u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; |
983 | u32 bank = PINT_2_BANK(pint_val); | 987 | u32 bank = PINT_2_BANK(pint_val); |
984 | u32 pintbit = PINT_BIT(pint_val); | 988 | u32 pintbit = PINT_BIT(pint_val); |
985 | 989 | ||
@@ -1081,17 +1085,17 @@ static void bfin_demux_gpio_irq(unsigned int inta_irq, | |||
1081 | 1085 | ||
1082 | static struct irq_chip bfin_gpio_irqchip = { | 1086 | static struct irq_chip bfin_gpio_irqchip = { |
1083 | .name = "GPIO", | 1087 | .name = "GPIO", |
1084 | .ack = bfin_gpio_ack_irq, | 1088 | .irq_ack = bfin_gpio_ack_irq, |
1085 | .mask = bfin_gpio_mask_irq, | 1089 | .irq_mask = bfin_gpio_mask_irq, |
1086 | .mask_ack = bfin_gpio_mask_ack_irq, | 1090 | .irq_mask_ack = bfin_gpio_mask_ack_irq, |
1087 | .unmask = bfin_gpio_unmask_irq, | 1091 | .irq_unmask = bfin_gpio_unmask_irq, |
1088 | .disable = bfin_gpio_mask_irq, | 1092 | .irq_disable = bfin_gpio_mask_irq, |
1089 | .enable = bfin_gpio_unmask_irq, | 1093 | .irq_enable = bfin_gpio_unmask_irq, |
1090 | .set_type = bfin_gpio_irq_type, | 1094 | .irq_set_type = bfin_gpio_irq_type, |
1091 | .startup = bfin_gpio_irq_startup, | 1095 | .irq_startup = bfin_gpio_irq_startup, |
1092 | .shutdown = bfin_gpio_irq_shutdown, | 1096 | .irq_shutdown = bfin_gpio_irq_shutdown, |
1093 | #ifdef CONFIG_PM | 1097 | #ifdef CONFIG_PM |
1094 | .set_wake = bfin_gpio_set_wake, | 1098 | .irq_set_wake = bfin_gpio_set_wake, |
1095 | #endif | 1099 | #endif |
1096 | }; | 1100 | }; |
1097 | 1101 | ||