|
@@ -22,6 +22,7 @@
|
|
|
#include <linux/pm_runtime.h>
|
|
|
#include <linux/videodev2.h>
|
|
|
|
|
|
+#include <media/rcar-fcp.h>
|
|
|
#include <media/v4l2-subdev.h>
|
|
|
|
|
|
#include "vsp1.h"
|
|
@@ -514,6 +515,10 @@ static int vsp1_pm_resume(struct device *dev)
|
|
|
|
|
|
static int vsp1_pm_runtime_suspend(struct device *dev)
|
|
|
{
|
|
|
+ struct vsp1_device *vsp1 = dev_get_drvdata(dev);
|
|
|
+
|
|
|
+ rcar_fcp_disable(vsp1->fcp);
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -528,7 +533,7 @@ static int vsp1_pm_runtime_resume(struct device *dev)
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
- return 0;
|
|
|
+ return rcar_fcp_enable(vsp1->fcp);
|
|
|
}
|
|
|
|
|
|
static const struct dev_pm_ops vsp1_pm_ops = {
|
|
@@ -614,6 +619,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
|
|
|
static int vsp1_probe(struct platform_device *pdev)
|
|
|
{
|
|
|
struct vsp1_device *vsp1;
|
|
|
+ struct device_node *fcp_node;
|
|
|
struct resource *irq;
|
|
|
struct resource *io;
|
|
|
unsigned int i;
|
|
@@ -649,6 +655,18 @@ static int vsp1_probe(struct platform_device *pdev)
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+ /* FCP (optional) */
|
|
|
+ fcp_node = of_parse_phandle(pdev->dev.of_node, "renesas,fcp", 0);
|
|
|
+ if (fcp_node) {
|
|
|
+ vsp1->fcp = rcar_fcp_get(fcp_node);
|
|
|
+ of_node_put(fcp_node);
|
|
|
+ if (IS_ERR(vsp1->fcp)) {
|
|
|
+ dev_dbg(&pdev->dev, "FCP not found (%ld)\n",
|
|
|
+ PTR_ERR(vsp1->fcp));
|
|
|
+ return PTR_ERR(vsp1->fcp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/* Configure device parameters based on the version register. */
|
|
|
pm_runtime_enable(&pdev->dev);
|
|
|
|
|
@@ -694,6 +712,7 @@ static int vsp1_remove(struct platform_device *pdev)
|
|
|
struct vsp1_device *vsp1 = platform_get_drvdata(pdev);
|
|
|
|
|
|
vsp1_destroy_entities(vsp1);
|
|
|
+ rcar_fcp_put(vsp1->fcp);
|
|
|
|
|
|
pm_runtime_disable(&pdev->dev);
|
|
|
|