Commit 581d62ab authored by Michael Hennerich's avatar Michael Hennerich Committed by Bryan Wu

Blackfin arch: fix bug can not wakeup from sleep via push buttons

Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarBryan Wu <bryan.wu@analog.com>
parent 5e10b4a6
...@@ -494,19 +494,24 @@ u32 gpio_pm_setup(void) ...@@ -494,19 +494,24 @@ u32 gpio_pm_setup(void)
gpio_bank_saved[bank].dir = gpio_bankb[bank]->dir; gpio_bank_saved[bank].dir = gpio_bankb[bank]->dir;
gpio_bank_saved[bank].edge = gpio_bankb[bank]->edge; gpio_bank_saved[bank].edge = gpio_bankb[bank]->edge;
gpio_bank_saved[bank].both = gpio_bankb[bank]->both; gpio_bank_saved[bank].both = gpio_bankb[bank]->both;
gpio_bank_saved[bank].reserved = reserved_map[bank];
gpio = i; gpio = i;
while (mask) { while (mask) {
if (mask & 1) { if (mask & 1) {
bfin_gpio_wakeup_type(gpio, wakeup_flags_map[gpio]); reserved_map[gpio_bank(gpio)] |=
gpio_bit(gpio);
bfin_gpio_wakeup_type(gpio,
wakeup_flags_map[gpio]);
set_gpio_data(gpio, 0); /*Clear*/ set_gpio_data(gpio, 0); /*Clear*/
} }
gpio++; gpio++;
mask >>= 1; mask >>= 1;
} }
sic_iwr |= 1 << (sic_iwr_irqs[bank] - (IRQ_CORETMR + 1)); sic_iwr |= 1 <<
(sic_iwr_irqs[bank] - (IRQ_CORETMR + 1));
gpio_bankb[bank]->maskb_set = wakeup_map[gpio_bank(i)]; gpio_bankb[bank]->maskb_set = wakeup_map[gpio_bank(i)];
} }
} }
...@@ -535,6 +540,9 @@ void gpio_pm_restore(void) ...@@ -535,6 +540,9 @@ void gpio_pm_restore(void)
gpio_bankb[bank]->polar = gpio_bank_saved[bank].polar; gpio_bankb[bank]->polar = gpio_bank_saved[bank].polar;
gpio_bankb[bank]->edge = gpio_bank_saved[bank].edge; gpio_bankb[bank]->edge = gpio_bank_saved[bank].edge;
gpio_bankb[bank]->both = gpio_bank_saved[bank].both; gpio_bankb[bank]->both = gpio_bank_saved[bank].both;
reserved_map[bank] = gpio_bank_saved[bank].reserved;
} }
gpio_bankb[bank]->maskb = gpio_bank_saved[bank].maskb; gpio_bankb[bank]->maskb = gpio_bank_saved[bank].maskb;
......
...@@ -332,6 +332,7 @@ struct gpio_port_s { ...@@ -332,6 +332,7 @@ struct gpio_port_s {
unsigned short inen; unsigned short inen;
unsigned short fer; unsigned short fer;
unsigned short reserved;
}; };
#endif /*CONFIG_PM*/ #endif /*CONFIG_PM*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment