aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-common
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2013-05-30 06:37:28 -0400
committerSteven Miao <realmz6@gmail.com>2013-11-15 04:33:42 -0500
commit54e4ff4d402450af5cec599f1cd9ab34997b3149 (patch)
tree2b4c53899c774b45fa37dbfc0440e459b2fdc16b /arch/blackfin/mach-common
parent036c5df1839f709ed2018d4cd3bed1934eb26b83 (diff)
blackfin: adi gpio driver and pinctrl driver support
Remove gpio driver for new gpio controller on BF54x and BF60x. Build the bfin_gpio driver only when other BF5xx processors are selected. Replace the prefix of some gpio and peripheral functions with adi. add portmux platform data in machine portmux.h Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Steven Miao <realmz6@gmail.com>
Diffstat (limited to 'arch/blackfin/mach-common')
-rw-r--r--arch/blackfin/mach-common/ints-priority.c421
-rw-r--r--arch/blackfin/mach-common/pm.c15
2 files changed, 35 insertions, 401 deletions
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index d143fd8d2bc5..ca75613231c8 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -704,10 +704,9 @@ static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle)
704 __irq_set_handler_locked(irq, handle); 704 __irq_set_handler_locked(irq, handle);
705} 705}
706 706
707static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS); 707#ifdef CONFIG_GPIO_ADI
708extern void bfin_gpio_irq_prepare(unsigned gpio);
709 708
710#if !BFIN_GPIO_PINT 709static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS);
711 710
712static void bfin_gpio_ack_irq(struct irq_data *d) 711static void bfin_gpio_ack_irq(struct irq_data *d)
713{ 712{
@@ -821,15 +820,6 @@ static int bfin_gpio_irq_type(struct irq_data *d, unsigned int type)
821 return 0; 820 return 0;
822} 821}
823 822
824#ifdef CONFIG_PM
825static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state)
826{
827 return gpio_pm_wakeup_ctrl(irq_to_gpio(d->irq), state);
828}
829#else
830# define bfin_gpio_set_wake NULL
831#endif
832
833static void bfin_demux_gpio_block(unsigned int irq) 823static void bfin_demux_gpio_block(unsigned int irq)
834{ 824{
835 unsigned int gpio, mask; 825 unsigned int gpio, mask;
@@ -896,279 +886,40 @@ void bfin_demux_gpio_irq(unsigned int inta_irq,
896 bfin_demux_gpio_block(irq); 886 bfin_demux_gpio_block(irq);
897} 887}
898 888
899#else
900
901#define NR_PINT_BITS 32
902#define IRQ_NOT_AVAIL 0xFF
903
904#define PINT_2_BANK(x) ((x) >> 5)
905#define PINT_2_BIT(x) ((x) & 0x1F)
906#define PINT_BIT(x) (1 << (PINT_2_BIT(x)))
907
908static unsigned char irq2pint_lut[NR_PINTS];
909static unsigned char pint2irq_lut[NR_PINT_SYS_IRQS * NR_PINT_BITS];
910
911static struct bfin_pint_regs * const pint[NR_PINT_SYS_IRQS] = {
912 (struct bfin_pint_regs *)PINT0_MASK_SET,
913 (struct bfin_pint_regs *)PINT1_MASK_SET,
914 (struct bfin_pint_regs *)PINT2_MASK_SET,
915 (struct bfin_pint_regs *)PINT3_MASK_SET,
916#ifdef CONFIG_BF60x
917 (struct bfin_pint_regs *)PINT4_MASK_SET,
918 (struct bfin_pint_regs *)PINT5_MASK_SET,
919#endif
920};
921
922inline unsigned int get_irq_base(u32 bank, u8 bmap)
923{
924 unsigned int irq_base;
925
926#ifndef CONFIG_BF60x
927 if (bank < 2) { /*PA-PB */
928 irq_base = IRQ_PA0 + bmap * 16;
929 } else { /*PC-PJ */
930 irq_base = IRQ_PC0 + bmap * 16;
931 }
932#else
933 irq_base = IRQ_PA0 + bank * 16 + bmap * 16;
934#endif
935 return irq_base;
936}
937
938 /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */
939void init_pint_lut(void)
940{
941 u16 bank, bit, irq_base, bit_pos;
942 u32 pint_assign;
943 u8 bmap;
944
945 memset(irq2pint_lut, IRQ_NOT_AVAIL, sizeof(irq2pint_lut));
946
947 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) {
948
949 pint_assign = pint[bank]->assign;
950
951 for (bit = 0; bit < NR_PINT_BITS; bit++) {
952
953 bmap = (pint_assign >> ((bit / 8) * 8)) & 0xFF;
954
955 irq_base = get_irq_base(bank, bmap);
956
957 irq_base += (bit % 8) + ((bit / 8) & 1 ? 8 : 0);
958 bit_pos = bit + bank * NR_PINT_BITS;
959
960 pint2irq_lut[bit_pos] = irq_base - SYS_IRQS;
961 irq2pint_lut[irq_base - SYS_IRQS] = bit_pos;
962 }
963 }
964}
965
966static void bfin_gpio_ack_irq(struct irq_data *d)
967{
968 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS];
969 u32 pintbit = PINT_BIT(pint_val);
970 u32 bank = PINT_2_BANK(pint_val);
971
972 if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH) {
973 if (pint[bank]->invert_set & pintbit)
974 pint[bank]->invert_clear = pintbit;
975 else
976 pint[bank]->invert_set = pintbit;
977 }
978 pint[bank]->request = pintbit;
979
980}
981
982static void bfin_gpio_mask_ack_irq(struct irq_data *d)
983{
984 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS];
985 u32 pintbit = PINT_BIT(pint_val);
986 u32 bank = PINT_2_BANK(pint_val);
987
988 if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH) {
989 if (pint[bank]->invert_set & pintbit)
990 pint[bank]->invert_clear = pintbit;
991 else
992 pint[bank]->invert_set = pintbit;
993 }
994
995 pint[bank]->request = pintbit;
996 pint[bank]->mask_clear = pintbit;
997}
998
999static void bfin_gpio_mask_irq(struct irq_data *d)
1000{
1001 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS];
1002
1003 pint[PINT_2_BANK(pint_val)]->mask_clear = PINT_BIT(pint_val);
1004}
1005
1006static void bfin_gpio_unmask_irq(struct irq_data *d)
1007{
1008 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS];
1009 u32 pintbit = PINT_BIT(pint_val);
1010 u32 bank = PINT_2_BANK(pint_val);
1011
1012 pint[bank]->mask_set = pintbit;
1013}
1014
1015static unsigned int bfin_gpio_irq_startup(struct irq_data *d)
1016{
1017 unsigned int irq = d->irq;
1018 u32 gpionr = irq_to_gpio(irq);
1019 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
1020
1021 if (pint_val == IRQ_NOT_AVAIL) {
1022 printk(KERN_ERR
1023 "GPIO IRQ %d :Not in PINT Assign table "
1024 "Reconfigure Interrupt to Port Assignemt\n", irq);
1025 return -ENODEV;
1026 }
1027
1028 if (__test_and_set_bit(gpionr, gpio_enabled))
1029 bfin_gpio_irq_prepare(gpionr);
1030
1031 bfin_gpio_unmask_irq(d);
1032
1033 return 0;
1034}
1035
1036static void bfin_gpio_irq_shutdown(struct irq_data *d)
1037{
1038 u32 gpionr = irq_to_gpio(d->irq);
1039
1040 bfin_gpio_mask_irq(d);
1041 __clear_bit(gpionr, gpio_enabled);
1042 bfin_gpio_irq_free(gpionr);
1043}
1044
1045static int bfin_gpio_irq_type(struct irq_data *d, unsigned int type)
1046{
1047 unsigned int irq = d->irq;
1048 int ret;
1049 char buf[16];
1050 u32 gpionr = irq_to_gpio(irq);
1051 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
1052 u32 pintbit = PINT_BIT(pint_val);
1053 u32 bank = PINT_2_BANK(pint_val);
1054
1055 if (pint_val == IRQ_NOT_AVAIL)
1056 return -ENODEV;
1057
1058 if (type == IRQ_TYPE_PROBE) {
1059 /* only probe unenabled GPIO interrupt lines */
1060 if (test_bit(gpionr, gpio_enabled))
1061 return 0;
1062 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
1063 }
1064
1065 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
1066 IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
1067
1068 snprintf(buf, 16, "gpio-irq%d", irq);
1069 ret = bfin_gpio_irq_request(gpionr, buf);
1070 if (ret)
1071 return ret;
1072
1073 if (__test_and_set_bit(gpionr, gpio_enabled))
1074 bfin_gpio_irq_prepare(gpionr);
1075
1076 } else {
1077 __clear_bit(gpionr, gpio_enabled);
1078 return 0;
1079 }
1080
1081 if ((type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)))
1082 pint[bank]->invert_set = pintbit; /* low or falling edge denoted by one */
1083 else
1084 pint[bank]->invert_clear = pintbit; /* high or rising edge denoted by zero */
1085
1086 if ((type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
1087 == (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
1088 if (gpio_get_value(gpionr))
1089 pint[bank]->invert_set = pintbit;
1090 else
1091 pint[bank]->invert_clear = pintbit;
1092 }
1093
1094 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
1095 pint[bank]->edge_set = pintbit;
1096 bfin_set_irq_handler(irq, handle_edge_irq);
1097 } else {
1098 pint[bank]->edge_clear = pintbit;
1099 bfin_set_irq_handler(irq, handle_level_irq);
1100 }
1101
1102 return 0;
1103}
1104
1105#ifdef CONFIG_PM 889#ifdef CONFIG_PM
1106static struct bfin_pm_pint_save save_pint_reg[NR_PINT_SYS_IRQS];
1107static u32 save_pint_sec_ctl[NR_PINT_SYS_IRQS];
1108 890
1109static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) 891static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state)
1110{ 892{
1111 u32 pint_irq; 893 return bfin_gpio_pm_wakeup_ctrl(irq_to_gpio(d->irq), state);
1112 u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; 894}
1113 u32 bank = PINT_2_BANK(pint_val);
1114
1115 switch (bank) {
1116 case 0:
1117 pint_irq = IRQ_PINT0;
1118 break;
1119 case 2:
1120 pint_irq = IRQ_PINT2;
1121 break;
1122 case 3:
1123 pint_irq = IRQ_PINT3;
1124 break;
1125 case 1:
1126 pint_irq = IRQ_PINT1;
1127 break;
1128#ifdef CONFIG_BF60x
1129 case 4:
1130 pint_irq = IRQ_PINT4;
1131 break;
1132 case 5:
1133 pint_irq = IRQ_PINT5;
1134 break;
1135#endif
1136 default:
1137 return -EINVAL;
1138 }
1139 895
1140#ifndef SEC_GCTL 896#else
1141 bfin_internal_set_wake(pint_irq, state);
1142#endif
1143 897
1144 return 0; 898# define bfin_gpio_set_wake NULL
1145}
1146 899
1147void bfin_pint_suspend(void) 900#endif
1148{
1149 u32 bank;
1150 901
1151 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) { 902static struct irq_chip bfin_gpio_irqchip = {
1152 save_pint_reg[bank].mask_set = pint[bank]->mask_set; 903 .name = "GPIO",
1153 save_pint_reg[bank].assign = pint[bank]->assign; 904 .irq_ack = bfin_gpio_ack_irq,
1154 save_pint_reg[bank].edge_set = pint[bank]->edge_set; 905 .irq_mask = bfin_gpio_mask_irq,
1155 save_pint_reg[bank].invert_set = pint[bank]->invert_set; 906 .irq_mask_ack = bfin_gpio_mask_ack_irq,
1156 } 907 .irq_unmask = bfin_gpio_unmask_irq,
1157} 908 .irq_disable = bfin_gpio_mask_irq,
909 .irq_enable = bfin_gpio_unmask_irq,
910 .irq_set_type = bfin_gpio_irq_type,
911 .irq_startup = bfin_gpio_irq_startup,
912 .irq_shutdown = bfin_gpio_irq_shutdown,
913 .irq_set_wake = bfin_gpio_set_wake,
914};
1158 915
1159void bfin_pint_resume(void) 916#endif
1160{
1161 u32 bank;
1162 917
1163 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) { 918#ifdef CONFIG_PM
1164 pint[bank]->mask_set = save_pint_reg[bank].mask_set;
1165 pint[bank]->assign = save_pint_reg[bank].assign;
1166 pint[bank]->edge_set = save_pint_reg[bank].edge_set;
1167 pint[bank]->invert_set = save_pint_reg[bank].invert_set;
1168 }
1169}
1170 919
1171#ifdef SEC_GCTL 920#ifdef SEC_GCTL
921static u32 save_pint_sec_ctl[NR_PINT_SYS_IRQS];
922
1172static int sec_suspend(void) 923static int sec_suspend(void)
1173{ 924{
1174 u32 bank; 925 u32 bank;
@@ -1195,92 +946,10 @@ static struct syscore_ops sec_pm_syscore_ops = {
1195 .suspend = sec_suspend, 946 .suspend = sec_suspend,
1196 .resume = sec_resume, 947 .resume = sec_resume,
1197}; 948};
1198
1199#endif
1200#else
1201# define bfin_gpio_set_wake NULL
1202#endif
1203
1204void bfin_demux_gpio_irq(unsigned int inta_irq,
1205 struct irq_desc *desc)
1206{
1207 u32 bank, pint_val;
1208 u32 request, irq;
1209 u32 level_mask;
1210 int umask = 0;
1211 struct irq_chip *chip = irq_desc_get_chip(desc);
1212
1213 if (chip->irq_mask_ack) {
1214 chip->irq_mask_ack(&desc->irq_data);
1215 } else {
1216 chip->irq_mask(&desc->irq_data);
1217 if (chip->irq_ack)
1218 chip->irq_ack(&desc->irq_data);
1219 }
1220
1221 switch (inta_irq) {
1222 case IRQ_PINT0:
1223 bank = 0;
1224 break;
1225 case IRQ_PINT2:
1226 bank = 2;
1227 break;
1228 case IRQ_PINT3:
1229 bank = 3;
1230 break;
1231 case IRQ_PINT1:
1232 bank = 1;
1233 break;
1234#ifdef CONFIG_BF60x
1235 case IRQ_PINT4:
1236 bank = 4;
1237 break;
1238 case IRQ_PINT5:
1239 bank = 5;
1240 break;
1241#endif 949#endif
1242 default:
1243 return;
1244 }
1245
1246 pint_val = bank * NR_PINT_BITS;
1247
1248 request = pint[bank]->request;
1249
1250 level_mask = pint[bank]->edge_set & request;
1251
1252 while (request) {
1253 if (request & 1) {
1254 irq = pint2irq_lut[pint_val] + SYS_IRQS;
1255 if (level_mask & PINT_BIT(pint_val)) {
1256 umask = 1;
1257 chip->irq_unmask(&desc->irq_data);
1258 }
1259 bfin_handle_irq(irq);
1260 }
1261 pint_val++;
1262 request >>= 1;
1263 }
1264 950
1265 if (!umask)
1266 chip->irq_unmask(&desc->irq_data);
1267}
1268#endif 951#endif
1269 952
1270static struct irq_chip bfin_gpio_irqchip = {
1271 .name = "GPIO",
1272 .irq_ack = bfin_gpio_ack_irq,
1273 .irq_mask = bfin_gpio_mask_irq,
1274 .irq_mask_ack = bfin_gpio_mask_ack_irq,
1275 .irq_unmask = bfin_gpio_unmask_irq,
1276 .irq_disable = bfin_gpio_mask_irq,
1277 .irq_enable = bfin_gpio_unmask_irq,
1278 .irq_set_type = bfin_gpio_irq_type,
1279 .irq_startup = bfin_gpio_irq_startup,
1280 .irq_shutdown = bfin_gpio_irq_shutdown,
1281 .irq_set_wake = bfin_gpio_set_wake,
1282};
1283
1284void init_exception_vectors(void) 953void init_exception_vectors(void)
1285{ 954{
1286 /* cannot program in software: 955 /* cannot program in software:
@@ -1331,17 +1000,6 @@ int __init init_arch_irq(void)
1331 1000
1332 local_irq_disable(); 1001 local_irq_disable();
1333 1002
1334#if BFIN_GPIO_PINT
1335# ifdef CONFIG_PINTx_REASSIGN
1336 pint[0]->assign = CONFIG_PINT0_ASSIGN;
1337 pint[1]->assign = CONFIG_PINT1_ASSIGN;
1338 pint[2]->assign = CONFIG_PINT2_ASSIGN;
1339 pint[3]->assign = CONFIG_PINT3_ASSIGN;
1340# endif
1341 /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */
1342 init_pint_lut();
1343#endif
1344
1345 for (irq = 0; irq <= SYS_IRQS; irq++) { 1003 for (irq = 0; irq <= SYS_IRQS; irq++) {
1346 if (irq <= IRQ_CORETMR) 1004 if (irq <= IRQ_CORETMR)
1347 irq_set_chip(irq, &bfin_core_irqchip); 1005 irq_set_chip(irq, &bfin_core_irqchip);
@@ -1349,12 +1007,8 @@ int __init init_arch_irq(void)
1349 irq_set_chip(irq, &bfin_internal_irqchip); 1007 irq_set_chip(irq, &bfin_internal_irqchip);
1350 1008
1351 switch (irq) { 1009 switch (irq) {
1352#if BFIN_GPIO_PINT 1010#if !BFIN_GPIO_PINT
1353 case IRQ_PINT0: 1011#if defined(BF537_FAMILY)
1354 case IRQ_PINT1:
1355 case IRQ_PINT2:
1356 case IRQ_PINT3:
1357#elif defined(BF537_FAMILY)
1358 case IRQ_PH_INTA_MAC_RX: 1012 case IRQ_PH_INTA_MAC_RX:
1359 case IRQ_PF_INTA_PG_INTA: 1013 case IRQ_PF_INTA_PG_INTA:
1360#elif defined(BF533_FAMILY) 1014#elif defined(BF533_FAMILY)
@@ -1372,6 +1026,7 @@ int __init init_arch_irq(void)
1372#endif 1026#endif
1373 irq_set_chained_handler(irq, bfin_demux_gpio_irq); 1027 irq_set_chained_handler(irq, bfin_demux_gpio_irq);
1374 break; 1028 break;
1029#endif
1375#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 1030#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
1376 case IRQ_MAC_ERROR: 1031 case IRQ_MAC_ERROR:
1377 irq_set_chained_handler(irq, 1032 irq_set_chained_handler(irq,
@@ -1419,10 +1074,12 @@ int __init init_arch_irq(void)
1419 handle_level_irq); 1074 handle_level_irq);
1420#endif 1075#endif
1421 /* if configured as edge, then will be changed to do_edge_IRQ */ 1076 /* if configured as edge, then will be changed to do_edge_IRQ */
1077#ifdef CONFIG_GPIO_ADI
1422 for (irq = GPIO_IRQ_BASE; 1078 for (irq = GPIO_IRQ_BASE;
1423 irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++) 1079 irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++)
1424 irq_set_chip_and_handler(irq, &bfin_gpio_irqchip, 1080 irq_set_chip_and_handler(irq, &bfin_gpio_irqchip,
1425 handle_level_irq); 1081 handle_level_irq);
1082#endif
1426 bfin_write_IMASK(0); 1083 bfin_write_IMASK(0);
1427 CSYNC(); 1084 CSYNC();
1428 ilat = bfin_read_ILAT(); 1085 ilat = bfin_read_ILAT();
@@ -1525,19 +1182,6 @@ int __init init_arch_irq(void)
1525 1182
1526 local_irq_disable(); 1183 local_irq_disable();
1527 1184
1528#if BFIN_GPIO_PINT
1529# ifdef CONFIG_PINTx_REASSIGN
1530 pint[0]->assign = CONFIG_PINT0_ASSIGN;
1531 pint[1]->assign = CONFIG_PINT1_ASSIGN;
1532 pint[2]->assign = CONFIG_PINT2_ASSIGN;
1533 pint[3]->assign = CONFIG_PINT3_ASSIGN;
1534 pint[4]->assign = CONFIG_PINT4_ASSIGN;
1535 pint[5]->assign = CONFIG_PINT5_ASSIGN;
1536# endif
1537 /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */
1538 init_pint_lut();
1539#endif
1540
1541 for (irq = 0; irq <= SYS_IRQS; irq++) { 1185 for (irq = 0; irq <= SYS_IRQS; irq++) {
1542 if (irq <= IRQ_CORETMR) { 1186 if (irq <= IRQ_CORETMR) {
1543 irq_set_chip_and_handler(irq, &bfin_core_irqchip, 1187 irq_set_chip_and_handler(irq, &bfin_core_irqchip,
@@ -1546,9 +1190,6 @@ int __init init_arch_irq(void)
1546 if (irq == IRQ_CORETMR) 1190 if (irq == IRQ_CORETMR)
1547 irq_set_handler(irq, handle_percpu_irq); 1191 irq_set_handler(irq, handle_percpu_irq);
1548#endif 1192#endif
1549 } else if (irq >= BFIN_IRQ(21) && irq <= BFIN_IRQ(26)) {
1550 irq_set_chip(irq, &bfin_sec_irqchip);
1551 irq_set_chained_handler(irq, bfin_demux_gpio_irq);
1552 } else if (irq >= BFIN_IRQ(34) && irq <= BFIN_IRQ(37)) { 1193 } else if (irq >= BFIN_IRQ(34) && irq <= BFIN_IRQ(37)) {
1553 irq_set_chip_and_handler(irq, &bfin_sec_irqchip, 1194 irq_set_chip_and_handler(irq, &bfin_sec_irqchip,
1554 handle_percpu_irq); 1195 handle_percpu_irq);
@@ -1563,10 +1204,6 @@ int __init init_arch_irq(void)
1563 __irq_set_preflow_handler(irq, bfin_sec_preflow_handler); 1204 __irq_set_preflow_handler(irq, bfin_sec_preflow_handler);
1564 } 1205 }
1565 } 1206 }
1566 for (irq = GPIO_IRQ_BASE;
1567 irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++)
1568 irq_set_chip_and_handler(irq, &bfin_gpio_irqchip,
1569 handle_level_irq);
1570 1207
1571 bfin_write_IMASK(0); 1208 bfin_write_IMASK(0);
1572 CSYNC(); 1209 CSYNC();
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c
index 87bfe549ad3f..675ffb148fbc 100644
--- a/arch/blackfin/mach-common/pm.c
+++ b/arch/blackfin/mach-common/pm.c
@@ -27,7 +27,7 @@ struct bfin_cpu_pm_fns *bfin_cpu_pm;
27 27
28void bfin_pm_suspend_standby_enter(void) 28void bfin_pm_suspend_standby_enter(void)
29{ 29{
30#ifndef CONFIG_BF60x 30#if !BFIN_GPIO_PINT
31 bfin_pm_standby_setup(); 31 bfin_pm_standby_setup();
32#endif 32#endif
33 33
@@ -41,7 +41,7 @@ void bfin_pm_suspend_standby_enter(void)
41# endif 41# endif
42#endif 42#endif
43 43
44#ifndef CONFIG_BF60x 44#if !BFIN_GPIO_PINT
45 bfin_pm_standby_restore(); 45 bfin_pm_standby_restore();
46#endif 46#endif
47 47
@@ -128,6 +128,7 @@ static void flushinv_all_dcache(void)
128 if ((status & 0x3) != 0x3) 128 if ((status & 0x3) != 0x3)
129 continue; 129 continue;
130 130
131
131 /* construct the address using the tag */ 132 /* construct the address using the tag */
132 addr = (status & 0xFFFFC800) | (subbank << 12) | (set << 5); 133 addr = (status & 0xFFFFC800) | (subbank << 12) | (set << 5);
133 134
@@ -170,10 +171,8 @@ int bfin_pm_suspend_mem_enter(void)
170 return ret; 171 return ret;
171 } 172 }
172 173
174#ifdef CONFIG_GPIO_ADI
173 bfin_gpio_pm_hibernate_suspend(); 175 bfin_gpio_pm_hibernate_suspend();
174
175#if BFIN_GPIO_PINT
176 bfin_pint_suspend();
177#endif 176#endif
178 177
179#if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK) 178#if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK)
@@ -194,11 +193,9 @@ int bfin_pm_suspend_mem_enter(void)
194 _enable_icplb(); 193 _enable_icplb();
195 _enable_dcplb(); 194 _enable_dcplb();
196 195
197#if BFIN_GPIO_PINT 196#ifdef CONFIG_GPIO_ADI
198 bfin_pint_resume();
199#endif
200
201 bfin_gpio_pm_hibernate_restore(); 197 bfin_gpio_pm_hibernate_restore();
198#endif
202 blackfin_dma_resume(); 199 blackfin_dma_resume();
203 200
204 kfree(memptr); 201 kfree(memptr);