drivers/gpu/drm/bridge/lontium-lt8713sx.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/lontium-lt8713sx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/lontium-lt8713sx.c- Extension
.c- Size
- 15821 bytes
- Lines
- 597
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/crc8.hlinux/firmware.hlinux/gpio/consumer.hlinux/i2c.hlinux/interrupt.hlinux/module.hlinux/mutex.hlinux/of_graph.hlinux/platform_device.hlinux/regmap.hlinux/regulator/consumer.hlinux/sizes.hlinux/wait.hlinux/workqueue.hdrm/drm_bridge.hdrm/drm_of.h
Detected Declarations
struct lt8713sxfunction lt8713sx_i2c_enablefunction lt8713sx_i2c_disablefunction lt8713sx_prepare_firmware_datafunction lt8713sx_config_parametersfunction lt8713sx_wrenfunction lt8713sx_wrdifunction lt8713sx_fifo_resetfunction lt8713sx_disable_sram_writefunction lt8713sx_sram_to_flashfunction lt8713sx_i2c_to_sramfunction lt8713sx_read_flash_statusfunction lt8713sx_block_erasefunction lt8713sx_load_main_fw_to_sramfunction lt8713sx_load_bank_fw_to_sramfunction lt8713sx_write_datafunction lt8713sx_main_upgrade_resultfunction lt8713sx_bank_upgrade_resultfunction lt8713sx_bank_result_checkfunction lt8713sx_firmware_upgradefunction lt8713sx_firmware_updatefunction lt8713sx_resetfunction lt8713sx_regulator_enablefunction lt8713sx_bridge_attachfunction lt8713sx_gpio_initfunction lt8713sx_firmware_storefunction lt8713sx_probefunction lt8713sx_remove
Annotated Snippet
struct lt8713sx {
struct device *dev;
struct drm_bridge bridge;
struct regmap *regmap;
/* Protects all accesses to registers by stopping the on-chip MCU */
struct mutex ocm_lock;
struct gpio_desc *reset_gpio;
struct gpio_desc *enable_gpio;
struct i2c_client *client;
const struct firmware *fw;
u8 *fw_buffer;
u32 main_crc_value;
u32 bank_crc_value[17];
int bank_num;
};
static void lt8713sx_reset(struct lt8713sx *lt8713sx);
static const struct regmap_range lt8713sx_ranges[] = {
{
.range_min = 0x0000,
.range_max = 0xffff
},
};
static const struct regmap_access_table lt8713sx_table = {
.yes_ranges = lt8713sx_ranges,
.n_yes_ranges = ARRAY_SIZE(lt8713sx_ranges),
};
static const struct regmap_range_cfg lt8713sx_range_cfg = {
.name = "lt8713sx",
.range_min = 0x0000,
.range_max = 0xffff,
.selector_reg = REG_PAGE_CONTROL,
.selector_mask = 0xff,
.selector_shift = 0,
.window_start = 0,
.window_len = 0x100,
};
static const struct regmap_config lt8713sx_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.volatile_table = <8713sx_table,
.ranges = <8713sx_range_cfg,
.num_ranges = 1,
.cache_type = REGCACHE_NONE,
.max_register = 0xffff,
};
static void lt8713sx_i2c_enable(struct lt8713sx *lt8713sx)
{
regmap_write(lt8713sx->regmap, 0xe0ee, 0x01);
}
static void lt8713sx_i2c_disable(struct lt8713sx *lt8713sx)
{
regmap_write(lt8713sx->regmap, 0xe0ee, 0x00);
}
static int lt8713sx_prepare_firmware_data(struct lt8713sx *lt8713sx)
{
int ret = 0;
size_t sz_12k = 12 * SZ_1K;
ret = request_firmware(<8713sx->fw, FW_FILE, lt8713sx->dev);
if (ret < 0) {
dev_err(lt8713sx->dev, "request firmware failed\n");
return ret;
}
dev_dbg(lt8713sx->dev, "Firmware size: %zu bytes\n", lt8713sx->fw->size);
if (lt8713sx->fw->size > SZ_256K - 1) {
dev_err(lt8713sx->dev, "Firmware size exceeds 256KB limit\n");
release_firmware(lt8713sx->fw);
return -EINVAL;
}
lt8713sx->fw_buffer = kvmalloc(SZ_256K, GFP_KERNEL);
if (!lt8713sx->fw_buffer) {
release_firmware(lt8713sx->fw);
return -ENOMEM;
Annotation
- Immediate include surface: `linux/crc8.h`, `linux/firmware.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/interrupt.h`, `linux/module.h`, `linux/mutex.h`, `linux/of_graph.h`.
- Detected declarations: `struct lt8713sx`, `function lt8713sx_i2c_enable`, `function lt8713sx_i2c_disable`, `function lt8713sx_prepare_firmware_data`, `function lt8713sx_config_parameters`, `function lt8713sx_wren`, `function lt8713sx_wrdi`, `function lt8713sx_fifo_reset`, `function lt8713sx_disable_sram_write`, `function lt8713sx_sram_to_flash`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.