@@ -224,15 +224,6 @@ static const struct cci_reg_sequence imx219_common_regs[] = {
224
224
{ CCI_REG8 (0x30eb ), 0x05 },
225
225
{ CCI_REG8 (0x30eb ), 0x09 },
226
226
227
- /* PLL Clock Table */
228
- { IMX219_REG_VTPXCK_DIV , 5 },
229
- { IMX219_REG_VTSYCK_DIV , 1 },
230
- { IMX219_REG_PREPLLCK_VT_DIV , 3 }, /* 0x03 = AUTO set */
231
- { IMX219_REG_PREPLLCK_OP_DIV , 3 }, /* 0x03 = AUTO set */
232
- { IMX219_REG_PLL_VT_MPY , 57 },
233
- { IMX219_REG_OPSYCK_DIV , 1 },
234
- { IMX219_REG_PLL_OP_MPY , 114 },
235
-
236
227
/* Undocumented registers */
237
228
{ CCI_REG8 (0x455e ), 0x00 },
238
229
{ CCI_REG8 (0x471e ), 0x4b },
@@ -257,6 +248,34 @@ static const struct cci_reg_sequence imx219_common_regs[] = {
257
248
{ IMX219_REG_EXCK_FREQ , IMX219_EXCK_FREQ (IMX219_XCLK_FREQ / 1000000 ) },
258
249
};
259
250
251
+ static const struct cci_reg_sequence imx219_2lane_regs [] = {
252
+ /* PLL Clock Table */
253
+ { IMX219_REG_VTPXCK_DIV , 5 },
254
+ { IMX219_REG_VTSYCK_DIV , 1 },
255
+ { IMX219_REG_PREPLLCK_VT_DIV , 3 }, /* 0x03 = AUTO set */
256
+ { IMX219_REG_PREPLLCK_OP_DIV , 3 }, /* 0x03 = AUTO set */
257
+ { IMX219_REG_PLL_VT_MPY , 57 },
258
+ { IMX219_REG_OPSYCK_DIV , 1 },
259
+ { IMX219_REG_PLL_OP_MPY , 114 },
260
+
261
+ /* 2-Lane CSI Mode */
262
+ { IMX219_REG_CSI_LANE_MODE , IMX219_CSI_2_LANE_MODE },
263
+ };
264
+
265
+ static const struct cci_reg_sequence imx219_4lane_regs [] = {
266
+ /* PLL Clock Table */
267
+ { IMX219_REG_VTPXCK_DIV , 5 },
268
+ { IMX219_REG_VTSYCK_DIV , 1 },
269
+ { IMX219_REG_PREPLLCK_VT_DIV , 3 }, /* 0x03 = AUTO set */
270
+ { IMX219_REG_PREPLLCK_OP_DIV , 3 }, /* 0x03 = AUTO set */
271
+ { IMX219_REG_PLL_VT_MPY , 88 },
272
+ { IMX219_REG_OPSYCK_DIV , 1 },
273
+ { IMX219_REG_PLL_OP_MPY , 91 },
274
+
275
+ /* 4-Lane CSI Mode */
276
+ { IMX219_REG_CSI_LANE_MODE , IMX219_CSI_4_LANE_MODE },
277
+ };
278
+
260
279
/*
261
280
* Register sets lifted off the i2C interface from the Raspberry Pi firmware
262
281
* driver.
@@ -941,9 +960,11 @@ static int imx219_get_selection(struct v4l2_subdev *sd,
941
960
942
961
static int imx219_configure_lanes (struct imx219 * imx219 )
943
962
{
944
- return cci_write (imx219 -> regmap , IMX219_REG_CSI_LANE_MODE ,
945
- imx219 -> lanes == 2 ? IMX219_CSI_2_LANE_MODE :
946
- IMX219_CSI_4_LANE_MODE , NULL );
963
+ /* Write the appropriate PLL settings for the number of MIPI lanes */
964
+ return cci_multi_reg_write (imx219 -> regmap ,
965
+ imx219 -> lanes == 2 ? imx219_2lane_regs : imx219_4lane_regs ,
966
+ imx219 -> lanes == 2 ? ARRAY_SIZE (imx219_2lane_regs ) :
967
+ ARRAY_SIZE (imx219_4lane_regs ), NULL );
947
968
};
948
969
949
970
static int imx219_start_streaming (struct imx219 * imx219 ,
@@ -1553,4 +1574,4 @@ module_i2c_driver(imx219_i2c_driver);
1553
1574
1554
1575
MODULE_AUTHOR (
"Dave Stevenson <[email protected] " );
1555
1576
MODULE_DESCRIPTION ("Sony IMX219 sensor driver" );
1556
- MODULE_LICENSE ("GPL v2" );
1577
+ MODULE_LICENSE ("GPL v2" );
0 commit comments