@@ -110,56 +110,6 @@ static const struct imx219_reg imx219_init_tab_3280_2464_21fps[] = {
110110 {IMX219_TABLE_END , 0x00 }
111111};
112112
113- /* MCLK:24MHz 3280x1848 28fps MIPI LANE2 */
114- static const struct imx219_reg imx219_init_tab_3280_1848_28fps [] = {
115- {0x30EB , 0x05 }, /* Access Code for address over 0x3000 */
116- {0x30EB , 0x0C }, /* Access Code for address over 0x3000 */
117- {0x300A , 0xFF }, /* Access Code for address over 0x3000 */
118- {0x300B , 0xFF }, /* Access Code for address over 0x3000 */
119- {0x30EB , 0x05 }, /* Access Code for address over 0x3000 */
120- {0x30EB , 0x09 }, /* Access Code for address over 0x3000 */
121- {0x0114 , 0x01 }, /* CSI_LANE_MODE[1:0} */
122- {0x0128 , 0x00 }, /* DPHY_CNTRL */
123- {0x012A , 0x18 }, /* EXCK_FREQ[15:8] */
124- {0x012B , 0x00 }, /* EXCK_FREQ[7:0] */
125- {0x0160 , 0x07 }, /* FRM_LENGTH_A[15:8] */
126- {0x0161 , 0x60 }, /* FRM_LENGTH_A[7:0] */
127- {0x0162 , 0x0F }, /* LINE_LENGTH_A[15:8] */
128- {0x0163 , 0xA0 }, /* LINE_LENGTH_A[7:0] */
129- {0x0260 , 0x07 }, /* FRM_LENGTH_B[15:8] */
130- {0x0261 , 0x60 }, /* FRM_LENGTH_B[7:0] */
131- {0x0262 , 0x0F }, /* LINE_LENGTH_B[15:8] */
132- {0x0263 , 0xA0 }, /* LINE_LENGTH_B[7:0] */
133- {0x0170 , 0x01 }, /* X_ODD_INC_A[2:0] */
134- {0x0171 , 0x01 }, /* Y_ODD_INC_A[2:0] */
135- {0x0270 , 0x01 }, /* X_ODD_INC_B[2:0] */
136- {0x0271 , 0x01 }, /* Y_ODD_INC_B[2:0] */
137- {0x0174 , 0x00 }, /* BINNING_MODE_H_A */
138- {0x0175 , 0x00 }, /* BINNING_MODE_V_A */
139- {0x0274 , 0x00 }, /* BINNING_MODE_H_B */
140- {0x0275 , 0x00 }, /* BINNING_MODE_V_B */
141- {0x018C , 0x0A }, /* CSI_DATA_FORMAT_A[15:8] */
142- {0x018D , 0x0A }, /* CSI_DATA_FORMAT_A[7:0] */
143- {0x028C , 0x0A }, /* CSI_DATA_FORMAT_B[15:8] */
144- {0x028D , 0x0A }, /* CSI_DATA_FORMAT_B[7:0] */
145- {0x0301 , 0x05 }, /* VTPXCK_DIV */
146- {0x0303 , 0x01 }, /* VTSYCK_DIV */
147- {0x0304 , 0x03 }, /* PREPLLCK_VT_DIV[3:0] */
148- {0x0305 , 0x03 }, /* PREPLLCK_OP_DIV[3:0] */
149- {0x0306 , 0x00 }, /* PLL_VT_MPY[10:8] */
150- {0x0307 , 0x42 }, /* PLL_VT_MPY[7:0] */
151- {0x0309 , 0x0A }, /* OPPXCK_DIV[4:0] */
152- {0x030B , 0x01 }, /* OPSYCK_DIV */
153- {0x030C , 0x00 }, /* PLL_OP_MPY[10:8] */
154- {0x030D , 0x72 }, /* PLL_OP_MPY[7:0] */
155- {0x455E , 0x00 }, /* CIS Tuning */
156- {0x471E , 0x4B }, /* CIS Tuning */
157- {0x4767 , 0x0F }, /* CIS Tuning */
158- {0x4750 , 0x14 }, /* CIS Tuning */
159- {0x47B4 , 0x14 }, /* CIS Tuning */
160- {IMX219_TABLE_END , 0x00 }
161- };
162-
163113/* MCLK:24MHz 1920x1080 30fps MIPI LANE2 */
164114static const struct imx219_reg imx219_init_tab_1920_1080_30fps [] = {
165115 {0x30EB , 0x05 },
@@ -364,16 +314,6 @@ static const struct imx219_mode supported_modes[] = {
364314 .binning_h = 1 ,
365315 .binning_v = 1 ,
366316 },
367- {
368- .width = 3280 ,
369- .height = 1848 ,
370- .max_fps = 28 ,
371- .hts_def = 0x0fa0 - IMX219_EXP_LINES_MARGIN ,
372- .vts_def = 0x0760 ,
373- .reg_list = imx219_init_tab_3280_1848_28fps ,
374- .binning_h = 0 ,
375- .binning_v = 0 ,
376- },
377317};
378318
379319static struct imx219 * to_imx219 (const struct i2c_client * client )
@@ -785,7 +725,14 @@ static int imx219_set_fmt(struct v4l2_subdev *sd,
785725 return 0 ;
786726
787727 mode = imx219_find_best_fit (fmt );
788- fmt -> format .code = MEDIA_BUS_FMT_SRGGB10_1X10 ;
728+ if (priv -> hflip == 0 && priv -> vflip == 0 )
729+ fmt -> format .code = MEDIA_BUS_FMT_SRGGB10_1X10 ;
730+ else if (priv -> hflip != 0 && priv -> vflip == 0 )
731+ fmt -> format .code = MEDIA_BUS_FMT_SGRBG10_1X10 ;
732+ else if (priv -> hflip == 0 && priv -> vflip != 0 )
733+ fmt -> format .code = MEDIA_BUS_FMT_SGBRG10_1X10 ;
734+ else
735+ fmt -> format .code = MEDIA_BUS_FMT_SBGGR10_1X10 ;
789736 fmt -> format .width = mode -> width ;
790737 fmt -> format .height = mode -> height ;
791738 fmt -> format .field = V4L2_FIELD_NONE ;
@@ -827,7 +774,16 @@ static int imx219_get_fmt(struct v4l2_subdev *sd,
827774
828775 fmt -> format .width = mode -> width ;
829776 fmt -> format .height = mode -> height ;
830- fmt -> format .code = MEDIA_BUS_FMT_SRGGB10_1X10 ;
777+
778+ if (priv -> hflip == 0 && priv -> vflip == 0 )
779+ fmt -> format .code = MEDIA_BUS_FMT_SRGGB10_1X10 ;
780+ else if (priv -> hflip != 0 && priv -> vflip == 0 )
781+ fmt -> format .code = MEDIA_BUS_FMT_SGRBG10_1X10 ;
782+ else if (priv -> hflip == 0 && priv -> vflip != 0 )
783+ fmt -> format .code = MEDIA_BUS_FMT_SGBRG10_1X10 ;
784+ else
785+ fmt -> format .code = MEDIA_BUS_FMT_SBGGR10_1X10 ;
786+
831787 fmt -> format .field = V4L2_FIELD_NONE ;
832788
833789 return 0 ;
@@ -1012,7 +968,6 @@ static int imx219_probe(struct i2c_client *client,
1012968 struct i2c_adapter * adapter = to_i2c_adapter (client -> dev .parent );
1013969 int ret ;
1014970
1015- printk ("[jcliao] imx219_probe \n" );
1016971 if (!i2c_check_functionality (adapter , I2C_FUNC_SMBUS_BYTE_DATA )) {
1017972 dev_warn (& adapter -> dev ,
1018973 "I2C-Adapter doesn't support I2C_FUNC_SMBUS_BYTE\n" );
0 commit comments