From: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
To: linux-aspeed@lists.ozlabs.org
Subject: [PATCH 3/3] media: aspeed: add AST2600 support
Date: Tue, 7 Jan 2020 09:58:02 -0800 [thread overview]
Message-ID: <86f3dc92-07b0-c993-6c3e-39db6c58214e@linux.intel.com> (raw)
In-Reply-To: <CACPK8XejA6emrboLzfwEpmn=dn1JcyHKJVud_cBXVNRiZixgTA@mail.gmail.com>
On 1/6/2020 7:15 PM, Joel Stanley wrote:
> On Tue, 7 Jan 2020 at 01:14, Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> wrote:
>>
>> 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 */
>
> Yeah, nah. This should have never been done this way. I will send some
> patches to fix it up, and you can add ast2600 support on top of them,
> if that works for you.
Yeah, the runtime configuration in your patch set is right way for it.
I'll rebase this patch set on top of your patch.
Thanks,
Jae
> Cheers,
>
> Joel
>
>>
>> #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
>>
prev parent reply other threads:[~2020-01-07 17:58 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 ` [PATCH 3/3] media: aspeed: add AST2600 support Jae Hyun Yoo
2020-01-07 3:15 ` Joel Stanley
2020-01-07 17:58 ` Jae Hyun Yoo [this message]
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=86f3dc92-07b0-c993-6c3e-39db6c58214e@linux.intel.com \
--to=jae.hyun.yoo@linux.intel.com \
--cc=linux-aspeed@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).