diff options
author | Yi Li <yi.li@analog.com> | 2009-01-07 10:14:39 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2009-01-07 10:14:39 -0500 |
commit | 6a01f230339321292cf065551f8cf55361052461 (patch) | |
tree | 7ac2ac8fc9f05a7315ef6a7f6f0a387433c62c14 /arch/blackfin/kernel/bfin_gpio.c | |
parent | 5105432a3201e3f0e6c219cd0a74feee1e5e262b (diff) |
Blackfin arch: merge adeos blackfin part to arch/blackfin/
[Mike Frysinger <vapier.adi@gmail.com>:
- handle bf531/bf532/bf534/bf536 variants in ipipe.h
- cleanup IPIPE logic for bfin_set_irq_handler()
- cleanup ipipe asm code a bit and add missing ENDPROC()
- simplify IPIPE code in trap_c
- unify some of the IPIPE code and fix style
- simplify DO_IRQ_L1 handling with ipipe code
- revert IRQ_SW_INT# addition from ipipe merge
- remove duplicate get_{c,s}clk() prototypes
]
Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/bfin_gpio.c')
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index 2c72b15b71b0..4c14331978f6 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c | |||
@@ -422,13 +422,13 @@ arch_initcall(bfin_gpio_init); | |||
422 | void set_gpio_ ## name(unsigned gpio, unsigned short arg) \ | 422 | void set_gpio_ ## name(unsigned gpio, unsigned short arg) \ |
423 | { \ | 423 | { \ |
424 | unsigned long flags; \ | 424 | unsigned long flags; \ |
425 | local_irq_save(flags); \ | 425 | local_irq_save_hw(flags); \ |
426 | if (arg) \ | 426 | if (arg) \ |
427 | gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \ | 427 | gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \ |
428 | else \ | 428 | else \ |
429 | gpio_bankb[gpio_bank(gpio)]->name &= ~gpio_bit(gpio); \ | 429 | gpio_bankb[gpio_bank(gpio)]->name &= ~gpio_bit(gpio); \ |
430 | AWA_DUMMY_READ(name); \ | 430 | AWA_DUMMY_READ(name); \ |
431 | local_irq_restore(flags); \ | 431 | local_irq_restore_hw(flags); \ |
432 | } \ | 432 | } \ |
433 | EXPORT_SYMBOL(set_gpio_ ## name); | 433 | EXPORT_SYMBOL(set_gpio_ ## name); |
434 | 434 | ||
@@ -444,13 +444,13 @@ SET_GPIO(both) | |||
444 | void set_gpio_ ## name(unsigned gpio, unsigned short arg) \ | 444 | void set_gpio_ ## name(unsigned gpio, unsigned short arg) \ |
445 | { \ | 445 | { \ |
446 | unsigned long flags; \ | 446 | unsigned long flags; \ |
447 | local_irq_save(flags); \ | 447 | local_irq_save_hw(flags); \ |
448 | if (arg) \ | 448 | if (arg) \ |
449 | gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \ | 449 | gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \ |
450 | else \ | 450 | else \ |
451 | gpio_bankb[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \ | 451 | gpio_bankb[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \ |
452 | AWA_DUMMY_READ(name); \ | 452 | AWA_DUMMY_READ(name); \ |
453 | local_irq_restore(flags); \ | 453 | local_irq_restore_hw(flags); \ |
454 | } \ | 454 | } \ |
455 | EXPORT_SYMBOL(set_gpio_ ## name); | 455 | EXPORT_SYMBOL(set_gpio_ ## name); |
456 | #else | 456 | #else |
@@ -473,10 +473,10 @@ SET_GPIO_SC(data) | |||
473 | void set_gpio_toggle(unsigned gpio) | 473 | void set_gpio_toggle(unsigned gpio) |
474 | { | 474 | { |
475 | unsigned long flags; | 475 | unsigned long flags; |
476 | local_irq_save(flags); | 476 | local_irq_save_hw(flags); |
477 | gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); | 477 | gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); |
478 | AWA_DUMMY_READ(toggle); | 478 | AWA_DUMMY_READ(toggle); |
479 | local_irq_restore(flags); | 479 | local_irq_restore_hw(flags); |
480 | } | 480 | } |
481 | #else | 481 | #else |
482 | void set_gpio_toggle(unsigned gpio) | 482 | void set_gpio_toggle(unsigned gpio) |
@@ -494,10 +494,10 @@ EXPORT_SYMBOL(set_gpio_toggle); | |||
494 | void set_gpiop_ ## name(unsigned gpio, unsigned short arg) \ | 494 | void set_gpiop_ ## name(unsigned gpio, unsigned short arg) \ |
495 | { \ | 495 | { \ |
496 | unsigned long flags; \ | 496 | unsigned long flags; \ |
497 | local_irq_save(flags); \ | 497 | local_irq_save_hw(flags); \ |
498 | gpio_bankb[gpio_bank(gpio)]->name = arg; \ | 498 | gpio_bankb[gpio_bank(gpio)]->name = arg; \ |
499 | AWA_DUMMY_READ(name); \ | 499 | AWA_DUMMY_READ(name); \ |
500 | local_irq_restore(flags); \ | 500 | local_irq_restore_hw(flags); \ |
501 | } \ | 501 | } \ |
502 | EXPORT_SYMBOL(set_gpiop_ ## name); | 502 | EXPORT_SYMBOL(set_gpiop_ ## name); |
503 | #else | 503 | #else |
@@ -525,10 +525,10 @@ unsigned short get_gpio_ ## name(unsigned gpio) \ | |||
525 | { \ | 525 | { \ |
526 | unsigned long flags; \ | 526 | unsigned long flags; \ |
527 | unsigned short ret; \ | 527 | unsigned short ret; \ |
528 | local_irq_save(flags); \ | 528 | local_irq_save_hw(flags); \ |
529 | ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio)); \ | 529 | ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio)); \ |
530 | AWA_DUMMY_READ(name); \ | 530 | AWA_DUMMY_READ(name); \ |
531 | local_irq_restore(flags); \ | 531 | local_irq_restore_hw(flags); \ |
532 | return ret; \ | 532 | return ret; \ |
533 | } \ | 533 | } \ |
534 | EXPORT_SYMBOL(get_gpio_ ## name); | 534 | EXPORT_SYMBOL(get_gpio_ ## name); |
@@ -558,10 +558,10 @@ unsigned short get_gpiop_ ## name(unsigned gpio) \ | |||
558 | { \ | 558 | { \ |
559 | unsigned long flags; \ | 559 | unsigned long flags; \ |
560 | unsigned short ret; \ | 560 | unsigned short ret; \ |
561 | local_irq_save(flags); \ | 561 | local_irq_save_hw(flags); \ |
562 | ret = (gpio_bankb[gpio_bank(gpio)]->name); \ | 562 | ret = (gpio_bankb[gpio_bank(gpio)]->name); \ |
563 | AWA_DUMMY_READ(name); \ | 563 | AWA_DUMMY_READ(name); \ |
564 | local_irq_restore(flags); \ | 564 | local_irq_restore_hw(flags); \ |
565 | return ret; \ | 565 | return ret; \ |
566 | } \ | 566 | } \ |
567 | EXPORT_SYMBOL(get_gpiop_ ## name); | 567 | EXPORT_SYMBOL(get_gpiop_ ## name); |
@@ -611,10 +611,10 @@ int gpio_pm_wakeup_request(unsigned gpio, unsigned char type) | |||
611 | if ((check_gpio(gpio) < 0) || !type) | 611 | if ((check_gpio(gpio) < 0) || !type) |
612 | return -EINVAL; | 612 | return -EINVAL; |
613 | 613 | ||
614 | local_irq_save(flags); | 614 | local_irq_save_hw(flags); |
615 | wakeup_map[gpio_bank(gpio)] |= gpio_bit(gpio); | 615 | wakeup_map[gpio_bank(gpio)] |= gpio_bit(gpio); |
616 | wakeup_flags_map[gpio] = type; | 616 | wakeup_flags_map[gpio] = type; |
617 | local_irq_restore(flags); | 617 | local_irq_restore_hw(flags); |
618 | 618 | ||
619 | return 0; | 619 | return 0; |
620 | } | 620 | } |
@@ -627,11 +627,11 @@ void gpio_pm_wakeup_free(unsigned gpio) | |||
627 | if (check_gpio(gpio) < 0) | 627 | if (check_gpio(gpio) < 0) |
628 | return; | 628 | return; |
629 | 629 | ||
630 | local_irq_save(flags); | 630 | local_irq_save_hw(flags); |
631 | 631 | ||
632 | wakeup_map[gpio_bank(gpio)] &= ~gpio_bit(gpio); | 632 | wakeup_map[gpio_bank(gpio)] &= ~gpio_bit(gpio); |
633 | 633 | ||
634 | local_irq_restore(flags); | 634 | local_irq_restore_hw(flags); |
635 | } | 635 | } |
636 | EXPORT_SYMBOL(gpio_pm_wakeup_free); | 636 | EXPORT_SYMBOL(gpio_pm_wakeup_free); |
637 | 637 | ||
@@ -882,7 +882,7 @@ int peripheral_request(unsigned short per, const char *label) | |||
882 | if (!(per & P_DEFINED)) | 882 | if (!(per & P_DEFINED)) |
883 | return -ENODEV; | 883 | return -ENODEV; |
884 | 884 | ||
885 | local_irq_save(flags); | 885 | local_irq_save_hw(flags); |
886 | 886 | ||
887 | /* If a pin can be muxed as either GPIO or peripheral, make | 887 | /* If a pin can be muxed as either GPIO or peripheral, make |
888 | * sure it is not already a GPIO pin when we request it. | 888 | * sure it is not already a GPIO pin when we request it. |
@@ -893,7 +893,7 @@ int peripheral_request(unsigned short per, const char *label) | |||
893 | printk(KERN_ERR | 893 | printk(KERN_ERR |
894 | "%s: Peripheral %d is already reserved as GPIO by %s !\n", | 894 | "%s: Peripheral %d is already reserved as GPIO by %s !\n", |
895 | __func__, ident, get_label(ident)); | 895 | __func__, ident, get_label(ident)); |
896 | local_irq_restore(flags); | 896 | local_irq_restore_hw(flags); |
897 | return -EBUSY; | 897 | return -EBUSY; |
898 | } | 898 | } |
899 | 899 | ||
@@ -923,7 +923,7 @@ int peripheral_request(unsigned short per, const char *label) | |||
923 | printk(KERN_ERR | 923 | printk(KERN_ERR |
924 | "%s: Peripheral %d function %d is already reserved by %s !\n", | 924 | "%s: Peripheral %d function %d is already reserved by %s !\n", |
925 | __func__, ident, P_FUNCT2MUX(per), get_label(ident)); | 925 | __func__, ident, P_FUNCT2MUX(per), get_label(ident)); |
926 | local_irq_restore(flags); | 926 | local_irq_restore_hw(flags); |
927 | return -EBUSY; | 927 | return -EBUSY; |
928 | } | 928 | } |
929 | } | 929 | } |
@@ -938,7 +938,7 @@ int peripheral_request(unsigned short per, const char *label) | |||
938 | #endif | 938 | #endif |
939 | port_setup(ident, PERIPHERAL_USAGE); | 939 | port_setup(ident, PERIPHERAL_USAGE); |
940 | 940 | ||
941 | local_irq_restore(flags); | 941 | local_irq_restore_hw(flags); |
942 | set_label(ident, label); | 942 | set_label(ident, label); |
943 | 943 | ||
944 | return 0; | 944 | return 0; |
@@ -980,10 +980,10 @@ void peripheral_free(unsigned short per) | |||
980 | if (check_gpio(ident) < 0) | 980 | if (check_gpio(ident) < 0) |
981 | return; | 981 | return; |
982 | 982 | ||
983 | local_irq_save(flags); | 983 | local_irq_save_hw(flags); |
984 | 984 | ||
985 | if (unlikely(!(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident)))) { | 985 | if (unlikely(!(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident)))) { |
986 | local_irq_restore(flags); | 986 | local_irq_restore_hw(flags); |
987 | return; | 987 | return; |
988 | } | 988 | } |
989 | 989 | ||
@@ -994,7 +994,7 @@ void peripheral_free(unsigned short per) | |||
994 | 994 | ||
995 | set_label(ident, "free"); | 995 | set_label(ident, "free"); |
996 | 996 | ||
997 | local_irq_restore(flags); | 997 | local_irq_restore_hw(flags); |
998 | } | 998 | } |
999 | EXPORT_SYMBOL(peripheral_free); | 999 | EXPORT_SYMBOL(peripheral_free); |
1000 | 1000 | ||
@@ -1028,7 +1028,7 @@ int bfin_gpio_request(unsigned gpio, const char *label) | |||
1028 | if (check_gpio(gpio) < 0) | 1028 | if (check_gpio(gpio) < 0) |
1029 | return -EINVAL; | 1029 | return -EINVAL; |
1030 | 1030 | ||
1031 | local_irq_save(flags); | 1031 | local_irq_save_hw(flags); |
1032 | 1032 | ||
1033 | /* | 1033 | /* |
1034 | * Allow that the identical GPIO can | 1034 | * Allow that the identical GPIO can |
@@ -1037,7 +1037,7 @@ int bfin_gpio_request(unsigned gpio, const char *label) | |||
1037 | */ | 1037 | */ |
1038 | 1038 | ||
1039 | if (cmp_label(gpio, label) == 0) { | 1039 | if (cmp_label(gpio, label) == 0) { |
1040 | local_irq_restore(flags); | 1040 | local_irq_restore_hw(flags); |
1041 | return 0; | 1041 | return 0; |
1042 | } | 1042 | } |
1043 | 1043 | ||
@@ -1045,7 +1045,7 @@ int bfin_gpio_request(unsigned gpio, const char *label) | |||
1045 | dump_stack(); | 1045 | dump_stack(); |
1046 | printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n", | 1046 | printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n", |
1047 | gpio, get_label(gpio)); | 1047 | gpio, get_label(gpio)); |
1048 | local_irq_restore(flags); | 1048 | local_irq_restore_hw(flags); |
1049 | return -EBUSY; | 1049 | return -EBUSY; |
1050 | } | 1050 | } |
1051 | if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) { | 1051 | if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) { |
@@ -1053,7 +1053,7 @@ int bfin_gpio_request(unsigned gpio, const char *label) | |||
1053 | printk(KERN_ERR | 1053 | printk(KERN_ERR |
1054 | "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n", | 1054 | "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n", |
1055 | gpio, get_label(gpio)); | 1055 | gpio, get_label(gpio)); |
1056 | local_irq_restore(flags); | 1056 | local_irq_restore_hw(flags); |
1057 | return -EBUSY; | 1057 | return -EBUSY; |
1058 | } | 1058 | } |
1059 | if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio))) | 1059 | if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio))) |
@@ -1063,7 +1063,7 @@ int bfin_gpio_request(unsigned gpio, const char *label) | |||
1063 | reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio); | 1063 | reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio); |
1064 | set_label(gpio, label); | 1064 | set_label(gpio, label); |
1065 | 1065 | ||
1066 | local_irq_restore(flags); | 1066 | local_irq_restore_hw(flags); |
1067 | 1067 | ||
1068 | port_setup(gpio, GPIO_USAGE); | 1068 | port_setup(gpio, GPIO_USAGE); |
1069 | 1069 | ||
@@ -1078,12 +1078,12 @@ void bfin_gpio_free(unsigned gpio) | |||
1078 | if (check_gpio(gpio) < 0) | 1078 | if (check_gpio(gpio) < 0) |
1079 | return; | 1079 | return; |
1080 | 1080 | ||
1081 | local_irq_save(flags); | 1081 | local_irq_save_hw(flags); |
1082 | 1082 | ||
1083 | if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { | 1083 | if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { |
1084 | dump_stack(); | 1084 | dump_stack(); |
1085 | gpio_error(gpio); | 1085 | gpio_error(gpio); |
1086 | local_irq_restore(flags); | 1086 | local_irq_restore_hw(flags); |
1087 | return; | 1087 | return; |
1088 | } | 1088 | } |
1089 | 1089 | ||
@@ -1091,7 +1091,7 @@ void bfin_gpio_free(unsigned gpio) | |||
1091 | 1091 | ||
1092 | set_label(gpio, "free"); | 1092 | set_label(gpio, "free"); |
1093 | 1093 | ||
1094 | local_irq_restore(flags); | 1094 | local_irq_restore_hw(flags); |
1095 | } | 1095 | } |
1096 | EXPORT_SYMBOL(bfin_gpio_free); | 1096 | EXPORT_SYMBOL(bfin_gpio_free); |
1097 | 1097 | ||
@@ -1102,14 +1102,14 @@ int bfin_gpio_irq_request(unsigned gpio, const char *label) | |||
1102 | if (check_gpio(gpio) < 0) | 1102 | if (check_gpio(gpio) < 0) |
1103 | return -EINVAL; | 1103 | return -EINVAL; |
1104 | 1104 | ||
1105 | local_irq_save(flags); | 1105 | local_irq_save_hw(flags); |
1106 | 1106 | ||
1107 | if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio))) { | 1107 | if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio))) { |
1108 | dump_stack(); | 1108 | dump_stack(); |
1109 | printk(KERN_ERR | 1109 | printk(KERN_ERR |
1110 | "bfin-gpio: GPIO %d is already reserved as gpio-irq !\n", | 1110 | "bfin-gpio: GPIO %d is already reserved as gpio-irq !\n", |
1111 | gpio); | 1111 | gpio); |
1112 | local_irq_restore(flags); | 1112 | local_irq_restore_hw(flags); |
1113 | return -EBUSY; | 1113 | return -EBUSY; |
1114 | } | 1114 | } |
1115 | if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) { | 1115 | if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) { |
@@ -1117,7 +1117,7 @@ int bfin_gpio_irq_request(unsigned gpio, const char *label) | |||
1117 | printk(KERN_ERR | 1117 | printk(KERN_ERR |
1118 | "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n", | 1118 | "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n", |
1119 | gpio, get_label(gpio)); | 1119 | gpio, get_label(gpio)); |
1120 | local_irq_restore(flags); | 1120 | local_irq_restore_hw(flags); |
1121 | return -EBUSY; | 1121 | return -EBUSY; |
1122 | } | 1122 | } |
1123 | if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) | 1123 | if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) |
@@ -1128,7 +1128,7 @@ int bfin_gpio_irq_request(unsigned gpio, const char *label) | |||
1128 | reserved_gpio_irq_map[gpio_bank(gpio)] |= gpio_bit(gpio); | 1128 | reserved_gpio_irq_map[gpio_bank(gpio)] |= gpio_bit(gpio); |
1129 | set_label(gpio, label); | 1129 | set_label(gpio, label); |
1130 | 1130 | ||
1131 | local_irq_restore(flags); | 1131 | local_irq_restore_hw(flags); |
1132 | 1132 | ||
1133 | port_setup(gpio, GPIO_USAGE); | 1133 | port_setup(gpio, GPIO_USAGE); |
1134 | 1134 | ||
@@ -1142,12 +1142,12 @@ void bfin_gpio_irq_free(unsigned gpio) | |||
1142 | if (check_gpio(gpio) < 0) | 1142 | if (check_gpio(gpio) < 0) |
1143 | return; | 1143 | return; |
1144 | 1144 | ||
1145 | local_irq_save(flags); | 1145 | local_irq_save_hw(flags); |
1146 | 1146 | ||
1147 | if (unlikely(!(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { | 1147 | if (unlikely(!(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { |
1148 | dump_stack(); | 1148 | dump_stack(); |
1149 | gpio_error(gpio); | 1149 | gpio_error(gpio); |
1150 | local_irq_restore(flags); | 1150 | local_irq_restore_hw(flags); |
1151 | return; | 1151 | return; |
1152 | } | 1152 | } |
1153 | 1153 | ||
@@ -1155,7 +1155,7 @@ void bfin_gpio_irq_free(unsigned gpio) | |||
1155 | 1155 | ||
1156 | set_label(gpio, "free"); | 1156 | set_label(gpio, "free"); |
1157 | 1157 | ||
1158 | local_irq_restore(flags); | 1158 | local_irq_restore_hw(flags); |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | 1161 | ||
@@ -1169,10 +1169,10 @@ int bfin_gpio_direction_input(unsigned gpio) | |||
1169 | return -EINVAL; | 1169 | return -EINVAL; |
1170 | } | 1170 | } |
1171 | 1171 | ||
1172 | local_irq_save(flags); | 1172 | local_irq_save_hw(flags); |
1173 | gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio); | 1173 | gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio); |
1174 | gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio); | 1174 | gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio); |
1175 | local_irq_restore(flags); | 1175 | local_irq_restore_hw(flags); |
1176 | 1176 | ||
1177 | return 0; | 1177 | return 0; |
1178 | } | 1178 | } |
@@ -1187,11 +1187,11 @@ int bfin_gpio_direction_output(unsigned gpio, int value) | |||
1187 | return -EINVAL; | 1187 | return -EINVAL; |
1188 | } | 1188 | } |
1189 | 1189 | ||
1190 | local_irq_save(flags); | 1190 | local_irq_save_hw(flags); |
1191 | gpio_array[gpio_bank(gpio)]->port_inen &= ~gpio_bit(gpio); | 1191 | gpio_array[gpio_bank(gpio)]->port_inen &= ~gpio_bit(gpio); |
1192 | gpio_set_value(gpio, value); | 1192 | gpio_set_value(gpio, value); |
1193 | gpio_array[gpio_bank(gpio)]->port_dir_set = gpio_bit(gpio); | 1193 | gpio_array[gpio_bank(gpio)]->port_dir_set = gpio_bit(gpio); |
1194 | local_irq_restore(flags); | 1194 | local_irq_restore_hw(flags); |
1195 | 1195 | ||
1196 | return 0; | 1196 | return 0; |
1197 | } | 1197 | } |
@@ -1218,10 +1218,10 @@ void bfin_gpio_irq_prepare(unsigned gpio) | |||
1218 | 1218 | ||
1219 | port_setup(gpio, GPIO_USAGE); | 1219 | port_setup(gpio, GPIO_USAGE); |
1220 | 1220 | ||
1221 | local_irq_save(flags); | 1221 | local_irq_save_hw(flags); |
1222 | gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio); | 1222 | gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio); |
1223 | gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio); | 1223 | gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio); |
1224 | local_irq_restore(flags); | 1224 | local_irq_restore_hw(flags); |
1225 | } | 1225 | } |
1226 | 1226 | ||
1227 | #else | 1227 | #else |
@@ -1232,11 +1232,11 @@ int bfin_gpio_get_value(unsigned gpio) | |||
1232 | int ret; | 1232 | int ret; |
1233 | 1233 | ||
1234 | if (unlikely(get_gpio_edge(gpio))) { | 1234 | if (unlikely(get_gpio_edge(gpio))) { |
1235 | local_irq_save(flags); | 1235 | local_irq_save_hw(flags); |
1236 | set_gpio_edge(gpio, 0); | 1236 | set_gpio_edge(gpio, 0); |
1237 | ret = get_gpio_data(gpio); | 1237 | ret = get_gpio_data(gpio); |
1238 | set_gpio_edge(gpio, 1); | 1238 | set_gpio_edge(gpio, 1); |
1239 | local_irq_restore(flags); | 1239 | local_irq_restore_hw(flags); |
1240 | 1240 | ||
1241 | return ret; | 1241 | return ret; |
1242 | } else | 1242 | } else |
@@ -1254,11 +1254,11 @@ int bfin_gpio_direction_input(unsigned gpio) | |||
1254 | return -EINVAL; | 1254 | return -EINVAL; |
1255 | } | 1255 | } |
1256 | 1256 | ||
1257 | local_irq_save(flags); | 1257 | local_irq_save_hw(flags); |
1258 | gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); | 1258 | gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); |
1259 | gpio_bankb[gpio_bank(gpio)]->inen |= gpio_bit(gpio); | 1259 | gpio_bankb[gpio_bank(gpio)]->inen |= gpio_bit(gpio); |
1260 | AWA_DUMMY_READ(inen); | 1260 | AWA_DUMMY_READ(inen); |
1261 | local_irq_restore(flags); | 1261 | local_irq_restore_hw(flags); |
1262 | 1262 | ||
1263 | return 0; | 1263 | return 0; |
1264 | } | 1264 | } |
@@ -1273,7 +1273,7 @@ int bfin_gpio_direction_output(unsigned gpio, int value) | |||
1273 | return -EINVAL; | 1273 | return -EINVAL; |
1274 | } | 1274 | } |
1275 | 1275 | ||
1276 | local_irq_save(flags); | 1276 | local_irq_save_hw(flags); |
1277 | gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); | 1277 | gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); |
1278 | 1278 | ||
1279 | if (value) | 1279 | if (value) |
@@ -1283,7 +1283,7 @@ int bfin_gpio_direction_output(unsigned gpio, int value) | |||
1283 | 1283 | ||
1284 | gpio_bankb[gpio_bank(gpio)]->dir |= gpio_bit(gpio); | 1284 | gpio_bankb[gpio_bank(gpio)]->dir |= gpio_bit(gpio); |
1285 | AWA_DUMMY_READ(dir); | 1285 | AWA_DUMMY_READ(dir); |
1286 | local_irq_restore(flags); | 1286 | local_irq_restore_hw(flags); |
1287 | 1287 | ||
1288 | return 0; | 1288 | return 0; |
1289 | } | 1289 | } |