summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2019-06-12 05:39:08 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-06-12 10:38:20 -0400
commit0fd7ada14eefa99921fc24666ac93ca6931c09f0 (patch)
tree5503da03772682682dbe4cf4b3165d52d55bc612 /drivers/staging
parent0b675962d9395269ab2a808a08dabce5249de7b2 (diff)
media: hantro: add PM runtime resume callback
It seems that on i.MX8MQ the power domain controller does not propagate resets to the VPU cores on resume. Add a callback to allow implementing manual reset of the VPU cores after ungating the power domain. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/hantro/hantro.h2
-rw-r--r--drivers/staging/media/hantro/hantro_drv.c13
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/staging/media/hantro/hantro.h b/drivers/staging/media/hantro/hantro.h
index 14e685428203..296b9ffad547 100644
--- a/drivers/staging/media/hantro/hantro.h
+++ b/drivers/staging/media/hantro/hantro.h
@@ -56,6 +56,7 @@ struct hantro_codec_ops;
* @codec: Supported codecs
* @codec_ops: Codec ops.
* @init: Initialize hardware.
+ * @runtime_resume: reenable hardware after power gating
* @vepu_irq: encoder interrupt handler
* @vdpu_irq: decoder interrupt handler
* @clk_names: array of clock names
@@ -71,6 +72,7 @@ struct hantro_variant {
unsigned int codec;
const struct hantro_codec_ops *codec_ops;
int (*init)(struct hantro_dev *vpu);
+ int (*runtime_resume)(struct hantro_dev *vpu);
irqreturn_t (*vepu_irq)(int irq, void *priv);
irqreturn_t (*vdpu_irq)(int irq, void *priv);
const char *clk_names[HANTRO_MAX_CLOCKS];
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index 0eadcc530e63..ed10052dc1c8 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -832,9 +832,22 @@ static int hantro_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM
+static int hantro_runtime_resume(struct device *dev)
+{
+ struct hantro_dev *vpu = dev_get_drvdata(dev);
+
+ if (vpu->variant->runtime_resume)
+ return vpu->variant->runtime_resume(vpu);
+
+ return 0;
+}
+#endif
+
static const struct dev_pm_ops hantro_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
+ SET_RUNTIME_PM_OPS(NULL, hantro_runtime_resume, NULL)
};
static struct platform_driver hantro_driver = {