Skip to content

Commit df6c776

Browse files
naushirpelwell
authored andcommitted
drivers: media: cfe: Workaround for 16-bit mismatch in the hardware
Set the data type for 16-bit modes to 0 (wildcard) to workarond the 16-bit mismatch in hardware. We also need to suppress the warning about DT == 0 on start stream in these cases. Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
1 parent 4f776c2 commit df6c776

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

drivers/media/platform/raspberrypi/rp1_cfe/cfe.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,11 @@ static void cfe_start_channel(struct cfe_node *node)
851851
width = source_fmt->width;
852852
height = source_fmt->height;
853853

854-
/* Must have a valid CSI2 datatype. */
855-
WARN_ON(!fmt->csi_dt);
854+
/*
855+
* Must have a valid CSI2 datatype, but it will be 0 for 16-bit
856+
* formats to work-around the HW mismatch.
857+
*/
858+
WARN_ON(fmt->depth != 16 && !fmt->csi_dt);
856859

857860
/*
858861
* Start the associated CSI2 Channel as well.

drivers/media/platform/raspberrypi/rp1_cfe/cfe_fmts.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,31 +197,31 @@ static const struct cfe_fmt formats[] = {
197197
.fourcc = V4L2_PIX_FMT_SBGGR16,
198198
.code = MEDIA_BUS_FMT_SBGGR16_1X16,
199199
.depth = 16,
200-
.csi_dt = MIPI_CSI2_DT_RAW16,
200+
.csi_dt = 0, /* Avoid RP1 HW mismatch for 16-bit modes. */
201201
.flags = CFE_FORMAT_FLAG_FE_OUT,
202202
.remap = { V4L2_PIX_FMT_SBGGR16, V4L2_PIX_FMT_PISP_COMP1_BGGR },
203203
},
204204
{
205205
.fourcc = V4L2_PIX_FMT_SGBRG16,
206206
.code = MEDIA_BUS_FMT_SGBRG16_1X16,
207207
.depth = 16,
208-
.csi_dt = MIPI_CSI2_DT_RAW16,
208+
.csi_dt = 0, /* Avoid RP1 HW mismatch for 16-bit modes. */
209209
.flags = CFE_FORMAT_FLAG_FE_OUT,
210210
.remap = { V4L2_PIX_FMT_SGBRG16, V4L2_PIX_FMT_PISP_COMP1_GBRG },
211211
},
212212
{
213213
.fourcc = V4L2_PIX_FMT_SGRBG16,
214214
.code = MEDIA_BUS_FMT_SGRBG16_1X16,
215215
.depth = 16,
216-
.csi_dt = MIPI_CSI2_DT_RAW16,
216+
.csi_dt = 0, /* Avoid RP1 HW mismatch for 16-bit modes. */
217217
.flags = CFE_FORMAT_FLAG_FE_OUT,
218218
.remap = { V4L2_PIX_FMT_SGRBG16, V4L2_PIX_FMT_PISP_COMP1_GRBG },
219219
},
220220
{
221221
.fourcc = V4L2_PIX_FMT_SRGGB16,
222222
.code = MEDIA_BUS_FMT_SRGGB16_1X16,
223223
.depth = 16,
224-
.csi_dt = MIPI_CSI2_DT_RAW16,
224+
.csi_dt = 0, /* Avoid RP1 HW mismatch for 16-bit modes. */
225225
.flags = CFE_FORMAT_FLAG_FE_OUT,
226226
.remap = { V4L2_PIX_FMT_SRGGB16, V4L2_PIX_FMT_PISP_COMP1_RGGB },
227227
},

0 commit comments

Comments
 (0)