From cc552b620fa3a184ba3d4064223ca1d59325b166 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 20 May 2011 04:25:09 -0300 Subject: [media] V4L: soc-camera: add a new packing for YUV 4:2:0 type formats 12-bit formats, similar to YUV 4:2:0 occupy 3 bytes for each two pixels and cannot be described by any of the existing SOC_MBUS_PACKING_* macros. This patch adds a new one SOC_MBUS_PACKING_1_5X8 to describe such formats and extends soc_mbus_samples_per_pixel() to support it. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/mx3_camera.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/mx3_camera.c') diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c index 8630c0c9e60a..3e5435b539ba 100644 --- a/drivers/media/video/mx3_camera.c +++ b/drivers/media/video/mx3_camera.c @@ -756,8 +756,10 @@ static void configure_geometry(struct mx3_camera_dev *mx3_cam, * the width parameter count the number of samples to * capture to complete the whole image width. */ - width *= soc_mbus_samples_per_pixel(fmt); - BUG_ON(width < 0); + unsigned int num, den; + int ret = soc_mbus_samples_per_pixel(fmt, &num, &den); + BUG_ON(ret < 0); + width = width * num / den; } /* Setup frame size - this cannot be changed on-the-fly... */ -- cgit v1.2.3