@@ -595,7 +595,7 @@ static struct rkcif_sensor_info *sd_to_sensor(struct rkcif_device *dev,
595
595
return NULL ;
596
596
}
597
597
598
- static unsigned char get_data_type (u32 pixelformat , u8 cmd_mode_en )
598
+ static unsigned char get_data_type (u32 pixelformat , u8 cmd_mode_en , u8 dsi_input )
599
599
{
600
600
switch (pixelformat ) {
601
601
/* csi raw8 */
@@ -622,12 +622,15 @@ static unsigned char get_data_type(u32 pixelformat, u8 cmd_mode_en)
622
622
case MEDIA_BUS_FMT_YUYV8_2X8 :
623
623
case MEDIA_BUS_FMT_YVYU8_2X8 :
624
624
return 0x1e ;
625
- case MEDIA_BUS_FMT_RGB888_1X24 : {
626
- if (cmd_mode_en ) /* dsi command mode*/
627
- return 0x39 ;
628
- else /* dsi video mode */
629
- return 0x3e ;
630
- }
625
+ case MEDIA_BUS_FMT_RGB888_1X24 :
626
+ if (dsi_input ) {
627
+ if (cmd_mode_en ) /* dsi command mode*/
628
+ return 0x39 ;
629
+ else /* dsi video mode */
630
+ return 0x3e ;
631
+ } else {
632
+ return 0x24 ;
633
+ }
631
634
case MEDIA_BUS_FMT_EBD_1X8 :
632
635
return 0x12 ;
633
636
case MEDIA_BUS_FMT_SPD_2X8 :
@@ -2089,6 +2092,7 @@ static int rkcif_csi_channel_init(struct rkcif_stream *stream,
2089
2092
channel -> fmt_val = stream -> cif_fmt_out -> csi_fmt_val ;
2090
2093
2091
2094
channel -> cmd_mode_en = 0 ; /* default use DSI Video Mode */
2095
+ channel -> dsi_input = dev -> terminal_sensor .dsi_input_en ;
2092
2096
2093
2097
if (stream -> crop_enable ) {
2094
2098
channel -> crop_en = 1 ;
@@ -2157,10 +2161,12 @@ static int rkcif_csi_channel_init(struct rkcif_stream *stream,
2157
2161
channel -> data_type = dev -> channels [stream -> id ].data_type ;
2158
2162
else
2159
2163
channel -> data_type = get_data_type (stream -> cif_fmt_in -> mbus_code ,
2160
- channel -> cmd_mode_en );
2164
+ channel -> cmd_mode_en ,
2165
+ channel -> dsi_input );
2161
2166
} else {
2162
2167
channel -> data_type = get_data_type (stream -> cif_fmt_in -> mbus_code ,
2163
- channel -> cmd_mode_en );
2168
+ channel -> cmd_mode_en ,
2169
+ channel -> dsi_input );
2164
2170
}
2165
2171
channel -> csi_fmt_val = get_csi_fmt_val (stream -> cif_fmt_in ,
2166
2172
& dev -> channels [stream -> id ]);
@@ -3808,6 +3814,13 @@ int rkcif_update_sensor_info(struct rkcif_stream *stream)
3808
3814
__func__ , terminal_sensor -> sd -> name );
3809
3815
return ret ;
3810
3816
}
3817
+ if (v4l2_subdev_call (terminal_sensor -> sd , core , ioctl , RKMODULE_GET_CSI_DSI_INFO ,
3818
+ & terminal_sensor -> dsi_input_en )) {
3819
+ v4l2_dbg (1 , rkcif_debug , & stream -> cifdev -> v4l2_dev ,
3820
+ "%s: get terminal %s CSI/DSI sel failed, default csi input!\n" ,
3821
+ __func__ , terminal_sensor -> sd -> name );
3822
+ terminal_sensor -> dsi_input_en = 0 ;
3823
+ }
3811
3824
} else {
3812
3825
v4l2_err (& stream -> cifdev -> v4l2_dev ,
3813
3826
"%s: stream[%d] get remote terminal sensor failed!\n" ,
0 commit comments