Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: aspeed: add AST2600 support

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>
Reviewed-by: Eddie James <eajames@linux.ibm.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Jae Hyun Yoo and committed by
Mauro Carvalho Chehab
d737e7fe 5f028c51

+11 -4
+11 -4
drivers/media/platform/aspeed-video.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 2 // Copyright 2020 IBM Corp. 3 - // Copyright (c) 2019 Intel Corporation 3 + // Copyright (c) 2019-2020 Intel Corporation 4 4 5 5 #include <linux/atomic.h> 6 6 #include <linux/bitfield.h> ··· 132 132 #define VE_COMP_CTRL_HQ_DCT_CHR GENMASK(26, 22) 133 133 #define VE_COMP_CTRL_HQ_DCT_LUM GENMASK(31, 27) 134 134 135 - #define VE_OFFSET_COMP_STREAM 0x078 135 + #define AST2400_VE_COMP_SIZE_READ_BACK 0x078 136 + #define AST2600_VE_COMP_SIZE_READ_BACK 0x084 136 137 137 138 #define VE_SRC_LR_EDGE_DET 0x090 138 139 #define VE_SRC_LR_EDGE_DET_LEFT GENMASK(11, 0) ··· 253 252 254 253 static const struct aspeed_video_config ast2400_config = { 255 254 .jpeg_mode = AST2400_VE_SEQ_CTRL_JPEG_MODE, 256 - .comp_size_read = VE_OFFSET_COMP_STREAM, 255 + .comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK, 257 256 }; 258 257 259 258 static const struct aspeed_video_config ast2500_config = { 260 259 .jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE, 261 - .comp_size_read = VE_OFFSET_COMP_STREAM, 260 + .comp_size_read = AST2400_VE_COMP_SIZE_READ_BACK, 261 + }; 262 + 263 + static const struct aspeed_video_config ast2600_config = { 264 + .jpeg_mode = AST2500_VE_SEQ_CTRL_JPEG_MODE, 265 + .comp_size_read = AST2600_VE_COMP_SIZE_READ_BACK, 262 266 }; 263 267 264 268 static const u32 aspeed_video_jpeg_header[ASPEED_VIDEO_JPEG_HEADER_SIZE] = { ··· 1679 1673 static const struct of_device_id aspeed_video_of_match[] = { 1680 1674 { .compatible = "aspeed,ast2400-video-engine", .data = &ast2400_config }, 1681 1675 { .compatible = "aspeed,ast2500-video-engine", .data = &ast2500_config }, 1676 + { .compatible = "aspeed,ast2600-video-engine", .data = &ast2600_config }, 1682 1677 {} 1683 1678 }; 1684 1679 MODULE_DEVICE_TABLE(of, aspeed_video_of_match);