drivers/i2c/busses/i2c-exynos5.c
Source file repositories/reference/linux-study-clean/drivers/i2c/busses/i2c-exynos5.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/i2c/busses/i2c-exynos5.c- Extension
.c- Size
- 28451 bytes
- Lines
- 1053
- Domain
- Driver Families
- Bucket
- drivers/i2c
- 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/kernel.hlinux/module.hlinux/i2c.hlinux/time.hlinux/interrupt.hlinux/delay.hlinux/errno.hlinux/err.hlinux/platform_device.hlinux/clk.hlinux/slab.hlinux/io.hlinux/of.hlinux/spinlock.h
Detected Declarations
struct exynos5_i2cstruct exynos_hsi2c_variantenum i2c_type_exynosfunction exynos5_i2c_clr_pend_irqfunction exynos5_i2c_set_timingfunction offunction exynos5_hsi2c_clock_setupfunction exynos5_i2c_initfunction exynos5_i2c_resetfunction exynos5_i2c_irqfunction exynos5_i2c_wait_bus_idlefunction exynos5_i2c_bus_recoverfunction exynos5_i2c_bus_checkfunction exynos5_i2c_message_startfunction exynos5_i2c_poll_irqs_timeoutfunction exynos5_i2c_xfer_msgfunction exynos5_i2c_xferfunction exynos5_i2c_xfer_atomicfunction exynos5_i2c_funcfunction exynos5_i2c_probefunction exynos5_i2c_removefunction exynos5_i2c_suspend_noirqfunction exynos5_i2c_resume_noirq
Annotated Snippet
struct exynos5_i2c {
struct i2c_adapter adap;
struct i2c_msg *msg;
struct completion msg_complete;
unsigned int msg_ptr;
unsigned int irq;
void __iomem *regs;
struct clk *clk; /* operating clock */
struct clk *pclk; /* bus clock */
struct device *dev;
int state;
spinlock_t lock; /* IRQ synchronization */
/*
* Since the TRANS_DONE bit is cleared on read, and we may read it
* either during an IRQ or after a transaction, keep track of its
* state here.
*/
int trans_done;
/*
* Called from atomic context, don't use interrupts.
*/
unsigned int atomic;
/* Controller operating frequency */
unsigned int op_clock;
/* Version of HS-I2C Hardware */
const struct exynos_hsi2c_variant *variant;
};
/**
* struct exynos_hsi2c_variant - platform specific HSI2C driver data
* @fifo_depth: the fifo depth supported by the HSI2C module
* @hw: the hardware variant of Exynos I2C controller
*
* Specifies platform specific configuration of HSI2C module.
* Note: A structure for driver specific platform data is used for future
* expansion of its usage.
*/
struct exynos_hsi2c_variant {
unsigned int fifo_depth;
enum i2c_type_exynos hw;
};
static const struct exynos_hsi2c_variant exynos5250_hsi2c_data = {
.fifo_depth = 64,
.hw = I2C_TYPE_EXYNOS5,
};
static const struct exynos_hsi2c_variant exynos5260_hsi2c_data = {
.fifo_depth = 16,
.hw = I2C_TYPE_EXYNOS5,
};
static const struct exynos_hsi2c_variant exynos7_hsi2c_data = {
.fifo_depth = 16,
.hw = I2C_TYPE_EXYNOS7,
};
static const struct exynos_hsi2c_variant exynosautov9_hsi2c_data = {
.fifo_depth = 64,
.hw = I2C_TYPE_EXYNOSAUTOV9,
};
static const struct exynos_hsi2c_variant exynos8895_hsi2c_data = {
.fifo_depth = 64,
.hw = I2C_TYPE_EXYNOS8895,
};
static const struct of_device_id exynos5_i2c_match[] = {
{
.compatible = "samsung,exynos5-hsi2c",
.data = &exynos5250_hsi2c_data
}, {
.compatible = "samsung,exynos5250-hsi2c",
.data = &exynos5250_hsi2c_data
}, {
.compatible = "samsung,exynos5260-hsi2c",
.data = &exynos5260_hsi2c_data
}, {
.compatible = "samsung,exynos7-hsi2c",
.data = &exynos7_hsi2c_data
}, {
.compatible = "samsung,exynosautov9-hsi2c",
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/i2c.h`, `linux/time.h`, `linux/interrupt.h`, `linux/delay.h`, `linux/errno.h`, `linux/err.h`.
- Detected declarations: `struct exynos5_i2c`, `struct exynos_hsi2c_variant`, `enum i2c_type_exynos`, `function exynos5_i2c_clr_pend_irq`, `function exynos5_i2c_set_timing`, `function of`, `function exynos5_hsi2c_clock_setup`, `function exynos5_i2c_init`, `function exynos5_i2c_reset`, `function exynos5_i2c_irq`.
- Atlas domain: Driver Families / drivers/i2c.
- 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.