Skip to content

Commit 9b8e6ee

Browse files
jwrdegoedemchehab
authored andcommitted
media: ov2680: Add a bunch of register tweaks
Usually when developing a sensor driver with help from the vendor the vendor will provide a bunch of register tweaks for optimal performance of the sensor. The atomisp-ov2680.c driver was (presumably) developed by Intel with help from OmniVision and indeed contains a bunch of register tweaks. Add these register tweaks to the "main" ov2680.c driver. Acked-by: Rui Miguel Silva <[email protected]> Reviewed-by: Daniel Scally <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 05d6bd8 commit 9b8e6ee

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

drivers/media/i2c/ov2680.c

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,71 @@ static const int ov2680_hv_flip_bayer_order[] = {
180180
};
181181

182182
static const struct reg_sequence ov2680_global_setting[] = {
183+
/* MIPI PHY, 0x10 -> 0x1c enable bp_c_hs_en_lat and bp_d_hs_en_lat */
184+
{0x3016, 0x1c},
185+
183186
/* R MANUAL set exposure and gain to manual (hw does not do auto) */
184187
{0x3503, 0x03},
185188

189+
/* Analog control register tweaks */
190+
{0x3603, 0x39}, /* Reset value 0x99 */
191+
{0x3604, 0x24}, /* Reset value 0x74 */
192+
{0x3621, 0x37}, /* Reset value 0x44 */
193+
194+
/* Sensor control register tweaks */
195+
{0x3701, 0x64}, /* Reset value 0x61 */
196+
{0x3705, 0x3c}, /* Reset value 0x21 */
197+
{0x370c, 0x50}, /* Reset value 0x10 */
198+
{0x370d, 0xc0}, /* Reset value 0x00 */
199+
{0x3718, 0x88}, /* Reset value 0x80 */
200+
201+
/* PSRAM tweaks */
202+
{0x3781, 0x80}, /* Reset value 0x00 */
203+
{0x3784, 0x0c}, /* Reset value 0x00, based on OV2680_R1A_AM10.ovt */
204+
{0x3789, 0x60}, /* Reset value 0x50 */
205+
206+
/* BLC CTRL00 0x01 -> 0x81 set avg_weight to 8 */
207+
{0x4000, 0x81},
208+
186209
/* Set black level compensation range to 0 - 3 (default 0 - 11) */
187210
{0x4008, 0x00},
188211
{0x4009, 0x03},
189212

213+
/* VFIFO R2 0x00 -> 0x02 set Frame reset enable */
214+
{0x4602, 0x02},
215+
216+
/* MIPI ctrl CLK PREPARE MIN change from 0x26 (38) -> 0x36 (54) */
217+
{0x481f, 0x36},
218+
219+
/* MIPI ctrl CLK LPX P MIN change from 0x32 (50) -> 0x36 (54) */
220+
{0x4825, 0x36},
221+
222+
/* R ISP CTRL2 0x20 -> 0x30, set sof_sel bit */
223+
{0x5002, 0x30},
224+
190225
/*
191226
* Window CONTROL 0x00 -> 0x01, enable manual window control,
192227
* this is necessary for full size flip and mirror support.
193228
*/
194229
{0x5708, 0x01},
230+
231+
/*
232+
* DPC CTRL0 0x14 -> 0x3e, set enable_tail, enable_3x3_cluster
233+
* and enable_general_tail bits based OV2680_R1A_AM10.ovt.
234+
*/
235+
{0x5780, 0x3e},
236+
237+
/* DPC MORE CONNECTION CASE THRE 0x0c (12) -> 0x02 (2) */
238+
{0x5788, 0x02},
239+
240+
/* DPC GAIN LIST1 0x0f (15) -> 0x08 (8) */
241+
{0x578e, 0x08},
242+
243+
/* DPC GAIN LIST2 0x3f (63) -> 0x0c (12) */
244+
{0x578f, 0x0c},
245+
246+
/* DPC THRE RATIO 0x04 (4) -> 0x00 (0) */
247+
{0x5792, 0x00},
195248
};
196249

197250
static struct ov2680_dev *to_ov2680_dev(struct v4l2_subdev *sd)

0 commit comments

Comments
 (0)