media: i2c: imx290: Simplify imx290_set_data_lanes()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 16 Jan 2023 14:44:53 +0000 (15:44 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 3 Feb 2023 14:05:50 +0000 (15:05 +0100)
commit76c001287f6a56f37a5d48682086c334d81ec9f2
tree6e31af9b08e51315f0897f72996189756cf19aeb
parent7d399658f7c666ead4bc3dbe88944bb8ea7746ca
media: i2c: imx290: Simplify imx290_set_data_lanes()

There's no need to check for an incorrect number of data lanes in
imx290_set_data_lanes() as the value is validated at probe() time. Drop
the check.

The PHY_LANE_NUM and CSI_LANE_MODE registers are programmed with a value
equal to the number of lanes minus one. Compute it instead of handling
it in the switch/case.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-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