drivers/mfd/da9052-core.c
Source file repositories/reference/linux-study-clean/drivers/mfd/da9052-core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mfd/da9052-core.c- Extension
.c- Size
- 16472 bytes
- Lines
- 657
- Domain
- Driver Families
- Bucket
- drivers/mfd
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/delay.hlinux/input.hlinux/interrupt.hlinux/mfd/core.hlinux/slab.hlinux/module.hlinux/property.hlinux/mfd/da9052/da9052.hlinux/mfd/da9052/pdata.hlinux/mfd/da9052/reg.h
Detected Declarations
function Copyrightfunction da9052_reg_writeablefunction da9052_reg_volatilefunction da9052_adc_manual_readfunction msecs_to_jiffiesfunction da9052_adc_read_tempfunction da9052_clear_fault_logfunction da9052_device_initfunction driverfunction da9052_device_exitexport da9052_adc_manual_readexport da9052_adc_read_tempexport da9052_regmap_config
Annotated Snippet
msecs_to_jiffies(500))) {
dev_err(da9052->dev,
"timeout waiting for ADC conversion interrupt\n");
ret = -ETIMEDOUT;
goto err;
}
ret = da9052_reg_read(da9052, DA9052_ADC_RES_H_REG);
if (ret < 0)
goto err;
calc_data = (unsigned short)ret;
data = calc_data << 2;
ret = da9052_reg_read(da9052, DA9052_ADC_RES_L_REG);
if (ret < 0)
goto err;
calc_data = (unsigned short)(ret & DA9052_ADC_RES_LSB);
data |= calc_data;
ret = data;
err:
mutex_unlock(&da9052->auxadc_lock);
return ret;
}
EXPORT_SYMBOL_GPL(da9052_adc_manual_read);
int da9052_adc_read_temp(struct da9052 *da9052)
{
int tbat;
tbat = da9052_reg_read(da9052, DA9052_TBAT_RES_REG);
if (tbat <= 0)
return tbat;
/* ARRAY_SIZE check is not needed since TBAT is a 8-bit register */
return tbat_lookup[tbat - 1];
}
EXPORT_SYMBOL_GPL(da9052_adc_read_temp);
static const struct mfd_cell da9052_subdev_info[] = {
{
.name = "da9052-regulator",
.id = 0,
},
{
.name = "da9052-regulator",
.id = 1,
},
{
.name = "da9052-regulator",
.id = 2,
},
{
.name = "da9052-regulator",
.id = 3,
},
{
.name = "da9052-regulator",
.id = 4,
},
{
.name = "da9052-regulator",
.id = 5,
},
{
.name = "da9052-regulator",
.id = 6,
},
{
.name = "da9052-regulator",
.id = 7,
},
{
.name = "da9052-regulator",
.id = 8,
},
{
.name = "da9052-regulator",
.id = 9,
},
{
.name = "da9052-regulator",
.id = 10,
},
{
.name = "da9052-regulator",
.id = 11,
Annotation
- Immediate include surface: `linux/device.h`, `linux/delay.h`, `linux/input.h`, `linux/interrupt.h`, `linux/mfd/core.h`, `linux/slab.h`, `linux/module.h`, `linux/property.h`.
- Detected declarations: `function Copyright`, `function da9052_reg_writeable`, `function da9052_reg_volatile`, `function da9052_adc_manual_read`, `function msecs_to_jiffies`, `function da9052_adc_read_temp`, `function da9052_clear_fault_log`, `function da9052_device_init`, `function driver`, `function da9052_device_exit`.
- Atlas domain: Driver Families / drivers/mfd.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.