drivers/media/pci/pt3/pt3_i2c.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/pt3/pt3_i2c.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/pt3/pt3_i2c.c- Extension
.c- Size
- 4909 bytes
- Lines
- 231
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/device.hlinux/i2c.hlinux/io.hlinux/pci.hpt3.h
Detected Declarations
enum ctl_cmdfunction cmdbuf_addfunction put_endfunction put_startfunction put_byte_writefunction put_byte_readfunction put_stopfunction translatefunction wait_i2c_resultfunction send_i2c_cmdfunction pt3_init_all_demodsfunction pt3_init_all_mxl301rffunction pt3_i2c_resetfunction pt3_i2c_master_xferfunction pt3_i2c_functionality
Annotated Snippet
if (msgs[i].flags & I2C_M_RECV_LEN) {
dev_warn(&pt3->pdev->dev,
"(%s) I2C_M_RECV_LEN not supported.\n",
__func__);
return -EINVAL;
}
translate(cbuf, msgs, num);
memcpy_toio(pt3->regs[1] + PT3_I2C_BASE + PT3_CMD_ADDR_NORMAL / 2,
cbuf->data, cbuf->num_cmds);
if (send_i2c_cmd(pt3, PT3_CMD_ADDR_NORMAL) < 0)
return -EIO;
p = pt3->regs[1] + PT3_I2C_BASE;
for (i = 0; i < num; i++)
if ((msgs[i].flags & I2C_M_RD) && msgs[i].len > 0) {
memcpy_fromio(msgs[i].buf, p, msgs[i].len);
p += msgs[i].len;
}
return num;
}
u32 pt3_i2c_functionality(struct i2c_adapter *adap)
{
return I2C_FUNC_I2C;
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/i2c.h`, `linux/io.h`, `linux/pci.h`, `pt3.h`.
- Detected declarations: `enum ctl_cmd`, `function cmdbuf_add`, `function put_end`, `function put_start`, `function put_byte_write`, `function put_byte_read`, `function put_stop`, `function translate`, `function wait_i2c_result`, `function send_i2c_cmd`.
- Atlas domain: Driver Families / drivers/media.
- 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.