struct clk *dbck;
u32 mod_usage;
u32 dbck_enable_mask;
+ bool dbck_enabled;
struct device *dev;
bool is_mpuio;
bool dbck_flag;
__raw_writel(l, base + reg);
}
+static inline void _gpio_dbck_enable(struct gpio_bank *bank)
+{
+ if (bank->dbck_enable_mask && !bank->dbck_enabled) {
+ clk_enable(bank->dbck);
+ bank->dbck_enabled = true;
+ }
+}
+
+static inline void _gpio_dbck_disable(struct gpio_bank *bank)
+{
+ if (bank->dbck_enable_mask && bank->dbck_enabled) {
+ clk_disable(bank->dbck);
+ bank->dbck_enabled = false;
+ }
+}
+
/**
* _set_gpio_debounce - low level gpio debounce time
* @bank: the gpio bank we're acting upon
bank->get_context_loss_count(bank->dev);
omap_gpio_save_context(bank);
+ _gpio_dbck_disable(bank);
spin_unlock_irqrestore(&bank->lock, flags);
return 0;
unsigned long flags;
spin_lock_irqsave(&bank->lock, flags);
+ _gpio_dbck_enable(bank);
if (!bank->enabled_non_wakeup_gpios || !bank->workaround_enabled) {
spin_unlock_irqrestore(&bank->lock, flags);
return 0;
struct gpio_bank *bank;
list_for_each_entry(bank, &omap_gpio_list, node) {
- int j;
-
if (!bank->mod_usage || !bank->loses_context)
continue;
bank->power_mode = pwr_mode;
- for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
- clk_disable(bank->dbck);
-
pm_runtime_put_sync_suspend(bank->dev);
}
}
struct gpio_bank *bank;
list_for_each_entry(bank, &omap_gpio_list, node) {
- int j;
-
if (!bank->mod_usage || !bank->loses_context)
continue;
- for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
- clk_enable(bank->dbck);
-
pm_runtime_get_sync(bank->dev);
}
}