drivers/mfd/wm8350-core.c
Source file repositories/reference/linux-study-clean/drivers/mfd/wm8350-core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mfd/wm8350-core.c- Extension
.c- Size
- 10647 bytes
- Lines
- 445
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/init.hlinux/export.hlinux/slab.hlinux/bug.hlinux/device.hlinux/delay.hlinux/interrupt.hlinux/regmap.hlinux/workqueue.hlinux/mfd/wm8350/core.hlinux/mfd/wm8350/audio.hlinux/mfd/wm8350/comparator.hlinux/mfd/wm8350/gpio.hlinux/mfd/wm8350/pmic.hlinux/mfd/wm8350/rtc.hlinux/mfd/wm8350/supply.hlinux/mfd/wm8350/wdt.h
Detected Declarations
function wm8350_clear_bitsfunction wm8350_set_bitsfunction wm8350_reg_readfunction wm8350_reg_writefunction wm8350_block_readfunction wm8350_block_writefunction wm8350_reg_lockfunction wm8350_reg_unlockfunction wm8350_read_auxadcfunction wm8350_auxadc_irqfunction wm8350_client_dev_registerfunction wm8350_device_initexport wm8350_clear_bitsexport wm8350_set_bitsexport wm8350_reg_readexport wm8350_reg_writeexport wm8350_block_readexport wm8350_block_writeexport wm8350_reg_lockexport wm8350_reg_unlockexport wm8350_read_auxadcexport wm8350_device_init
Annotated Snippet
switch (chip_rev) {
case WM8350_REV_E:
dev_info(wm8350->dev, "WM8350 Rev E\n");
break;
case WM8350_REV_F:
dev_info(wm8350->dev, "WM8350 Rev F\n");
break;
case WM8350_REV_G:
dev_info(wm8350->dev, "WM8350 Rev G\n");
wm8350->power.rev_g_coeff = 1;
break;
case WM8350_REV_H:
dev_info(wm8350->dev, "WM8350 Rev H\n");
wm8350->power.rev_g_coeff = 1;
break;
default:
/* For safety we refuse to run on unknown hardware */
dev_err(wm8350->dev, "Unknown WM8350 CHIP_REV\n");
ret = -ENODEV;
goto err;
}
break;
case 1:
wm8350->pmic.max_dcdc = WM8350_DCDC_4;
wm8350->pmic.max_isink = WM8350_ISINK_A;
switch (chip_rev) {
case 0:
dev_info(wm8350->dev, "WM8351 Rev A\n");
wm8350->power.rev_g_coeff = 1;
break;
case 1:
dev_info(wm8350->dev, "WM8351 Rev B\n");
wm8350->power.rev_g_coeff = 1;
break;
default:
dev_err(wm8350->dev, "Unknown WM8351 CHIP_REV\n");
ret = -ENODEV;
goto err;
}
break;
case 2:
wm8350->pmic.max_dcdc = WM8350_DCDC_6;
wm8350->pmic.max_isink = WM8350_ISINK_B;
switch (chip_rev) {
case 0:
dev_info(wm8350->dev, "WM8352 Rev A\n");
wm8350->power.rev_g_coeff = 1;
break;
default:
dev_err(wm8350->dev, "Unknown WM8352 CHIP_REV\n");
ret = -ENODEV;
goto err;
}
break;
default:
dev_err(wm8350->dev, "Unknown MASK_REV\n");
ret = -ENODEV;
goto err;
}
mutex_init(&wm8350->auxadc_mutex);
init_completion(&wm8350->auxadc_done);
ret = wm8350_irq_init(wm8350, irq, pdata);
if (ret < 0)
goto err;
if (wm8350->irq_base) {
ret = request_threaded_irq(wm8350->irq_base +
WM8350_IRQ_AUXADC_DATARDY,
NULL, wm8350_auxadc_irq,
IRQF_ONESHOT,
"auxadc", wm8350);
if (ret < 0)
dev_warn(wm8350->dev,
"Failed to request AUXADC IRQ: %d\n", ret);
}
if (pdata && pdata->init) {
ret = pdata->init(wm8350);
if (ret != 0) {
dev_err(wm8350->dev, "Platform init() failed: %d\n",
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/export.h`, `linux/slab.h`, `linux/bug.h`, `linux/device.h`, `linux/delay.h`, `linux/interrupt.h`.
- Detected declarations: `function wm8350_clear_bits`, `function wm8350_set_bits`, `function wm8350_reg_read`, `function wm8350_reg_write`, `function wm8350_block_read`, `function wm8350_block_write`, `function wm8350_reg_lock`, `function wm8350_reg_unlock`, `function wm8350_read_auxadc`, `function wm8350_auxadc_irq`.
- 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.
- 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.