diff options
author | Sakari Ailus <sakari.ailus@iki.fi> | 2012-03-03 15:19:52 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 08:06:00 -0400 |
commit | ccfc97bdb5ae8b8edc55169ac6924e08449836ac (patch) | |
tree | 8e9215ce9211d2270e7f3598560b4cf96995aa9e /include/media | |
parent | cf1c5fae5f8a28d478b7177a2d83e42d25eab072 (diff) |
[media] smiapp: Add driver
Add driver for SMIA++/SMIA image sensors. The driver exposes the sensor as
three subdevs, pixel array, binner and scaler --- in case the device has a
scaler.
Currently it relies on the board code for external clock handling. There is
no fast way out of this dependency before the ISP drivers (omap3isp) among
others will be able to export that clock through the clock framework
instead.
Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/smiapp.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/include/media/smiapp.h b/include/media/smiapp.h new file mode 100644 index 000000000000..a7877cd0733d --- /dev/null +++ b/include/media/smiapp.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * include/media/smiapp.h | ||
3 | * | ||
4 | * Generic driver for SMIA/SMIA++ compliant camera modules | ||
5 | * | ||
6 | * Copyright (C) 2011--2012 Nokia Corporation | ||
7 | * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | ||
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 | |||
39 | #define SMIAPP_NO_XSHUTDOWN -1 | ||
40 | |||
41 | /* | ||
42 | * Sometimes due to board layout considerations the camera module can be | ||
43 | * mounted rotated. The typical rotation used is 180 degrees which can be | ||
44 | * corrected by giving a default H-FLIP and V-FLIP in the sensor readout. | ||
45 | * FIXME: rotation also changes the bayer pattern. | ||
46 | */ | ||
47 | enum smiapp_module_board_orient { | ||
48 | SMIAPP_MODULE_BOARD_ORIENT_0 = 0, | ||
49 | SMIAPP_MODULE_BOARD_ORIENT_180, | ||
50 | }; | ||
51 | |||
52 | struct smiapp_flash_strobe_parms { | ||
53 | u8 mode; | ||
54 | u32 strobe_width_high_us; | ||
55 | u16 strobe_delay; | ||
56 | u16 stobe_start_point; | ||
57 | u8 trigger; | ||
58 | }; | ||
59 | |||
60 | struct smiapp_platform_data { | ||
61 | /* | ||
62 | * Change the cci address if i2c_addr_alt is set. | ||
63 | * Both default and alternate cci addr need to be present | ||
64 | */ | ||
65 | unsigned short i2c_addr_dfl; /* Default i2c addr */ | ||
66 | unsigned short i2c_addr_alt; /* Alternate i2c addr */ | ||
67 | |||
68 | unsigned int nvm_size; /* bytes */ | ||
69 | unsigned int ext_clk; /* sensor external clk */ | ||
70 | |||
71 | unsigned int lanes; /* Number of CSI-2 lanes */ | ||
72 | u8 csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */ | ||
73 | const s64 *op_sys_clock; | ||
74 | |||
75 | enum smiapp_module_board_orient module_board_orient; | ||
76 | |||
77 | struct smiapp_flash_strobe_parms *strobe_setup; | ||
78 | |||
79 | int (*set_xclk)(struct v4l2_subdev *sd, int hz); | ||
80 | int xshutdown; /* gpio or SMIAPP_NO_XSHUTDOWN */ | ||
81 | }; | ||
82 | |||
83 | #endif /* __SMIAPP_H_ */ | ||