media: i2c: imx290: Rename, extend and expand usage of imx290_pixfmt
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 17 Oct 2022 10:44:27 +0000 (12:44 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 3 Feb 2023 14:04:06 +0000 (15:04 +0100)
commit10591fe63691bd8199d5e7244029cc065959ffc9
tree2a6904abdad76640162174cf6dfcd048b43e433d
parenta2514b9a634ac0a2cfbc329822b8fb58ffe23a80
media: i2c: imx290: Rename, extend and expand usage of imx290_pixfmt

The imx290_pixfmt structure contains information about formats,
currently limited to the bpp value. Extend it with the register settings
for each format, and rename it to imx290_format_info to make its purpose
clearer. Add a function named imx290_format_info() to look up format
info for a media bus code, and use it through the code. This allows
dropping the imx290 bpp field as the value is now looked up dynamically.

The error handling in imx290_setup_format() can also be dropped, as the
format is guaranteed by imx290_set_fmt() to be valid.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/imx290.c