* [PATCH 0/2] mailbox: stm32-ipcc: rework wakeup @ 2019-10-16 12:13 ` Fabien Dessenne 0 siblings, 0 replies; 8+ messages in thread From: Fabien Dessenne @ 2019-10-16 12:13 UTC (permalink / raw) To: Rob Herring, Mark Rutland, Jassi Brar, Maxime Coquelin, Alexandre Torgue, linux-kernel, linux-stm32, linux-arm-kernel, devicetree Cc: Fabien Dessenne Remove the dedicated wakeup IRQ as wakeup can be handled by the RX IRQ. Fabien Dessenne (2): dt-bindings: mailbox: stm32-ipcc: Updates for wakeup management mailbox: stm32-ipcc: Update wakeup management .../devicetree/bindings/mailbox/stm32-ipcc.txt | 4 +-- drivers/mailbox/stm32-ipcc.c | 36 +++++----------------- 2 files changed, 9 insertions(+), 31 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/2] mailbox: stm32-ipcc: rework wakeup @ 2019-10-16 12:13 ` Fabien Dessenne 0 siblings, 0 replies; 8+ messages in thread From: Fabien Dessenne @ 2019-10-16 12:13 UTC (permalink / raw) To: Rob Herring, Mark Rutland, Jassi Brar, Maxime Coquelin, Alexandre Torgue, linux-kernel, linux-stm32, linux-arm-kernel, devicetree Cc: Fabien Dessenne Remove the dedicated wakeup IRQ as wakeup can be handled by the RX IRQ. Fabien Dessenne (2): dt-bindings: mailbox: stm32-ipcc: Updates for wakeup management mailbox: stm32-ipcc: Update wakeup management .../devicetree/bindings/mailbox/stm32-ipcc.txt | 4 +-- drivers/mailbox/stm32-ipcc.c | 36 +++++----------------- 2 files changed, 9 insertions(+), 31 deletions(-) -- 2.7.4 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] dt-bindings: mailbox: stm32-ipcc: Updates for wakeup management 2019-10-16 12:13 ` Fabien Dessenne @ 2019-10-16 12:13 ` Fabien Dessenne -1 siblings, 0 replies; 8+ messages in thread From: Fabien Dessenne @ 2019-10-16 12:13 UTC (permalink / raw) To: Rob Herring, Mark Rutland, Jassi Brar, Maxime Coquelin, Alexandre Torgue, linux-kernel, linux-stm32, linux-arm-kernel, devicetree Cc: Fabien Dessenne The wakeup specific IRQ management is no more needed to wake up the stm32 plaform. Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> --- Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt b/Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt index 1d2b7fe..139c06a 100644 --- a/Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt +++ b/Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt @@ -14,9 +14,9 @@ Required properties: property. Must contain the following entries: - "rx" - "tx" - - "wakeup" - interrupts: Interrupt specifiers for "rx channel occupied", "tx channel - free" and "system wakeup". + free". If "wakeup-source" is set the rx interrupt is the + one used to wake up the system. - #mbox-cells: Number of cells required for the mailbox specifier. Must be 1. The data contained in the mbox specifier of the "mboxes" property in the client node is the mailbox channel index. -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 1/2] dt-bindings: mailbox: stm32-ipcc: Updates for wakeup management @ 2019-10-16 12:13 ` Fabien Dessenne 0 siblings, 0 replies; 8+ messages in thread From: Fabien Dessenne @ 2019-10-16 12:13 UTC (permalink / raw) To: Rob Herring, Mark Rutland, Jassi Brar, Maxime Coquelin, Alexandre Torgue, linux-kernel, linux-stm32, linux-arm-kernel, devicetree Cc: Fabien Dessenne The wakeup specific IRQ management is no more needed to wake up the stm32 plaform. Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> --- Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt b/Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt index 1d2b7fe..139c06a 100644 --- a/Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt +++ b/Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt @@ -14,9 +14,9 @@ Required properties: property. Must contain the following entries: - "rx" - "tx" - - "wakeup" - interrupts: Interrupt specifiers for "rx channel occupied", "tx channel - free" and "system wakeup". + free". If "wakeup-source" is set the rx interrupt is the + one used to wake up the system. - #mbox-cells: Number of cells required for the mailbox specifier. Must be 1. The data contained in the mbox specifier of the "mboxes" property in the client node is the mailbox channel index. -- 2.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: mailbox: stm32-ipcc: Updates for wakeup management 2019-10-16 12:13 ` Fabien Dessenne @ 2019-10-29 1:26 ` Rob Herring -1 siblings, 0 replies; 8+ messages in thread From: Rob Herring @ 2019-10-29 1:26 UTC (permalink / raw) To: Fabien Dessenne Cc: Mark Rutland, devicetree, Alexandre Torgue, Jassi Brar, linux-kernel, Maxime Coquelin, linux-stm32, linux-arm-kernel On Wed, Oct 16, 2019 at 02:13:48PM +0200, Fabien Dessenne wrote: > The wakeup specific IRQ management is no more needed to wake up the stm32 > plaform. typo > > Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com> > Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> > --- > Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) With that fixed, Acked-by: Rob Herring <robh@kernel.org> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] dt-bindings: mailbox: stm32-ipcc: Updates for wakeup management @ 2019-10-29 1:26 ` Rob Herring 0 siblings, 0 replies; 8+ messages in thread From: Rob Herring @ 2019-10-29 1:26 UTC (permalink / raw) To: Fabien Dessenne Cc: Mark Rutland, Jassi Brar, Maxime Coquelin, Alexandre Torgue, linux-kernel, linux-stm32, linux-arm-kernel, devicetree On Wed, Oct 16, 2019 at 02:13:48PM +0200, Fabien Dessenne wrote: > The wakeup specific IRQ management is no more needed to wake up the stm32 > plaform. typo > > Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com> > Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> > --- > Documentation/devicetree/bindings/mailbox/stm32-ipcc.txt | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) With that fixed, Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] mailbox: stm32-ipcc: Update wakeup management 2019-10-16 12:13 ` Fabien Dessenne @ 2019-10-16 12:13 ` Fabien Dessenne -1 siblings, 0 replies; 8+ messages in thread From: Fabien Dessenne @ 2019-10-16 12:13 UTC (permalink / raw) To: Rob Herring, Mark Rutland, Jassi Brar, Maxime Coquelin, Alexandre Torgue, linux-kernel, linux-stm32, linux-arm-kernel, devicetree Cc: Fabien Dessenne The wakeup specific IRQ management is no more needed to wake up the stm32 plaform. A relationship has been established between the EXTI and the RX IRQ, just need to declare the EXTI interrupt instead of the IPCC RX IRQ. Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> --- drivers/mailbox/stm32-ipcc.c | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/drivers/mailbox/stm32-ipcc.c b/drivers/mailbox/stm32-ipcc.c index 5c2d1e1..ef96688 100644 --- a/drivers/mailbox/stm32-ipcc.c +++ b/drivers/mailbox/stm32-ipcc.c @@ -52,7 +52,6 @@ struct stm32_ipcc { struct clk *clk; spinlock_t lock; /* protect access to IPCC registers */ int irqs[IPCC_IRQ_NUM]; - int wkp; u32 proc_id; u32 n_chans; u32 xcr; @@ -282,16 +281,9 @@ static int stm32_ipcc_probe(struct platform_device *pdev) /* wakeup */ if (of_property_read_bool(np, "wakeup-source")) { - ipcc->wkp = platform_get_irq_byname(pdev, "wakeup"); - if (ipcc->wkp < 0) { - if (ipcc->wkp != -EPROBE_DEFER) - dev_err(dev, "could not get wakeup IRQ\n"); - ret = ipcc->wkp; - goto err_clk; - } - device_set_wakeup_capable(dev, true); - ret = dev_pm_set_dedicated_wake_irq(dev, ipcc->wkp); + + ret = dev_pm_set_wake_irq(dev, ipcc->irqs[IPCC_IRQ_RX]); if (ret) { dev_err(dev, "Failed to set wake up irq\n"); goto err_init_wkp; @@ -334,10 +326,10 @@ static int stm32_ipcc_probe(struct platform_device *pdev) return 0; err_irq_wkp: - if (ipcc->wkp) + if (of_property_read_bool(np, "wakeup-source")) dev_pm_clear_wake_irq(dev); err_init_wkp: - device_init_wakeup(dev, false); + device_set_wakeup_capable(dev, false); err_clk: clk_disable_unprepare(ipcc->clk); return ret; @@ -345,27 +337,17 @@ static int stm32_ipcc_probe(struct platform_device *pdev) static int stm32_ipcc_remove(struct platform_device *pdev) { - struct stm32_ipcc *ipcc = platform_get_drvdata(pdev); + struct device *dev = &pdev->dev; - if (ipcc->wkp) + if (of_property_read_bool(dev->of_node, "wakeup-source")) dev_pm_clear_wake_irq(&pdev->dev); - device_init_wakeup(&pdev->dev, false); + device_set_wakeup_capable(dev, false); return 0; } #ifdef CONFIG_PM_SLEEP -static void stm32_ipcc_set_irq_wake(struct device *dev, bool enable) -{ - struct stm32_ipcc *ipcc = dev_get_drvdata(dev); - unsigned int i; - - if (device_may_wakeup(dev)) - for (i = 0; i < IPCC_IRQ_NUM; i++) - irq_set_irq_wake(ipcc->irqs[i], enable); -} - static int stm32_ipcc_suspend(struct device *dev) { struct stm32_ipcc *ipcc = dev_get_drvdata(dev); @@ -373,8 +355,6 @@ static int stm32_ipcc_suspend(struct device *dev) ipcc->xmr = readl_relaxed(ipcc->reg_proc + IPCC_XMR); ipcc->xcr = readl_relaxed(ipcc->reg_proc + IPCC_XCR); - stm32_ipcc_set_irq_wake(dev, true); - return 0; } @@ -382,8 +362,6 @@ static int stm32_ipcc_resume(struct device *dev) { struct stm32_ipcc *ipcc = dev_get_drvdata(dev); - stm32_ipcc_set_irq_wake(dev, false); - writel_relaxed(ipcc->xmr, ipcc->reg_proc + IPCC_XMR); writel_relaxed(ipcc->xcr, ipcc->reg_proc + IPCC_XCR); -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] mailbox: stm32-ipcc: Update wakeup management @ 2019-10-16 12:13 ` Fabien Dessenne 0 siblings, 0 replies; 8+ messages in thread From: Fabien Dessenne @ 2019-10-16 12:13 UTC (permalink / raw) To: Rob Herring, Mark Rutland, Jassi Brar, Maxime Coquelin, Alexandre Torgue, linux-kernel, linux-stm32, linux-arm-kernel, devicetree Cc: Fabien Dessenne The wakeup specific IRQ management is no more needed to wake up the stm32 plaform. A relationship has been established between the EXTI and the RX IRQ, just need to declare the EXTI interrupt instead of the IPCC RX IRQ. Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> --- drivers/mailbox/stm32-ipcc.c | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/drivers/mailbox/stm32-ipcc.c b/drivers/mailbox/stm32-ipcc.c index 5c2d1e1..ef96688 100644 --- a/drivers/mailbox/stm32-ipcc.c +++ b/drivers/mailbox/stm32-ipcc.c @@ -52,7 +52,6 @@ struct stm32_ipcc { struct clk *clk; spinlock_t lock; /* protect access to IPCC registers */ int irqs[IPCC_IRQ_NUM]; - int wkp; u32 proc_id; u32 n_chans; u32 xcr; @@ -282,16 +281,9 @@ static int stm32_ipcc_probe(struct platform_device *pdev) /* wakeup */ if (of_property_read_bool(np, "wakeup-source")) { - ipcc->wkp = platform_get_irq_byname(pdev, "wakeup"); - if (ipcc->wkp < 0) { - if (ipcc->wkp != -EPROBE_DEFER) - dev_err(dev, "could not get wakeup IRQ\n"); - ret = ipcc->wkp; - goto err_clk; - } - device_set_wakeup_capable(dev, true); - ret = dev_pm_set_dedicated_wake_irq(dev, ipcc->wkp); + + ret = dev_pm_set_wake_irq(dev, ipcc->irqs[IPCC_IRQ_RX]); if (ret) { dev_err(dev, "Failed to set wake up irq\n"); goto err_init_wkp; @@ -334,10 +326,10 @@ static int stm32_ipcc_probe(struct platform_device *pdev) return 0; err_irq_wkp: - if (ipcc->wkp) + if (of_property_read_bool(np, "wakeup-source")) dev_pm_clear_wake_irq(dev); err_init_wkp: - device_init_wakeup(dev, false); + device_set_wakeup_capable(dev, false); err_clk: clk_disable_unprepare(ipcc->clk); return ret; @@ -345,27 +337,17 @@ static int stm32_ipcc_probe(struct platform_device *pdev) static int stm32_ipcc_remove(struct platform_device *pdev) { - struct stm32_ipcc *ipcc = platform_get_drvdata(pdev); + struct device *dev = &pdev->dev; - if (ipcc->wkp) + if (of_property_read_bool(dev->of_node, "wakeup-source")) dev_pm_clear_wake_irq(&pdev->dev); - device_init_wakeup(&pdev->dev, false); + device_set_wakeup_capable(dev, false); return 0; } #ifdef CONFIG_PM_SLEEP -static void stm32_ipcc_set_irq_wake(struct device *dev, bool enable) -{ - struct stm32_ipcc *ipcc = dev_get_drvdata(dev); - unsigned int i; - - if (device_may_wakeup(dev)) - for (i = 0; i < IPCC_IRQ_NUM; i++) - irq_set_irq_wake(ipcc->irqs[i], enable); -} - static int stm32_ipcc_suspend(struct device *dev) { struct stm32_ipcc *ipcc = dev_get_drvdata(dev); @@ -373,8 +355,6 @@ static int stm32_ipcc_suspend(struct device *dev) ipcc->xmr = readl_relaxed(ipcc->reg_proc + IPCC_XMR); ipcc->xcr = readl_relaxed(ipcc->reg_proc + IPCC_XCR); - stm32_ipcc_set_irq_wake(dev, true); - return 0; } @@ -382,8 +362,6 @@ static int stm32_ipcc_resume(struct device *dev) { struct stm32_ipcc *ipcc = dev_get_drvdata(dev); - stm32_ipcc_set_irq_wake(dev, false); - writel_relaxed(ipcc->xmr, ipcc->reg_proc + IPCC_XMR); writel_relaxed(ipcc->xcr, ipcc->reg_proc + IPCC_XCR); -- 2.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-10-29 1:26 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-10-16 12:13 [PATCH 0/2] mailbox: stm32-ipcc: rework wakeup Fabien Dessenne 2019-10-16 12:13 ` Fabien Dessenne 2019-10-16 12:13 ` [PATCH 1/2] dt-bindings: mailbox: stm32-ipcc: Updates for wakeup management Fabien Dessenne 2019-10-16 12:13 ` Fabien Dessenne 2019-10-29 1:26 ` Rob Herring 2019-10-29 1:26 ` Rob Herring 2019-10-16 12:13 ` [PATCH 2/2] mailbox: stm32-ipcc: Update " Fabien Dessenne 2019-10-16 12:13 ` Fabien Dessenne
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.