drivers/mfd/rk8xx-i2c.c
Source file repositories/reference/linux-study-clean/drivers/mfd/rk8xx-i2c.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mfd/rk8xx-i2c.c- Extension
.c- Size
- 7254 bytes
- Lines
- 285
- Domain
- Driver Families
- Bucket
- drivers/mfd
- 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/i2c.hlinux/mfd/rk808.hlinux/module.hlinux/of.hlinux/regmap.h
Detected Declarations
struct rk8xx_i2c_platform_datafunction rk801_is_volatile_regfunction rk806_is_volatile_regfunction rk808_is_volatile_regfunction rk816_is_volatile_regfunction rk817_is_volatile_regfunction rk8xx_i2c_probefunction rk8xx_i2c_shutdown
Annotated Snippet
struct rk8xx_i2c_platform_data {
const struct regmap_config *regmap_cfg;
int variant;
};
static bool rk801_is_volatile_reg(struct device *dev, unsigned int reg)
{
switch (reg) {
case RK801_SYS_STS_REG:
case RK801_INT_STS0_REG:
case RK801_SYS_CFG0_REG:
case RK801_SYS_CFG1_REG:
case RK801_SYS_CFG2_REG:
case RK801_SYS_CFG3_REG:
case RK801_SYS_CFG4_REG:
case RK801_SLEEP_CFG_REG:
return true;
}
return false;
}
static bool rk806_is_volatile_reg(struct device *dev, unsigned int reg)
{
switch (reg) {
case RK806_POWER_EN0 ... RK806_POWER_EN5:
case RK806_DVS_START_CTRL ... RK806_INT_MSK1:
return true;
}
return false;
}
static bool rk808_is_volatile_reg(struct device *dev, unsigned int reg)
{
/*
* Notes:
* - Technically the ROUND_30s bit makes RTC_CTRL_REG volatile, but
* we don't use that feature. It's better to cache.
* - It's unlikely we care that RK808_DEVCTRL_REG is volatile since
* bits are cleared in case when we shutoff anyway, but better safe.
*/
switch (reg) {
case RK808_SECONDS_REG ... RK808_WEEKS_REG:
case RK808_RTC_STATUS_REG:
case RK808_VB_MON_REG:
case RK808_THERMAL_REG:
case RK808_DCDC_UV_STS_REG:
case RK808_LDO_UV_STS_REG:
case RK808_DCDC_PG_REG:
case RK808_LDO_PG_REG:
case RK808_DEVCTRL_REG:
case RK808_INT_STS_REG1:
case RK808_INT_STS_REG2:
return true;
}
return false;
}
static bool rk816_is_volatile_reg(struct device *dev, unsigned int reg)
{
/*
* Technically the ROUND_30s bit makes RTC_CTRL_REG volatile, but
* we don't use that feature. It's better to cache.
*/
switch (reg) {
case RK808_SECONDS_REG ... RK808_WEEKS_REG:
case RK808_RTC_STATUS_REG:
case RK808_VB_MON_REG:
case RK808_THERMAL_REG:
case RK816_DCDC_EN_REG1:
case RK816_DCDC_EN_REG2:
case RK816_INT_STS_REG1:
case RK816_INT_STS_REG2:
case RK816_INT_STS_REG3:
case RK808_DEVCTRL_REG:
case RK816_SUP_STS_REG:
case RK816_GGSTS_REG:
case RK816_ZERO_CUR_ADC_REGH:
case RK816_ZERO_CUR_ADC_REGL:
case RK816_GASCNT_REG(0) ... RK816_BAT_VOL_REGL:
return true;
}
return false;
}
Annotation
- Immediate include surface: `linux/i2c.h`, `linux/mfd/rk808.h`, `linux/module.h`, `linux/of.h`, `linux/regmap.h`.
- Detected declarations: `struct rk8xx_i2c_platform_data`, `function rk801_is_volatile_reg`, `function rk806_is_volatile_reg`, `function rk808_is_volatile_reg`, `function rk816_is_volatile_reg`, `function rk817_is_volatile_reg`, `function rk8xx_i2c_probe`, `function rk8xx_i2c_shutdown`.
- Atlas domain: Driver Families / drivers/mfd.
- 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.