drivers/media/i2c/lt6911uxe.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/lt6911uxe.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/lt6911uxe.c- Extension
.c- Size
- 19055 bytes
- Lines
- 708
- Domain
- Driver Families
- Bucket
- drivers/media
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/acpi.hlinux/delay.hlinux/gpio/consumer.hlinux/i2c.hlinux/interrupt.hlinux/module.hlinux/pm_runtime.hlinux/regmap.hlinux/v4l2-dv-timings.hmedia/v4l2-cci.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-dv-timings.hmedia/v4l2-event.hmedia/v4l2-fwnode.h
Detected Declarations
struct lt6911uxe_modestruct lt6911uxefunction get_pixel_ratefunction lt6911uxe_get_detected_timingsfunction lt6911uxe_s_dv_timingsfunction lt6911uxe_g_dv_timingsfunction lt6911uxe_query_dv_timingsfunction lt6911uxe_enum_dv_timingsfunction lt6911uxe_dv_timings_capfunction lt6911uxe_status_updatefunction lt6911uxe_init_controlsfunction lt6911uxe_update_pad_formatfunction lt6911uxe_enable_streamsfunction lt6911uxe_disable_streamsfunction lt6911uxe_set_formatfunction lt6911uxe_enum_mbus_codefunction lt6911uxe_get_mbus_configfunction lt6911uxe_init_statefunction lt6911uxe_fwnode_parsefunction lt6911uxe_identify_modulefunction lt6911uxe_threaded_irq_fnfunction lt6911uxe_removefunction lt6911uxe_probe
Annotated Snippet
struct lt6911uxe_mode {
u32 width;
u32 height;
u32 htotal;
u32 vtotal;
u32 code;
u32 fps;
u32 lanes;
s64 link_freq;
u64 pixel_clk;
};
struct lt6911uxe {
struct v4l2_subdev sd;
struct media_pad pad;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_ctrl *pixel_rate;
struct v4l2_dv_timings timings;
struct lt6911uxe_mode cur_mode;
struct regmap *regmap;
struct gpio_desc *reset_gpio;
struct gpio_desc *irq_gpio;
};
static const struct v4l2_event lt6911uxe_ev_source_change = {
.type = V4L2_EVENT_SOURCE_CHANGE,
.u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION,
};
static inline struct lt6911uxe *to_lt6911uxe(struct v4l2_subdev *sd)
{
return container_of(sd, struct lt6911uxe, sd);
}
static s64 get_pixel_rate(struct lt6911uxe *lt6911uxe)
{
s64 pixel_rate;
pixel_rate = (s64)lt6911uxe->cur_mode.width *
lt6911uxe->cur_mode.height *
lt6911uxe->cur_mode.fps * 16;
do_div(pixel_rate, lt6911uxe->cur_mode.lanes);
return pixel_rate;
}
static int lt6911uxe_get_detected_timings(struct v4l2_subdev *sd,
struct v4l2_dv_timings *timings)
{
struct lt6911uxe *lt6911uxe = to_lt6911uxe(sd);
struct v4l2_bt_timings *bt = &timings->bt;
memset(timings, 0, sizeof(struct v4l2_dv_timings));
timings->type = V4L2_DV_BT_656_1120;
bt->width = lt6911uxe->cur_mode.width;
bt->height = lt6911uxe->cur_mode.height;
bt->vsync = lt6911uxe->cur_mode.vtotal - lt6911uxe->cur_mode.height;
bt->hsync = lt6911uxe->cur_mode.htotal - lt6911uxe->cur_mode.width;
bt->pixelclock = lt6911uxe->cur_mode.pixel_clk;
return 0;
}
static int lt6911uxe_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_dv_timings *timings)
{
struct lt6911uxe *lt6911uxe = to_lt6911uxe(sd);
struct v4l2_subdev_state *state;
state = v4l2_subdev_lock_and_get_active_state(sd);
if (v4l2_match_dv_timings(<6911uxe->timings, timings, 0, false)) {
v4l2_subdev_unlock_state(state);
return 0;
}
if (!v4l2_valid_dv_timings(timings, <6911uxe_timings_cap_4kp30,
NULL, NULL)) {
v4l2_subdev_unlock_state(state);
return -ERANGE;
}
lt6911uxe->timings = *timings;
v4l2_subdev_unlock_state(state);
return 0;
}
static int lt6911uxe_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_dv_timings *timings)
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/interrupt.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/regmap.h`.
- Detected declarations: `struct lt6911uxe_mode`, `struct lt6911uxe`, `function get_pixel_rate`, `function lt6911uxe_get_detected_timings`, `function lt6911uxe_s_dv_timings`, `function lt6911uxe_g_dv_timings`, `function lt6911uxe_query_dv_timings`, `function lt6911uxe_enum_dv_timings`, `function lt6911uxe_dv_timings_cap`, `function lt6911uxe_status_update`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.