aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/bfin_gpio.c
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-02-08 15:12:37 -0500
committerBryan Wu <bryan.wu@analog.com>2008-02-08 15:12:37 -0500
commitcfefe3c683e0d14c9ce3aeb883c55c7f30c20183 (patch)
tree77434010fc64f64606e893ce7b6f73243073ebb0 /arch/blackfin/kernel/bfin_gpio.c
parent2c4f829b0ce3d2fb447acca823e141094a50daa5 (diff)
[Blackfin] arch: hook up set_irq_wake in Blackfin's irq code
- Add support for irq_wake on system and gpio interrupts - Remove outdated kernel options - Add option to select default PM mode - Fix various places where SIC_IWRx was only handled partially Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/kernel/bfin_gpio.c')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 6bbe0a2fccb8..08788f7bbfba 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -186,7 +186,7 @@ static struct str_ident {
186 char name[RESOURCE_LABEL_SIZE]; 186 char name[RESOURCE_LABEL_SIZE];
187} str_ident[MAX_RESOURCES]; 187} str_ident[MAX_RESOURCES];
188 188
189#ifdef CONFIG_PM 189#if defined(CONFIG_PM) && !defined(CONFIG_BF54x)
190static unsigned short wakeup_map[gpio_bank(MAX_BLACKFIN_GPIOS)]; 190static unsigned short wakeup_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
191static unsigned char wakeup_flags_map[MAX_BLACKFIN_GPIOS]; 191static unsigned char wakeup_flags_map[MAX_BLACKFIN_GPIOS];
192static struct gpio_port_s gpio_bank_saved[gpio_bank(MAX_BLACKFIN_GPIOS)]; 192static struct gpio_port_s gpio_bank_saved[gpio_bank(MAX_BLACKFIN_GPIOS)];
@@ -696,9 +696,8 @@ static int bfin_gpio_wakeup_type(unsigned gpio, unsigned char type)
696 return 0; 696 return 0;
697} 697}
698 698
699u32 gpio_pm_setup(void) 699u32 bfin_pm_setup(void)
700{ 700{
701 u32 sic_iwr = 0;
702 u16 bank, mask, i, gpio; 701 u16 bank, mask, i, gpio;
703 702
704 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { 703 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
@@ -723,7 +722,8 @@ u32 gpio_pm_setup(void)
723 gpio = i; 722 gpio = i;
724 723
725 while (mask) { 724 while (mask) {
726 if (mask & 1) { 725 if ((mask & 1) && (wakeup_flags_map[gpio] !=
726 PM_WAKE_IGNORE)) {
727 reserved_gpio_map[gpio_bank(gpio)] |= 727 reserved_gpio_map[gpio_bank(gpio)] |=
728 gpio_bit(gpio); 728 gpio_bit(gpio);
729 bfin_gpio_wakeup_type(gpio, 729 bfin_gpio_wakeup_type(gpio,
@@ -734,21 +734,17 @@ u32 gpio_pm_setup(void)
734 mask >>= 1; 734 mask >>= 1;
735 } 735 }
736 736
737 sic_iwr |= 1 << 737 bfin_internal_set_wake(sic_iwr_irqs[bank], 1);
738 (sic_iwr_irqs[bank] - (IRQ_CORETMR + 1));
739 gpio_bankb[bank]->maskb_set = wakeup_map[gpio_bank(i)]; 738 gpio_bankb[bank]->maskb_set = wakeup_map[gpio_bank(i)];
740 } 739 }
741 } 740 }
742 741
743 AWA_DUMMY_READ(maskb_set); 742 AWA_DUMMY_READ(maskb_set);
744 743
745 if (sic_iwr) 744 return 0;
746 return sic_iwr;
747 else
748 return IWR_ENABLE_ALL;
749} 745}
750 746
751void gpio_pm_restore(void) 747void bfin_pm_restore(void)
752{ 748{
753 u16 bank, mask, i; 749 u16 bank, mask, i;
754 750
@@ -768,7 +764,7 @@ void gpio_pm_restore(void)
768 764
769 reserved_gpio_map[bank] = 765 reserved_gpio_map[bank] =
770 gpio_bank_saved[bank].reserved; 766 gpio_bank_saved[bank].reserved;
771 767 bfin_internal_set_wake(sic_iwr_irqs[bank], 0);
772 } 768 }
773 769
774 gpio_bankb[bank]->maskb = gpio_bank_saved[bank].maskb; 770 gpio_bankb[bank]->maskb = gpio_bank_saved[bank].maskb;