diff options
author | Paul Kocialkowski <paul.kocialkowski@bootlin.com> | 2022-11-03 19:30:50 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-11-25 10:04:18 +0300 |
commit | 0f6417f1c802bae43384e5b7933ccea1f6572b83 (patch) | |
tree | 0bb6946e00975d71513f6c62dec5db96debba346 /drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c | |
parent | b3a07d8e3e06c048a72caeff123dd5b409771f16 (diff) | |
download | linux-0f6417f1c802bae43384e5b7933ccea1f6572b83.tar.xz |
media: sun6i-csi: Add dimensions and format helpers to capture
Define and export useful helpers to access dimensions and pixel format.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c')
-rw-r--r-- | drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c index b3d19d850e8b..9a20b9fc2577 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c @@ -25,6 +25,25 @@ /* 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 * sun6i_csi_capture_remote_subdev(struct sun6i_csi_capture *capture, u32 *pad) { |