|
@@ -29,6 +29,7 @@
|
|
|
#include <linux/slab.h>
|
|
|
#include <linux/module.h>
|
|
|
#include <linux/platform_data/irq-renesas-irqc.h>
|
|
|
+#include <linux/pm_runtime.h>
|
|
|
|
|
|
#define IRQC_IRQ_MAX 32 /* maximum 32 interrupts per driver instance */
|
|
|
|
|
@@ -180,6 +181,9 @@ static int irqc_probe(struct platform_device *pdev)
|
|
|
p->pdev = pdev;
|
|
|
platform_set_drvdata(pdev, p);
|
|
|
|
|
|
+ pm_runtime_enable(&pdev->dev);
|
|
|
+ pm_runtime_get_sync(&pdev->dev);
|
|
|
+
|
|
|
/* get hold of manadatory IOMEM */
|
|
|
io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
|
if (!io) {
|
|
@@ -260,6 +264,8 @@ err3:
|
|
|
err2:
|
|
|
iounmap(p->iomem);
|
|
|
err1:
|
|
|
+ pm_runtime_put(&pdev->dev);
|
|
|
+ pm_runtime_disable(&pdev->dev);
|
|
|
kfree(p);
|
|
|
err0:
|
|
|
return ret;
|
|
@@ -275,6 +281,8 @@ static int irqc_remove(struct platform_device *pdev)
|
|
|
|
|
|
irq_domain_remove(p->irq_domain);
|
|
|
iounmap(p->iomem);
|
|
|
+ pm_runtime_put(&pdev->dev);
|
|
|
+ pm_runtime_disable(&pdev->dev);
|
|
|
kfree(p);
|
|
|
return 0;
|
|
|
}
|