.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * drivers/media/i2c/smiapp/smiapp.h |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (C) 2010--2012 Nokia Corporation |
---|
7 | 8 | * Contact: Sakari Ailus <sakari.ailus@iki.fi> |
---|
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 | 9 | */ |
---|
18 | 10 | |
---|
19 | 11 | #ifndef __SMIAPP_PRIV_H_ |
---|
.. | .. |
---|
22 | 14 | #include <linux/mutex.h> |
---|
23 | 15 | #include <media/v4l2-ctrls.h> |
---|
24 | 16 | #include <media/v4l2-subdev.h> |
---|
25 | | -#include <media/i2c/smiapp.h> |
---|
26 | 17 | |
---|
27 | 18 | #include "smiapp-pll.h" |
---|
28 | 19 | #include "smiapp-reg.h" |
---|
.. | .. |
---|
49 | 40 | + (clk) / 1000 - 1) / ((clk) / 1000)) |
---|
50 | 41 | |
---|
51 | 42 | #define SMIAPP_COLOUR_COMPONENTS 4 |
---|
| 43 | + |
---|
| 44 | +#define SMIAPP_NAME "smiapp" |
---|
| 45 | + |
---|
| 46 | +#define SMIAPP_DFL_I2C_ADDR (0x20 >> 1) /* Default I2C Address */ |
---|
| 47 | +#define SMIAPP_ALT_I2C_ADDR (0x6e >> 1) /* Alternate I2C Address */ |
---|
| 48 | + |
---|
| 49 | +/* |
---|
| 50 | + * Sometimes due to board layout considerations the camera module can be |
---|
| 51 | + * mounted rotated. The typical rotation used is 180 degrees which can be |
---|
| 52 | + * corrected by giving a default H-FLIP and V-FLIP in the sensor readout. |
---|
| 53 | + * FIXME: rotation also changes the bayer pattern. |
---|
| 54 | + */ |
---|
| 55 | +enum smiapp_module_board_orient { |
---|
| 56 | + SMIAPP_MODULE_BOARD_ORIENT_0 = 0, |
---|
| 57 | + SMIAPP_MODULE_BOARD_ORIENT_180, |
---|
| 58 | +}; |
---|
| 59 | + |
---|
| 60 | +struct smiapp_flash_strobe_parms { |
---|
| 61 | + u8 mode; |
---|
| 62 | + u32 strobe_width_high_us; |
---|
| 63 | + u16 strobe_delay; |
---|
| 64 | + u16 stobe_start_point; |
---|
| 65 | + u8 trigger; |
---|
| 66 | +}; |
---|
| 67 | + |
---|
| 68 | +struct smiapp_hwconfig { |
---|
| 69 | + /* |
---|
| 70 | + * Change the cci address if i2c_addr_alt is set. |
---|
| 71 | + * Both default and alternate cci addr need to be present |
---|
| 72 | + */ |
---|
| 73 | + unsigned short i2c_addr_dfl; /* Default i2c addr */ |
---|
| 74 | + unsigned short i2c_addr_alt; /* Alternate i2c addr */ |
---|
| 75 | + |
---|
| 76 | + uint32_t ext_clk; /* sensor external clk */ |
---|
| 77 | + |
---|
| 78 | + unsigned int lanes; /* Number of CSI-2 lanes */ |
---|
| 79 | + uint32_t csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */ |
---|
| 80 | + uint64_t *op_sys_clock; |
---|
| 81 | + |
---|
| 82 | + enum smiapp_module_board_orient module_board_orient; |
---|
| 83 | + |
---|
| 84 | + struct smiapp_flash_strobe_parms *strobe_setup; |
---|
| 85 | +}; |
---|
52 | 86 | |
---|
53 | 87 | #include "smiapp-limits.h" |
---|
54 | 88 | |
---|
.. | .. |
---|
206 | 240 | |
---|
207 | 241 | u8 hvflip_inv_mask; /* H/VFLIP inversion due to sensor orientation */ |
---|
208 | 242 | u8 frame_skip; |
---|
209 | | - bool active; /* is the sensor powered on? */ |
---|
210 | 243 | u16 embedded_start; /* embedded data start line */ |
---|
211 | 244 | u16 embedded_end; |
---|
212 | 245 | u16 image_start; /* image data start line */ |
---|
.. | .. |
---|
215 | 248 | bool streaming; |
---|
216 | 249 | bool dev_init_done; |
---|
217 | 250 | u8 compressed_min_bpp; |
---|
218 | | - |
---|
219 | | - u8 *nvm; /* nvm memory buffer */ |
---|
220 | | - unsigned int nvm_size; /* bytes */ |
---|
221 | 251 | |
---|
222 | 252 | struct smiapp_module_info minfo; |
---|
223 | 253 | |
---|