Linux 4.16.11
[linux/fpc-iii.git] / include / media / i2c / smiapp.h
blob525d55b2afeb81ee1c1ae12716343c6b26a13f37
1 /*
2 * include/media/i2c/smiapp.h
4 * Generic driver for SMIA/SMIA++ compliant camera modules
6 * Copyright (C) 2011--2012 Nokia Corporation
7 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
20 #ifndef __SMIAPP_H_
21 #define __SMIAPP_H_
23 #include <media/v4l2-subdev.h>
25 #define SMIAPP_NAME "smiapp"
27 #define SMIAPP_DFL_I2C_ADDR (0x20 >> 1) /* Default I2C Address */
28 #define SMIAPP_ALT_I2C_ADDR (0x6e >> 1) /* Alternate I2C Address */
30 #define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_CLOCK 0
31 #define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_STROBE 1
32 #define SMIAPP_CSI_SIGNALLING_MODE_CSI2 2
35 * Sometimes due to board layout considerations the camera module can be
36 * mounted rotated. The typical rotation used is 180 degrees which can be
37 * corrected by giving a default H-FLIP and V-FLIP in the sensor readout.
38 * FIXME: rotation also changes the bayer pattern.
40 enum smiapp_module_board_orient {
41 SMIAPP_MODULE_BOARD_ORIENT_0 = 0,
42 SMIAPP_MODULE_BOARD_ORIENT_180,
45 struct smiapp_flash_strobe_parms {
46 u8 mode;
47 u32 strobe_width_high_us;
48 u16 strobe_delay;
49 u16 stobe_start_point;
50 u8 trigger;
53 struct smiapp_hwconfig {
55 * Change the cci address if i2c_addr_alt is set.
56 * Both default and alternate cci addr need to be present
58 unsigned short i2c_addr_dfl; /* Default i2c addr */
59 unsigned short i2c_addr_alt; /* Alternate i2c addr */
61 uint32_t nvm_size; /* bytes */
62 uint32_t ext_clk; /* sensor external clk */
64 unsigned int lanes; /* Number of CSI-2 lanes */
65 uint32_t csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */
66 uint64_t *op_sys_clock;
68 enum smiapp_module_board_orient module_board_orient;
70 struct smiapp_flash_strobe_parms *strobe_setup;
73 #endif /* __SMIAPP_H_ */