Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/stm: dsi: move lane capability detection in probe()

There is no need to re-compute the dsi lane capability because it
only depends on dsi hw version.
Since dsi hw version is detected at probe(), move there also the
assignment of dsi lane capability.

Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Acked-by: Philippe Cornu <philippe.cornu@foss.st.com>
Reviewed-by: Philippe Cornu <philippe.cornu@foss.st.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211218215055.212421-1-antonio.borneo@foss.st.com

authored by

Antonio Borneo and committed by
Robert Foss
22f99f2d fa747d75

+8 -8
+8 -8
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
··· 247 247 int ret, bpp; 248 248 u32 val; 249 249 250 - /* Update lane capabilities according to hw version */ 251 - dsi->lane_min_kbps = LANE_MIN_KBPS; 252 - dsi->lane_max_kbps = LANE_MAX_KBPS; 253 - if (dsi->hw_version == HWVER_131) { 254 - dsi->lane_min_kbps *= 2; 255 - dsi->lane_max_kbps *= 2; 256 - } 257 - 258 250 pll_in_khz = (unsigned int)(clk_get_rate(dsi->pllref_clk) / 1000); 259 251 260 252 /* Compute requested pll out */ ··· 407 415 ret = -ENODEV; 408 416 DRM_ERROR("bad dsi hardware version\n"); 409 417 goto err_dsi_probe; 418 + } 419 + 420 + /* set lane capabilities according to hw version */ 421 + dsi->lane_min_kbps = LANE_MIN_KBPS; 422 + dsi->lane_max_kbps = LANE_MAX_KBPS; 423 + if (dsi->hw_version == HWVER_131) { 424 + dsi->lane_min_kbps *= 2; 425 + dsi->lane_max_kbps *= 2; 410 426 } 411 427 412 428 dw_mipi_dsi_stm_plat_data.base = dsi->base;