Commit 0f6417f1 authored by Paul Kocialkowski's avatar Paul Kocialkowski Committed by Mauro Carvalho Chehab

media: sun6i-csi: Add dimensions and format helpers to capture

Define and export useful helpers to access dimensions and pixel format.
Signed-off-by: default avatarPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Acked-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent b3a07d8e
...@@ -25,6 +25,25 @@ ...@@ -25,6 +25,25 @@
/* Helpers */ /* Helpers */
void sun6i_csi_capture_dimensions(struct sun6i_csi_device *csi_dev,
unsigned int *width, unsigned int *height)
{
if (width)
*width = csi_dev->capture.format.fmt.pix.width;
if (height)
*height = csi_dev->capture.format.fmt.pix.height;
}
void sun6i_csi_capture_format(struct sun6i_csi_device *csi_dev,
u32 *pixelformat, u32 *field)
{
if (pixelformat)
*pixelformat = csi_dev->capture.format.fmt.pix.pixelformat;
if (field)
*field = csi_dev->capture.format.fmt.pix.field;
}
static struct v4l2_subdev * static struct v4l2_subdev *
sun6i_csi_capture_remote_subdev(struct sun6i_csi_capture *capture, u32 *pad) sun6i_csi_capture_remote_subdev(struct sun6i_csi_capture *capture, u32 *pad)
{ {
......
...@@ -37,6 +37,11 @@ struct sun6i_csi_capture { ...@@ -37,6 +37,11 @@ struct sun6i_csi_capture {
u32 mbus_code; u32 mbus_code;
}; };
void sun6i_csi_capture_dimensions(struct sun6i_csi_device *csi_dev,
unsigned int *width, unsigned int *height);
void sun6i_csi_capture_format(struct sun6i_csi_device *csi_dev,
u32 *pixelformat, u32 *field);
void sun6i_csi_capture_sync(struct sun6i_csi_device *csi_dev); void sun6i_csi_capture_sync(struct sun6i_csi_device *csi_dev);
void sun6i_csi_capture_frame_done(struct sun6i_csi_device *csi_dev); void sun6i_csi_capture_frame_done(struct sun6i_csi_device *csi_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment