From: "Börge Strümpfel" <bstruempfel@data-modul.com>
To: Marek Vasut <marex@nabladev.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] drm/bridge: lt9211: Add drive-strength-microamp DT property
Date: Wed, 13 May 2026 11:02:52 +0200 [thread overview]
Message-ID: <agQ4pVGFEMGaMqgc@DATAMODULBOERGELINUX> (raw)
In-Reply-To: <dff39a7a-a25c-4565-ad20-48026995af11@nabladev.com>
Hello Marek,
Thank you for your feedback,
On Tue, May 12, 2026 at 08:29:55PM +0200, Marek Vasut wrote:
> On 5/12/26 6:46 PM, Boerge Struempfel wrote:
>
> > +/* Maps register value (index) to drive-strength-microamp DT property value */
> > +static const u32 lt9211_hsdrv_microamp[] = {
>
> This can be u8 .
>
you are right, I'll change that in the v2.
> > + 12, 14, 16, 17, 19, 20, 22, 23, 25, 27, 28, 30, 31, 33, 34, 36
> > +};
> > +
> > struct lt9211 {
> > struct drm_bridge bridge;
> > struct device *dev;
> > @@ -50,6 +55,7 @@ struct lt9211 {
> > struct regulator *vccio;
> > bool lvds_dual_link;
> > bool lvds_dual_link_even_odd_swap;
> > + u8 lvds_hsdrv_isel;
> > };
> >
> > static const struct regmap_range lt9211_rw_ranges[] = {
> > @@ -374,7 +380,8 @@ static int lt9211_configure_tx(struct lt9211 *ctx, bool jeida,
> > /* BIT(7) is LVDS dual-port */
> > { 0x823b, 0x38 | (ctx->lvds_dual_link ? BIT(7) : 0) },
> > { 0x823e, 0x92 },
> > - { 0x823f, 0x48 },
> > + /* bits 3:0: RG_MLTX_HSDRV_ISEL, LVDS TX driver current */
> > + { 0x823f, 0x40 | ctx->lvds_hsdrv_isel },
> > { 0x8240, 0x31 },
> > { 0x8243, 0x80 },
> > { 0x8244, 0x00 },
> > @@ -629,7 +636,9 @@ static int lt9211_parse_dt(struct lt9211 *ctx)
> > struct device *dev = ctx->dev;
> > struct drm_panel *panel;
> > int dual_link;
> > + u32 microamp;
> > int ret;
> > + int i;
> >
> > ctx->vccio = devm_regulator_get(dev, "vccio");
> > if (IS_ERR(ctx->vccio))
> > @@ -666,6 +675,23 @@ static int lt9211_parse_dt(struct lt9211 *ctx)
> >
> > ctx->panel_bridge = panel_bridge;
> >
> > + ctx->lvds_hsdrv_isel = 8; /* default: 25 uA */
> > + ret = of_property_read_u32(dev->of_node, "drive-strength-microamp",
> > + µamp);
>
> if ret != 0 , then what happens here ?
>
if ret != 0, we will keep the default value of 8 (corresponding to 25 uA
as written above), which is the behavior that the driver had previously.
According to the documentation, of_property_read_u32() will return 0 on
success, -EINVAL if the property does not exist, -ENODATA if property
does not have a value, and -EOVERFLOW if the property data isn't large
enough. I think we only would need to give a warning or similar if the
-ENODATA or -EOVERFLOW cases. However, I personally do not think that is
necessary, as the usage is specified unambiguously in the devicetree
bindings.
If you feel like we should add a warning in those cases, I can add them
however.
> > + if (!ret) {
> > + for (i = 0; i < ARRAY_SIZE(lt9211_hsdrv_microamp); i++) {
> > + if (lt9211_hsdrv_microamp[i] == microamp) {
> > + ctx->lvds_hsdrv_isel = i;
> > + break;
> > + }
> > + }
> > + if (i == ARRAY_SIZE(lt9211_hsdrv_microamp)) {
> > + dev_err(dev, "Invalid drive-strength-microamp value %u\n",
> > + microamp);
> > + return -EINVAL;
> > + }
> > + }
> > +
> > return 0;
> [...]
>
--
Best regards,
Börge Strümpfel
DATA MODUL AG
Landsberger Str. 322
80687 München
next prev parent reply other threads:[~2026-05-13 9:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 16:46 [PATCH 0/2] drm/bridge: lt9211: Add drive-strength-microamp DT property Boerge Struempfel
2026-05-12 16:46 ` [PATCH 1/2] dt-bindings: display/bridge: lt9211: Add drive-strength-microamp property Boerge Struempfel
2026-05-12 17:05 ` Conor Dooley
2026-05-12 16:46 ` [PATCH 2/2] drm/bridge: lt9211: Add drive-strength-microamp DT property Boerge Struempfel
2026-05-12 18:29 ` Marek Vasut
2026-05-13 9:02 ` Börge Strümpfel [this message]
2026-05-13 11:33 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=agQ4pVGFEMGaMqgc@DATAMODULBOERGELINUX \
--to=bstruempfel@data-modul.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marex@nabladev.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox