summaryrefslogtreecommitdiff
path: root/drivers/media/usb/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorFrank Schaefer <fschaefer.oss@googlemail.com>2013-02-10 16:05:11 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-04 14:30:18 -0300
commit8168532712fe0c662f22180755fb89103a2e6558 (patch)
treec057eae582bb97b1e457f2b2f233b0c60b76e2c7 /drivers/media/usb/em28xx/em28xx-video.c
parent84e902aa05b628b940c4a17ea2c92ec4fbcffc18 (diff)
downloadlwn-8168532712fe0c662f22180755fb89103a2e6558.tar.gz
lwn-8168532712fe0c662f22180755fb89103a2e6558.zip
[media] em28xx: introduce #define for maximum supported scaling values (register 0x30-0x33)
The maximum supported scaling value for registers 0x30+0x31 (horizontal scaling) and 0x32+0x33 (vertical scaling) is 0x3fff, which corresponds to 20% of the input frame size. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 6d261232278c..9451e1ed0ec8 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -807,12 +807,12 @@ static void get_scale(struct em28xx *dev,
unsigned int maxh = norm_maxh(dev);
*hscale = (((unsigned long)maxw) << 12) / width - 4096L;
- if (*hscale >= 0x4000)
- *hscale = 0x3fff;
+ if (*hscale > EM28XX_HVSCALE_MAX)
+ *hscale = EM28XX_HVSCALE_MAX;
*vscale = (((unsigned long)maxh) << 12) / height - 4096L;
- if (*vscale >= 0x4000)
- *vscale = 0x3fff;
+ if (*vscale > EM28XX_HVSCALE_MAX)
+ *vscale = EM28XX_HVSCALE_MAX;
}
/* ------------------------------------------------------------------