Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: imx: imx-mipi-csis: Implement the .get_frame_desc() operation

The CSIS is connected to its sink through an SoC-specific gasket that
needs to be configured. Depending on the platform, the gasket
configuration requires knowing the CSI-2 DT. To provide the needed
information, implement the .get_frame_desc() operation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Laurent Pinchart and committed by
Mauro Carvalho Chehab
d200de90 a1c046d3

+27
+27
drivers/media/platform/nxp/imx-mipi-csis.c
··· 1160 1160 return 0; 1161 1161 } 1162 1162 1163 + static int mipi_csis_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, 1164 + struct v4l2_mbus_frame_desc *fd) 1165 + { 1166 + struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd); 1167 + struct v4l2_mbus_frame_desc_entry *entry = &fd->entry[0]; 1168 + 1169 + if (pad != CSIS_PAD_SOURCE) 1170 + return -EINVAL; 1171 + 1172 + fd->type = V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL; 1173 + fd->num_entries = 1; 1174 + 1175 + memset(entry, 0, sizeof(*entry)); 1176 + 1177 + mutex_lock(&csis->lock); 1178 + 1179 + entry->flags = 0; 1180 + entry->pixelcode = csis->csis_fmt->code; 1181 + entry->bus.csi2.vc = 0; 1182 + entry->bus.csi2.dt = csis->csis_fmt->data_type; 1183 + 1184 + mutex_unlock(&csis->lock); 1185 + 1186 + return 0; 1187 + } 1188 + 1163 1189 static int mipi_csis_log_status(struct v4l2_subdev *sd) 1164 1190 { 1165 1191 struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd); ··· 1210 1184 .enum_mbus_code = mipi_csis_enum_mbus_code, 1211 1185 .get_fmt = mipi_csis_get_fmt, 1212 1186 .set_fmt = mipi_csis_set_fmt, 1187 + .get_frame_desc = mipi_csis_get_frame_desc, 1213 1188 }; 1214 1189 1215 1190 static const struct v4l2_subdev_ops mipi_csis_subdev_ops = {