@@ -676,6 +676,45 @@ static const u16 ds5_framerate_100[] = {100};
676676static const u16 ds5_framerate_90 [] = {90 };
677677static const u16 ds5_imu_framerates [] = {50 , 100 , 200 , 400 };
678678
679+ static const struct ds5_resolution d40x_depth_sizes [] = {
680+ {
681+ .width = 1280 ,
682+ .height = 720 ,
683+ .framerates = ds5_depth_framerate_to_30 ,
684+ .n_framerates = ARRAY_SIZE (ds5_depth_framerate_to_30 ),
685+ }, {
686+ .width = 848 ,
687+ .height = 480 ,
688+ .framerates = ds5_framerate_to_90 ,
689+ .n_framerates = ARRAY_SIZE (ds5_framerate_to_90 ),
690+ }, {
691+ .width = 640 ,
692+ .height = 480 ,
693+ .framerates = ds5_framerate_to_90 ,
694+ .n_framerates = ARRAY_SIZE (ds5_framerate_to_90 ),
695+ }, {
696+ .width = 640 ,
697+ .height = 360 ,
698+ .framerates = ds5_framerate_to_90 ,
699+ .n_framerates = ARRAY_SIZE (ds5_framerate_to_90 ),
700+ }, {
701+ .width = 480 ,
702+ .height = 270 ,
703+ .framerates = ds5_framerate_to_90 ,
704+ .n_framerates = ARRAY_SIZE (ds5_framerate_to_90 ),
705+ }, {
706+ .width = 424 ,
707+ .height = 240 ,
708+ .framerates = ds5_framerate_to_90 ,
709+ .n_framerates = ARRAY_SIZE (ds5_framerate_to_90 ),
710+ }, {
711+ .width = 256 ,
712+ .height = 144 ,
713+ .framerates = ds5_framerate_90 ,
714+ .n_framerates = ARRAY_SIZE (ds5_framerate_90 ),
715+ },
716+ };
717+
679718static const struct ds5_resolution d41x_depth_sizes [] = {
680719 {
681720 .width = 1280 ,
@@ -985,6 +1024,15 @@ static const struct ds5_resolution ds5_size_w10 = {
9851024 .n_framerates = 1 ,
9861025};
9871026
1027+ static const struct ds5_resolution d40x_calibration_sizes [] = {
1028+ {
1029+ .width = 1288 ,
1030+ .height = 808 ,
1031+ .framerates = ds5_framerate_15_25 ,
1032+ .n_framerates = ARRAY_SIZE (ds5_framerate_15_25 ),
1033+ },
1034+ };
1035+
9881036static const struct ds5_resolution d41x_calibration_sizes [] = {
9891037 {
9901038 .width = 1920 ,
@@ -1040,6 +1088,26 @@ static const struct ds5_resolution ds5_size_imu_extended[] = {
10401088 },
10411089};
10421090
1091+ static const struct ds5_format ds5_depth_formats_d40x [] = {
1092+ {
1093+ // TODO: 0x31 is replaced with 0x1e since it caused low FPS in Jetson.
1094+ .data_type = GMSL_CSI_DT_YUV422_8 , /* Z16 */
1095+ .mbus_code = MEDIA_BUS_FMT_UYVY8_1X16 ,
1096+ .n_resolutions = ARRAY_SIZE (d40x_depth_sizes ),
1097+ .resolutions = d40x_depth_sizes ,
1098+ }, {
1099+ .data_type = GMSL_CSI_DT_RAW_8 , /* Y8 */
1100+ .mbus_code = MEDIA_BUS_FMT_Y8_1X8 ,
1101+ .n_resolutions = ARRAY_SIZE (d40x_depth_sizes ),
1102+ .resolutions = d40x_depth_sizes ,
1103+ }, {
1104+ .data_type = GMSL_CSI_DT_RGB_888 , /* 24-bit Calibration */
1105+ .mbus_code = MEDIA_BUS_FMT_RGB888_1X24 , /* FIXME */
1106+ .n_resolutions = ARRAY_SIZE (d40x_calibration_sizes ),
1107+ .resolutions = d40x_calibration_sizes ,
1108+ },
1109+ };
1110+
10431111static const struct ds5_format ds5_depth_formats_d41x [] = {
10441112 {
10451113 // TODO: 0x31 is replaced with 0x1e since it caused low FPS in Jetson.
@@ -4812,8 +4880,6 @@ static int ds5_fixed_configuration(struct i2c_client *client, struct ds5 *state)
48124880 if (ret < 0 )
48134881 return ret ;
48144882
4815- dev_err (& client -> dev , "EHUD_DEBUG: %s(): dev_type = %u, res = {%u, %u}\n" ,
4816- __func__ , dev_type , dw , dh );
48174883 dev_dbg (& client -> dev , "%s(): cfg0 %x %ux%u cfg0_md %x %ux%u\n" , __func__ ,
48184884 cfg0 , dw , dh , cfg0_md , yw , yh );
48194885
@@ -4825,8 +4891,9 @@ static int ds5_fixed_configuration(struct i2c_client *client, struct ds5 *state)
48254891 case DS5_DEVICE_TYPE_D41X :
48264892 sensor -> formats = ds5_depth_formats_d41x ;
48274893 break ;
4828- /* TODO EHUD: Should probably be different to 457 */
48294894 case DS5_DEVICE_TYPE_D40X :
4895+ sensor -> formats = ds5_depth_formats_d40x ;
4896+ break ;
48304897 case DS5_DEVICE_TYPE_D43X :
48314898 case DS5_DEVICE_TYPE_D45X :
48324899 sensor -> formats = ds5_depth_formats_d43x ;
@@ -4867,7 +4934,7 @@ static int ds5_fixed_configuration(struct i2c_client *client, struct ds5 *state)
48674934 sensor -> formats = & ds5_41x_rgb_format ;
48684935 sensor -> n_formats = DS5_RLT_RGB_N_FORMATS ;
48694936 break ;
4870- /* TODO EHUD: Should probably be different to 457 */
4937+ /* TODO EHUD: Should be disabled (no rgb in 401) */
48714938 case DS5_DEVICE_TYPE_D40X :
48724939 case DS5_DEVICE_TYPE_D45X :
48734940 sensor -> formats = & ds5_rlt_rgb_format ;
0 commit comments