summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/sh_mobile_ceu_camera.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-05-30 17:45:46 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2009-05-30 17:45:46 -0700
commitfc32b7aec72765c7ee074348f4bf6f8f920aacc4 (patch)
tree149a135850bee91ea940dfbfa80fc4de03a0611a /linux/drivers/media/video/sh_mobile_ceu_camera.c
parent9b58b19cf0eba5a8a77bbbd58df57194a5688a80 (diff)
downloadmediapointer-dvb-s2-fc32b7aec72765c7ee074348f4bf6f8f920aacc4.tar.gz
mediapointer-dvb-s2-fc32b7aec72765c7ee074348f4bf6f8f920aacc4.tar.bz2
sh_mobile_ceu_camera: Use v4l bounding/alignment function
From: Trent Piepho <xyzzy@speakeasy.org> The v4l function has a better algorithm for aligning image size. Priority: normal Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/drivers/media/video/sh_mobile_ceu_camera.c')
-rw-r--r--linux/drivers/media/video/sh_mobile_ceu_camera.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/linux/drivers/media/video/sh_mobile_ceu_camera.c b/linux/drivers/media/video/sh_mobile_ceu_camera.c
index bf0b176f9..7ea2a0edf 100644
--- a/linux/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/linux/drivers/media/video/sh_mobile_ceu_camera.c
@@ -690,16 +690,8 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,
/* FIXME: calculate using depth and bus width */
- if (f->fmt.pix.height < 4)
- f->fmt.pix.height = 4;
- if (f->fmt.pix.height > 1920)
- f->fmt.pix.height = 1920;
- if (f->fmt.pix.width < 2)
- f->fmt.pix.width = 2;
- if (f->fmt.pix.width > 2560)
- f->fmt.pix.width = 2560;
- f->fmt.pix.width &= ~0x01;
- f->fmt.pix.height &= ~0x03;
+ v4l_bound_align_image(&f->fmt.pix.width, 2, 2560, 1,
+ &f->fmt.pix.height, 4, 1920, 2, 0);
f->fmt.pix.bytesperline = f->fmt.pix.width *
DIV_ROUND_UP(xlate->host_fmt->depth, 8);