From: Philipp Zabel <p.zabel@pengutronix.de>
To: linux-media@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Boris Brezillon <boris.brezillon@collabora.com>,
Ezequiel Garcia <ezequiel@collabora.com>,
Nicolas Dufresne <nicolas@ndufresne.ca>,
Jonas Karlman <jonas@kwiboo.se>,
devicetree@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH v5 03/10] media: hantro: add PM runtime resume callback
Date: Wed, 12 Jun 2019 11:39:08 +0200 [thread overview]
Message-ID: <20190612093915.18973-4-p.zabel@pengutronix.de> (raw)
In-Reply-To: <20190612093915.18973-1-p.zabel@pengutronix.de>
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>
---
drivers/staging/media/hantro/hantro.h | 2 ++
drivers/staging/media/hantro/hantro_drv.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
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 = {
--
2.20.1
next prev parent reply other threads:[~2019-06-12 9:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-12 9:39 [PATCH v5 00/10] Rename Rockchip VPU driver to Hantro, add initial i.MX8M support Philipp Zabel
2019-06-12 9:39 ` [PATCH v5 01/10] rockchip/vpu: rename from rockchip to hantro Philipp Zabel
2019-06-12 9:39 ` [PATCH v5 02/10] media: hantro: print video device name in addition to device node Philipp Zabel
2019-06-12 9:39 ` Philipp Zabel [this message]
2019-06-12 9:39 ` [PATCH v5 04/10] media: hantro: make irq names configurable Philipp Zabel
2019-06-12 9:39 ` [PATCH v5 05/10] media: hantro: add support for named register ranges Philipp Zabel
2019-06-12 9:39 ` [PATCH v5 06/10] media: hantro: add support for separate control block Philipp Zabel
2019-06-12 9:39 ` [PATCH v5 07/10] media: hantro: allow arbitrary number of clocks Philipp Zabel
2019-06-12 9:39 ` [PATCH v5 08/10] media: dt-bindings: Document i.MX8MQ and i.MX8MM VPU bindings Philipp Zabel
2019-06-28 8:42 ` Hans Verkuil
2019-06-28 8:43 ` Hans Verkuil
2019-07-09 14:25 ` Rob Herring
2019-12-20 16:52 ` Adam Ford
2019-06-12 9:39 ` [PATCH v5 09/10] media: hantro: add initial i.MX8MQ support Philipp Zabel
2019-10-25 8:01 ` Hans Verkuil
2019-11-04 10:04 ` Philipp Zabel
2019-06-12 9:39 ` [PATCH v5 10/10] media: hantro: add initial i.MX8MM support (untested) Philipp Zabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190612093915.18973-4-p.zabel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=boris.brezillon@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=ezequiel@collabora.com \
--cc=hverkuil@xs4all.nl \
--cc=jonas@kwiboo.se \
--cc=kernel@pengutronix.de \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).