]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: rcar-csi2: Optimize rcsi2_calc_mbps()
authorTomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Thu, 15 Jan 2026 10:07:01 +0000 (12:07 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 11 Mar 2026 00:05:31 +0000 (01:05 +0100)
commit291d75952cf7e6801fe02c62ad694d50dc64e56b
tree5f8b9d8b1e8d7543f0edea0c9c3e865afc5b1779
parent21bcc9355cae73637e42865ee2c61d48d209a91d
media: rcar-csi2: Optimize rcsi2_calc_mbps()

With modern drivers supporting link-freq, we don't need to do any
calculations based on the bpp and number of lanes when figuring out the
link frequency. However, the code currently always runs code to get the
bpp and number of lanes.

Optimize the rcsi2_calc_mbps() so that we only do that when needed, i.e.
when querying the link-freq is not supported by the upstream subdevice.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/renesas/rcar-csi2.c