drivers/gpu/drm/bridge/sil-sii8620.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/sil-sii8620.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/sil-sii8620.c- Extension
.c- Size
- 58409 bytes
- Lines
- 2391
- 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.
- 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/unaligned.hdrm/bridge/mhl.hdrm/drm_bridge.hdrm/drm_crtc.hdrm/drm_edid.hdrm/drm_encoder.hlinux/clk.hlinux/delay.hlinux/extcon.hlinux/gpio/consumer.hlinux/i2c.hlinux/interrupt.hlinux/irq.hlinux/kernel.hlinux/list.hlinux/module.hlinux/mutex.hlinux/of_graph.hlinux/regulator/consumer.hlinux/slab.hmedia/rc-core.hsil-sii8620.h
Detected Declarations
struct sii8620struct sii8620_mt_msgstruct sii8620_mt_msgenum sii8620_modeenum sii8620_sink_typeenum sii8620_mt_statefunction sii8620_clear_errorfunction sii8620_read_buffunction sii8620_readbfunction sii8620_write_buffunction __sii8620_write_seqfunction sii8620_setbitsfunction sii8620_is_mhl3function sii8620_mt_cleanupfunction list_for_each_entry_safefunction sii8620_mt_workfunction sii8620_enable_gen2_write_burstfunction sii8620_disable_gen2_write_burstfunction sii8620_start_gen2_write_burstfunction sii8620_mt_msc_cmd_sendfunction sii8620_mt_set_contfunction sii8620_mt_msc_cmdfunction sii8620_mt_write_statfunction sii8620_mt_set_intfunction sii8620_mt_msc_msgfunction sii8620_mt_rapfunction sii8620_mt_rcpkfunction sii8620_mt_rcpefunction sii8620_mt_read_devcap_sendfunction sii8620_update_arrayfunction sii8620_identify_sinkfunction sii8620_mr_devcapfunction sii8620_mr_xdevcapfunction sii8620_mt_read_devcap_recvfunction sii8620_mt_read_devcapfunction sii8620_mt_read_devcap_reg_recvfunction sii8620_mt_read_devcap_regfunction sii8620_mt_read_xdevcap_regfunction sii8620_burst_sendfunction sii8620_burst_receivefunction sii8620_burst_tx_rbuf_infofunction sii8620_checksumfunction sii8620_mhl_burst_hdr_setfunction sii8620_burst_tx_bits_per_pixel_fmtfunction sii8620_burst_rx_allfunction sii8620_fetch_edidfunction sii8620_set_upstream_edidfunction sii8620_xtal_set_rate
Annotated Snippet
struct sii8620 {
struct drm_bridge bridge;
struct device *dev;
struct rc_dev *rc_dev;
struct clk *clk_xtal;
struct gpio_desc *gpio_reset;
struct gpio_desc *gpio_int;
struct regulator_bulk_data supplies[2];
struct mutex lock; /* context lock, protects fields below */
int error;
unsigned int use_packed_pixel:1;
enum sii8620_mode mode;
enum sii8620_sink_type sink_type;
u8 cbus_status;
u8 stat[MHL_DST_SIZE];
u8 xstat[MHL_XDS_SIZE];
u8 devcap[MHL_DCAP_SIZE];
u8 xdevcap[MHL_XDC_SIZE];
bool feature_complete;
bool devcap_read;
bool sink_detected;
struct edid *edid;
unsigned int gen2_write_burst:1;
enum sii8620_mt_state mt_state;
struct extcon_dev *extcon;
struct notifier_block extcon_nb;
struct work_struct extcon_wq;
int cable_state;
struct list_head mt_queue;
struct {
int r_size;
int r_count;
int rx_ack;
int rx_count;
u8 rx_buf[32];
int tx_count;
u8 tx_buf[32];
} burst;
};
struct sii8620_mt_msg;
typedef void (*sii8620_mt_msg_cb)(struct sii8620 *ctx,
struct sii8620_mt_msg *msg);
typedef void (*sii8620_cb)(struct sii8620 *ctx, int ret);
struct sii8620_mt_msg {
struct list_head node;
u8 reg[4];
u8 ret;
sii8620_mt_msg_cb send;
sii8620_mt_msg_cb recv;
sii8620_cb continuation;
};
static const u8 sii8620_i2c_page[] = {
0x39, /* Main System */
0x3d, /* TDM and HSIC */
0x49, /* TMDS Receiver, MHL EDID */
0x4d, /* eMSC, HDCP, HSIC */
0x5d, /* MHL Spec */
0x64, /* MHL CBUS */
0x59, /* Hardware TPI (Transmitter Programming Interface) */
0x61, /* eCBUS-S, eCBUS-D */
};
static void sii8620_fetch_edid(struct sii8620 *ctx);
static void sii8620_set_upstream_edid(struct sii8620 *ctx);
static void sii8620_enable_hpd(struct sii8620 *ctx);
static void sii8620_mhl_disconnected(struct sii8620 *ctx);
static void sii8620_disconnect(struct sii8620 *ctx);
static int sii8620_clear_error(struct sii8620 *ctx)
{
int ret = ctx->error;
ctx->error = 0;
return ret;
}
static void sii8620_read_buf(struct sii8620 *ctx, u16 addr, u8 *buf, int len)
{
struct device *dev = ctx->dev;
struct i2c_client *client = to_i2c_client(dev);
u8 data = addr;
struct i2c_msg msg[] = {
{
.addr = sii8620_i2c_page[addr >> 8],
.flags = client->flags,
Annotation
- Immediate include surface: `linux/unaligned.h`, `drm/bridge/mhl.h`, `drm/drm_bridge.h`, `drm/drm_crtc.h`, `drm/drm_edid.h`, `drm/drm_encoder.h`, `linux/clk.h`, `linux/delay.h`.
- Detected declarations: `struct sii8620`, `struct sii8620_mt_msg`, `struct sii8620_mt_msg`, `enum sii8620_mode`, `enum sii8620_sink_type`, `enum sii8620_mt_state`, `function sii8620_clear_error`, `function sii8620_read_buf`, `function sii8620_readb`, `function sii8620_write_buf`.
- 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.