media: ov5640: Make 2592x1944 mode only available at 15 fps
authorBenoit Parrot <bparrot@ti.com>
Wed, 9 Oct 2019 12:35:10 +0000 (09:35 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:44:17 +0000 (16:44 +0100)
[ Upstream commit 981e445454531c9d5ac5d3fa8c0f1bd55262d001 ]

The sensor data sheet clearly state that 2592x1944 only works at 15 fps
make sure we don't try to miss configure the pll out of acceptable
range.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/ov5640.c

index 500d9bbff10b5038cd4350432402db58e94c11d8..18dd2d717088b7198492d5d5d6670c1c01022b5c 100644 (file)
@@ -1611,6 +1611,11 @@ ov5640_find_mode(struct ov5640_dev *sensor, enum ov5640_frame_rate fr,
            !(mode->hact == 640 && mode->vact == 480))
                return NULL;
 
+       /* 2592x1944 only works at 15fps max */
+       if ((mode->hact == 2592 && mode->vact == 1944) &&
+           fr > OV5640_15_FPS)
+               return NULL;
+
        return mode;
 }