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

Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC late fixes and dependencies from Kevin Hilman:
"This is a collection of a few late fixes and other misc stuff that had
dependencies on things being merged from other trees.

Other than the fixes, the primary feature being added is the
conversion of some OMAP drivers to the new generic wakeirq interface"

* tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
ARM: multi_v7_defconfig: Enable BRCMNAND driver
ARM: BCM: Do not select CONFIG_MTD_NAND_BRCMNAND
ARM: at91/dt: update udc compatible strings
ARM: at91/dt: trivial: fix USB udc compatible string
arm64: dts: Add APM X-Gene standby GPIO controller DTS entries
soc: qcom: spm: Fix idle on THUMB2 kernels
ARM: dove: fix legacy dove IRQ numbers
ARM: mvebu: fix suspend to RAM on big-endian configurations
ARM: mvebu: adjust Armada XP DT spi muxing after pinctrl function rename
serial: 8250_omap: Move wake-up interrupt to generic wakeirq
serial: omap: Switch wake-up interrupt to generic wakeirq
mmc: omap_hsmmc: Change wake-up interrupt to use generic wakeirq

+103 -201
+3 -3
Documentation/devicetree/bindings/usb/atmel-usb.txt
··· 79 79 80 80 Required properties: 81 81 - compatible: Should be one of the following 82 - "at91sam9rl-udc" 83 - "at91sam9g45-udc" 84 - "sama5d3-udc" 82 + "atmel,at91sam9rl-udc" 83 + "atmel,at91sam9g45-udc" 84 + "atmel,sama5d3-udc" 85 85 - reg: Address and length of the register set for the device 86 86 - interrupts: Should contain usba interrupt 87 87 - clocks: Should reference the peripheral and host clocks
+1 -1
arch/arm/boot/dts/armada-xp.dtsi
··· 305 305 spi0_pins: spi0-pins { 306 306 marvell,pins = "mpp36", "mpp37", 307 307 "mpp38", "mpp39"; 308 - marvell,function = "spi"; 308 + marvell,function = "spi0"; 309 309 }; 310 310 311 311 uart2_pins: uart2-pins {
+1 -1
arch/arm/boot/dts/at91sam9g45.dtsi
··· 1148 1148 usb2: gadget@fff78000 { 1149 1149 #address-cells = <1>; 1150 1150 #size-cells = <0>; 1151 - compatible = "atmel,at91sam9rl-udc"; 1151 + compatible = "atmel,at91sam9g45-udc"; 1152 1152 reg = <0x00600000 0x80000 1153 1153 0xfff78000 0x400>; 1154 1154 interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>;
+1 -1
arch/arm/boot/dts/at91sam9x5.dtsi
··· 1108 1108 usb2: gadget@f803c000 { 1109 1109 #address-cells = <1>; 1110 1110 #size-cells = <0>; 1111 - compatible = "atmel,at91sam9rl-udc"; 1111 + compatible = "atmel,at91sam9g45-udc"; 1112 1112 reg = <0x00500000 0x80000 1113 1113 0xf803c000 0x400>; 1114 1114 interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>;
+1 -1
arch/arm/boot/dts/sama5d3.dtsi
··· 1321 1321 usb0: gadget@00500000 { 1322 1322 #address-cells = <1>; 1323 1323 #size-cells = <0>; 1324 - compatible = "atmel,at91sam9rl-udc"; 1324 + compatible = "atmel,sama5d3-udc"; 1325 1325 reg = <0x00500000 0x100000 1326 1326 0xf8030000 0x4000>; 1327 1327 interrupts = <33 IRQ_TYPE_LEVEL_HIGH 2>;
+1 -1
arch/arm/boot/dts/sama5d4.dtsi
··· 127 127 usb0: gadget@00400000 { 128 128 #address-cells = <1>; 129 129 #size-cells = <0>; 130 - compatible = "atmel,at91sam9rl-udc"; 130 + compatible = "atmel,sama5d3-udc"; 131 131 reg = <0x00400000 0x100000 132 132 0xfc02c000 0x4000>; 133 133 interrupts = <47 IRQ_TYPE_LEVEL_HIGH 2>;
+1
arch/arm/configs/multi_v7_defconfig
··· 169 169 CONFIG_MTD_M25P80=y 170 170 CONFIG_MTD_NAND=y 171 171 CONFIG_MTD_NAND_ATMEL=y 172 + CONFIG_MTD_NAND_BRCMNAND=y 172 173 CONFIG_MTD_NAND_DAVINCI=y 173 174 CONFIG_MTD_SPI_NOR=y 174 175 CONFIG_MTD_UBI=y
-1
arch/arm/mach-bcm/Kconfig
··· 19 19 select ARCH_REQUIRE_GPIOLIB 20 20 select ARM_AMBA 21 21 select PINCTRL 22 - select MTD_NAND_BRCMNAND 23 22 help 24 23 This enables support for systems based on Broadcom IPROC architected SoCs. 25 24 The IPROC complex contains one or more ARM CPUs along with common
+59 -59
arch/arm/mach-dove/include/mach/irqs.h
··· 14 14 /* 15 15 * Dove Low Interrupt Controller 16 16 */ 17 - #define IRQ_DOVE_BRIDGE 0 18 - #define IRQ_DOVE_H2C 1 19 - #define IRQ_DOVE_C2H 2 20 - #define IRQ_DOVE_NAND 3 21 - #define IRQ_DOVE_PDMA 4 22 - #define IRQ_DOVE_SPI1 5 23 - #define IRQ_DOVE_SPI0 6 24 - #define IRQ_DOVE_UART_0 7 25 - #define IRQ_DOVE_UART_1 8 26 - #define IRQ_DOVE_UART_2 9 27 - #define IRQ_DOVE_UART_3 10 28 - #define IRQ_DOVE_I2C 11 29 - #define IRQ_DOVE_GPIO_0_7 12 30 - #define IRQ_DOVE_GPIO_8_15 13 31 - #define IRQ_DOVE_GPIO_16_23 14 32 - #define IRQ_DOVE_PCIE0_ERR 15 33 - #define IRQ_DOVE_PCIE0 16 34 - #define IRQ_DOVE_PCIE1_ERR 17 35 - #define IRQ_DOVE_PCIE1 18 36 - #define IRQ_DOVE_I2S0 19 37 - #define IRQ_DOVE_I2S0_ERR 20 38 - #define IRQ_DOVE_I2S1 21 39 - #define IRQ_DOVE_I2S1_ERR 22 40 - #define IRQ_DOVE_USB_ERR 23 41 - #define IRQ_DOVE_USB0 24 42 - #define IRQ_DOVE_USB1 25 43 - #define IRQ_DOVE_GE00_RX 26 44 - #define IRQ_DOVE_GE00_TX 27 45 - #define IRQ_DOVE_GE00_MISC 28 46 - #define IRQ_DOVE_GE00_SUM 29 47 - #define IRQ_DOVE_GE00_ERR 30 48 - #define IRQ_DOVE_CRYPTO 31 17 + #define IRQ_DOVE_BRIDGE (1 + 0) 18 + #define IRQ_DOVE_H2C (1 + 1) 19 + #define IRQ_DOVE_C2H (1 + 2) 20 + #define IRQ_DOVE_NAND (1 + 3) 21 + #define IRQ_DOVE_PDMA (1 + 4) 22 + #define IRQ_DOVE_SPI1 (1 + 5) 23 + #define IRQ_DOVE_SPI0 (1 + 6) 24 + #define IRQ_DOVE_UART_0 (1 + 7) 25 + #define IRQ_DOVE_UART_1 (1 + 8) 26 + #define IRQ_DOVE_UART_2 (1 + 9) 27 + #define IRQ_DOVE_UART_3 (1 + 10) 28 + #define IRQ_DOVE_I2C (1 + 11) 29 + #define IRQ_DOVE_GPIO_0_7 (1 + 12) 30 + #define IRQ_DOVE_GPIO_8_15 (1 + 13) 31 + #define IRQ_DOVE_GPIO_16_23 (1 + 14) 32 + #define IRQ_DOVE_PCIE0_ERR (1 + 15) 33 + #define IRQ_DOVE_PCIE0 (1 + 16) 34 + #define IRQ_DOVE_PCIE1_ERR (1 + 17) 35 + #define IRQ_DOVE_PCIE1 (1 + 18) 36 + #define IRQ_DOVE_I2S0 (1 + 19) 37 + #define IRQ_DOVE_I2S0_ERR (1 + 20) 38 + #define IRQ_DOVE_I2S1 (1 + 21) 39 + #define IRQ_DOVE_I2S1_ERR (1 + 22) 40 + #define IRQ_DOVE_USB_ERR (1 + 23) 41 + #define IRQ_DOVE_USB0 (1 + 24) 42 + #define IRQ_DOVE_USB1 (1 + 25) 43 + #define IRQ_DOVE_GE00_RX (1 + 26) 44 + #define IRQ_DOVE_GE00_TX (1 + 27) 45 + #define IRQ_DOVE_GE00_MISC (1 + 28) 46 + #define IRQ_DOVE_GE00_SUM (1 + 29) 47 + #define IRQ_DOVE_GE00_ERR (1 + 30) 48 + #define IRQ_DOVE_CRYPTO (1 + 31) 49 49 50 50 /* 51 51 * Dove High Interrupt Controller 52 52 */ 53 - #define IRQ_DOVE_AC97 32 54 - #define IRQ_DOVE_PMU 33 55 - #define IRQ_DOVE_CAM 34 56 - #define IRQ_DOVE_SDIO0 35 57 - #define IRQ_DOVE_SDIO1 36 58 - #define IRQ_DOVE_SDIO0_WAKEUP 37 59 - #define IRQ_DOVE_SDIO1_WAKEUP 38 60 - #define IRQ_DOVE_XOR_00 39 61 - #define IRQ_DOVE_XOR_01 40 62 - #define IRQ_DOVE_XOR0_ERR 41 63 - #define IRQ_DOVE_XOR_10 42 64 - #define IRQ_DOVE_XOR_11 43 65 - #define IRQ_DOVE_XOR1_ERR 44 66 - #define IRQ_DOVE_LCD_DCON 45 67 - #define IRQ_DOVE_LCD1 46 68 - #define IRQ_DOVE_LCD0 47 69 - #define IRQ_DOVE_GPU 48 70 - #define IRQ_DOVE_PERFORM_MNTR 49 71 - #define IRQ_DOVE_VPRO_DMA1 51 72 - #define IRQ_DOVE_SSP_TIMER 54 73 - #define IRQ_DOVE_SSP 55 74 - #define IRQ_DOVE_MC_L2_ERR 56 75 - #define IRQ_DOVE_CRYPTO_ERR 59 76 - #define IRQ_DOVE_GPIO_24_31 60 77 - #define IRQ_DOVE_HIGH_GPIO 61 78 - #define IRQ_DOVE_SATA 62 53 + #define IRQ_DOVE_AC97 (1 + 32) 54 + #define IRQ_DOVE_PMU (1 + 33) 55 + #define IRQ_DOVE_CAM (1 + 34) 56 + #define IRQ_DOVE_SDIO0 (1 + 35) 57 + #define IRQ_DOVE_SDIO1 (1 + 36) 58 + #define IRQ_DOVE_SDIO0_WAKEUP (1 + 37) 59 + #define IRQ_DOVE_SDIO1_WAKEUP (1 + 38) 60 + #define IRQ_DOVE_XOR_00 (1 + 39) 61 + #define IRQ_DOVE_XOR_01 (1 + 40) 62 + #define IRQ_DOVE_XOR0_ERR (1 + 41) 63 + #define IRQ_DOVE_XOR_10 (1 + 42) 64 + #define IRQ_DOVE_XOR_11 (1 + 43) 65 + #define IRQ_DOVE_XOR1_ERR (1 + 44) 66 + #define IRQ_DOVE_LCD_DCON (1 + 45) 67 + #define IRQ_DOVE_LCD1 (1 + 46) 68 + #define IRQ_DOVE_LCD0 (1 + 47) 69 + #define IRQ_DOVE_GPU (1 + 48) 70 + #define IRQ_DOVE_PERFORM_MNTR (1 + 49) 71 + #define IRQ_DOVE_VPRO_DMA1 (1 + 51) 72 + #define IRQ_DOVE_SSP_TIMER (1 + 54) 73 + #define IRQ_DOVE_SSP (1 + 55) 74 + #define IRQ_DOVE_MC_L2_ERR (1 + 56) 75 + #define IRQ_DOVE_CRYPTO_ERR (1 + 59) 76 + #define IRQ_DOVE_GPIO_24_31 (1 + 60) 77 + #define IRQ_DOVE_HIGH_GPIO (1 + 61) 78 + #define IRQ_DOVE_SATA (1 + 62) 79 79 80 80 /* 81 81 * DOVE General Purpose Pins 82 82 */ 83 - #define IRQ_DOVE_GPIO_START 64 83 + #define IRQ_DOVE_GPIO_START 65 84 84 #define NR_GPIO_IRQS 64 85 85 86 86 /*
+4 -4
arch/arm/mach-dove/irq.c
··· 126 126 stat = readl_relaxed(dove_irq_base + IRQ_CAUSE_LOW_OFF); 127 127 stat &= readl_relaxed(dove_irq_base + IRQ_MASK_LOW_OFF); 128 128 if (stat) { 129 - unsigned int hwirq = __fls(stat); 129 + unsigned int hwirq = 1 + __fls(stat); 130 130 handle_IRQ(hwirq, regs); 131 131 return; 132 132 } 133 133 stat = readl_relaxed(dove_irq_base + IRQ_CAUSE_HIGH_OFF); 134 134 stat &= readl_relaxed(dove_irq_base + IRQ_MASK_HIGH_OFF); 135 135 if (stat) { 136 - unsigned int hwirq = 32 + __fls(stat); 136 + unsigned int hwirq = 33 + __fls(stat); 137 137 handle_IRQ(hwirq, regs); 138 138 return; 139 139 } ··· 144 144 { 145 145 int i; 146 146 147 - orion_irq_init(0, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF); 148 - orion_irq_init(32, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF); 147 + orion_irq_init(1, IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF); 148 + orion_irq_init(33, IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF); 149 149 150 150 #ifdef CONFIG_MULTI_IRQ_HANDLER 151 151 set_handle_irq(dove_legacy_handle_irq);
+3
arch/arm/mach-mvebu/pm-board.c
··· 43 43 for (i = 0; i < ARMADA_XP_GP_PIC_NR_GPIOS; i++) 44 44 ackcmd |= BIT(pic_raw_gpios[i]); 45 45 46 + srcmd = cpu_to_le32(srcmd); 47 + ackcmd = cpu_to_le32(ackcmd); 48 + 46 49 /* 47 50 * Wait a while, the PIC needs quite a bit of time between the 48 51 * two GPIO commands.
+13
arch/arm64/boot/dts/apm/apm-storm.dtsi
··· 717 717 phy-names = "sata-phy"; 718 718 }; 719 719 720 + sbgpio: sbgpio@17001000{ 721 + compatible = "apm,xgene-gpio-sb"; 722 + reg = <0x0 0x17001000 0x0 0x400>; 723 + #gpio-cells = <2>; 724 + gpio-controller; 725 + interrupts = <0x0 0x28 0x1>, 726 + <0x0 0x29 0x1>, 727 + <0x0 0x2a 0x1>, 728 + <0x0 0x2b 0x1>, 729 + <0x0 0x2c 0x1>, 730 + <0x0 0x2d 0x1>; 731 + }; 732 + 720 733 rtc: rtc@10510000 { 721 734 compatible = "apm,xgene-rtc"; 722 735 reg = <0x0 0x10510000 0x0 0x400>;
+6 -43
drivers/mmc/host/omap_hsmmc.c
··· 43 43 #include <linux/regulator/consumer.h> 44 44 #include <linux/pinctrl/consumer.h> 45 45 #include <linux/pm_runtime.h> 46 + #include <linux/pm_wakeirq.h> 46 47 #include <linux/platform_data/hsmmc-omap.h> 47 48 48 49 /* OMAP HSMMC Host Controller Registers */ ··· 219 218 unsigned int flags; 220 219 #define AUTO_CMD23 (1 << 0) /* Auto CMD23 support */ 221 220 #define HSMMC_SDIO_IRQ_ENABLED (1 << 1) /* SDIO irq enabled */ 222 - #define HSMMC_WAKE_IRQ_ENABLED (1 << 2) 223 221 struct omap_hsmmc_next next_data; 224 222 struct omap_hsmmc_platform_data *pdata; 225 223 ··· 1117 1117 return IRQ_HANDLED; 1118 1118 } 1119 1119 1120 - static irqreturn_t omap_hsmmc_wake_irq(int irq, void *dev_id) 1121 - { 1122 - struct omap_hsmmc_host *host = dev_id; 1123 - 1124 - /* cirq is level triggered, disable to avoid infinite loop */ 1125 - spin_lock(&host->irq_lock); 1126 - if (host->flags & HSMMC_WAKE_IRQ_ENABLED) { 1127 - disable_irq_nosync(host->wake_irq); 1128 - host->flags &= ~HSMMC_WAKE_IRQ_ENABLED; 1129 - } 1130 - spin_unlock(&host->irq_lock); 1131 - pm_request_resume(host->dev); /* no use counter */ 1132 - 1133 - return IRQ_HANDLED; 1134 - } 1135 - 1136 1120 static void set_sd_bus_power(struct omap_hsmmc_host *host) 1137 1121 { 1138 1122 unsigned long i; ··· 1649 1665 1650 1666 static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host) 1651 1667 { 1652 - struct mmc_host *mmc = host->mmc; 1653 1668 int ret; 1654 1669 1655 1670 /* ··· 1660 1677 if (!host->dev->of_node || !host->wake_irq) 1661 1678 return -ENODEV; 1662 1679 1663 - /* Prevent auto-enabling of IRQ */ 1664 - irq_set_status_flags(host->wake_irq, IRQ_NOAUTOEN); 1665 - ret = devm_request_irq(host->dev, host->wake_irq, omap_hsmmc_wake_irq, 1666 - IRQF_TRIGGER_LOW | IRQF_ONESHOT, 1667 - mmc_hostname(mmc), host); 1680 + ret = dev_pm_set_dedicated_wake_irq(host->dev, host->wake_irq); 1668 1681 if (ret) { 1669 1682 dev_err(mmc_dev(host->mmc), "Unable to request wake IRQ\n"); 1670 1683 goto err; ··· 1697 1718 return 0; 1698 1719 1699 1720 err_free_irq: 1700 - devm_free_irq(host->dev, host->wake_irq, host); 1721 + dev_pm_clear_wake_irq(host->dev); 1701 1722 err: 1702 1723 dev_warn(host->dev, "no SDIO IRQ support, falling back to polling\n"); 1703 1724 host->wake_irq = 0; ··· 1986 2007 omap_hsmmc_ops.multi_io_quirk = omap_hsmmc_multi_io_quirk; 1987 2008 } 1988 2009 2010 + device_init_wakeup(&pdev->dev, true); 1989 2011 pm_runtime_enable(host->dev); 1990 2012 pm_runtime_get_sync(host->dev); 1991 2013 pm_runtime_set_autosuspend_delay(host->dev, MMC_AUTOSUSPEND_DELAY); ··· 2127 2147 if (host->use_reg) 2128 2148 omap_hsmmc_reg_put(host); 2129 2149 err_irq: 2150 + device_init_wakeup(&pdev->dev, false); 2130 2151 if (host->tx_chan) 2131 2152 dma_release_channel(host->tx_chan); 2132 2153 if (host->rx_chan) ··· 2159 2178 2160 2179 pm_runtime_put_sync(host->dev); 2161 2180 pm_runtime_disable(host->dev); 2181 + device_init_wakeup(&pdev->dev, false); 2162 2182 if (host->dbclk) 2163 2183 clk_disable_unprepare(host->dbclk); 2164 2184 ··· 2186 2204 OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP); 2187 2205 } 2188 2206 2189 - /* do not wake up due to sdio irq */ 2190 - if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && 2191 - !(host->mmc->pm_flags & MMC_PM_WAKE_SDIO_IRQ)) 2192 - disable_irq(host->wake_irq); 2193 - 2194 2207 if (host->dbclk) 2195 2208 clk_disable_unprepare(host->dbclk); 2196 2209 ··· 2210 2233 omap_hsmmc_conf_bus_power(host); 2211 2234 2212 2235 omap_hsmmc_protect_card(host); 2213 - 2214 - if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && 2215 - !(host->mmc->pm_flags & MMC_PM_WAKE_SDIO_IRQ)) 2216 - enable_irq(host->wake_irq); 2217 - 2218 2236 pm_runtime_mark_last_busy(host->dev); 2219 2237 pm_runtime_put_autosuspend(host->dev); 2220 2238 return 0; ··· 2249 2277 } 2250 2278 2251 2279 pinctrl_pm_select_idle_state(dev); 2252 - 2253 - WARN_ON(host->flags & HSMMC_WAKE_IRQ_ENABLED); 2254 - enable_irq(host->wake_irq); 2255 - host->flags |= HSMMC_WAKE_IRQ_ENABLED; 2256 2280 } else { 2257 2281 pinctrl_pm_select_idle_state(dev); 2258 2282 } ··· 2270 2302 spin_lock_irqsave(&host->irq_lock, flags); 2271 2303 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && 2272 2304 (host->flags & HSMMC_SDIO_IRQ_ENABLED)) { 2273 - /* sdio irq flag can't change while in runtime suspend */ 2274 - if (host->flags & HSMMC_WAKE_IRQ_ENABLED) { 2275 - disable_irq_nosync(host->wake_irq); 2276 - host->flags &= ~HSMMC_WAKE_IRQ_ENABLED; 2277 - } 2278 2305 2279 2306 pinctrl_pm_select_default_state(host->dev); 2280 2307
+1 -1
drivers/soc/qcom/spm.c
··· 260 260 /* We have atleast one power down mode */ 261 261 cpumask_clear(&mask); 262 262 cpumask_set_cpu(cpu, &mask); 263 - qcom_scm_set_warm_boot_addr(cpu_resume, &mask); 263 + qcom_scm_set_warm_boot_addr(cpu_resume_arm, &mask); 264 264 } 265 265 266 266 per_cpu(qcom_idle_ops, cpu) = fns;
+4 -54
drivers/tty/serial/8250/8250_omap.c
··· 22 22 #include <linux/pm_runtime.h> 23 23 #include <linux/console.h> 24 24 #include <linux/pm_qos.h> 25 + #include <linux/pm_wakeirq.h> 25 26 #include <linux/dma-mapping.h> 26 27 27 28 #include "8250.h" ··· 553 552 pm_qos_update_request(&priv->pm_qos_request, priv->latency); 554 553 } 555 554 556 - static irqreturn_t omap_wake_irq(int irq, void *dev_id) 557 - { 558 - struct uart_port *port = dev_id; 559 - int ret; 560 - 561 - ret = port->handle_irq(port); 562 - if (ret) 563 - return IRQ_HANDLED; 564 - return IRQ_NONE; 565 - } 566 - 567 555 #ifdef CONFIG_SERIAL_8250_DMA 568 556 static int omap_8250_dma_handle_irq(struct uart_port *port); 569 557 #endif ··· 586 596 int ret; 587 597 588 598 if (priv->wakeirq) { 589 - ret = request_irq(priv->wakeirq, omap_wake_irq, 590 - port->irqflags, "uart wakeup irq", port); 599 + ret = dev_pm_set_dedicated_wake_irq(port->dev, priv->wakeirq); 591 600 if (ret) 592 601 return ret; 593 - disable_irq(priv->wakeirq); 594 602 } 595 603 596 604 pm_runtime_get_sync(port->dev); ··· 637 649 err: 638 650 pm_runtime_mark_last_busy(port->dev); 639 651 pm_runtime_put_autosuspend(port->dev); 640 - if (priv->wakeirq) 641 - free_irq(priv->wakeirq, port); 652 + dev_pm_clear_wake_irq(port->dev); 642 653 return ret; 643 654 } 644 655 ··· 669 682 670 683 pm_runtime_mark_last_busy(port->dev); 671 684 pm_runtime_put_autosuspend(port->dev); 672 - 673 685 free_irq(port->irq, port); 674 - if (priv->wakeirq) 675 - free_irq(priv->wakeirq, port); 686 + dev_pm_clear_wake_irq(port->dev); 676 687 } 677 688 678 689 static void omap_8250_throttle(struct uart_port *port) ··· 1211 1226 return 0; 1212 1227 } 1213 1228 1214 - #ifdef CONFIG_PM 1215 - 1216 - static inline void omap8250_enable_wakeirq(struct omap8250_priv *priv, 1217 - bool enable) 1218 - { 1219 - if (!priv->wakeirq) 1220 - return; 1221 - 1222 - if (enable) 1223 - enable_irq(priv->wakeirq); 1224 - else 1225 - disable_irq_nosync(priv->wakeirq); 1226 - } 1227 - 1228 - static void omap8250_enable_wakeup(struct omap8250_priv *priv, 1229 - bool enable) 1230 - { 1231 - if (enable == priv->wakeups_enabled) 1232 - return; 1233 - 1234 - omap8250_enable_wakeirq(priv, enable); 1235 - priv->wakeups_enabled = enable; 1236 - } 1237 - #endif 1238 - 1239 1229 #ifdef CONFIG_PM_SLEEP 1240 1230 static int omap8250_prepare(struct device *dev) 1241 1231 { ··· 1237 1277 1238 1278 serial8250_suspend_port(priv->line); 1239 1279 flush_work(&priv->qos_work); 1240 - 1241 - if (device_may_wakeup(dev)) 1242 - omap8250_enable_wakeup(priv, true); 1243 - else 1244 - omap8250_enable_wakeup(priv, false); 1245 1280 return 0; 1246 1281 } 1247 1282 1248 1283 static int omap8250_resume(struct device *dev) 1249 1284 { 1250 1285 struct omap8250_priv *priv = dev_get_drvdata(dev); 1251 - 1252 - if (device_may_wakeup(dev)) 1253 - omap8250_enable_wakeup(priv, false); 1254 1286 1255 1287 serial8250_resume_port(priv->line); 1256 1288 return 0; ··· 1285 1333 return -EBUSY; 1286 1334 } 1287 1335 1288 - omap8250_enable_wakeup(priv, true); 1289 1336 if (up->dma) 1290 1337 omap_8250_rx_dma(up, UART_IIR_RX_TIMEOUT); 1291 1338 ··· 1305 1354 return 0; 1306 1355 1307 1356 up = serial8250_get_port(priv->line); 1308 - omap8250_enable_wakeup(priv, false); 1309 1357 loss_cntx = omap8250_lost_context(up); 1310 1358 1311 1359 if (loss_cntx)
+4 -31
drivers/tty/serial/omap-serial.c
··· 38 38 #include <linux/serial_core.h> 39 39 #include <linux/irq.h> 40 40 #include <linux/pm_runtime.h> 41 + #include <linux/pm_wakeirq.h> 41 42 #include <linux/of.h> 42 43 #include <linux/of_irq.h> 43 44 #include <linux/gpio.h> ··· 161 160 unsigned long port_activity; 162 161 int context_loss_cnt; 163 162 u32 errata; 164 - u8 wakeups_enabled; 165 163 u32 features; 166 164 167 165 int rts_gpio; ··· 209 209 return pdata->get_context_loss_count(up->dev); 210 210 } 211 211 212 - static inline void serial_omap_enable_wakeirq(struct uart_omap_port *up, 213 - bool enable) 214 - { 215 - if (!up->wakeirq) 216 - return; 217 - 218 - if (enable) 219 - enable_irq(up->wakeirq); 220 - else 221 - disable_irq_nosync(up->wakeirq); 222 - } 223 - 212 + /* REVISIT: Remove this when omap3 boots in device tree only mode */ 224 213 static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable) 225 214 { 226 215 struct omap_uart_port_info *pdata = dev_get_platdata(up->dev); 227 - 228 - if (enable == up->wakeups_enabled) 229 - return; 230 - 231 - serial_omap_enable_wakeirq(up, enable); 232 - up->wakeups_enabled = enable; 233 216 234 217 if (!pdata || !pdata->enable_wakeup) 235 218 return; ··· 733 750 734 751 /* Optional wake-up IRQ */ 735 752 if (up->wakeirq) { 736 - retval = request_irq(up->wakeirq, serial_omap_irq, 737 - up->port.irqflags, up->name, up); 753 + retval = dev_pm_set_dedicated_wake_irq(up->dev, up->wakeirq); 738 754 if (retval) { 739 755 free_irq(up->port.irq, up); 740 756 return retval; 741 757 } 742 - disable_irq(up->wakeirq); 743 758 } 744 759 745 760 dev_dbg(up->port.dev, "serial_omap_startup+%d\n", up->port.line); ··· 826 845 pm_runtime_mark_last_busy(up->dev); 827 846 pm_runtime_put_autosuspend(up->dev); 828 847 free_irq(up->port.irq, up); 829 - if (up->wakeirq) 830 - free_irq(up->wakeirq, up); 848 + dev_pm_clear_wake_irq(up->dev); 831 849 } 832 850 833 851 static void serial_omap_uart_qos_work(struct work_struct *work) ··· 1118 1138 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 1119 1139 serial_out(up, UART_EFR, efr); 1120 1140 serial_out(up, UART_LCR, 0); 1121 - 1122 - if (!device_may_wakeup(up->dev)) { 1123 - if (!state) 1124 - pm_runtime_forbid(up->dev); 1125 - else 1126 - pm_runtime_allow(up->dev); 1127 - } 1128 1141 1129 1142 pm_runtime_mark_last_busy(up->dev); 1130 1143 pm_runtime_put_autosuspend(up->dev);