From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: 杨孙运 <yangsunyun1993@gmail.com>
Cc: syyang@lontium.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, andrzej.hajda@intel.com,
neil.armstrong@linaro.org, maarten.lankhorst@linux.intel.com,
rfoss@kernel.org, mripard@kernel.org,
Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se,
jernej.skrabec@gmail.com, devicetree@vger.kernel.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
xmzhu@lontium.corp-partner.google.com, tzimmermann@suse.de,
xbpeng@lontium.com, rlyu@lontium.com, xmzhu@lontium.com
Subject: Re: [PATCH 2/2] drm/bridge: Add LT7911EXC edp to mipi bridge driver
Date: Tue, 21 Apr 2026 14:15:37 +0300 [thread overview]
Message-ID: <ed5u73a5lpsixqvm35zpmooolstjv22ygusorub2owbgz7cwj5@42uq6kl6run7> (raw)
In-Reply-To: <CAFQXuNYV+wt2-+8R4m+mtby9TBwcX+vGdqvUvb_6wXkkBg6b=w@mail.gmail.com>
On Tue, Apr 21, 2026 at 11:13:30AM +0800, 杨孙运 wrote:
> Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> 于2026年4月20日周一 11:57写道:
> >
> > On Mon, 20 Apr 2026 at 05:34, <syyang@lontium.com> wrote:
> > >
> > > From: Sunyun Yang <syyang@lontium.com>
> > >
> > > LT7911EXC is a high performance eDP1.4 to MIPI chip for
> >
> > MIPI what?
> >
> MIPI DSI,
> It will be modified in the next version.
>
> > > VR/Display application.
> > >
> > > -eDP1.4Receiver
> > > 1.Support SSC
> > > 2.Support 1/2/4 lanes
> > > 3.Support up to 4K@60HzRGB/YCbCr4:4:48bpc
> > > 4.Support lane swap and PN swap
> > >
> > > -MIPI Transmitter
> > > 1.CompliantwithD-PHY1.2&DSI1.1&CSI-22.0;1 clock lane,
> > > and1/2/3/4 configurable data lanes:2.5Gbpsperdatalane
> > > 2.CompliantwithC-PHY1.0&DSI-21.0&CSI-22.0;
> > > 1/2/3 configurable data trio;2.5Gsps perdatatrio
> > > 3.Support1/2configurable ports
> > > 4.DSISupport16/20/24-bit YCbCr4:2:2,16/18/24/30-bit RGB
> > >
> > > Signed-off-by: Sunyun Yang <syyang@lontium.com>
> > > ---
> > > drivers/gpu/drm/bridge/Kconfig | 18 +
> > > drivers/gpu/drm/bridge/Makefile | 1 +
> > > drivers/gpu/drm/bridge/lontium-lt7911exc.c | 571 +++++++++++++++++++++
> > > 3 files changed, 590 insertions(+)
> > > create mode 100644 drivers/gpu/drm/bridge/lontium-lt7911exc.c
> > >
> > > diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
> > > index c3209b0f4678..bae8cdaea666 100644
> > > --- a/drivers/gpu/drm/bridge/Kconfig
> > > +++ b/drivers/gpu/drm/bridge/Kconfig
> > > @@ -202,6 +202,24 @@ config DRM_LONTIUM_LT8713SX
> > > to 3 configurable Type-C/DP1.4/HDMI2.0 outputs
> > > Please say Y if you have such hardware.
> > >
> > > +config DRM_LONTIUM_LT9611C
> >
> > I thought the patch is for LT7911EXC
> >
> Yes, it is LT7911EXC, It will be modified in the next version.
>
> > > + tristate "Lontium LT9611C DSI/HDMI bridge"
> > > + select SND_SOC_HDMI_CODEC if SND_SOC
> > > + depends on OF
> > > + select CRC8
> > > + select FW_LOADER
> > > + select DRM_PANEL_BRIDGE
> > > + select DRM_KMS_HELPER
> > > + select DRM_MIPI_DSI
> > > + select DRM_DISPLAY_HELPER
> > > + select DRM_DISPLAY_HDMI_STATE_HELPER
> > > + select REGMAP_I2C
> > > + help
> > > + Driver for Lontium DSI to HDMI bridge
> > > + chip driver that converts dual DSI and I2S to
> > > + HDMI signals
> > > + Please say Y if you have such hardware.
> > > +
> > > config DRM_ITE_IT66121
> > > tristate "ITE IT66121 HDMI bridge"
> > > depends on OF
> > > diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
> > > index beab5b695a6e..54b293d1663e 100644
> > > --- a/drivers/gpu/drm/bridge/Makefile
> > > +++ b/drivers/gpu/drm/bridge/Makefile
> > > @@ -18,6 +18,7 @@ obj-$(CONFIG_DRM_LONTIUM_LT9211) += lontium-lt9211.o
> > > obj-$(CONFIG_DRM_LONTIUM_LT9611) += lontium-lt9611.o
> > > obj-$(CONFIG_DRM_LONTIUM_LT9611UXC) += lontium-lt9611uxc.o
> > > obj-$(CONFIG_DRM_LONTIUM_LT8713SX) += lontium-lt8713sx.o
> > > +obj-$(CONFIG_DRM_LONTIUM_LT7911EXC) += lontium-lt7911exc.o
> >
> > Keep the list sorted, please.
> >
> Where can I see the sorting rules? Please guide me.
> it is:
> obj-$(CONFIG_DRM_LONTIUM_LT7911EXC) += lontium-lt7911exc.o
> obj-$(CONFIG_DRM_LONTIUM_LT8713SX) += lontium-lt8713sx.o
zoom out, check the overall contents, submit a patch fixing the error.
> ?
>
> > > obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o
> > > obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
> > > obj-$(CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER) += microchip-lvds.o
> > > diff --git a/drivers/gpu/drm/bridge/lontium-lt7911exc.c b/drivers/gpu/drm/bridge/lontium-lt7911exc.c
> > > new file mode 100644
> > > index 000000000000..d1c1d9e073ef
> > > --- /dev/null
> > > +++ b/drivers/gpu/drm/bridge/lontium-lt7911exc.c
> > > @@ -0,0 +1,571 @@
> > > +// SPDX-License-Identifier: GPL-2.0
> > > +/*
> > > + * Copyright (C) 2026 Lontium Semiconductor, Inc.
> > > + */
> > > +
> > > +#include <linux/crc32.h>
> > > +#include <linux/firmware.h>
> > > +#include <linux/gpio/consumer.h>
> > > +#include <linux/i2c.h>
> > > +#include <linux/regmap.h>
> >
> > I think you use more than that.
> >
> It will be modified in the next version.
>
> > > +#include <drm/drm_of.h>
> > > +
> > > +#define FW_SIZE (64 * 1024)
> > > +#define LT_PAGE_SIZE 32
> > > +#define FW_FILE "LT7911EXC.bin"
> > > +#define LT7911EXC_PAGE_CONTROL 0xff
> > > +
> > > +struct lt7911exc {
> > > + struct device *dev;
> > > + struct i2c_client *client;
> > > + struct drm_bridge bridge;
> > > + struct drm_bridge *panel_bridge;
> >
> > Use next_bridge from struct drm_bridge instead.
> >
> It will be modified in the next version.
>
> > > + struct regmap *regmap;
> > > + /* Protects all accesses to registers by stopping the on-chip MCU */
> > > + struct mutex ocm_lock;
> > > + struct regulator_bulk_data supplies[2];
> > > +
> > > + struct gpio_desc *reset_gpio;
> > > + const struct firmware *fw;
> >
> > Do you need to store it during the runtime? If not, please remove from
> > the data struct.
> >
> Don't need store during the runtime.
> Can I use the global variable 'fw'?
Of course not.
> Because I need use 'fw' to calculate the CRC32 and burn the firmware.
Sure, but what does it have to do with the field in struct lt7911exc?
>
> > > + int fw_version;
> > > + u32 fw_crc;
> > > +
> > > + bool enabled;
> >
> > What for?
> >
> (bool enabled;) is used as a flag in the code to reduce the frequency
> of power supply switching.
How does it help to reduce the rate?
> Of course, it can also be removed in the next version.
>
> > > +};
> > > +
> > > +static const struct regmap_range_cfg lt7911exc_ranges[] = {
> > > + {
> > > + .name = "register_range",
> > > + .range_min = 0,
> > > + .range_max = 0xffff,
> >
> > Is it an actual range?
> >
> 0xe8ff is actual range.
Then why?
>
> > > + .selector_reg = LT7911EXC_PAGE_CONTROL,
> > > + .selector_mask = 0xff,
> > > + .selector_shift = 0,
> > > + .window_start = 0,
> > > + .window_len = 0x100,
> > > + },
> > > +};
> > > +
> > > +static const struct regmap_config lt7911exc_regmap_config = {
> > > + .reg_bits = 8,
> > > + .val_bits = 8,
> > > + .max_register = 0xffff,
> > > + .ranges = lt7911exc_ranges,
> > > + .num_ranges = ARRAY_SIZE(lt7911exc_ranges),
> > > +};
> > > +
> > > +static u32 cal_crc32_custom(const u8 *data, u64 length)
> > > +{
> > > + u32 crc = 0xffffffff;
> > > + u8 buf[4];
> > > + u64 i;
> > > +
> > > + for (i = 0; i < length; i += 4) {
> > > + buf[0] = data[i + 3];
> > > + buf[1] = data[i + 2];
> > > + buf[2] = data[i + 1];
> > > + buf[3] = data[i + 0];
> > > + crc = crc32_be(crc, buf, 4);
> >
> > How is it different from crc32_le()?
> >
> The implementation differs from crc32_le() in both byte ordering and
> processing granularity.
> This function performs a 32-bit word-wise byte swap (little-endian to
> big-endian) before feeding data into crc32_be(), while crc32_le()
> processes the input stream directly in little-endian order without
> transformation.
> Therefore, the result is not equivalent to crc32_le(), and is required
> to match the firmware's expected big-endian word-based CRC format.
ack.
>
>
> > > +MODULE_LICENSE("GPL v2");
> Should GPL be used here? I got an error during testing: GPL v2;
Which error?
--
With best wishes
Dmitry
next prev parent reply other threads:[~2026-04-21 11:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 2:33 [PATCH 0/2] Add LT7911EXC edp to mipi bridge driver syyang
2026-04-20 2:33 ` [PATCH 1/2] dt-bindings:bridge Add LT7911EXC binding syyang
2026-04-20 3:12 ` Dmitry Baryshkov
2026-04-21 1:33 ` 杨孙运
2026-04-21 11:07 ` Dmitry Baryshkov
2026-04-22 0:46 ` 杨孙运
2026-04-23 0:26 ` Claude review: " Claude Code Review Bot
2026-04-20 2:33 ` [PATCH 2/2] drm/bridge: Add LT7911EXC edp to mipi bridge driver syyang
2026-04-20 3:57 ` Dmitry Baryshkov
2026-04-21 3:13 ` 杨孙运
2026-04-21 11:15 ` Dmitry Baryshkov [this message]
2026-04-22 1:06 ` 杨孙运
2026-04-22 18:58 ` Dmitry Baryshkov
2026-04-23 0:26 ` Claude review: " Claude Code Review Bot
2026-04-20 5:05 ` Quentin Freimanis
2026-04-21 3:26 ` 杨孙运
2026-04-23 0:26 ` Claude review: " Claude Code Review Bot
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=ed5u73a5lpsixqvm35zpmooolstjv22ygusorub2owbgz7cwj5@42uq6kl6run7 \
--to=dmitry.baryshkov@oss.qualcomm.com \
--cc=Laurent.pinchart@ideasonboard.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=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=rlyu@lontium.com \
--cc=robh@kernel.org \
--cc=syyang@lontium.com \
--cc=tzimmermann@suse.de \
--cc=xbpeng@lontium.com \
--cc=xmzhu@lontium.com \
--cc=xmzhu@lontium.corp-partner.google.com \
--cc=yangsunyun1993@gmail.com \
/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