Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'ib-omap' into devel

+237 -130
+3 -4
arch/arm/mach-omap2/pm24xx.c
··· 18 18 * published by the Free Software Foundation. 19 19 */ 20 20 21 + #include <linux/cpu_pm.h> 21 22 #include <linux/suspend.h> 22 23 #include <linux/sched.h> 23 24 #include <linux/proc_fs.h> ··· 30 29 #include <linux/clk-provider.h> 31 30 #include <linux/irq.h> 32 31 #include <linux/time.h> 33 - #include <linux/gpio.h> 34 - #include <linux/platform_data/gpio-omap.h> 35 32 36 33 #include <asm/fncpy.h> 37 34 ··· 86 87 l = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0) | OMAP24XX_USBSTANDBYCTRL; 87 88 omap_ctrl_writel(l, OMAP2_CONTROL_DEVCONF0); 88 89 89 - omap2_gpio_prepare_for_idle(0); 90 + cpu_cluster_pm_enter(); 90 91 91 92 /* One last check for pending IRQs to avoid extra latency due 92 93 * to sleeping unnecessarily. */ ··· 99 100 OMAP_SDRC_REGADDR(SDRC_POWER)); 100 101 101 102 no_sleep: 102 - omap2_gpio_resume_after_idle(); 103 + cpu_cluster_pm_exit(); 103 104 104 105 clk_enable(osc_ck); 105 106
+5 -9
arch/arm/mach-omap2/pm34xx.c
··· 18 18 * published by the Free Software Foundation. 19 19 */ 20 20 21 + #include <linux/cpu_pm.h> 21 22 #include <linux/pm.h> 22 23 #include <linux/suspend.h> 23 24 #include <linux/interrupt.h> 24 25 #include <linux/module.h> 25 26 #include <linux/list.h> 26 27 #include <linux/err.h> 27 - #include <linux/gpio.h> 28 28 #include <linux/clk.h> 29 29 #include <linux/delay.h> 30 30 #include <linux/slab.h> 31 31 #include <linux/omap-dma.h> 32 32 #include <linux/omap-gpmc.h> 33 - #include <linux/platform_data/gpio-omap.h> 34 33 35 34 #include <trace/events/power.h> 36 35 ··· 196 197 int mpu_next_state = PWRDM_POWER_ON; 197 198 int per_next_state = PWRDM_POWER_ON; 198 199 int core_next_state = PWRDM_POWER_ON; 199 - int per_going_off; 200 200 u32 sdrc_pwr = 0; 201 201 202 202 mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm); ··· 225 227 pwrdm_pre_transition(NULL); 226 228 227 229 /* PER */ 228 - if (per_next_state < PWRDM_POWER_ON) { 229 - per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; 230 - omap2_gpio_prepare_for_idle(per_going_off); 231 - } 230 + if (per_next_state == PWRDM_POWER_OFF) 231 + cpu_cluster_pm_enter(); 232 232 233 233 /* CORE */ 234 234 if (core_next_state < PWRDM_POWER_ON) { ··· 291 295 pwrdm_post_transition(NULL); 292 296 293 297 /* PER */ 294 - if (per_next_state < PWRDM_POWER_ON) 295 - omap2_gpio_resume_after_idle(); 298 + if (per_next_state == PWRDM_POWER_OFF) 299 + cpu_cluster_pm_exit(); 296 300 } 297 301 298 302 static void omap3_pm_idle(void)
+227 -104
drivers/gpio/gpio-omap.c
··· 19 19 #include <linux/err.h> 20 20 #include <linux/clk.h> 21 21 #include <linux/io.h> 22 + #include <linux/cpu_pm.h> 22 23 #include <linux/device.h> 23 24 #include <linux/pm_runtime.h> 24 25 #include <linux/pm.h> ··· 29 28 #include <linux/bitops.h> 30 29 #include <linux/platform_data/gpio-omap.h> 31 30 32 - #define OFF_MODE 1 33 31 #define OMAP4_GPIO_DEBOUNCINGTIME_MASK 0xFF 32 + 33 + #define OMAP_GPIO_QUIRK_IDLE_REMOVE_TRIGGER BIT(2) 34 + #define OMAP_GPIO_QUIRK_DEFERRED_WKUP_EN BIT(1) 34 35 35 36 static LIST_HEAD(omap_gpio_list); 36 37 ··· 51 48 u32 debounce_en; 52 49 }; 53 50 51 + struct gpio_bank; 52 + 53 + struct gpio_omap_funcs { 54 + void (*idle_enable_level_quirk)(struct gpio_bank *bank); 55 + void (*idle_disable_level_quirk)(struct gpio_bank *bank); 56 + }; 57 + 54 58 struct gpio_bank { 55 59 struct list_head node; 56 60 void __iomem *base; ··· 65 55 u32 non_wakeup_gpios; 66 56 u32 enabled_non_wakeup_gpios; 67 57 struct gpio_regs context; 58 + struct gpio_omap_funcs funcs; 68 59 u32 saved_datain; 69 60 u32 level_mask; 70 61 u32 toggle_mask; ··· 73 62 raw_spinlock_t wa_lock; 74 63 struct gpio_chip chip; 75 64 struct clk *dbck; 65 + struct notifier_block nb; 66 + unsigned int is_suspended:1; 76 67 u32 mod_usage; 77 68 u32 irq_usage; 78 69 u32 dbck_enable_mask; ··· 86 73 int stride; 87 74 u32 width; 88 75 int context_loss_count; 89 - int power_mode; 90 76 bool workaround_enabled; 77 + u32 quirks; 91 78 92 79 void (*set_dataout)(struct gpio_bank *bank, unsigned gpio, int enable); 93 80 void (*set_dataout_multiple)(struct gpio_bank *bank, ··· 381 368 readl_relaxed(bank->base + bank->regs->fallingdetect); 382 369 383 370 if (likely(!(bank->non_wakeup_gpios & gpio_bit))) { 384 - omap_gpio_rmw(base, bank->regs->wkup_en, gpio_bit, trigger != 0); 385 - bank->context.wake_en = 386 - readl_relaxed(bank->base + bank->regs->wkup_en); 371 + /* Defer wkup_en register update until we idle? */ 372 + if (bank->quirks & OMAP_GPIO_QUIRK_DEFERRED_WKUP_EN) { 373 + if (trigger) 374 + bank->context.wake_en |= gpio_bit; 375 + else 376 + bank->context.wake_en &= ~gpio_bit; 377 + } else { 378 + omap_gpio_rmw(base, bank->regs->wkup_en, gpio_bit, 379 + trigger != 0); 380 + bank->context.wake_en = 381 + readl_relaxed(bank->base + bank->regs->wkup_en); 382 + } 387 383 } 388 384 389 385 /* This part needs to be executed always for OMAP{34xx, 44xx} */ ··· 763 741 if (WARN_ON(!isr_reg)) 764 742 goto exit; 765 743 766 - pm_runtime_get_sync(bank->chip.parent); 744 + if (WARN_ONCE(!pm_runtime_active(bank->chip.parent), 745 + "gpio irq%i while runtime suspended?\n", irq)) 746 + return IRQ_NONE; 767 747 768 748 while (1) { 769 749 raw_spin_lock_irqsave(&bank->lock, lock_flags); ··· 816 792 } 817 793 } 818 794 exit: 819 - pm_runtime_put(bank->chip.parent); 820 795 return IRQ_HANDLED; 821 796 } 822 797 ··· 920 897 921 898 omap_set_gpio_irqenable(bank, offset, 1); 922 899 raw_spin_unlock_irqrestore(&bank->lock, flags); 900 + } 901 + 902 + /* 903 + * Only edges can generate a wakeup event to the PRCM. 904 + * 905 + * Therefore, ensure any wake-up capable GPIOs have 906 + * edge-detection enabled before going idle to ensure a wakeup 907 + * to the PRCM is generated on a GPIO transition. (c.f. 34xx 908 + * NDA TRM 25.5.3.1) 909 + * 910 + * The normal values will be restored upon ->runtime_resume() 911 + * by writing back the values saved in bank->context. 912 + */ 913 + static void __maybe_unused 914 + omap2_gpio_enable_level_quirk(struct gpio_bank *bank) 915 + { 916 + u32 wake_low, wake_hi; 917 + 918 + /* Enable additional edge detection for level gpios for idle */ 919 + wake_low = bank->context.leveldetect0 & bank->context.wake_en; 920 + if (wake_low) 921 + writel_relaxed(wake_low | bank->context.fallingdetect, 922 + bank->base + bank->regs->fallingdetect); 923 + 924 + wake_hi = bank->context.leveldetect1 & bank->context.wake_en; 925 + if (wake_hi) 926 + writel_relaxed(wake_hi | bank->context.risingdetect, 927 + bank->base + bank->regs->risingdetect); 928 + } 929 + 930 + static void __maybe_unused 931 + omap2_gpio_disable_level_quirk(struct gpio_bank *bank) 932 + { 933 + /* Disable edge detection for level gpios after idle */ 934 + writel_relaxed(bank->context.fallingdetect, 935 + bank->base + bank->regs->fallingdetect); 936 + writel_relaxed(bank->context.risingdetect, 937 + bank->base + bank->regs->risingdetect); 938 + } 939 + 940 + /* 941 + * On omap4 and later SoC variants a level interrupt with wkup_en 942 + * enabled blocks the GPIO functional clock from idling until the GPIO 943 + * instance has been reset. To avoid that, we must set wkup_en only for 944 + * idle for level interrupts, and clear level registers for the duration 945 + * of idle. The level interrupts will be still there on wakeup by their 946 + * nature. 947 + */ 948 + static void __maybe_unused 949 + omap4_gpio_enable_level_quirk(struct gpio_bank *bank) 950 + { 951 + /* Update wake register for idle, edge bits might be already set */ 952 + writel_relaxed(bank->context.wake_en, 953 + bank->base + bank->regs->wkup_en); 954 + 955 + /* Clear level registers for idle */ 956 + writel_relaxed(0, bank->base + bank->regs->leveldetect0); 957 + writel_relaxed(0, bank->base + bank->regs->leveldetect1); 958 + } 959 + 960 + static void __maybe_unused 961 + omap4_gpio_disable_level_quirk(struct gpio_bank *bank) 962 + { 963 + /* Restore level registers after idle */ 964 + writel_relaxed(bank->context.leveldetect0, 965 + bank->base + bank->regs->leveldetect0); 966 + writel_relaxed(bank->context.leveldetect1, 967 + bank->base + bank->regs->leveldetect1); 968 + 969 + /* Clear saved wkup_en for level, it will be set for next idle again */ 970 + bank->context.wake_en &= ~(bank->context.leveldetect0 | 971 + bank->context.leveldetect1); 972 + 973 + /* Update wake with only edge configuration */ 974 + writel_relaxed(bank->context.wake_en, 975 + bank->base + bank->regs->wkup_en); 923 976 } 924 977 925 978 /*---------------------------------------------------------------------*/ ··· 1317 1218 return ret; 1318 1219 } 1319 1220 1221 + static void omap_gpio_idle(struct gpio_bank *bank, bool may_lose_context); 1222 + static void omap_gpio_unidle(struct gpio_bank *bank); 1223 + 1224 + static int gpio_omap_cpu_notifier(struct notifier_block *nb, 1225 + unsigned long cmd, void *v) 1226 + { 1227 + struct gpio_bank *bank; 1228 + struct device *dev; 1229 + unsigned long flags; 1230 + 1231 + bank = container_of(nb, struct gpio_bank, nb); 1232 + dev = bank->chip.parent; 1233 + 1234 + raw_spin_lock_irqsave(&bank->lock, flags); 1235 + switch (cmd) { 1236 + case CPU_CLUSTER_PM_ENTER: 1237 + if (bank->is_suspended) 1238 + break; 1239 + omap_gpio_idle(bank, true); 1240 + break; 1241 + case CPU_CLUSTER_PM_ENTER_FAILED: 1242 + case CPU_CLUSTER_PM_EXIT: 1243 + if (bank->is_suspended) 1244 + break; 1245 + omap_gpio_unidle(bank); 1246 + break; 1247 + } 1248 + raw_spin_unlock_irqrestore(&bank->lock, flags); 1249 + 1250 + return NOTIFY_OK; 1251 + } 1252 + 1320 1253 static const struct of_device_id omap_gpio_match[]; 1321 1254 1322 1255 static int omap_gpio_probe(struct platform_device *pdev) ··· 1401 1270 bank->chip.parent = dev; 1402 1271 bank->chip.owner = THIS_MODULE; 1403 1272 bank->dbck_flag = pdata->dbck_flag; 1273 + bank->quirks = pdata->quirks; 1404 1274 bank->stride = pdata->bank_stride; 1405 1275 bank->width = pdata->bank_width; 1406 1276 bank->is_mpuio = pdata->is_mpuio; ··· 1410 1278 #ifdef CONFIG_OF_GPIO 1411 1279 bank->chip.of_node = of_node_get(node); 1412 1280 #endif 1281 + 1413 1282 if (node) { 1414 1283 if (!of_property_read_bool(node, "ti,gpio-always-on")) 1415 1284 bank->loses_context = true; ··· 1429 1296 bank->set_dataout = omap_set_gpio_dataout_mask; 1430 1297 bank->set_dataout_multiple = 1431 1298 omap_set_gpio_dataout_mask_multiple; 1299 + } 1300 + 1301 + if (bank->quirks & OMAP_GPIO_QUIRK_DEFERRED_WKUP_EN) { 1302 + bank->funcs.idle_enable_level_quirk = 1303 + omap4_gpio_enable_level_quirk; 1304 + bank->funcs.idle_disable_level_quirk = 1305 + omap4_gpio_disable_level_quirk; 1306 + } else if (bank->quirks & OMAP_GPIO_QUIRK_IDLE_REMOVE_TRIGGER) { 1307 + bank->funcs.idle_enable_level_quirk = 1308 + omap2_gpio_enable_level_quirk; 1309 + bank->funcs.idle_disable_level_quirk = 1310 + omap2_gpio_disable_level_quirk; 1432 1311 } 1433 1312 1434 1313 raw_spin_lock_init(&bank->lock); ··· 1467 1322 platform_set_drvdata(pdev, bank); 1468 1323 1469 1324 pm_runtime_enable(dev); 1470 - pm_runtime_irq_safe(dev); 1471 1325 pm_runtime_get_sync(dev); 1472 1326 1473 1327 if (bank->is_mpuio) ··· 1485 1341 1486 1342 omap_gpio_show_rev(bank); 1487 1343 1344 + if (bank->funcs.idle_enable_level_quirk && 1345 + bank->funcs.idle_disable_level_quirk) { 1346 + bank->nb.notifier_call = gpio_omap_cpu_notifier; 1347 + cpu_pm_register_notifier(&bank->nb); 1348 + } 1349 + 1488 1350 pm_runtime_put(dev); 1489 1351 1490 1352 list_add_tail(&bank->node, &omap_gpio_list); ··· 1502 1352 { 1503 1353 struct gpio_bank *bank = platform_get_drvdata(pdev); 1504 1354 1355 + if (bank->nb.notifier_call) 1356 + cpu_pm_unregister_notifier(&bank->nb); 1505 1357 list_del(&bank->node); 1506 1358 gpiochip_remove(&bank->chip); 1507 1359 pm_runtime_disable(&pdev->dev); ··· 1513 1361 return 0; 1514 1362 } 1515 1363 1516 - #ifdef CONFIG_ARCH_OMAP2PLUS 1517 - 1518 - #if defined(CONFIG_PM) 1519 1364 static void omap_gpio_restore_context(struct gpio_bank *bank); 1520 1365 1521 - static int omap_gpio_runtime_suspend(struct device *dev) 1366 + static void omap_gpio_idle(struct gpio_bank *bank, bool may_lose_context) 1522 1367 { 1523 - struct platform_device *pdev = to_platform_device(dev); 1524 - struct gpio_bank *bank = platform_get_drvdata(pdev); 1368 + struct device *dev = bank->chip.parent; 1525 1369 u32 l1 = 0, l2 = 0; 1526 - unsigned long flags; 1527 - u32 wake_low, wake_hi; 1528 1370 1529 - raw_spin_lock_irqsave(&bank->lock, flags); 1530 - 1531 - /* 1532 - * Only edges can generate a wakeup event to the PRCM. 1533 - * 1534 - * Therefore, ensure any wake-up capable GPIOs have 1535 - * edge-detection enabled before going idle to ensure a wakeup 1536 - * to the PRCM is generated on a GPIO transition. (c.f. 34xx 1537 - * NDA TRM 25.5.3.1) 1538 - * 1539 - * The normal values will be restored upon ->runtime_resume() 1540 - * by writing back the values saved in bank->context. 1541 - */ 1542 - wake_low = bank->context.leveldetect0 & bank->context.wake_en; 1543 - if (wake_low) 1544 - writel_relaxed(wake_low | bank->context.fallingdetect, 1545 - bank->base + bank->regs->fallingdetect); 1546 - wake_hi = bank->context.leveldetect1 & bank->context.wake_en; 1547 - if (wake_hi) 1548 - writel_relaxed(wake_hi | bank->context.risingdetect, 1549 - bank->base + bank->regs->risingdetect); 1371 + if (bank->funcs.idle_enable_level_quirk) 1372 + bank->funcs.idle_enable_level_quirk(bank); 1550 1373 1551 1374 if (!bank->enabled_non_wakeup_gpios) 1552 1375 goto update_gpio_context_count; 1553 1376 1554 - if (bank->power_mode != OFF_MODE) { 1555 - bank->power_mode = 0; 1377 + if (!may_lose_context) 1556 1378 goto update_gpio_context_count; 1557 - } 1379 + 1558 1380 /* 1559 1381 * If going to OFF, remove triggering for all 1560 1382 * non-wakeup GPIOs. Otherwise spurious IRQs will be ··· 1553 1427 bank->get_context_loss_count(dev); 1554 1428 1555 1429 omap_gpio_dbck_disable(bank); 1556 - raw_spin_unlock_irqrestore(&bank->lock, flags); 1557 - 1558 - return 0; 1559 1430 } 1560 1431 1561 1432 static void omap_gpio_init_context(struct gpio_bank *p); 1562 1433 1563 - static int omap_gpio_runtime_resume(struct device *dev) 1434 + static void omap_gpio_unidle(struct gpio_bank *bank) 1564 1435 { 1565 - struct platform_device *pdev = to_platform_device(dev); 1566 - struct gpio_bank *bank = platform_get_drvdata(pdev); 1436 + struct device *dev = bank->chip.parent; 1567 1437 u32 l = 0, gen, gen0, gen1; 1568 - unsigned long flags; 1569 1438 int c; 1570 - 1571 - raw_spin_lock_irqsave(&bank->lock, flags); 1572 1439 1573 1440 /* 1574 1441 * On the first resume during the probe, the context has not ··· 1578 1459 1579 1460 omap_gpio_dbck_enable(bank); 1580 1461 1581 - /* 1582 - * In ->runtime_suspend(), level-triggered, wakeup-enabled 1583 - * GPIOs were set to edge trigger also in order to be able to 1584 - * generate a PRCM wakeup. Here we restore the 1585 - * pre-runtime_suspend() values for edge triggering. 1586 - */ 1587 - writel_relaxed(bank->context.fallingdetect, 1588 - bank->base + bank->regs->fallingdetect); 1589 - writel_relaxed(bank->context.risingdetect, 1590 - bank->base + bank->regs->risingdetect); 1462 + if (bank->funcs.idle_disable_level_quirk) 1463 + bank->funcs.idle_disable_level_quirk(bank); 1591 1464 1592 1465 if (bank->loses_context) { 1593 1466 if (!bank->get_context_loss_count) { ··· 1589 1478 if (c != bank->context_loss_count) { 1590 1479 omap_gpio_restore_context(bank); 1591 1480 } else { 1592 - raw_spin_unlock_irqrestore(&bank->lock, flags); 1593 - return 0; 1481 + return; 1594 1482 } 1595 1483 } 1596 1484 } 1597 1485 1598 - if (!bank->workaround_enabled) { 1599 - raw_spin_unlock_irqrestore(&bank->lock, flags); 1600 - return 0; 1601 - } 1486 + if (!bank->workaround_enabled) 1487 + return; 1602 1488 1603 1489 l = readl_relaxed(bank->base + bank->regs->datain); 1604 1490 ··· 1648 1540 } 1649 1541 1650 1542 bank->workaround_enabled = false; 1651 - raw_spin_unlock_irqrestore(&bank->lock, flags); 1652 - 1653 - return 0; 1654 - } 1655 - #endif /* CONFIG_PM */ 1656 - 1657 - #if IS_BUILTIN(CONFIG_GPIO_OMAP) 1658 - void omap2_gpio_prepare_for_idle(int pwr_mode) 1659 - { 1660 - struct gpio_bank *bank; 1661 - 1662 - list_for_each_entry(bank, &omap_gpio_list, node) { 1663 - if (!BANK_USED(bank) || !bank->loses_context) 1664 - continue; 1665 - 1666 - bank->power_mode = pwr_mode; 1667 - 1668 - pm_runtime_put_sync_suspend(bank->chip.parent); 1669 - } 1670 1543 } 1671 1544 1672 - void omap2_gpio_resume_after_idle(void) 1673 - { 1674 - struct gpio_bank *bank; 1675 - 1676 - list_for_each_entry(bank, &omap_gpio_list, node) { 1677 - if (!BANK_USED(bank) || !bank->loses_context) 1678 - continue; 1679 - 1680 - pm_runtime_get_sync(bank->chip.parent); 1681 - } 1682 - } 1683 - #endif 1684 - 1685 - #if defined(CONFIG_PM) 1686 1545 static void omap_gpio_init_context(struct gpio_bank *p) 1687 1546 { 1688 1547 struct omap_gpio_reg_offs *regs = p->regs; ··· 1706 1631 writel_relaxed(bank->context.irqenable2, 1707 1632 bank->base + bank->regs->irqenable2); 1708 1633 } 1709 - #endif /* CONFIG_PM */ 1710 - #else 1711 - #define omap_gpio_runtime_suspend NULL 1712 - #define omap_gpio_runtime_resume NULL 1713 - static inline void omap_gpio_init_context(struct gpio_bank *p) {} 1714 - #endif 1715 1634 1635 + static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev) 1636 + { 1637 + struct platform_device *pdev = to_platform_device(dev); 1638 + struct gpio_bank *bank = platform_get_drvdata(pdev); 1639 + unsigned long flags; 1640 + int error = 0; 1641 + 1642 + raw_spin_lock_irqsave(&bank->lock, flags); 1643 + /* Must be idled only by CPU_CLUSTER_PM_ENTER? */ 1644 + if (bank->irq_usage) { 1645 + error = -EBUSY; 1646 + goto unlock; 1647 + } 1648 + omap_gpio_idle(bank, true); 1649 + bank->is_suspended = true; 1650 + unlock: 1651 + raw_spin_unlock_irqrestore(&bank->lock, flags); 1652 + 1653 + return error; 1654 + } 1655 + 1656 + static int __maybe_unused omap_gpio_runtime_resume(struct device *dev) 1657 + { 1658 + struct platform_device *pdev = to_platform_device(dev); 1659 + struct gpio_bank *bank = platform_get_drvdata(pdev); 1660 + unsigned long flags; 1661 + int error = 0; 1662 + 1663 + raw_spin_lock_irqsave(&bank->lock, flags); 1664 + /* Must be unidled only by CPU_CLUSTER_PM_ENTER? */ 1665 + if (bank->irq_usage) { 1666 + error = -EBUSY; 1667 + goto unlock; 1668 + } 1669 + omap_gpio_unidle(bank); 1670 + bank->is_suspended = false; 1671 + unlock: 1672 + raw_spin_unlock_irqrestore(&bank->lock, flags); 1673 + 1674 + return error; 1675 + } 1676 + 1677 + #ifdef CONFIG_ARCH_OMAP2PLUS 1716 1678 static const struct dev_pm_ops gpio_pm_ops = { 1717 1679 SET_RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume, 1718 1680 NULL) 1719 1681 }; 1682 + #else 1683 + static const struct dev_pm_ops gpio_pm_ops; 1684 + #endif /* CONFIG_ARCH_OMAP2PLUS */ 1720 1685 1721 1686 #if defined(CONFIG_OF) 1722 1687 static struct omap_gpio_reg_offs omap2_gpio_regs = { ··· 1805 1690 .fallingdetect = OMAP4_GPIO_FALLINGDETECT, 1806 1691 }; 1807 1692 1693 + /* 1694 + * Note that omap2 does not currently support idle modes with context loss so 1695 + * no need to add OMAP_GPIO_QUIRK_IDLE_REMOVE_TRIGGER quirk flag to save 1696 + * and restore context. 1697 + */ 1808 1698 static const struct omap_gpio_platform_data omap2_pdata = { 1809 1699 .regs = &omap2_gpio_regs, 1810 1700 .bank_width = 32, ··· 1820 1700 .regs = &omap2_gpio_regs, 1821 1701 .bank_width = 32, 1822 1702 .dbck_flag = true, 1703 + .quirks = OMAP_GPIO_QUIRK_IDLE_REMOVE_TRIGGER, 1823 1704 }; 1824 1705 1825 1706 static const struct omap_gpio_platform_data omap4_pdata = { 1826 1707 .regs = &omap4_gpio_regs, 1827 1708 .bank_width = 32, 1828 1709 .dbck_flag = true, 1710 + .quirks = OMAP_GPIO_QUIRK_IDLE_REMOVE_TRIGGER | 1711 + OMAP_GPIO_QUIRK_DEFERRED_WKUP_EN, 1829 1712 }; 1830 1713 1831 1714 static const struct of_device_id omap_gpio_match[] = {
+2 -13
include/linux/platform_data/gpio-omap.h
··· 197 197 bool is_mpuio; /* whether the bank is of type MPUIO */ 198 198 u32 non_wakeup_gpios; 199 199 200 + u32 quirks; /* Version specific quirks mask */ 201 + 200 202 struct omap_gpio_reg_offs *regs; 201 203 202 204 /* Return context loss count due to PM states changing */ 203 205 int (*get_context_loss_count)(struct device *dev); 204 206 }; 205 - 206 - #if IS_BUILTIN(CONFIG_GPIO_OMAP) 207 - extern void omap2_gpio_prepare_for_idle(int off_mode); 208 - extern void omap2_gpio_resume_after_idle(void); 209 - #else 210 - static inline void omap2_gpio_prepare_for_idle(int off_mode) 211 - { 212 - } 213 - 214 - static inline void omap2_gpio_resume_after_idle(void) 215 - { 216 - } 217 - #endif 218 207 219 208 #endif