diff options
Diffstat (limited to 'arch/blackfin/kernel/bfin_gpio.c')
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index bcf8cf6fe412..16d7ebfa0db1 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c | |||
@@ -118,6 +118,9 @@ static struct str_ident { | |||
118 | 118 | ||
119 | #if defined(CONFIG_PM) | 119 | #if defined(CONFIG_PM) |
120 | static struct gpio_port_s gpio_bank_saved[GPIO_BANK_NUM]; | 120 | static struct gpio_port_s gpio_bank_saved[GPIO_BANK_NUM]; |
121 | # ifdef BF538_FAMILY | ||
122 | static unsigned short port_fer_saved[3]; | ||
123 | # endif | ||
121 | #endif | 124 | #endif |
122 | 125 | ||
123 | static void gpio_error(unsigned gpio) | 126 | static void gpio_error(unsigned gpio) |
@@ -604,6 +607,11 @@ void bfin_gpio_pm_hibernate_suspend(void) | |||
604 | { | 607 | { |
605 | int i, bank; | 608 | int i, bank; |
606 | 609 | ||
610 | #ifdef BF538_FAMILY | ||
611 | for (i = 0; i < ARRAY_SIZE(port_fer_saved); ++i) | ||
612 | port_fer_saved[i] = *port_fer[i]; | ||
613 | #endif | ||
614 | |||
607 | for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { | 615 | for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { |
608 | bank = gpio_bank(i); | 616 | bank = gpio_bank(i); |
609 | 617 | ||
@@ -625,6 +633,10 @@ void bfin_gpio_pm_hibernate_suspend(void) | |||
625 | gpio_bank_saved[bank].maska = gpio_array[bank]->maska; | 633 | gpio_bank_saved[bank].maska = gpio_array[bank]->maska; |
626 | } | 634 | } |
627 | 635 | ||
636 | #ifdef BFIN_SPECIAL_GPIO_BANKS | ||
637 | bfin_special_gpio_pm_hibernate_suspend(); | ||
638 | #endif | ||
639 | |||
628 | AWA_DUMMY_READ(maska); | 640 | AWA_DUMMY_READ(maska); |
629 | } | 641 | } |
630 | 642 | ||
@@ -632,6 +644,11 @@ void bfin_gpio_pm_hibernate_restore(void) | |||
632 | { | 644 | { |
633 | int i, bank; | 645 | int i, bank; |
634 | 646 | ||
647 | #ifdef BF538_FAMILY | ||
648 | for (i = 0; i < ARRAY_SIZE(port_fer_saved); ++i) | ||
649 | *port_fer[i] = port_fer_saved[i]; | ||
650 | #endif | ||
651 | |||
635 | for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { | 652 | for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { |
636 | bank = gpio_bank(i); | 653 | bank = gpio_bank(i); |
637 | 654 | ||
@@ -653,6 +670,11 @@ void bfin_gpio_pm_hibernate_restore(void) | |||
653 | gpio_array[bank]->both = gpio_bank_saved[bank].both; | 670 | gpio_array[bank]->both = gpio_bank_saved[bank].both; |
654 | gpio_array[bank]->maska = gpio_bank_saved[bank].maska; | 671 | gpio_array[bank]->maska = gpio_bank_saved[bank].maska; |
655 | } | 672 | } |
673 | |||
674 | #ifdef BFIN_SPECIAL_GPIO_BANKS | ||
675 | bfin_special_gpio_pm_hibernate_restore(); | ||
676 | #endif | ||
677 | |||
656 | AWA_DUMMY_READ(maska); | 678 | AWA_DUMMY_READ(maska); |
657 | } | 679 | } |
658 | 680 | ||