aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-omap/gpio.c')
-rw-r--r--arch/arm/plat-omap/gpio.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index b55b4adffbe7..7c70a6afcf66 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1895,7 +1895,7 @@ void omap2_gpio_resume_after_retention(void)
1895 return; 1895 return;
1896 for (i = 0; i < gpio_bank_count; i++) { 1896 for (i = 0; i < gpio_bank_count; i++) {
1897 struct gpio_bank *bank = &gpio_bank[i]; 1897 struct gpio_bank *bank = &gpio_bank[i];
1898 u32 l; 1898 u32 l, gen, gen0, gen1;
1899 1899
1900 if (!(bank->enabled_non_wakeup_gpios)) 1900 if (!(bank->enabled_non_wakeup_gpios))
1901 continue; 1901 continue;
@@ -1916,14 +1916,33 @@ void omap2_gpio_resume_after_retention(void)
1916#endif 1916#endif
1917 l ^= bank->saved_datain; 1917 l ^= bank->saved_datain;
1918 l &= bank->non_wakeup_gpios; 1918 l &= bank->non_wakeup_gpios;
1919 if (l) { 1919
1920 /*
1921 * No need to generate IRQs for the rising edge for gpio IRQs
1922 * configured with falling edge only; and vice versa.
1923 */
1924 gen0 = l & bank->saved_fallingdetect;
1925 gen0 &= bank->saved_datain;
1926
1927 gen1 = l & bank->saved_risingdetect;
1928 gen1 &= ~(bank->saved_datain);
1929
1930 /* FIXME: Consider GPIO IRQs with level detections properly! */
1931 gen = l & (~(bank->saved_fallingdetect) &
1932 ~(bank->saved_risingdetect));
1933 /* Consider all GPIO IRQs needed to be updated */
1934 gen |= gen0 | gen1;
1935
1936 if (gen) {
1920 u32 old0, old1; 1937 u32 old0, old1;
1921#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 1938#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
1922 defined(CONFIG_ARCH_OMAP4) 1939 defined(CONFIG_ARCH_OMAP4)
1923 old0 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0); 1940 old0 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0);
1924 old1 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1); 1941 old1 = __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
1925 __raw_writel(old0 | l, bank->base + OMAP24XX_GPIO_LEVELDETECT0); 1942 __raw_writel(old0 | gen, bank->base +
1926 __raw_writel(old1 | l, bank->base + OMAP24XX_GPIO_LEVELDETECT1); 1943 OMAP24XX_GPIO_LEVELDETECT0);
1944 __raw_writel(old1 | gen, bank->base +
1945 OMAP24XX_GPIO_LEVELDETECT1);
1927 __raw_writel(old0, bank->base + OMAP24XX_GPIO_LEVELDETECT0); 1946 __raw_writel(old0, bank->base + OMAP24XX_GPIO_LEVELDETECT0);
1928 __raw_writel(old1, bank->base + OMAP24XX_GPIO_LEVELDETECT1); 1947 __raw_writel(old1, bank->base + OMAP24XX_GPIO_LEVELDETECT1);
1929#endif 1948#endif