mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] irqchip/imx-irqsteer: constify irq_chip struct
@ 2022-04-06 16:37 Lucas Stach
  2022-04-06 16:37 ` [PATCH 2/2] irqchip/imx-irqsteer: add runtime PM support Lucas Stach
  2022-05-04 16:15 ` [irqchip: irq/irqchip-next] irqchip/imx-irqsteer: Constify irq_chip struct irqchip-bot for Lucas Stach
  0 siblings, 2 replies; 4+ messages in thread
From: Lucas Stach @ 2022-04-06 16:37 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier
  Cc: Pengutronix Kernel Team, NXP Linux Team, linux-kernel,
	linux-arm-kernel, patchwork-lst

The imx_irqsteer_irq_chip struct is constant data.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/irqchip/irq-imx-irqsteer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c
index 8d91a02593fc..e286e7c5ccbf 100644
--- a/drivers/irqchip/irq-imx-irqsteer.c
+++ b/drivers/irqchip/irq-imx-irqsteer.c
@@ -70,7 +70,7 @@ static void imx_irqsteer_irq_mask(struct irq_data *d)
 	raw_spin_unlock_irqrestore(&data->lock, flags);
 }
 
-static struct irq_chip imx_irqsteer_irq_chip = {
+static const struct irq_chip imx_irqsteer_irq_chip = {
 	.name		= "irqsteer",
 	.irq_mask	= imx_irqsteer_irq_mask,
 	.irq_unmask	= imx_irqsteer_irq_unmask,
-- 
2.30.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] irqchip/imx-irqsteer: add runtime PM support
  2022-04-06 16:37 [PATCH 1/2] irqchip/imx-irqsteer: constify irq_chip struct Lucas Stach
@ 2022-04-06 16:37 ` Lucas Stach
  2022-05-04 16:15   ` [irqchip: irq/irqchip-next] irqchip/imx-irqsteer: Add " irqchip-bot for Lucas Stach
  2022-05-04 16:15 ` [irqchip: irq/irqchip-next] irqchip/imx-irqsteer: Constify irq_chip struct irqchip-bot for Lucas Stach
  1 sibling, 1 reply; 4+ messages in thread
From: Lucas Stach @ 2022-04-06 16:37 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier
  Cc: Pengutronix Kernel Team, NXP Linux Team, linux-kernel,
	linux-arm-kernel, patchwork-lst

There are now SoCs that integrate the irqsteer controller within
a separate power domain. In order to allow this domain to be
powered down when not needed, add runtime PM support to the driver.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/irqchip/irq-imx-irqsteer.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c
index e286e7c5ccbf..96230a04ec23 100644
--- a/drivers/irqchip/irq-imx-irqsteer.c
+++ b/drivers/irqchip/irq-imx-irqsteer.c
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
+#include <linux/pm_runtime.h>
 #include <linux/spinlock.h>
 
 #define CTRL_STRIDE_OFF(_t, _r)	(_t * 4 * _r)
@@ -175,7 +176,7 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
 	data->irq_count = DIV_ROUND_UP(irqs_num, 64);
 	data->reg_num = irqs_num / 32;
 
-	if (IS_ENABLED(CONFIG_PM_SLEEP)) {
+	if (IS_ENABLED(CONFIG_PM)) {
 		data->saved_reg = devm_kzalloc(&pdev->dev,
 					sizeof(u32) * data->reg_num,
 					GFP_KERNEL);
@@ -199,6 +200,7 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
 		ret = -ENOMEM;
 		goto out;
 	}
+	irq_domain_set_pm_device(data->domain, &pdev->dev);
 
 	if (!data->irq_count || data->irq_count > CHAN_MAX_OUTPUT_INT) {
 		ret = -EINVAL;
@@ -219,6 +221,9 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, data);
 
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
+
 	return 0;
 out:
 	clk_disable_unprepare(data->ipg_clk);
@@ -241,7 +246,7 @@ static int imx_irqsteer_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_PM
 static void imx_irqsteer_save_regs(struct irqsteer_data *data)
 {
 	int i;
@@ -288,7 +293,10 @@ static int imx_irqsteer_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops imx_irqsteer_pm_ops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx_irqsteer_suspend, imx_irqsteer_resume)
+	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				      pm_runtime_force_resume)
+	SET_RUNTIME_PM_OPS(imx_irqsteer_suspend,
+			   imx_irqsteer_resume, NULL)
 };
 
 static const struct of_device_id imx_irqsteer_dt_ids[] = {
-- 
2.30.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [irqchip: irq/irqchip-next] irqchip/imx-irqsteer: Add runtime PM support
  2022-04-06 16:37 ` [PATCH 2/2] irqchip/imx-irqsteer: add runtime PM support Lucas Stach
@ 2022-05-04 16:15   ` irqchip-bot for Lucas Stach
  0 siblings, 0 replies; 4+ messages in thread
From: irqchip-bot for Lucas Stach @ 2022-05-04 16:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lucas Stach, Marc Zyngier, tglx

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     4730d2233311d86cad9dc510318d1b40e4b53cf2
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/4730d2233311d86cad9dc510318d1b40e4b53cf2
Author:        Lucas Stach <l.stach@pengutronix.de>
AuthorDate:    Wed, 06 Apr 2022 18:37:01 +02:00
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Wed, 04 May 2022 16:44:51 +01:00

irqchip/imx-irqsteer: Add runtime PM support

There are now SoCs that integrate the irqsteer controller within
a separate power domain. In order to allow this domain to be
powered down when not needed, add runtime PM support to the driver.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220406163701.1277930-2-l.stach@pengutronix.de
---
 drivers/irqchip/irq-imx-irqsteer.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c
index e286e7c..96230a0 100644
--- a/drivers/irqchip/irq-imx-irqsteer.c
+++ b/drivers/irqchip/irq-imx-irqsteer.c
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
+#include <linux/pm_runtime.h>
 #include <linux/spinlock.h>
 
 #define CTRL_STRIDE_OFF(_t, _r)	(_t * 4 * _r)
@@ -175,7 +176,7 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
 	data->irq_count = DIV_ROUND_UP(irqs_num, 64);
 	data->reg_num = irqs_num / 32;
 
-	if (IS_ENABLED(CONFIG_PM_SLEEP)) {
+	if (IS_ENABLED(CONFIG_PM)) {
 		data->saved_reg = devm_kzalloc(&pdev->dev,
 					sizeof(u32) * data->reg_num,
 					GFP_KERNEL);
@@ -199,6 +200,7 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
 		ret = -ENOMEM;
 		goto out;
 	}
+	irq_domain_set_pm_device(data->domain, &pdev->dev);
 
 	if (!data->irq_count || data->irq_count > CHAN_MAX_OUTPUT_INT) {
 		ret = -EINVAL;
@@ -219,6 +221,9 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, data);
 
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
+
 	return 0;
 out:
 	clk_disable_unprepare(data->ipg_clk);
@@ -241,7 +246,7 @@ static int imx_irqsteer_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_PM
 static void imx_irqsteer_save_regs(struct irqsteer_data *data)
 {
 	int i;
@@ -288,7 +293,10 @@ static int imx_irqsteer_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops imx_irqsteer_pm_ops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx_irqsteer_suspend, imx_irqsteer_resume)
+	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				      pm_runtime_force_resume)
+	SET_RUNTIME_PM_OPS(imx_irqsteer_suspend,
+			   imx_irqsteer_resume, NULL)
 };
 
 static const struct of_device_id imx_irqsteer_dt_ids[] = {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [irqchip: irq/irqchip-next] irqchip/imx-irqsteer: Constify irq_chip struct
  2022-04-06 16:37 [PATCH 1/2] irqchip/imx-irqsteer: constify irq_chip struct Lucas Stach
  2022-04-06 16:37 ` [PATCH 2/2] irqchip/imx-irqsteer: add runtime PM support Lucas Stach
@ 2022-05-04 16:15 ` irqchip-bot for Lucas Stach
  1 sibling, 0 replies; 4+ messages in thread
From: irqchip-bot for Lucas Stach @ 2022-05-04 16:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lucas Stach, Marc Zyngier, tglx

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     e9a50f12e579a48e124ac5adb93dafc35f0a46b8
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/e9a50f12e579a48e124ac5adb93dafc35f0a46b8
Author:        Lucas Stach <l.stach@pengutronix.de>
AuthorDate:    Wed, 06 Apr 2022 18:37:00 +02:00
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Wed, 04 May 2022 16:44:45 +01:00

irqchip/imx-irqsteer: Constify irq_chip struct

The imx_irqsteer_irq_chip struct is constant data.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220406163701.1277930-1-l.stach@pengutronix.de
---
 drivers/irqchip/irq-imx-irqsteer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c
index 8d91a02..e286e7c 100644
--- a/drivers/irqchip/irq-imx-irqsteer.c
+++ b/drivers/irqchip/irq-imx-irqsteer.c
@@ -70,7 +70,7 @@ static void imx_irqsteer_irq_mask(struct irq_data *d)
 	raw_spin_unlock_irqrestore(&data->lock, flags);
 }
 
-static struct irq_chip imx_irqsteer_irq_chip = {
+static const struct irq_chip imx_irqsteer_irq_chip = {
 	.name		= "irqsteer",
 	.irq_mask	= imx_irqsteer_irq_mask,
 	.irq_unmask	= imx_irqsteer_irq_unmask,

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-04 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06 16:37 [PATCH 1/2] irqchip/imx-irqsteer: constify irq_chip struct Lucas Stach
2022-04-06 16:37 ` [PATCH 2/2] irqchip/imx-irqsteer: add runtime PM support Lucas Stach
2022-05-04 16:15   ` [irqchip: irq/irqchip-next] irqchip/imx-irqsteer: Add " irqchip-bot for Lucas Stach
2022-05-04 16:15 ` [irqchip: irq/irqchip-next] irqchip/imx-irqsteer: Constify irq_chip struct irqchip-bot for Lucas Stach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®