Sakari Ailus | ccfc97b | 2012-03-03 17:19:52 -0300 | [diff] [blame] | 1 | /* |
Mauro Carvalho Chehab | b5dcee2 | 2015-11-10 12:01:44 -0200 | [diff] [blame] | 2 | * include/media/i2c/smiapp.h |
Sakari Ailus | ccfc97b | 2012-03-03 17:19:52 -0300 | [diff] [blame] | 3 | * |
| 4 | * Generic driver for SMIA/SMIA++ compliant camera modules |
| 5 | * |
| 6 | * Copyright (C) 2011--2012 Nokia Corporation |
Sakari Ailus | 8c5dff9 | 2012-10-28 06:44:17 -0300 | [diff] [blame] | 7 | * Contact: Sakari Ailus <sakari.ailus@iki.fi> |
Sakari Ailus | ccfc97b | 2012-03-03 17:19:52 -0300 | [diff] [blame] | 8 | * |
| 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. |
| 12 | * |
| 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. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 21 | * 02110-1301 USA |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | #ifndef __SMIAPP_H_ |
| 26 | #define __SMIAPP_H_ |
| 27 | |
| 28 | #include <media/v4l2-subdev.h> |
| 29 | |
| 30 | #define SMIAPP_NAME "smiapp" |
| 31 | |
| 32 | #define SMIAPP_DFL_I2C_ADDR (0x20 >> 1) /* Default I2C Address */ |
| 33 | #define SMIAPP_ALT_I2C_ADDR (0x6e >> 1) /* Alternate I2C Address */ |
| 34 | |
| 35 | #define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_CLOCK 0 |
| 36 | #define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_STROBE 1 |
| 37 | #define SMIAPP_CSI_SIGNALLING_MODE_CSI2 2 |
| 38 | |
Sakari Ailus | ccfc97b | 2012-03-03 17:19:52 -0300 | [diff] [blame] | 39 | /* |
| 40 | * Sometimes due to board layout considerations the camera module can be |
| 41 | * mounted rotated. The typical rotation used is 180 degrees which can be |
| 42 | * corrected by giving a default H-FLIP and V-FLIP in the sensor readout. |
| 43 | * FIXME: rotation also changes the bayer pattern. |
| 44 | */ |
| 45 | enum smiapp_module_board_orient { |
| 46 | SMIAPP_MODULE_BOARD_ORIENT_0 = 0, |
| 47 | SMIAPP_MODULE_BOARD_ORIENT_180, |
| 48 | }; |
| 49 | |
| 50 | struct smiapp_flash_strobe_parms { |
| 51 | u8 mode; |
| 52 | u32 strobe_width_high_us; |
| 53 | u16 strobe_delay; |
| 54 | u16 stobe_start_point; |
| 55 | u8 trigger; |
| 56 | }; |
| 57 | |
Sakari Ailus | 697a521 | 2016-08-11 07:43:50 -0300 | [diff] [blame] | 58 | struct smiapp_hwconfig { |
Sakari Ailus | ccfc97b | 2012-03-03 17:19:52 -0300 | [diff] [blame] | 59 | /* |
| 60 | * Change the cci address if i2c_addr_alt is set. |
| 61 | * Both default and alternate cci addr need to be present |
| 62 | */ |
| 63 | unsigned short i2c_addr_dfl; /* Default i2c addr */ |
| 64 | unsigned short i2c_addr_alt; /* Alternate i2c addr */ |
| 65 | |
Sakari Ailus | ec176a6 | 2013-11-30 16:35:48 -0300 | [diff] [blame] | 66 | uint32_t nvm_size; /* bytes */ |
| 67 | uint32_t ext_clk; /* sensor external clk */ |
Sakari Ailus | ccfc97b | 2012-03-03 17:19:52 -0300 | [diff] [blame] | 68 | |
| 69 | unsigned int lanes; /* Number of CSI-2 lanes */ |
Sakari Ailus | ec176a6 | 2013-11-30 16:35:48 -0300 | [diff] [blame] | 70 | uint32_t csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */ |
| 71 | uint64_t *op_sys_clock; |
Sakari Ailus | ccfc97b | 2012-03-03 17:19:52 -0300 | [diff] [blame] | 72 | |
| 73 | enum smiapp_module_board_orient module_board_orient; |
| 74 | |
| 75 | struct smiapp_flash_strobe_parms *strobe_setup; |
Sakari Ailus | ccfc97b | 2012-03-03 17:19:52 -0300 | [diff] [blame] | 76 | }; |
| 77 | |
| 78 | #endif /* __SMIAPP_H_ */ |