All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] media: aspeed: add AST2600 support
@ 2020-02-25 19:58 Jae Hyun Yoo
  2020-02-25 23:52   ` Joel Stanley
  2020-02-26 14:50 ` Eddie James
  0 siblings, 2 replies; 5+ messages in thread
From: Jae Hyun Yoo @ 2020-02-25 19:58 UTC (permalink / raw)
  To: Eddie James, Mauro Carvalho Chehab, Joel Stanley, Andrew Jeffery
  Cc: linux-aspeed, linux-media, openbmc, Jae Hyun Yoo

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 47444a336ebb..7d98db1d9b52 100644
--- a/drivers/media/platform/aspeed-video.c
+++ b/drivers/media/platform/aspeed-video.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // Copyright 2020 IBM Corp.
-// Copyright (c) 2019 Intel Corporation
+// Copyright (c) 2019-2020 Intel Corporation
 
 #include <linux/atomic.h>
 #include <linux/bitfield.h>
@@ -132,7 +132,8 @@
 #define  VE_COMP_CTRL_HQ_DCT_CHR	GENMASK(26, 22)
 #define  VE_COMP_CTRL_HQ_DCT_LUM	GENMASK(31, 27)
 
-#define VE_OFFSET_COMP_STREAM		0x078
+#define AST2400_VE_COMP_SIZE_READ_BACK	0x078
+#define AST2600_VE_COMP_SIZE_READ_BACK	0x084
 
 #define VE_SRC_LR_EDGE_DET		0x090
 #define  VE_SRC_LR_EDGE_DET_LEFT	GENMASK(11, 0)
@@ -252,12 +253,17 @@ struct aspeed_video_config {
 
 static const struct aspeed_video_config ast2400_config = {
 	.jpeg_mode = AST2400_VE_SEQ_CTRL_JPEG_MODE,
-	.comp_size_read = VE_OFFSET_COMP_STREAM,
+	.comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK,
 };
 
 static const struct aspeed_video_config ast2500_config = {
 	.jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE,
-	.comp_size_read = VE_OFFSET_COMP_STREAM,
+	.comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK,
+};
+
+static const struct aspeed_video_config ast2600_config = {
+	.jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE,
+	.comp_size_read = AST2600_VE_COMP_SIZE_READ_BACK,
 };
 
 static const u32 aspeed_video_jpeg_header[ASPEED_VIDEO_JPEG_HEADER_SIZE] = {
@@ -1673,6 +1679,7 @@ static int aspeed_video_init(struct aspeed_video *video)
 static const struct of_device_id aspeed_video_of_match[] = {
 	{ .compatible = "aspeed,ast2400-video-engine", .data = &ast2400_config },
 	{ .compatible = "aspeed,ast2500-video-engine", .data = &ast2500_config },
+	{ .compatible = "aspeed,ast2600-video-engine", .data = &ast2600_config },
 	{}
 };
 MODULE_DEVICE_TABLE(of, aspeed_video_of_match);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] media: aspeed: add AST2600 support
  2020-02-25 19:58 [PATCH -next] media: aspeed: add AST2600 support Jae Hyun Yoo
@ 2020-02-25 23:52   ` Joel Stanley
  2020-02-26 14:50 ` Eddie James
  1 sibling, 0 replies; 5+ messages in thread
From: Joel Stanley @ 2020-02-25 23:52 UTC (permalink / raw)
  To: Jae Hyun Yoo
  Cc: Eddie James, Mauro Carvalho Chehab, Andrew Jeffery, linux-aspeed,
	linux-media, OpenBMC Maillist

On Tue, 25 Feb 2020 at 19:56, 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>

Reviewed-by: Joel Stanley <joel@jms.id.au>

Did you post an update to the device tree bindings too?

> ---
>  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 47444a336ebb..7d98db1d9b52 100644
> --- a/drivers/media/platform/aspeed-video.c
> +++ b/drivers/media/platform/aspeed-video.c
> @@ -1,6 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0-or-later
>  // Copyright 2020 IBM Corp.
> -// Copyright (c) 2019 Intel Corporation
> +// Copyright (c) 2019-2020 Intel Corporation
>
>  #include <linux/atomic.h>
>  #include <linux/bitfield.h>
> @@ -132,7 +132,8 @@
>  #define  VE_COMP_CTRL_HQ_DCT_CHR       GENMASK(26, 22)
>  #define  VE_COMP_CTRL_HQ_DCT_LUM       GENMASK(31, 27)
>
> -#define VE_OFFSET_COMP_STREAM          0x078
> +#define AST2400_VE_COMP_SIZE_READ_BACK 0x078
> +#define AST2600_VE_COMP_SIZE_READ_BACK 0x084
>
>  #define VE_SRC_LR_EDGE_DET             0x090
>  #define  VE_SRC_LR_EDGE_DET_LEFT       GENMASK(11, 0)
> @@ -252,12 +253,17 @@ struct aspeed_video_config {
>
>  static const struct aspeed_video_config ast2400_config = {
>         .jpeg_mode = AST2400_VE_SEQ_CTRL_JPEG_MODE,
> -       .comp_size_read = VE_OFFSET_COMP_STREAM,
> +       .comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK,
>  };
>
>  static const struct aspeed_video_config ast2500_config = {
>         .jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE,
> -       .comp_size_read = VE_OFFSET_COMP_STREAM,
> +       .comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK,
> +};
> +
> +static const struct aspeed_video_config ast2600_config = {
> +       .jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE,
> +       .comp_size_read = AST2600_VE_COMP_SIZE_READ_BACK,
>  };
>
>  static const u32 aspeed_video_jpeg_header[ASPEED_VIDEO_JPEG_HEADER_SIZE] = {
> @@ -1673,6 +1679,7 @@ static int aspeed_video_init(struct aspeed_video *video)
>  static const struct of_device_id aspeed_video_of_match[] = {
>         { .compatible = "aspeed,ast2400-video-engine", .data = &ast2400_config },
>         { .compatible = "aspeed,ast2500-video-engine", .data = &ast2500_config },
> +       { .compatible = "aspeed,ast2600-video-engine", .data = &ast2600_config },
>         {}
>  };
>  MODULE_DEVICE_TABLE(of, aspeed_video_of_match);
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] media: aspeed: add AST2600 support
@ 2020-02-25 23:52   ` Joel Stanley
  0 siblings, 0 replies; 5+ messages in thread
From: Joel Stanley @ 2020-02-25 23:52 UTC (permalink / raw)
  To: Jae Hyun Yoo
  Cc: Eddie James, Mauro Carvalho Chehab, Andrew Jeffery, linux-aspeed,
	linux-media, OpenBMC Maillist

On Tue, 25 Feb 2020 at 19:56, 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>

Reviewed-by: Joel Stanley <joel@jms.id.au>

Did you post an update to the device tree bindings too?

> ---
>  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 47444a336ebb..7d98db1d9b52 100644
> --- a/drivers/media/platform/aspeed-video.c
> +++ b/drivers/media/platform/aspeed-video.c
> @@ -1,6 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0-or-later
>  // Copyright 2020 IBM Corp.
> -// Copyright (c) 2019 Intel Corporation
> +// Copyright (c) 2019-2020 Intel Corporation
>
>  #include <linux/atomic.h>
>  #include <linux/bitfield.h>
> @@ -132,7 +132,8 @@
>  #define  VE_COMP_CTRL_HQ_DCT_CHR       GENMASK(26, 22)
>  #define  VE_COMP_CTRL_HQ_DCT_LUM       GENMASK(31, 27)
>
> -#define VE_OFFSET_COMP_STREAM          0x078
> +#define AST2400_VE_COMP_SIZE_READ_BACK 0x078
> +#define AST2600_VE_COMP_SIZE_READ_BACK 0x084
>
>  #define VE_SRC_LR_EDGE_DET             0x090
>  #define  VE_SRC_LR_EDGE_DET_LEFT       GENMASK(11, 0)
> @@ -252,12 +253,17 @@ struct aspeed_video_config {
>
>  static const struct aspeed_video_config ast2400_config = {
>         .jpeg_mode = AST2400_VE_SEQ_CTRL_JPEG_MODE,
> -       .comp_size_read = VE_OFFSET_COMP_STREAM,
> +       .comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK,
>  };
>
>  static const struct aspeed_video_config ast2500_config = {
>         .jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE,
> -       .comp_size_read = VE_OFFSET_COMP_STREAM,
> +       .comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK,
> +};
> +
> +static const struct aspeed_video_config ast2600_config = {
> +       .jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE,
> +       .comp_size_read = AST2600_VE_COMP_SIZE_READ_BACK,
>  };
>
>  static const u32 aspeed_video_jpeg_header[ASPEED_VIDEO_JPEG_HEADER_SIZE] = {
> @@ -1673,6 +1679,7 @@ static int aspeed_video_init(struct aspeed_video *video)
>  static const struct of_device_id aspeed_video_of_match[] = {
>         { .compatible = "aspeed,ast2400-video-engine", .data = &ast2400_config },
>         { .compatible = "aspeed,ast2500-video-engine", .data = &ast2500_config },
> +       { .compatible = "aspeed,ast2600-video-engine", .data = &ast2600_config },
>         {}
>  };
>  MODULE_DEVICE_TABLE(of, aspeed_video_of_match);
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] media: aspeed: add AST2600 support
  2020-02-25 23:52   ` Joel Stanley
  (?)
@ 2020-02-26  0:09   ` Jae Hyun Yoo
  -1 siblings, 0 replies; 5+ messages in thread
From: Jae Hyun Yoo @ 2020-02-26  0:09 UTC (permalink / raw)
  To: Joel Stanley
  Cc: linux-aspeed, Andrew Jeffery, OpenBMC Maillist, Eddie James,
	Mauro Carvalho Chehab, linux-media

Hi Joel,

On 2/25/2020 3:52 PM, Joel Stanley wrote:
> On Tue, 25 Feb 2020 at 19:56, 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>
> 
> Reviewed-by: Joel Stanley <joel@jms.id.au>

Thanks for your review!

> Did you post an update to the device tree bindings too?

Device tree bindings and aspeed-g6.dtsi change were merged in
'next-20200225' tag already.

Thanks,

Jae

>> ---
>>   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 47444a336ebb..7d98db1d9b52 100644
>> --- a/drivers/media/platform/aspeed-video.c
>> +++ b/drivers/media/platform/aspeed-video.c
>> @@ -1,6 +1,6 @@
>>   // SPDX-License-Identifier: GPL-2.0-or-later
>>   // Copyright 2020 IBM Corp.
>> -// Copyright (c) 2019 Intel Corporation
>> +// Copyright (c) 2019-2020 Intel Corporation
>>
>>   #include <linux/atomic.h>
>>   #include <linux/bitfield.h>
>> @@ -132,7 +132,8 @@
>>   #define  VE_COMP_CTRL_HQ_DCT_CHR       GENMASK(26, 22)
>>   #define  VE_COMP_CTRL_HQ_DCT_LUM       GENMASK(31, 27)
>>
>> -#define VE_OFFSET_COMP_STREAM          0x078
>> +#define AST2400_VE_COMP_SIZE_READ_BACK 0x078
>> +#define AST2600_VE_COMP_SIZE_READ_BACK 0x084
>>
>>   #define VE_SRC_LR_EDGE_DET             0x090
>>   #define  VE_SRC_LR_EDGE_DET_LEFT       GENMASK(11, 0)
>> @@ -252,12 +253,17 @@ struct aspeed_video_config {
>>
>>   static const struct aspeed_video_config ast2400_config = {
>>          .jpeg_mode = AST2400_VE_SEQ_CTRL_JPEG_MODE,
>> -       .comp_size_read = VE_OFFSET_COMP_STREAM,
>> +       .comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK,
>>   };
>>
>>   static const struct aspeed_video_config ast2500_config = {
>>          .jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE,
>> -       .comp_size_read = VE_OFFSET_COMP_STREAM,
>> +       .comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK,
>> +};
>> +
>> +static const struct aspeed_video_config ast2600_config = {
>> +       .jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE,
>> +       .comp_size_read = AST2600_VE_COMP_SIZE_READ_BACK,
>>   };
>>
>>   static const u32 aspeed_video_jpeg_header[ASPEED_VIDEO_JPEG_HEADER_SIZE] = {
>> @@ -1673,6 +1679,7 @@ static int aspeed_video_init(struct aspeed_video *video)
>>   static const struct of_device_id aspeed_video_of_match[] = {
>>          { .compatible = "aspeed,ast2400-video-engine", .data = &ast2400_config },
>>          { .compatible = "aspeed,ast2500-video-engine", .data = &ast2500_config },
>> +       { .compatible = "aspeed,ast2600-video-engine", .data = &ast2600_config },
>>          {}
>>   };
>>   MODULE_DEVICE_TABLE(of, aspeed_video_of_match);
>> --
>> 2.17.1
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] media: aspeed: add AST2600 support
  2020-02-25 19:58 [PATCH -next] media: aspeed: add AST2600 support Jae Hyun Yoo
  2020-02-25 23:52   ` Joel Stanley
@ 2020-02-26 14:50 ` Eddie James
  1 sibling, 0 replies; 5+ messages in thread
From: Eddie James @ 2020-02-26 14:50 UTC (permalink / raw)
  To: Jae Hyun Yoo, Mauro Carvalho Chehab, Joel Stanley, Andrew Jeffery
  Cc: openbmc, linux-aspeed, linux-media


On 2/25/20 1:58 PM, Jae Hyun Yoo 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.


Thanks Jae!

Reviewed-by: Eddie James <eajames@linux.ibm.com>


>
> 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 47444a336ebb..7d98db1d9b52 100644
> --- a/drivers/media/platform/aspeed-video.c
> +++ b/drivers/media/platform/aspeed-video.c
> @@ -1,6 +1,6 @@
>   // SPDX-License-Identifier: GPL-2.0-or-later
>   // Copyright 2020 IBM Corp.
> -// Copyright (c) 2019 Intel Corporation
> +// Copyright (c) 2019-2020 Intel Corporation
>   
>   #include <linux/atomic.h>
>   #include <linux/bitfield.h>
> @@ -132,7 +132,8 @@
>   #define  VE_COMP_CTRL_HQ_DCT_CHR	GENMASK(26, 22)
>   #define  VE_COMP_CTRL_HQ_DCT_LUM	GENMASK(31, 27)
>   
> -#define VE_OFFSET_COMP_STREAM		0x078
> +#define AST2400_VE_COMP_SIZE_READ_BACK	0x078
> +#define AST2600_VE_COMP_SIZE_READ_BACK	0x084
>   
>   #define VE_SRC_LR_EDGE_DET		0x090
>   #define  VE_SRC_LR_EDGE_DET_LEFT	GENMASK(11, 0)
> @@ -252,12 +253,17 @@ struct aspeed_video_config {
>   
>   static const struct aspeed_video_config ast2400_config = {
>   	.jpeg_mode = AST2400_VE_SEQ_CTRL_JPEG_MODE,
> -	.comp_size_read = VE_OFFSET_COMP_STREAM,
> +	.comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK,
>   };
>   
>   static const struct aspeed_video_config ast2500_config = {
>   	.jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE,
> -	.comp_size_read = VE_OFFSET_COMP_STREAM,
> +	.comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK,
> +};
> +
> +static const struct aspeed_video_config ast2600_config = {
> +	.jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE,
> +	.comp_size_read = AST2600_VE_COMP_SIZE_READ_BACK,
>   };
>   
>   static const u32 aspeed_video_jpeg_header[ASPEED_VIDEO_JPEG_HEADER_SIZE] = {
> @@ -1673,6 +1679,7 @@ static int aspeed_video_init(struct aspeed_video *video)
>   static const struct of_device_id aspeed_video_of_match[] = {
>   	{ .compatible = "aspeed,ast2400-video-engine", .data = &ast2400_config },
>   	{ .compatible = "aspeed,ast2500-video-engine", .data = &ast2500_config },
> +	{ .compatible = "aspeed,ast2600-video-engine", .data = &ast2600_config },
>   	{}
>   };
>   MODULE_DEVICE_TABLE(of, aspeed_video_of_match);

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-26 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 19:58 [PATCH -next] media: aspeed: add AST2600 support Jae Hyun Yoo
2020-02-25 23:52 ` Joel Stanley
2020-02-25 23:52   ` Joel Stanley
2020-02-26  0:09   ` Jae Hyun Yoo
2020-02-26 14:50 ` Eddie James

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.