[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ffdyawzggxva47wl3a7iukqiikls5aoovnfdjyuouqhr7vucsx@ilk5hrpszjnd>
Date: Sat, 16 Aug 2025 22:55:25 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Nishanth Menon <nm@...com>
Cc: Conor Dooley <conor+dt@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Rob Herring <robh@...nel.org>, David Airlie <airlied@...il.com>,
Maxime Ripard <mripard@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
Robert Nelson <robertcnelson@...il.com>,
Jason Kridner <jkridner@...gleboard.org>, afd@...com,
tomi.valkeinen@...asonboard.com, devarsht@...com
Subject: Re: [PATCH V3 3/4] drm/bridge: it66121: Use vid/pid to detect the
type of chip
On Thu, Aug 14, 2025 at 10:41:04PM -0500, Nishanth Menon wrote:
> The driver knows exactly which version of the chip is present since
> the vid/pid is used to enforce a compatibility. Given that some
> devices like IT66121 has potentially been replaced with IT66122 mid
> production for many platforms, it makes no sense to use the vid/pid as
> an enforcement for compatibility. Instead, let us detect the ID of the
> actual chip in use by matching the corresponding vid/pid.
>
> This also allows for some future compatibility to be checked only
> against a restricted set of vid/pid.
>
> While at this, fix up a bit of formatting errors reported by
> checkpatch warning, and since the ctx info just requires the id, drop
> storing the entire chip_info pointer.
Separate commit, please. Don't mix unrelated changes into a single
patch. "While at it" usually means that it should be a separate patch.
>
> Signed-off-by: Nishanth Menon <nm@...com>
> ---
> Changes in V3:
> * Converted the patch to lookup ID based on vid/pid match rather than
> enforcing vid/pid match per compatible.
> * Squashed a formating fix for pre-existing checkpatch --strict warning
>
> V2: https://lore.kernel.org/all/20250813204106.580141-3-nm@ti.com/
>
> drivers/gpu/drm/bridge/ite-it66121.c | 53 ++++++++++++++--------------
> 1 file changed, 27 insertions(+), 26 deletions(-)
>
> @@ -1606,28 +1613,22 @@ static void it66121_remove(struct i2c_client *client)
> mutex_destroy(&ctx->lock);
> }
>
> -static const struct it66121_chip_info it66121_chip_info = {
> - .id = ID_IT66121,
> - .vid = 0x4954,
> - .pid = 0x0612,
> -};
> -
> -static const struct it66121_chip_info it6610_chip_info = {
> - .id = ID_IT6610,
> - .vid = 0xca00,
> - .pid = 0x0611,
> +static const struct it66121_chip_info it66xx_chip_info[] = {
> + {.id = ID_IT66121, .vid = 0x4954, .pid = 0x0612 },
> + {.id = ID_IT6610, .vid = 0xca00, .pid = 0x0611 },
> + { }
> };
>
> static const struct of_device_id it66121_dt_match[] = {
> - { .compatible = "ite,it66121", &it66121_chip_info },
> - { .compatible = "ite,it6610", &it6610_chip_info },
> + { .compatible = "ite,it66121", &it66xx_chip_info },
> + { .compatible = "ite,it6610", &it66xx_chip_info },
Other than dropping the match data completely, please keep arrays
sorted.
> { }
> };
> MODULE_DEVICE_TABLE(of, it66121_dt_match);
>
> static const struct i2c_device_id it66121_id[] = {
> - { "it66121", (kernel_ulong_t) &it66121_chip_info },
> - { "it6610", (kernel_ulong_t) &it6610_chip_info },
> + { "it66121", (kernel_ulong_t)&it66xx_chip_info },
> + { "it6610", (kernel_ulong_t)&it66xx_chip_info },
> { }
> };
> MODULE_DEVICE_TABLE(i2c, it66121_id);
> --
> 2.47.0
>
--
With best wishes
Dmitry
Powered by blists - more mailing lists