18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Register definition file for s3c24xx/s3c64xx SoC CAMIF driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2012 Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
68c2ecf20Sopenharmony_ci * Copyright (C) 2012 Tomasz Figa <tomasz.figa@gmail.com>
78c2ecf20Sopenharmony_ci*/
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef CAMIF_REGS_H_
108c2ecf20Sopenharmony_ci#define CAMIF_REGS_H_
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <linux/bitops.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include "camif-core.h"
158c2ecf20Sopenharmony_ci#include <media/drv-intf/s3c_camif.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/*
188c2ecf20Sopenharmony_ci * The id argument indicates the processing path:
198c2ecf20Sopenharmony_ci * id = 0 - codec (FIMC C), 1 - preview (FIMC P).
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci/* Camera input format */
238c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CISRCFMT			0x00
248c2ecf20Sopenharmony_ci#define  CISRCFMT_ITU601_8BIT			BIT(31)
258c2ecf20Sopenharmony_ci#define  CISRCFMT_ITU656_8BIT			(0 << 31)
268c2ecf20Sopenharmony_ci#define  CISRCFMT_ORDER422_YCBYCR		(0 << 14)
278c2ecf20Sopenharmony_ci#define  CISRCFMT_ORDER422_YCRYCB		(1 << 14)
288c2ecf20Sopenharmony_ci#define  CISRCFMT_ORDER422_CBYCRY		(2 << 14)
298c2ecf20Sopenharmony_ci#define  CISRCFMT_ORDER422_CRYCBY		(3 << 14)
308c2ecf20Sopenharmony_ci#define  CISRCFMT_ORDER422_MASK			(3 << 14)
318c2ecf20Sopenharmony_ci#define  CISRCFMT_SIZE_CAM_MASK			(0x1fff << 16 | 0x1fff)
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci/* Window offset */
348c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CIWDOFST			0x04
358c2ecf20Sopenharmony_ci#define  CIWDOFST_WINOFSEN			BIT(31)
368c2ecf20Sopenharmony_ci#define  CIWDOFST_CLROVCOFIY			BIT(30)
378c2ecf20Sopenharmony_ci#define  CIWDOFST_CLROVRLB_PR			BIT(28)
388c2ecf20Sopenharmony_ci/* #define  CIWDOFST_CLROVPRFIY			BIT(27) */
398c2ecf20Sopenharmony_ci#define  CIWDOFST_CLROVCOFICB			BIT(15)
408c2ecf20Sopenharmony_ci#define  CIWDOFST_CLROVCOFICR			BIT(14)
418c2ecf20Sopenharmony_ci#define  CIWDOFST_CLROVPRFICB			BIT(13)
428c2ecf20Sopenharmony_ci#define  CIWDOFST_CLROVPRFICR			BIT(12)
438c2ecf20Sopenharmony_ci#define  CIWDOFST_OFST_MASK			(0x7ff << 16 | 0x7ff)
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci/* Window offset 2 */
468c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CIWDOFST2			0x14
478c2ecf20Sopenharmony_ci#define  CIWDOFST2_OFST2_MASK			(0xfff << 16 | 0xfff)
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci/* Global control */
508c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CIGCTRL			0x08
518c2ecf20Sopenharmony_ci#define  CIGCTRL_SWRST				BIT(31)
528c2ecf20Sopenharmony_ci#define  CIGCTRL_CAMRST				BIT(30)
538c2ecf20Sopenharmony_ci#define  CIGCTRL_TESTPATTERN_NORMAL		(0 << 27)
548c2ecf20Sopenharmony_ci#define  CIGCTRL_TESTPATTERN_COLOR_BAR		(1 << 27)
558c2ecf20Sopenharmony_ci#define  CIGCTRL_TESTPATTERN_HOR_INC		(2 << 27)
568c2ecf20Sopenharmony_ci#define  CIGCTRL_TESTPATTERN_VER_INC		(3 << 27)
578c2ecf20Sopenharmony_ci#define  CIGCTRL_TESTPATTERN_MASK		(3 << 27)
588c2ecf20Sopenharmony_ci#define  CIGCTRL_INVPOLPCLK			BIT(26)
598c2ecf20Sopenharmony_ci#define  CIGCTRL_INVPOLVSYNC			BIT(25)
608c2ecf20Sopenharmony_ci#define  CIGCTRL_INVPOLHREF			BIT(24)
618c2ecf20Sopenharmony_ci#define  CIGCTRL_IRQ_OVFEN			BIT(22)
628c2ecf20Sopenharmony_ci#define  CIGCTRL_HREF_MASK			BIT(21)
638c2ecf20Sopenharmony_ci#define  CIGCTRL_IRQ_LEVEL			BIT(20)
648c2ecf20Sopenharmony_ci/* IRQ_CLR_C, IRQ_CLR_P */
658c2ecf20Sopenharmony_ci#define  CIGCTRL_IRQ_CLR(id)			BIT(19 - (id))
668c2ecf20Sopenharmony_ci#define  CIGCTRL_FIELDMODE			BIT(2)
678c2ecf20Sopenharmony_ci#define  CIGCTRL_INVPOLFIELD			BIT(1)
688c2ecf20Sopenharmony_ci#define  CIGCTRL_CAM_INTERLACE			BIT(0)
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci/* Y DMA output frame start address. n = 0..3. */
718c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CIYSA(id, n)		(0x18 + (id) * 0x54 + (n) * 4)
728c2ecf20Sopenharmony_ci/* Cb plane output DMA start address. n = 0..3. Only codec path. */
738c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CICBSA(id, n)		(0x28 + (id) * 0x54 + (n) * 4)
748c2ecf20Sopenharmony_ci/* Cr plane output DMA start address. n = 0..3. Only codec path. */
758c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CICRSA(id, n)		(0x38 + (id) * 0x54 + (n) * 4)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/* CICOTRGFMT, CIPRTRGFMT - Target format */
788c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CITRGFMT(id, _offs)	(0x48 + (id) * (0x34 + (_offs)))
798c2ecf20Sopenharmony_ci#define  CITRGFMT_IN422				BIT(31) /* only for s3c24xx */
808c2ecf20Sopenharmony_ci#define  CITRGFMT_OUT422			BIT(30) /* only for s3c24xx */
818c2ecf20Sopenharmony_ci#define  CITRGFMT_OUTFORMAT_YCBCR420		(0 << 29) /* only for s3c6410 */
828c2ecf20Sopenharmony_ci#define  CITRGFMT_OUTFORMAT_YCBCR422		(1 << 29) /* only for s3c6410 */
838c2ecf20Sopenharmony_ci#define  CITRGFMT_OUTFORMAT_YCBCR422I		(2 << 29) /* only for s3c6410 */
848c2ecf20Sopenharmony_ci#define  CITRGFMT_OUTFORMAT_RGB			(3 << 29) /* only for s3c6410 */
858c2ecf20Sopenharmony_ci#define  CITRGFMT_OUTFORMAT_MASK		(3 << 29) /* only for s3c6410 */
868c2ecf20Sopenharmony_ci#define  CITRGFMT_TARGETHSIZE(x)		((x) << 16)
878c2ecf20Sopenharmony_ci#define  CITRGFMT_FLIP_NORMAL			(0 << 14)
888c2ecf20Sopenharmony_ci#define  CITRGFMT_FLIP_X_MIRROR			(1 << 14)
898c2ecf20Sopenharmony_ci#define  CITRGFMT_FLIP_Y_MIRROR			(2 << 14)
908c2ecf20Sopenharmony_ci#define  CITRGFMT_FLIP_180			(3 << 14)
918c2ecf20Sopenharmony_ci#define  CITRGFMT_FLIP_MASK			(3 << 14)
928c2ecf20Sopenharmony_ci/* Preview path only */
938c2ecf20Sopenharmony_ci#define  CITRGFMT_ROT90_PR			BIT(13)
948c2ecf20Sopenharmony_ci#define  CITRGFMT_TARGETVSIZE(x)		((x) << 0)
958c2ecf20Sopenharmony_ci#define  CITRGFMT_TARGETSIZE_MASK		((0x1fff << 16) | 0x1fff)
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci/* CICOCTRL, CIPRCTRL. Output DMA control. */
988c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CICTRL(id, _offs)		(0x4c + (id) * (0x34 + (_offs)))
998c2ecf20Sopenharmony_ci#define  CICTRL_BURST_MASK			(0xfffff << 4)
1008c2ecf20Sopenharmony_ci/* xBURSTn - 5-bits width */
1018c2ecf20Sopenharmony_ci#define  CICTRL_YBURST1(x)			((x) << 19)
1028c2ecf20Sopenharmony_ci#define  CICTRL_YBURST2(x)			((x) << 14)
1038c2ecf20Sopenharmony_ci#define  CICTRL_RGBBURST1(x)			((x) << 19)
1048c2ecf20Sopenharmony_ci#define  CICTRL_RGBBURST2(x)			((x) << 14)
1058c2ecf20Sopenharmony_ci#define  CICTRL_CBURST1(x)			((x) << 9)
1068c2ecf20Sopenharmony_ci#define  CICTRL_CBURST2(x)			((x) << 4)
1078c2ecf20Sopenharmony_ci#define  CICTRL_LASTIRQ_ENABLE			BIT(2)
1088c2ecf20Sopenharmony_ci#define  CICTRL_ORDER422_MASK			(3 << 0)
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci/* CICOSCPRERATIO, CIPRSCPRERATIO. Pre-scaler control 1. */
1118c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CISCPRERATIO(id, _offs)	(0x50 + (id) * (0x34 + (_offs)))
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci/* CICOSCPREDST, CIPRSCPREDST. Pre-scaler control 2. */
1148c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CISCPREDST(id, _offs)	(0x54 + (id) * (0x34 + (_offs)))
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci/* CICOSCCTRL, CIPRSCCTRL. Main scaler control. */
1178c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CISCCTRL(id, _offs)	(0x58 + (id) * (0x34 + (_offs)))
1188c2ecf20Sopenharmony_ci#define  CISCCTRL_SCALERBYPASS			BIT(31)
1198c2ecf20Sopenharmony_ci/* s3c244x preview path only, s3c64xx both */
1208c2ecf20Sopenharmony_ci#define  CIPRSCCTRL_SAMPLE			BIT(31)
1218c2ecf20Sopenharmony_ci/* 0 - 16-bit RGB, 1 - 24-bit RGB */
1228c2ecf20Sopenharmony_ci#define  CIPRSCCTRL_RGB_FORMAT_24BIT		BIT(30) /* only for s3c244x */
1238c2ecf20Sopenharmony_ci#define  CIPRSCCTRL_SCALEUP_H			BIT(29) /* only for s3c244x */
1248c2ecf20Sopenharmony_ci#define  CIPRSCCTRL_SCALEUP_V			BIT(28) /* only for s3c244x */
1258c2ecf20Sopenharmony_ci/* s3c64xx */
1268c2ecf20Sopenharmony_ci#define  CISCCTRL_SCALEUP_H			BIT(30)
1278c2ecf20Sopenharmony_ci#define  CISCCTRL_SCALEUP_V			BIT(29)
1288c2ecf20Sopenharmony_ci#define  CISCCTRL_SCALEUP_MASK			(0x3 << 29)
1298c2ecf20Sopenharmony_ci#define  CISCCTRL_CSCR2Y_WIDE			BIT(28)
1308c2ecf20Sopenharmony_ci#define  CISCCTRL_CSCY2R_WIDE			BIT(27)
1318c2ecf20Sopenharmony_ci#define  CISCCTRL_LCDPATHEN_FIFO		BIT(26)
1328c2ecf20Sopenharmony_ci#define  CISCCTRL_INTERLACE			BIT(25)
1338c2ecf20Sopenharmony_ci#define  CISCCTRL_SCALERSTART			BIT(15)
1348c2ecf20Sopenharmony_ci#define  CISCCTRL_INRGB_FMT_RGB565		(0 << 13)
1358c2ecf20Sopenharmony_ci#define  CISCCTRL_INRGB_FMT_RGB666		(1 << 13)
1368c2ecf20Sopenharmony_ci#define  CISCCTRL_INRGB_FMT_RGB888		(2 << 13)
1378c2ecf20Sopenharmony_ci#define  CISCCTRL_INRGB_FMT_MASK		(3 << 13)
1388c2ecf20Sopenharmony_ci#define  CISCCTRL_OUTRGB_FMT_RGB565		(0 << 11)
1398c2ecf20Sopenharmony_ci#define  CISCCTRL_OUTRGB_FMT_RGB666		(1 << 11)
1408c2ecf20Sopenharmony_ci#define  CISCCTRL_OUTRGB_FMT_RGB888		(2 << 11)
1418c2ecf20Sopenharmony_ci#define  CISCCTRL_OUTRGB_FMT_MASK		(3 << 11)
1428c2ecf20Sopenharmony_ci#define  CISCCTRL_EXTRGB_EXTENSION		BIT(10)
1438c2ecf20Sopenharmony_ci#define  CISCCTRL_ONE2ONE			BIT(9)
1448c2ecf20Sopenharmony_ci#define  CISCCTRL_MAIN_RATIO_MASK		(0x1ff << 16 | 0x1ff)
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci/* CICOTAREA, CIPRTAREA. Target area for DMA (Hsize x Vsize). */
1478c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CITAREA(id, _offs)	(0x5c + (id) * (0x34 + (_offs)))
1488c2ecf20Sopenharmony_ci#define CITAREA_MASK				0xfffffff
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ci/* Codec (id = 0) or preview (id = 1) path status. */
1518c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CISTATUS(id, _offs)	(0x64 + (id) * (0x34 + (_offs)))
1528c2ecf20Sopenharmony_ci#define  CISTATUS_OVFIY_STATUS			BIT(31)
1538c2ecf20Sopenharmony_ci#define  CISTATUS_OVFICB_STATUS			BIT(30)
1548c2ecf20Sopenharmony_ci#define  CISTATUS_OVFICR_STATUS			BIT(29)
1558c2ecf20Sopenharmony_ci#define  CISTATUS_OVF_MASK			(0x7 << 29)
1568c2ecf20Sopenharmony_ci#define  CIPRSTATUS_OVF_MASK			(0x3 << 30)
1578c2ecf20Sopenharmony_ci#define  CISTATUS_VSYNC_STATUS			BIT(28)
1588c2ecf20Sopenharmony_ci#define  CISTATUS_FRAMECNT_MASK			(3 << 26)
1598c2ecf20Sopenharmony_ci#define  CISTATUS_FRAMECNT(__reg)		(((__reg) >> 26) & 0x3)
1608c2ecf20Sopenharmony_ci#define  CISTATUS_WINOFSTEN_STATUS		BIT(25)
1618c2ecf20Sopenharmony_ci#define  CISTATUS_IMGCPTEN_STATUS		BIT(22)
1628c2ecf20Sopenharmony_ci#define  CISTATUS_IMGCPTENSC_STATUS		BIT(21)
1638c2ecf20Sopenharmony_ci#define  CISTATUS_VSYNC_A_STATUS		BIT(20)
1648c2ecf20Sopenharmony_ci#define  CISTATUS_FRAMEEND_STATUS		BIT(19) /* 17 on s3c64xx */
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci/* Image capture enable */
1678c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CIIMGCPT(_offs)		(0xa0 + (_offs))
1688c2ecf20Sopenharmony_ci#define  CIIMGCPT_IMGCPTEN			BIT(31)
1698c2ecf20Sopenharmony_ci#define  CIIMGCPT_IMGCPTEN_SC(id)		BIT(30 - (id))
1708c2ecf20Sopenharmony_ci/* Frame control: 1 - one-shot, 0 - free run */
1718c2ecf20Sopenharmony_ci#define  CIIMGCPT_CPT_FREN_ENABLE(id)		BIT(25 - (id))
1728c2ecf20Sopenharmony_ci#define  CIIMGCPT_CPT_FRMOD_ENABLE		(0 << 18)
1738c2ecf20Sopenharmony_ci#define  CIIMGCPT_CPT_FRMOD_CNT			BIT(18)
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci/* Capture sequence */
1768c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CICPTSEQ			0xc4
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci/* Image effects */
1798c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CIIMGEFF(_offs)		(0xb0 + (_offs))
1808c2ecf20Sopenharmony_ci#define  CIIMGEFF_IE_ENABLE(id)			BIT(30 + (id))
1818c2ecf20Sopenharmony_ci#define  CIIMGEFF_IE_ENABLE_MASK		(3 << 30)
1828c2ecf20Sopenharmony_ci/* Image effect: 1 - after scaler, 0 - before scaler */
1838c2ecf20Sopenharmony_ci#define  CIIMGEFF_IE_AFTER_SC			BIT(29)
1848c2ecf20Sopenharmony_ci#define  CIIMGEFF_FIN_MASK			(7 << 26)
1858c2ecf20Sopenharmony_ci#define  CIIMGEFF_FIN_BYPASS			(0 << 26)
1868c2ecf20Sopenharmony_ci#define  CIIMGEFF_FIN_ARBITRARY			(1 << 26)
1878c2ecf20Sopenharmony_ci#define  CIIMGEFF_FIN_NEGATIVE			(2 << 26)
1888c2ecf20Sopenharmony_ci#define  CIIMGEFF_FIN_ARTFREEZE			(3 << 26)
1898c2ecf20Sopenharmony_ci#define  CIIMGEFF_FIN_EMBOSSING			(4 << 26)
1908c2ecf20Sopenharmony_ci#define  CIIMGEFF_FIN_SILHOUETTE		(5 << 26)
1918c2ecf20Sopenharmony_ci#define  CIIMGEFF_PAT_CBCR_MASK			((0xff << 13) | 0xff)
1928c2ecf20Sopenharmony_ci#define  CIIMGEFF_PAT_CB(x)			((x) << 13)
1938c2ecf20Sopenharmony_ci#define  CIIMGEFF_PAT_CR(x)			(x)
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci/* MSCOY0SA, MSPRY0SA. Y/Cb/Cr frame start address for input DMA. */
1968c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSY0SA(id)		(0xd4 + ((id) * 0x2c))
1978c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSCB0SA(id)		(0xd8 + ((id) * 0x2c))
1988c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSCR0SA(id)		(0xdc + ((id) * 0x2c))
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci/* MSCOY0END, MSCOY0END. Y/Cb/Cr frame end address for input DMA. */
2018c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSY0END(id)		(0xe0 + ((id) * 0x2c))
2028c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSCB0END(id)		(0xe4 + ((id) * 0x2c))
2038c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSCR0END(id)		(0xe8 + ((id) * 0x2c))
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci/* MSPRYOFF, MSPRYOFF. Y/Cb/Cr offset. n: 0 - codec, 1 - preview. */
2068c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSYOFF(id)		(0x118 + ((id) * 0x2c))
2078c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSCBOFF(id)		(0x11c + ((id) * 0x2c))
2088c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSCROFF(id)		(0x120 + ((id) * 0x2c))
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ci/* Real input DMA data size. n = 0 - codec, 1 - preview. */
2118c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSWIDTH(id)		(0xf8 + (id) * 0x2c)
2128c2ecf20Sopenharmony_ci#define  AUTOLOAD_ENABLE			BIT(31)
2138c2ecf20Sopenharmony_ci#define  ADDR_CH_DIS				BIT(30)
2148c2ecf20Sopenharmony_ci#define  MSHEIGHT(x)				(((x) & 0x3ff) << 16)
2158c2ecf20Sopenharmony_ci#define  MSWIDTH(x)				((x) & 0x3ff)
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci/* Input DMA control. n = 0 - codec, 1 - preview */
2188c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_MSCTRL(id)		(0xfc + (id) * 0x2c)
2198c2ecf20Sopenharmony_ci#define  MSCTRL_ORDER422_M_YCBYCR		(0 << 4)
2208c2ecf20Sopenharmony_ci#define  MSCTRL_ORDER422_M_YCRYCB		(1 << 4)
2218c2ecf20Sopenharmony_ci#define  MSCTRL_ORDER422_M_CBYCRY		(2 << 4)
2228c2ecf20Sopenharmony_ci#define  MSCTRL_ORDER422_M_CRYCBY		(3 << 4)
2238c2ecf20Sopenharmony_ci/* 0 - camera, 1 - DMA */
2248c2ecf20Sopenharmony_ci#define  MSCTRL_SEL_DMA_CAM			BIT(3)
2258c2ecf20Sopenharmony_ci#define  MSCTRL_INFORMAT_M_YCBCR420		(0 << 1)
2268c2ecf20Sopenharmony_ci#define  MSCTRL_INFORMAT_M_YCBCR422		(1 << 1)
2278c2ecf20Sopenharmony_ci#define  MSCTRL_INFORMAT_M_YCBCR422I		(2 << 1)
2288c2ecf20Sopenharmony_ci#define  MSCTRL_INFORMAT_M_RGB			(3 << 1)
2298c2ecf20Sopenharmony_ci#define  MSCTRL_ENVID_M				BIT(0)
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci/* CICOSCOSY, CIPRSCOSY. Scan line Y/Cb/Cr offset. */
2328c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CISSY(id)			(0x12c + (id) * 0x0c)
2338c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CISSCB(id)		(0x130 + (id) * 0x0c)
2348c2ecf20Sopenharmony_ci#define S3C_CAMIF_REG_CISSCR(id)		(0x134 + (id) * 0x0c)
2358c2ecf20Sopenharmony_ci#define S3C_CISS_OFFS_INITIAL(x)		((x) << 16)
2368c2ecf20Sopenharmony_ci#define S3C_CISS_OFFS_LINE(x)			((x) << 0)
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci/* ------------------------------------------------------------------ */
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_civoid camif_hw_reset(struct camif_dev *camif);
2418c2ecf20Sopenharmony_civoid camif_hw_clear_pending_irq(struct camif_vp *vp);
2428c2ecf20Sopenharmony_civoid camif_hw_clear_fifo_overflow(struct camif_vp *vp);
2438c2ecf20Sopenharmony_civoid camif_hw_set_lastirq(struct camif_vp *vp, int enable);
2448c2ecf20Sopenharmony_civoid camif_hw_set_input_path(struct camif_vp *vp);
2458c2ecf20Sopenharmony_civoid camif_hw_enable_scaler(struct camif_vp *vp, bool on);
2468c2ecf20Sopenharmony_civoid camif_hw_enable_capture(struct camif_vp *vp);
2478c2ecf20Sopenharmony_civoid camif_hw_disable_capture(struct camif_vp *vp);
2488c2ecf20Sopenharmony_civoid camif_hw_set_camera_bus(struct camif_dev *camif);
2498c2ecf20Sopenharmony_civoid camif_hw_set_source_format(struct camif_dev *camif);
2508c2ecf20Sopenharmony_civoid camif_hw_set_camera_crop(struct camif_dev *camif);
2518c2ecf20Sopenharmony_civoid camif_hw_set_scaler(struct camif_vp *vp);
2528c2ecf20Sopenharmony_civoid camif_hw_set_flip(struct camif_vp *vp);
2538c2ecf20Sopenharmony_civoid camif_hw_set_output_dma(struct camif_vp *vp);
2548c2ecf20Sopenharmony_civoid camif_hw_set_target_format(struct camif_vp *vp);
2558c2ecf20Sopenharmony_civoid camif_hw_set_test_pattern(struct camif_dev *camif, unsigned int pattern);
2568c2ecf20Sopenharmony_civoid camif_hw_set_effect(struct camif_dev *camif, unsigned int effect,
2578c2ecf20Sopenharmony_ci			unsigned int cr, unsigned int cb);
2588c2ecf20Sopenharmony_civoid camif_hw_set_output_addr(struct camif_vp *vp, struct camif_addr *paddr,
2598c2ecf20Sopenharmony_ci			      int index);
2608c2ecf20Sopenharmony_civoid camif_hw_dump_regs(struct camif_dev *camif, const char *label);
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_cistatic inline u32 camif_hw_get_status(struct camif_vp *vp)
2638c2ecf20Sopenharmony_ci{
2648c2ecf20Sopenharmony_ci	return readl(vp->camif->io_base + S3C_CAMIF_REG_CISTATUS(vp->id,
2658c2ecf20Sopenharmony_ci								vp->offset));
2668c2ecf20Sopenharmony_ci}
2678c2ecf20Sopenharmony_ci
2688c2ecf20Sopenharmony_ci#endif /* CAMIF_REGS_H_ */
269