From: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
To: Eddie James <eajames@linux.ibm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>
Cc: linux-aspeed@lists.ozlabs.org, linux-media@vger.kernel.org,
devicetree@vger.kernel.org, openbmc@lists.ozlabs.org,
Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
Subject: [PATCH 3/3] media: aspeed: add AST2600 support
Date: Mon, 6 Jan 2020 17:15:03 -0800 [thread overview]
Message-ID: <20200107011503.17435-4-jae.hyun.yoo@linux.intel.com> (raw)
In-Reply-To: <20200107011503.17435-1-jae.hyun.yoo@linux.intel.com>
Video engine in AST2600 has the exactly same register set with
AST2500 except VR084 register which provides more precise JPEG
size read back. This commit adds support for the difference and
adds 'aspeed,ast2600-video-engine' compatible OF string.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
---
drivers/media/platform/aspeed-video.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
index d8593cb2ae84..0dbe72672338 100644
--- a/drivers/media/platform/aspeed-video.c
+++ b/drivers/media/platform/aspeed-video.c
@@ -72,10 +72,10 @@
#define VE_SEQ_CTRL_CAP_BUSY BIT(16)
#define VE_SEQ_CTRL_COMP_BUSY BIT(18)
-#ifdef CONFIG_MACH_ASPEED_G5
-#define VE_SEQ_CTRL_JPEG_MODE BIT(13) /* AST2500 */
-#else
+#ifdef CONFIG_MACH_ASPEED_G4
#define VE_SEQ_CTRL_JPEG_MODE BIT(8) /* AST2400 */
+#else
+#define VE_SEQ_CTRL_JPEG_MODE BIT(13) /* AST2500/2600 */
#endif /* CONFIG_MACH_ASPEED_G5 */
#define VE_CTRL 0x008
@@ -135,6 +135,12 @@
#define VE_OFFSET_COMP_STREAM 0x078
+#ifdef CONFIG_MACH_ASPEED_G6
+#define VE_JPEG_COMP_SIZE_READ_BACK 0x084 /* AST2600 */
+#else
+#define VE_JPEG_COMP_SIZE_READ_BACK VE_OFFSET_COMP_STREAM
+#endif
+
#define VE_SRC_LR_EDGE_DET 0x090
#define VE_SRC_LR_EDGE_DET_LEFT GENMASK(11, 0)
#define VE_SRC_LR_EDGE_DET_NO_V BIT(12)
@@ -572,7 +578,7 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg)
if (sts & VE_INTERRUPT_COMP_COMPLETE) {
struct aspeed_video_buffer *buf;
u32 frame_size = aspeed_video_read(video,
- VE_OFFSET_COMP_STREAM);
+ VE_JPEG_COMP_SIZE_READ_BACK);
spin_lock(&video->lock);
clear_bit(VIDEO_FRAME_INPRG, &video->flags);
@@ -1719,6 +1725,7 @@ static int aspeed_video_remove(struct platform_device *pdev)
static const struct of_device_id aspeed_video_of_match[] = {
{ .compatible = "aspeed,ast2400-video-engine" },
{ .compatible = "aspeed,ast2500-video-engine" },
+ { .compatible = "aspeed,ast2600-video-engine" },
{}
};
MODULE_DEVICE_TABLE(of, aspeed_video_of_match);
--
2.17.1
next prev parent reply other threads:[~2020-01-07 1:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-07 1:15 [PATCH 0/3] Add AST2600 Video Engine support Jae Hyun Yoo
2020-01-07 1:15 ` [PATCH 1/3] ARM: dts: aspeed-g6: Add Video Engine node Jae Hyun Yoo
2020-01-07 3:34 ` Joel Stanley
2020-01-07 1:15 ` [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support Jae Hyun Yoo
2020-01-07 2:43 ` Joel Stanley
2020-01-08 20:33 ` Rob Herring
2020-01-07 1:15 ` Jae Hyun Yoo [this message]
2020-01-07 3:15 ` [PATCH 3/3] media: aspeed: add AST2600 support Joel Stanley
2020-01-07 17:58 ` Jae Hyun Yoo
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=20200107011503.17435-4-jae.hyun.yoo@linux.intel.com \
--to=jae.hyun.yoo@linux.intel.com \
--cc=andrew@aj.id.au \
--cc=devicetree@vger.kernel.org \
--cc=eajames@linux.ibm.com \
--cc=joel@jms.id.au \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-media@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=robh+dt@kernel.org \
/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