]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: i2c: mt9v032: fix enum mbus codes and frame sizes
authorEugen Hristev <eugen.hristev@microchip.com>
Thu, 21 Nov 2019 07:55:24 +0000 (08:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:34:36 +0000 (08:34 +0100)
commit03ac6ed43fa282fab72e2b26818f5563eb58a13a
treea790e45d98ac4cde999447883acdc1121a6d4df3
parent8cc5aa5ce61a3c137b14c01fc9c342ba5371a38b
media: i2c: mt9v032: fix enum mbus codes and frame sizes

[ Upstream commit 1451d5ae351d938a0ab1677498c893f17b9ee21d ]

This driver supports both the mt9v032 (color) and the mt9v022 (mono)
sensors. Depending on which sensor is used, the format from the sensor is
different. The format.code inside the dev struct holds this information.
The enum mbus and enum frame sizes need to take into account both type of
sensors, not just the color one. To solve this, use the format.code in
these functions instead of the hardcoded bayer color format (which is only
used for mt9v032).

[Sakari Ailus: rewrapped commit message]

Suggested-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/mt9v032.c