Skip to content

Commit

Permalink
ARM: OMAP: Fixup gpio-omap context save/restore.
Browse files Browse the repository at this point in the history
We need to save and restore context even if they are not in use as they
may have been reconfigured by u-boot or configured differently than
reset by a resume kernel.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
  • Loading branch information
Russ Dill authored and Russ Dill committed Feb 19, 2013
1 parent add8a51 commit a587840
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions drivers/gpio/gpio-omap.c
Expand Up @@ -1360,12 +1360,14 @@ void omap2_gpio_prepare_for_idle(int pwr_mode)
struct gpio_bank *bank;

list_for_each_entry(bank, &omap_gpio_list, node) {
if (!bank->mod_usage)
continue;
if (bank->get_context_loss_count)
bank->context_loss_count =
bank->get_context_loss_count(bank->dev);
if (bank->mod_usage) {
bank->power_mode = pwr_mode;

bank->power_mode = pwr_mode;

pm_runtime_put_sync_suspend(bank->dev);
pm_runtime_put_sync_suspend(bank->dev);
}
}
}

Expand All @@ -1374,10 +1376,14 @@ void omap2_gpio_resume_after_idle(void)
struct gpio_bank *bank;

list_for_each_entry(bank, &omap_gpio_list, node) {
if (!bank->mod_usage)
continue;

pm_runtime_get_sync(bank->dev);
if (bank->get_context_loss_count) {
int context_lost_cnt_after =
bank->get_context_loss_count(bank->dev);
if (context_lost_cnt_after != bank->context_loss_count)
omap_gpio_restore_context(bank);
}
if (bank->mod_usage)
pm_runtime_get_sync(bank->dev);
}
}

Expand Down

0 comments on commit a587840

Please sign in to comment.