1/* SPDX-License-Identifier: GPL-2.0-only */
2/* drivers/gpu/drm/exynos/regs-rotator.h
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * Register definition file for Samsung Rotator Interface (Rotator) driver
8*/
9
10#ifndef EXYNOS_REGS_ROTATOR_H
11#define EXYNOS_REGS_ROTATOR_H
12
13/* Configuration */
14#define ROT_CONFIG 0x00
15#define ROT_CONFIG_IRQ (3 << 8)
16
17/* Image Control */
18#define ROT_CONTROL 0x10
19#define ROT_CONTROL_PATTERN_WRITE (1 << 16)
20#define ROT_CONTROL_FMT_YCBCR420_2P (1 << 8)
21#define ROT_CONTROL_FMT_RGB888 (6 << 8)
22#define ROT_CONTROL_FMT_MASK (7 << 8)
23#define ROT_CONTROL_FLIP_VERTICAL (2 << 6)
24#define ROT_CONTROL_FLIP_HORIZONTAL (3 << 6)
25#define ROT_CONTROL_FLIP_MASK (3 << 6)
26#define ROT_CONTROL_ROT_90 (1 << 4)
27#define ROT_CONTROL_ROT_180 (2 << 4)
28#define ROT_CONTROL_ROT_270 (3 << 4)
29#define ROT_CONTROL_ROT_MASK (3 << 4)
30#define ROT_CONTROL_START (1 << 0)
31
32/* Status */
33#define ROT_STATUS 0x20
34#define ROT_STATUS_IRQ_PENDING(x) (1 << (x))
35#define ROT_STATUS_IRQ(x) (((x) >> 8) & 0x3)
36#define ROT_STATUS_IRQ_VAL_COMPLETE 1
37#define ROT_STATUS_IRQ_VAL_ILLEGAL 2
38
39/* Buffer Address */
40#define ROT_SRC_BUF_ADDR(n) (0x30 + ((n) << 2))
41#define ROT_DST_BUF_ADDR(n) (0x50 + ((n) << 2))
42
43/* Buffer Size */
44#define ROT_SRC_BUF_SIZE 0x3c
45#define ROT_DST_BUF_SIZE 0x5c
46#define ROT_SET_BUF_SIZE_H(x) ((x) << 16)
47#define ROT_SET_BUF_SIZE_W(x) ((x) << 0)
48#define ROT_GET_BUF_SIZE_H(x) ((x) >> 16)
49#define ROT_GET_BUF_SIZE_W(x) ((x) & 0xffff)
50
51/* Crop Position */
52#define ROT_SRC_CROP_POS 0x40
53#define ROT_DST_CROP_POS 0x60
54#define ROT_CROP_POS_Y(x) ((x) << 16)
55#define ROT_CROP_POS_X(x) ((x) << 0)
56
57/* Source Crop Size */
58#define ROT_SRC_CROP_SIZE 0x44
59#define ROT_SRC_CROP_SIZE_H(x) ((x) << 16)
60#define ROT_SRC_CROP_SIZE_W(x) ((x) << 0)
61
62/* Round to nearest aligned value */
63#define ROT_ALIGN(x, align, mask) (((x) + (1 << ((align) - 1))) & (mask))
64/* Minimum limit value */
65#define ROT_MIN(min, mask) (((min) + ~(mask)) & (mask))
66/* Maximum limit value */
67#define ROT_MAX(max, mask) ((max) & (mask))
68
69#endif /* EXYNOS_REGS_ROTATOR_H */
70
71

source code of linux/drivers/gpu/drm/exynos/regs-rotator.h