18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * drivers/media/i2c/smiapp/smiapp-reg.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Generic driver for SMIA/SMIA++ compliant camera modules
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 2011--2012 Nokia Corporation
88c2ecf20Sopenharmony_ci * Contact: Sakari Ailus <sakari.ailus@iki.fi>
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef __SMIAPP_REG_H_
128c2ecf20Sopenharmony_ci#define __SMIAPP_REG_H_
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <linux/bits.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include "smiapp-reg-defs.h"
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/* Bits for above register */
198c2ecf20Sopenharmony_ci#define SMIAPP_IMAGE_ORIENTATION_HFLIP			BIT(0)
208c2ecf20Sopenharmony_ci#define SMIAPP_IMAGE_ORIENTATION_VFLIP			BIT(1)
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define SMIAPP_DATA_TRANSFER_IF_1_CTRL_EN		BIT(0)
238c2ecf20Sopenharmony_ci#define SMIAPP_DATA_TRANSFER_IF_1_CTRL_WR_EN		BIT(1)
248c2ecf20Sopenharmony_ci#define SMIAPP_DATA_TRANSFER_IF_1_CTRL_ERR_CLEAR	BIT(2)
258c2ecf20Sopenharmony_ci#define SMIAPP_DATA_TRANSFER_IF_1_STATUS_RD_READY	BIT(0)
268c2ecf20Sopenharmony_ci#define SMIAPP_DATA_TRANSFER_IF_1_STATUS_WR_READY	BIT(1)
278c2ecf20Sopenharmony_ci#define SMIAPP_DATA_TRANSFER_IF_1_STATUS_EDATA		BIT(2)
288c2ecf20Sopenharmony_ci#define SMIAPP_DATA_TRANSFER_IF_1_STATUS_EUSAGE		BIT(3)
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define SMIAPP_DATA_TRANSFER_IF_CAPABILITY_SUPPORTED	BIT(0)
318c2ecf20Sopenharmony_ci#define SMIAPP_DATA_TRANSFER_IF_CAPABILITY_POLL		BIT(2)
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#define SMIAPP_SOFTWARE_RESET				BIT(0)
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define SMIAPP_FLASH_MODE_CAPABILITY_SINGLE_STROBE	BIT(0)
368c2ecf20Sopenharmony_ci#define SMIAPP_FLASH_MODE_CAPABILITY_MULTIPLE_STROBE	BIT(1)
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_CLOCK	0
398c2ecf20Sopenharmony_ci#define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_STROBE	1
408c2ecf20Sopenharmony_ci#define SMIAPP_CSI_SIGNALLING_MODE_CSI2			2
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define SMIAPP_DPHY_CTRL_AUTOMATIC			0
438c2ecf20Sopenharmony_ci/* DPHY control based on REQUESTED_LINK_BIT_RATE_MBPS */
448c2ecf20Sopenharmony_ci#define SMIAPP_DPHY_CTRL_UI				1
458c2ecf20Sopenharmony_ci#define SMIAPP_DPHY_CTRL_REGISTER			2
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define SMIAPP_COMPRESSION_MODE_SIMPLE_PREDICTOR	1
488c2ecf20Sopenharmony_ci#define SMIAPP_COMPRESSION_MODE_ADVANCED_PREDICTOR	2
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define SMIAPP_MODE_SELECT_SOFTWARE_STANDBY		0
518c2ecf20Sopenharmony_ci#define SMIAPP_MODE_SELECT_STREAMING			1
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define SMIAPP_SCALING_MODE_NONE			0
548c2ecf20Sopenharmony_ci#define SMIAPP_SCALING_MODE_HORIZONTAL			1
558c2ecf20Sopenharmony_ci#define SMIAPP_SCALING_MODE_BOTH			2
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci#define SMIAPP_SCALING_CAPABILITY_NONE			0
588c2ecf20Sopenharmony_ci#define SMIAPP_SCALING_CAPABILITY_HORIZONTAL		1
598c2ecf20Sopenharmony_ci#define SMIAPP_SCALING_CAPABILITY_BOTH			2 /* horizontal/both */
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci/* digital crop right before scaler */
628c2ecf20Sopenharmony_ci#define SMIAPP_DIGITAL_CROP_CAPABILITY_NONE		0
638c2ecf20Sopenharmony_ci#define SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP	1
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#define SMIAPP_BINNING_CAPABILITY_NO			0
668c2ecf20Sopenharmony_ci#define SMIAPP_BINNING_CAPABILITY_YES			1
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci/* Maximum number of binning subtypes */
698c2ecf20Sopenharmony_ci#define SMIAPP_BINNING_SUBTYPES				253
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci#define SMIAPP_PIXEL_ORDER_GRBG				0
728c2ecf20Sopenharmony_ci#define SMIAPP_PIXEL_ORDER_RGGB				1
738c2ecf20Sopenharmony_ci#define SMIAPP_PIXEL_ORDER_BGGR				2
748c2ecf20Sopenharmony_ci#define SMIAPP_PIXEL_ORDER_GBRG				3
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci#define SMIAPP_DATA_FORMAT_MODEL_TYPE_NORMAL		1
778c2ecf20Sopenharmony_ci#define SMIAPP_DATA_FORMAT_MODEL_TYPE_EXTENDED		2
788c2ecf20Sopenharmony_ci#define SMIAPP_DATA_FORMAT_MODEL_TYPE_NORMAL_N		8
798c2ecf20Sopenharmony_ci#define SMIAPP_DATA_FORMAT_MODEL_TYPE_EXTENDED_N	16
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_MODEL_TYPE_2BYTE		0x01
828c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_MODEL_TYPE_4BYTE		0x02
838c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_MODEL_SUBTYPE_NROWS_MASK	0x0f
848c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_MODEL_SUBTYPE_NCOLS_MASK	0xf0
858c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_MODEL_SUBTYPE_NCOLS_SHIFT	4
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_2_PIXELCODE_MASK	0xf000
888c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_2_PIXELCODE_SHIFT	12
898c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_2_PIXELS_MASK		0x0fff
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_4_PIXELCODE_MASK	0xf0000000
928c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_4_PIXELCODE_SHIFT	28
938c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_4_PIXELS_MASK		0x0000ffff
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_PIXELCODE_EMBEDDED	1
968c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_PIXELCODE_DUMMY	2
978c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_PIXELCODE_BLACK	3
988c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_PIXELCODE_DARK		4
998c2ecf20Sopenharmony_ci#define SMIAPP_FRAME_FORMAT_DESC_PIXELCODE_VISIBLE	5
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci#define SMIAPP_FAST_STANDBY_CTRL_COMPLETE_FRAMES	0
1028c2ecf20Sopenharmony_ci#define SMIAPP_FAST_STANDBY_CTRL_IMMEDIATE		1
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/* Scaling N factor */
1058c2ecf20Sopenharmony_ci#define SMIAPP_SCALE_N					16
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci/* Image statistics registers */
1088c2ecf20Sopenharmony_ci/* Registers 0x2000 to 0x2fff are reserved for future
1098c2ecf20Sopenharmony_ci * use for statistics features.
1108c2ecf20Sopenharmony_ci */
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci/* Manufacturer Specific Registers: 0x3000 to 0x3fff
1138c2ecf20Sopenharmony_ci * The manufacturer specifies these as a black box.
1148c2ecf20Sopenharmony_ci */
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci#endif /* __SMIAPP_REG_H_ */
117