drivers/gpu/drm/bridge/tc358767.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/tc358767.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/tc358767.c- Extension
.c- Size
- 69016 bytes
- Lines
- 2639
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/clk.hlinux/device.hlinux/gpio/consumer.hlinux/i2c.hlinux/kernel.hlinux/media-bus-format.hlinux/module.hlinux/regmap.hlinux/slab.hdrm/display/drm_dp_helper.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_edid.hdrm/drm_mipi_dsi.hdrm/drm_of.hdrm/drm_panel.hdrm/drm_print.hdrm/drm_probe_helper.h
Detected Declarations
struct tc_edp_linkstruct tc_dataenum tc_modefunction tc_poll_timeoutfunction tc_aux_wait_busyfunction tc_aux_write_datafunction tc_aux_read_datafunction tc_auxcfg0function tc_aux_transferfunction tc_srcctrlfunction tc_pllupdatefunction tc_pxl_pll_calcfunction tc_pxl_pll_enfunction tc_pxl_pll_disfunction tc_stream_clock_calcfunction tc_set_syspllparamfunction tc_aux_link_setupfunction tc_get_display_propsfunction tc_set_common_video_modefunction tc_set_dpi_video_modefunction tc_set_edp_video_modefunction tc_wait_link_trainingfunction tc_main_link_enablefunction tc_main_link_disablefunction tc_dsi_rx_enablefunction tc_dpi_rx_enablefunction tc_dpi_stream_enablefunction tc_dpi_stream_disablefunction tc_edp_stream_enablefunction tc_edp_stream_disablefunction tc_dpi_bridge_atomic_enablefunction tc_dpi_bridge_atomic_disablefunction tc_edp_bridge_atomic_enablefunction tc_edp_bridge_atomic_disablefunction tc_dpi_atomic_checkfunction tc_edp_atomic_checkfunction tc_dpi_mode_validfunction tc_edp_mode_validfunction tc_bridge_mode_setfunction tc_connector_get_modesfunction tc_bridge_detectfunction tc_connector_detectfunction tc_dpi_bridge_attachfunction tc_edp_bridge_attachfunction tc_edp_bridge_detachfunction tc_dpi_atomic_get_input_bus_fmtsfunction tc_edp_atomic_get_output_bus_fmtsfunction tc_readable_reg
Annotated Snippet
struct tc_edp_link {
u8 dpcd[DP_RECEIVER_CAP_SIZE];
unsigned int rate;
u8 num_lanes;
u8 assr;
bool scrambler_dis;
bool spread;
};
struct tc_data {
struct device *dev;
struct regmap *regmap;
struct drm_dp_aux aux;
struct drm_bridge bridge;
struct drm_bridge *panel_bridge;
struct drm_connector connector;
struct mipi_dsi_device *dsi;
/* link settings */
struct tc_edp_link link;
/* current mode */
struct drm_display_mode mode;
u32 rev;
u8 assr;
u8 pre_emphasis[2];
struct gpio_desc *sd_gpio;
struct gpio_desc *reset_gpio;
struct clk *refclk;
/* do we have IRQ */
bool have_irq;
/* Input connector type, DSI and not DPI. */
bool input_connector_dsi;
/* HPD pin number (0 or 1) or -ENODEV */
int hpd_pin;
};
static inline struct tc_data *aux_to_tc(struct drm_dp_aux *a)
{
return container_of(a, struct tc_data, aux);
}
static inline struct tc_data *bridge_to_tc(struct drm_bridge *b)
{
return container_of(b, struct tc_data, bridge);
}
static inline struct tc_data *connector_to_tc(struct drm_connector *c)
{
return container_of(c, struct tc_data, connector);
}
static inline int tc_poll_timeout(struct tc_data *tc, unsigned int addr,
unsigned int cond_mask,
unsigned int cond_value,
unsigned long sleep_us, u64 timeout_us)
{
unsigned int val;
return regmap_read_poll_timeout(tc->regmap, addr, val,
(val & cond_mask) == cond_value,
sleep_us, timeout_us);
}
static int tc_aux_wait_busy(struct tc_data *tc)
{
return tc_poll_timeout(tc, DP0_AUXSTATUS, AUX_BUSY, 0, 100, 100000);
}
static int tc_aux_write_data(struct tc_data *tc, const void *data,
size_t size)
{
u32 auxwdata[DP_AUX_MAX_PAYLOAD_BYTES / sizeof(u32)] = { 0 };
int ret, count = ALIGN(size, sizeof(u32));
memcpy(auxwdata, data, size);
ret = regmap_raw_write(tc->regmap, DP0_AUXWDATA(0), auxwdata, count);
if (ret)
return ret;
return size;
}
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/kernel.h`, `linux/media-bus-format.h`, `linux/module.h`.
- Detected declarations: `struct tc_edp_link`, `struct tc_data`, `enum tc_mode`, `function tc_poll_timeout`, `function tc_aux_wait_busy`, `function tc_aux_write_data`, `function tc_aux_read_data`, `function tc_auxcfg0`, `function tc_aux_transfer`, `function tc_srcctrl`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.