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.

Dependency Surface

Detected Declarations

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

Implementation Notes