[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6948375.lOV4Wx5bFT@senjougahara>
Date: Tue, 02 Sep 2025 09:46:52 +0900
From: Mikko Perttunen <mperttunen@...dia.com>
To: Thierry Reding <thierry.reding@...il.com>,
Thierry Reding <treding@...dia.com>, Jonathan Hunter <jonathanh@...dia.com>,
Sowjanya Komatineni <skomatineni@...dia.com>,
Luca Ceresoli <luca.ceresoli@...tlin.com>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Peter De Schrijver <pdeschrijver@...dia.com>,
Prashant Gaikwad <pgaikwad@...dia.com>,
Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Svyatoslav Ryhel <clamor95@...il.com>, Dmitry Osipenko <digetx@...il.com>,
Charan Pedumuru <charan.pedumuru@...il.com>,
Svyatoslav Ryhel <clamor95@...il.com>
Cc: linux-media@...r.kernel.org, linux-tegra@...r.kernel.org,
dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org,
linux-staging@...ts.linux.dev
Subject:
Re: [PATCH v1 07/19] staging: media: tegra-video: csi: parametrize MIPI
calibration device presence
On Tuesday, August 19, 2025 9:16 PM Svyatoslav Ryhel wrote:
> Dedicated MIPI calibration block appears only in Tegra114, before Tegra114
> all MIPI calibration pads were part of VI block.
>
> Signed-off-by: Svyatoslav Ryhel <clamor95@...il.com>
> ---
> drivers/staging/media/tegra-video/csi.c | 12 +++++++-----
> drivers/staging/media/tegra-video/csi.h | 1 +
> drivers/staging/media/tegra-video/tegra210.c | 1 +
> 3 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/media/tegra-video/csi.c
> b/drivers/staging/media/tegra-video/csi.c index 74c92db1032f..2f9907a20db1
> 100644
> --- a/drivers/staging/media/tegra-video/csi.c
> +++ b/drivers/staging/media/tegra-video/csi.c
> @@ -485,11 +485,13 @@ static int tegra_csi_channel_alloc(struct tegra_csi
> *csi, if (IS_ENABLED(CONFIG_VIDEO_TEGRA_TPG))
> return 0;
>
> - chan->mipi = tegra_mipi_request(csi->dev, node);
> - if (IS_ERR(chan->mipi)) {
> - ret = PTR_ERR(chan->mipi);
> - chan->mipi = NULL;
> - dev_err(csi->dev, "failed to get mipi device: %d\n", ret);
> + if (csi->soc->has_mipi_calibration) {
> + chan->mipi = tegra_mipi_request(csi->dev, node);
The way I would read 'soc->has_mipi_calibration' is that this device (CSI)
contains the MIPI calibration hardware. I.e. the opposite of here. I would
invert the logic and optionally call it e.g. 'internal_mipi_calib'.
A cleaner way to do this might be to always call tegra_mipi_request et al. --
on pre-Tegra114 SoCs this would just call back to the VI/CSI driver using the
callbacks registered in the MIPI driver as we discussed before. That way the
CSI driver won't need separate code paths for SoCs with internal MIPI
calibration and SoCs with the external MIPI calibration device.
Cheers,
Mikko
> + if (IS_ERR(chan->mipi)) {
> + ret = PTR_ERR(chan->mipi);
> + chan->mipi = NULL;
> + dev_err(csi->dev, "failed to get mipi device:
%d\n", ret);
> + }
> }
>
> return ret;
> diff --git a/drivers/staging/media/tegra-video/csi.h
> b/drivers/staging/media/tegra-video/csi.h index 3ed2dbc73ce9..400b913bb1cb
> 100644
> --- a/drivers/staging/media/tegra-video/csi.h
> +++ b/drivers/staging/media/tegra-video/csi.h
> @@ -128,6 +128,7 @@ struct tegra_csi_soc {
> unsigned int num_clks;
> const struct tpg_framerate *tpg_frmrate_table;
> unsigned int tpg_frmrate_table_size;
> + bool has_mipi_calibration;
> };
>
> /**
> diff --git a/drivers/staging/media/tegra-video/tegra210.c
> b/drivers/staging/media/tegra-video/tegra210.c index
> da99f19a39e7..305472e94af4 100644
> --- a/drivers/staging/media/tegra-video/tegra210.c
> +++ b/drivers/staging/media/tegra-video/tegra210.c
> @@ -1218,4 +1218,5 @@ const struct tegra_csi_soc tegra210_csi_soc = {
> .num_clks = ARRAY_SIZE(tegra210_csi_cil_clks),
> .tpg_frmrate_table = tegra210_tpg_frmrate_table,
> .tpg_frmrate_table_size = ARRAY_SIZE(tegra210_tpg_frmrate_table),
> + .has_mipi_calibration = true,
> };
Powered by blists - more mailing lists