Add Lontium LT7911EXC eDP to MIPI DSI bridge
Subsystems (4)
v7 cover Add Lontium LT7911EXC eDP to MIPI DSI bridge
From: Sunyun Yang <[email protected]>
The LT7911EXC is an I2C-controlled bridge that receives eDP1.4 and output mipi dsi. This series introduces:
- A device tree binding YAML file describing the hardware
- A new DRM bridge driver implementing the basic functionality
---
Change in v7:
- dt-binding:
1. fix commit message typos(Receiver、signal) [sashiko-bot]
2. remove the ambiguity caused by "signal/dual".
- drm/bridge:
1. using devm_regulator_get_enable avoids power leaks. [sashiko-bot]
2. set reset gpio is low after cutting off power in lt7911exc_remove function, avoid backpowering.
3. synchronous request_firmware() call cause a permanent probe failure if the driver is built-in, probe executes before the root filesystem is mounted, which would cause this to fail with -ENOENT, we have removed this functionality. Use trigger to upgrade.
4. add depends on I2C and select REGMAP_I2C in Kconfig.
5. add return value of devm_drm_bridge_add() in probe().
6. add directly header files (linux/slab.h, linux/delay.h, linux/regulator/consumer.h)
- Link to v6: https://lore.kernel.org/lkml/[email protected]/
Change in v6:
- dt-binding:
- drm/bridge:
1. use #define FW_FILE "Lontium/lt7911exc_fw.bin" to match linux-firmware
- Link to v5: https://lore.kernel.org/lkml/[email protected]/
Change in v5:
- dt-binding:
- drm/bridge:
1. Change "mipi" to "mipi dsi" in the commit message. [Dmitry]
2. Change "eDP/MIPI" to "eDP/MIPI DSI" in Kconfig.
- Link to v4: https://lore.kernel.org/lkml/[email protected]/
Change in v4:
- dt-binding:
1. Fix the missing spaces on the "subject". [Krzysztof]
2. Fix the error descriptions for port@0 and port@1.
- drm/bridge:
- Link to v3: https://lore.kernel.org/lkml/[email protected]/
Change in v3:
- dt-binding:
- drm/bridge:
1. already submit lt7911exc_fw.bin to linux-firmware. [Dmitry]
2. remove lt7911exc_remove function.
3. drop the "lontium, " in lt7911exc_i2c_table.
- Link to v2: https://lore.kernel.org/lkml/[email protected]/
Change in v2:
- dt-binding:
1. reset pins use active low. [Dmitry]
- drm/bridge:
1. use atomic_* callbacks. [Quentin]
2. fix the incorrect formatting and spaces.
3. add the required header files. [Dmitry]
4. remove "enabled" flag.
5. remove *fw from the lt7911exc struct.
6. .max_register and .range_max use actual range.
7. regulator use bulk interface.
8. use dev_err_probe, devm_mutex_init and devm_drm_bridge_add.
9. Replace GPL v2 with GPL.
- Link to v1: https://lore.kernel.org/lkml/[email protected]/
---
Sunyun Yang (2):
dt-bindings: bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge
.../display/bridge/lontium,lt7911exc.yaml | 89 +++ drivers/gpu/drm/bridge/Kconfig | 15 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/lontium-lt7911exc.c | 514 ++++++++++++++++++ 4 files changed, 619 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/lontium,lt7911exc.yaml create mode 100644 drivers/gpu/drm/bridge/lontium-lt7911exc.c
Signature · 1 line
2.34.1
PATCH v7 1/2 dt-bindings: bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge
From: Sunyun Yang <[email protected]>
This commit adds the device tree binding schema for the Lontium LT7911EXC. This device is an I2C-controlled bridge that converts eDP 1.4 input to MIPI DSI output.
--- .../display/bridge/lontium,lt7911exc.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/lontium,lt7911exc.yaml
Documentation/devicetree/bindings/display/bridge/lontium,lt7911exc.yaml new file +89 -0
@@ -0,0 +1,89 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/lontium,lt7911exc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Lontium LT7911EXC eDP to MIPI DSI Bridge + +maintainers: + - Sunyun Yang <[email protected]> + +properties: + compatible: + enum: + - lontium,lt7911exc + + reg: + maxItems: 1 + + reset-gpios: + maxItems: 1 + description: GPIO connected to RST_ pin. + + vdd-supply: + description: Regulator for 1.2V MIPI phy power. + + vcc-supply: + description: Regulator for 3.3V IO power. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Video port for eDP input. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Video port for MIPI DSI output. + + required: + - port@0 + - port@1 + +required: + - compatible + - reg + - reset-gpios + - vdd-supply + - vcc-supply + - ports + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + + mipi-bridge@41 { + compatible = "lontium,lt7911exc"; + reg = <0x41>; + reset-gpios = <&gpy8 8 GPIO_ACTIVE_LOW>; + vdd-supply = <<7911exc_1v2>; + vcc-supply = <<7911exc_3v3>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + bridge_in: endpoint { + remote-endpoint = <&edp_out>; + }; + }; + + port@1 { + reg = <1>; + bridge_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + }; + };
Signature · 1 line
2.34.1
PATCH v7 2/2 drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge
In reply to [email protected]From: Sunyun Yang <[email protected]>
This commit adds support for the Lontium LT7911EXC eDP to MIPI DSI bridge. It implements I2C-based setup, display configuration, and provides a firmware update mechanism.
--- drivers/gpu/drm/bridge/Kconfig | 15 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/lontium-lt7911exc.c | 514 +++++++++++++++++++++ 3 files changed, 530 insertions(+) create mode 100644 drivers/gpu/drm/bridge/lontium-lt7911exc.c
drivers/gpu/drm/bridge/Kconfig +15 -0
@@ -132,6 +132,21 @@ config DRM_ITE_IT6505 help ITE IT6505 DisplayPort bridge chip driver. +config DRM_LONTIUM_LT7911EXC + tristate "Lontium eDP/MIPI DSI bridge" + depends on OF + depends on I2C + select CRC32 + select FW_LOADER + select DRM_PANEL + select DRM_KMS_HELPER + select REGMAP_I2C + help + DRM driver for the Lontium LT7911EXC bridge + chip.The LT7911EXC converts eDP input to MIPI + DSI output. + Please say Y if you have such hardware. + config DRM_LONTIUM_LT8912B tristate "Lontium LT8912B DSI/HDMI bridge" depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
@@ -13,6 +13,7 @@ obj-$(CONFIG_DRM_I2C_NXP_TDA998X) += tda998x.o obj-$(CONFIG_DRM_INNO_HDMI) += inno-hdmi.o obj-$(CONFIG_DRM_ITE_IT6263) += ite-it6263.o obj-$(CONFIG_DRM_ITE_IT6505) += ite-it6505.o +obj-$(CONFIG_DRM_LONTIUM_LT7911EXC) += lontium-lt7911exc.o obj-$(CONFIG_DRM_LONTIUM_LT8912B) += lontium-lt8912b.o obj-$(CONFIG_DRM_LONTIUM_LT9211) += lontium-lt9211.o obj-$(CONFIG_DRM_LONTIUM_LT9611) += lontium-lt9611.o
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +514 -0
514 lines not on this page · raw message
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v7 2/2] drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge
Thank you for your contribution! Sashiko AI review found 7 potential issue(s) to consider: - [Critical] Firmware upgrade via sysfs races with DRM atomic modeset callbacks, risking hardware bricking.…
Thank you for your contribution! Sashiko AI review found 7 potential issue(s) to consider:
- [Critical] Firmware upgrade via sysfs races with DRM atomic modeset callbacks, risking hardware bricking.
- [High] Hardware reset in remove callback races with DRM bridge teardown.
- [Medium] Undefined behavior in CRC validation due to integer promotion.
- [Medium] Incomplete display configuration and missing MIPI DSI host registration.
- [Medium] Unbalanced reset pin state on probe failure creates backpowering risk.
- [Medium] Ignored return values for critical I2C writes during firmware upgrades.
- [Low] dev_err_probe() used outside of probe context.
--
commit 0bae053b4ef87003ffe3f7c844f0ddb1092f16bf
Author: Sunyun Yang <[email protected]> Date: Tue May 12 06:40:13 2026 +0000
drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge
This commit adds support for the Lontium LT7911EXC eDP to MIPI DSI bridge. It implements I2C-based setup, display configuration, and provides a firmware update mechanism.
The commit message states:
Quoted 2 lines
It implements I2C-based setup, display configuration, and provides a firmware update mechanism.
Is this description completely accurate? Looking at the drm_bridge_funcs implementation, there are no atomic_enable/disable functions configuring the display. Additionally, as an eDP to MIPI DSI bridge, should it also register a mipi_dsi_host so downstream panels can attach?
Quoted 4 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +0
-0
[ ... ]
Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2
-0+static void lt7911exc_block_erase (struct lt7911exc *lt7911exc) +{
[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 164
Quoted 5 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +5
-0+regmap_multi_reg_write (lt7911exc->regmap, seq_write,ARRAY_SIZE (seq_write)); + +msleep (200 ); +dev_dbg (dev,"erase flash done.\n" ); +}
Could this silently fail to erase the flash? If regmap_multi_reg_write() fails due to hardware communication errors, the driver will continue and attempt to write new firmware data to an unerased flash segment. Should the return value be checked here and in lt7911exc_prog_init()?
[ ... ]
Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2
-0+static int lt7911exc_upgrade_result (struct lt7911exc *lt7911exc,u32 crc32) +{
[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 267
Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2
-0+ read_hw_crc = crc_tmp[0 ] <<24 | crc_tmp[1 ] <<16 | + crc_tmp[2 ] <<8 | crc_tmp[3 ];
Can this cause a signed integer overflow? In C, u8 values are implicitly promoted to signed 32-bit integers before shifting. If crc_tmp[0] is 128 or greater, shifting left by 24 bits will shift into the sign bit. Would explicitly casting to u32 prevent this?
[ ... ]
Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2
-0+static int lt7911exc_firmware_upgrade (struct lt7911exc *lt7911exc) +{
[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 291
Quoted 4 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +4
-0+/*1. load firmware*/ + ret =request_firmware (&fw,FW_FILE , dev); +if (ret) +return dev_err_probe (dev, ret,"failed to load '%s'\n" ,FW_FILE );
Is it safe to use dev_err_probe() outside of a probe context? This function is called exclusively from the sysfs store callback. Calling dev_err_probe() here might interfere with deferred probe tracking.
[ ... ]
Quoted 6 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +6
-0+static void lt7911exc_atomic_pre_enable (struct drm_bridge *bridge,struct drm_atomic_state *state) +{ +struct lt7911exc *lt7911exc =bridge_to_lt7911exc (bridge); + +lt7911exc_reset (lt7911exc); +}
[ ... ]
Quoted 3 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +3
-0+static ssize_t lt7911exc_firmware_store (struct device *dev,struct device_attribute *attr, +const char *buf,size_t len) +{
[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 391
Quoted 3 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +3
-0+lt7911exc_lock (lt7911exc); + + ret =lt7911exc_firmware_upgrade (lt7911exc);
Can a DRM atomic modeset race with a firmware upgrade here?
The sysfs attribute protects internal I2C sequences with ocm_lock, but the DRM bridge callbacks toggle the reset_gpio without acquiring this lock.
If a display modeset occurs concurrently with a firmware flash, could the hardware reset pin be toggled mid-flash and corrupt the firmware?
[ ... ]
Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2
-0+static int lt7911exc_probe (struct i2c_client *client) +{
[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 471
Quoted 9 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +9
-0+lt7911exc_reset (lt7911exc); + +lt7911exc_lock (lt7911exc); + + lt7911exc->fw_version =lt7911exc_read_version (lt7911exc); + +lt7911exc_unlock (lt7911exc); +if (lt7911exc->fw_version <0 ) +return dev_err_probe (dev, lt7911exc->fw_version,"failed read version of chip\n" );
If lt7911exc_read_version() fails, does this leave the reset pin in an unbalanced state?
The lt7911exc_reset() call leaves the reset_gpio low, and as noted in the remove function, it should be pulled high to prevent backpowering. Should the error path assert the reset pin high?
[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 484
Quoted 10 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +10
-0+return devm_drm_bridge_add (dev, <7911exc->bridge); +} + +static void lt7911exc_remove (struct i2c_client *client) +{ +struct lt7911exc *lt7911exc =i2c_get_clientdata (client); + +/* pull reset low to prevent backpowering*/ +gpiod_set_value_cansleep (lt7911exc->reset_gpio,1 ); +}
Does this teardown sequence race with DRM operations?
Because the bridge is registered with devm_drm_bridge_add(), it will be unregistered during the devres cleanup phase, which happens after the driver's remove callback has finished.
Since lt7911exc_remove() asserts the reset pin to shut down the hardware, could concurrent DRM operations attempt to access the disabled hardware while it is still registered?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Re: [PATCH v7 2/2] drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge
Quoted 3 lines · <[email protected]> 于2026年5月13日周三 14:04写道:
Thank you for your contribution! Sashiko AI review found 7 potential issue(s) to consider:
- [Critical] Firmware upgrade via sysfs races with DRM atomic modeset callbacks, risking hardware bricking.
it will be fixed in next version.
Quoted 1 line
- [High] Hardware reset in
removecallback races with DRM bridge teardown.
we will remove set reset gpio in remove. the chip has
hardware protection, no need to consider backpowering.
Quoted 1 line
- [Medium] Undefined behavior in CRC validation due to integer promotion.
it will be fixed in next version.
Quoted 1 line
- [Medium] Incomplete display configuration and missing MIPI DSI host registration.
it will be fixed in next version.
Quoted 1 line
- [Medium] Unbalanced reset pin state on probe failure creates backpowering risk.
the chip has hardware protection, no need to consider backpowering.
Quoted 1 line
- [Medium] Ignored return values for critical I2C writes during firmware upgrades.
it will be fixed in next version.
Quoted 1 line
- [Low]
dev_err_probe()used outside ofprobecontext.
it will be fixed in next version.
Quoted 136 lines
--
commit
0bae053b4ef87003ffe3f7c844f0ddb1092f16bfAuthor: Sunyun Yang <[email protected]> Date: Tue May 12 06:40:13 2026 +0000drm/bridge: Add Lontium LT7911EXC eDP to MIPI DSI bridge
This commit adds support for the Lontium LT7911EXC eDP to MIPI DSI bridge. It implements I2C-based setup, display configuration, and provides a firmware update mechanism.
The commit message states:
Quoted 2 lines
It implements I2C-based setup, display configuration, and provides a firmware update mechanism.
Is this description completely accurate? Looking at the
drm_bridge_funcsimplementation, there are no atomic_enable/disable functions configuring the display. Additionally, as an eDP to MIPI DSI bridge, should it also register amipi_dsi_hostso downstream panels can attach?Quoted 4 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +0
-0[ ... ]
Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2
-0+static void lt7911exc_block_erase (struct lt7911exc *lt7911exc) +{[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 164
Quoted 5 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +5
-0+regmap_multi_reg_write (lt7911exc->regmap, seq_write,ARRAY_SIZE (seq_write)); + +msleep (200 ); +dev_dbg (dev,"erase flash done.\n" ); +}Could this silently fail to erase the flash? If
regmap_multi_reg_write()fails due to hardware communication errors, the driver will continue and attempt to write new firmware data to an unerased flash segment. Should the return value be checked here and inlt7911exc_prog_init()?[ ... ]
Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2
-0+static int lt7911exc_upgrade_result (struct lt7911exc *lt7911exc,u32 crc32) +{[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 267
Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2
-0+ read_hw_crc = crc_tmp[0 ] <<24 | crc_tmp[1 ] <<16 | + crc_tmp[2 ] <<8 | crc_tmp[3 ];Can this cause a signed integer overflow? In C, u8 values are implicitly promoted to signed 32-bit integers before shifting. If crc_tmp[0] is 128 or greater, shifting left by 24 bits will shift into the sign bit. Would explicitly casting to u32 prevent this?
[ ... ]
Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2
-0+static int lt7911exc_firmware_upgrade (struct lt7911exc *lt7911exc) +{[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 291
Quoted 4 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +4
-0+/*1. load firmware*/ + ret =request_firmware (&fw,FW_FILE , dev); +if (ret) +return dev_err_probe (dev, ret,"failed to load '%s'\n" ,FW_FILE );Is it safe to use
dev_err_probe()outside of a probe context? This function is called exclusively from the sysfs store callback. Callingdev_err_probe()here might interfere with deferred probe tracking.[ ... ]
Quoted 6 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +6
-0+static void lt7911exc_atomic_pre_enable (struct drm_bridge *bridge,struct drm_atomic_state *state) +{ +struct lt7911exc *lt7911exc =bridge_to_lt7911exc (bridge); + +lt7911exc_reset (lt7911exc); +}[ ... ]
Quoted 3 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +3
-0+static ssize_t lt7911exc_firmware_store (struct device *dev,struct device_attribute *attr, +const char *buf,size_t len) +{[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 391
Quoted 3 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +3
-0+lt7911exc_lock (lt7911exc); + + ret =lt7911exc_firmware_upgrade (lt7911exc);Can a DRM atomic modeset race with a firmware upgrade here?
The sysfs attribute protects internal I2C sequences with
ocm_lock, but the DRM bridge callbacks toggle thereset_gpiowithout acquiring this lock.If a display modeset occurs concurrently with a firmware flash, could the hardware reset pin be toggled mid-flash and corrupt the firmware?
[ ... ]
Quoted 2 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +2
-0+static int lt7911exc_probe (struct i2c_client *client) +{[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 471
Quoted 9 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +9
-0+lt7911exc_reset (lt7911exc); + +lt7911exc_lock (lt7911exc); + + lt7911exc->fw_version =lt7911exc_read_version (lt7911exc); + +lt7911exc_unlock (lt7911exc); +if (lt7911exc->fw_version <0 ) +return dev_err_probe (dev, lt7911exc->fw_version,"failed read version of chip\n" );If
lt7911exc_read_version()fails, does this leave the reset pin in an unbalanced state?The
lt7911exc_reset()call leaves thereset_gpiolow, and as noted in the remove function, it should be pulled high to prevent backpowering. Should the error path assert the reset pin high?[ ... ]
drivers/gpu/drm/bridge/lontium-lt7911exc.c line 484
Quoted 10 lines
drivers/gpu/drm/bridge/lontium-lt7911exc.c new file +10
-0+return devm_drm_bridge_add (dev, <7911exc->bridge); +} + +static void lt7911exc_remove (struct i2c_client *client) +{ +struct lt7911exc *lt7911exc =i2c_get_clientdata (client); + +/* pull reset low to prevent backpowering*/ +gpiod_set_value_cansleep (lt7911exc->reset_gpio,1 ); +}Does this teardown sequence race with DRM operations?
Because the bridge is registered with
devm_drm_bridge_add(), it will be unregistered during the devres cleanup phase, which happens after the driver's remove callback has finished.Since
lt7911exc_remove()asserts the reset pin to shut down the hardware, could concurrent DRM operations attempt to access the disabled hardware while it is still registered?--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2