drivers/rtc/rtc-isl1208.c
Source file repositories/reference/linux-study-clean/drivers/rtc/rtc-isl1208.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/rtc/rtc-isl1208.c- Extension
.c- Size
- 25201 bytes
- Lines
- 989
- Domain
- Driver Families
- Bucket
- drivers/rtc
- 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.
- 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/bcd.hlinux/clk.hlinux/delay.hlinux/i2c.hlinux/module.hlinux/of.hlinux/of_irq.hlinux/rtc.h
Detected Declarations
struct isl1208_configstruct isl1208_statefunction isl1208_i2c_read_regsfunction isl1208_i2c_set_regsfunction isl1208_i2c_validate_clientfunction isl1208_set_xtoscbfunction isl1208_i2c_get_srfunction isl1208_i2c_get_atrfunction isl1208_i2c_get_dtrfunction isl1208_i2c_get_usrfunction isl1208_i2c_set_usrfunction isl1208_rtc_toggle_alarmfunction isl1208_rtc_procfunction isl1208_i2c_read_timefunction isl1208_i2c_read_alarmfunction isl1208_i2c_set_alarmfunction isl1208_rtc_read_timefunction isl1208_i2c_set_timefunction isl1208_rtc_set_timefunction isl1208_rtc_read_alarmfunction isl1208_rtc_set_alarmfunction timestamp0_storefunction timestamp0_showfunction isl1208_rtc_interruptfunction isl1208_sysfs_show_atrimfunction isl1208_sysfs_show_dtrimfunction isl1208_sysfs_show_usrfunction isl1208_sysfs_store_usrfunction isl1208_nvmem_readfunction isl1208_nvmem_writefunction isl1208_setup_irqfunction isl1208_clk_presentfunction isl1208_probe
Annotated Snippet
struct isl1208_config {
unsigned int nvmem_length;
unsigned has_tamper:1;
unsigned has_timestamp:1;
unsigned has_inverted_osc_bit:1;
};
static const struct isl1208_config config_isl1208 = {
.nvmem_length = 2,
.has_tamper = false,
.has_timestamp = false
};
static const struct isl1208_config config_isl1209 = {
.nvmem_length = 2,
.has_tamper = true,
.has_timestamp = false
};
static const struct isl1208_config config_isl1218 = {
.nvmem_length = 8,
.has_tamper = false,
.has_timestamp = false
};
static const struct isl1208_config config_isl1219 = {
.nvmem_length = 2,
.has_tamper = true,
.has_timestamp = true
};
static const struct isl1208_config config_raa215300_a0 = {
.nvmem_length = 2,
.has_tamper = false,
.has_timestamp = false,
.has_inverted_osc_bit = true
};
static const struct i2c_device_id isl1208_id[] = {
{ "isl1208", .driver_data = (kernel_ulong_t)&config_isl1208 },
{ "isl1209", .driver_data = (kernel_ulong_t)&config_isl1209 },
{ "isl1218", .driver_data = (kernel_ulong_t)&config_isl1218 },
{ "isl1219", .driver_data = (kernel_ulong_t)&config_isl1219 },
{ "raa215300_a0", .driver_data = (kernel_ulong_t)&config_raa215300_a0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, isl1208_id);
static const __maybe_unused struct of_device_id isl1208_of_match[] = {
{ .compatible = "isil,isl1208", .data = &config_isl1208 },
{ .compatible = "isil,isl1209", .data = &config_isl1209 },
{ .compatible = "isil,isl1218", .data = &config_isl1218 },
{ .compatible = "isil,isl1219", .data = &config_isl1219 },
{ }
};
MODULE_DEVICE_TABLE(of, isl1208_of_match);
/* Device state */
struct isl1208_state {
struct nvmem_config nvmem_config;
struct rtc_device *rtc;
const struct isl1208_config *config;
};
/* block read */
static int
isl1208_i2c_read_regs(struct i2c_client *client, u8 reg, u8 buf[],
unsigned len)
{
int ret;
WARN_ON(reg > ISL1219_REG_YRT);
WARN_ON(reg + len > ISL1219_REG_YRT + 1);
ret = i2c_smbus_read_i2c_block_data(client, reg, len, buf);
return (ret < 0) ? ret : 0;
}
/* block write */
static int
isl1208_i2c_set_regs(struct i2c_client *client, u8 reg, u8 const buf[],
unsigned len)
{
int ret;
WARN_ON(reg > ISL1219_REG_YRT);
WARN_ON(reg + len > ISL1219_REG_YRT + 1);
ret = i2c_smbus_write_i2c_block_data(client, reg, len, buf);
return (ret < 0) ? ret : 0;
Annotation
- Immediate include surface: `linux/bcd.h`, `linux/clk.h`, `linux/delay.h`, `linux/i2c.h`, `linux/module.h`, `linux/of.h`, `linux/of_irq.h`, `linux/rtc.h`.
- Detected declarations: `struct isl1208_config`, `struct isl1208_state`, `function isl1208_i2c_read_regs`, `function isl1208_i2c_set_regs`, `function isl1208_i2c_validate_client`, `function isl1208_set_xtoscb`, `function isl1208_i2c_get_sr`, `function isl1208_i2c_get_atr`, `function isl1208_i2c_get_dtr`, `function isl1208_i2c_get_usr`.
- Atlas domain: Driver Families / drivers/rtc.
- Implementation status: source implementation candidate.
- 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.