@@ -174,12 +174,22 @@ static inline void _gpio_dbck_enable(struct gpio_bank *bank)
174
174
if (bank -> dbck_enable_mask && !bank -> dbck_enabled ) {
175
175
clk_enable (bank -> dbck );
176
176
bank -> dbck_enabled = true;
177
+
178
+ __raw_writel (bank -> dbck_enable_mask ,
179
+ bank -> base + bank -> regs -> debounce_en );
177
180
}
178
181
}
179
182
180
183
static inline void _gpio_dbck_disable (struct gpio_bank * bank )
181
184
{
182
185
if (bank -> dbck_enable_mask && bank -> dbck_enabled ) {
186
+ /*
187
+ * Disable debounce before cutting it's clock. If debounce is
188
+ * enabled but the clock is not, GPIO module seems to be unable
189
+ * to detect events and generate interrupts at least on OMAP3.
190
+ */
191
+ __raw_writel (0 , bank -> base + bank -> regs -> debounce_en );
192
+
183
193
clk_disable (bank -> dbck );
184
194
bank -> dbck_enabled = false;
185
195
}
@@ -1081,7 +1091,6 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
1081
1091
bank -> is_mpuio = pdata -> is_mpuio ;
1082
1092
bank -> non_wakeup_gpios = pdata -> non_wakeup_gpios ;
1083
1093
bank -> loses_context = pdata -> loses_context ;
1084
- bank -> get_context_loss_count = pdata -> get_context_loss_count ;
1085
1094
bank -> regs = pdata -> regs ;
1086
1095
#ifdef CONFIG_OF_GPIO
1087
1096
bank -> chip .of_node = of_node_get (node );
@@ -1135,6 +1144,9 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
1135
1144
omap_gpio_chip_init (bank );
1136
1145
omap_gpio_show_rev (bank );
1137
1146
1147
+ if (bank -> loses_context )
1148
+ bank -> get_context_loss_count = pdata -> get_context_loss_count ;
1149
+
1138
1150
pm_runtime_put (bank -> dev );
1139
1151
1140
1152
list_add_tail (& bank -> node , & omap_gpio_list );
0 commit comments