drivers/nvmem/qfprom.c
Source file repositories/reference/linux-study-clean/drivers/nvmem/qfprom.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/nvmem/qfprom.c- Extension
.c- Size
- 13703 bytes
- Lines
- 479
- Domain
- Driver Families
- Bucket
- drivers/nvmem
- 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.
- 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/clk.hlinux/device.hlinux/io.hlinux/iopoll.hlinux/kernel.hlinux/module.hlinux/mod_devicetable.hlinux/nvmem-provider.hlinux/platform_device.hlinux/pm_domain.hlinux/pm_runtime.hlinux/property.hlinux/regulator/consumer.h
Detected Declarations
struct qfprom_soc_datastruct qfprom_privstruct qfprom_touched_valuesstruct qfprom_soc_compatible_datafunction qfprom_disable_fuse_blowingfunction qfprom_enable_fuse_blowingfunction qfprom_reg_writefunction qfprom_reg_readfunction qfprom_fixup_dt_cell_infofunction qfprom_runtime_disablefunction qfprom_probe
Annotated Snippet
struct qfprom_soc_data {
u32 accel_value;
u32 qfprom_blow_timer_value;
u32 qfprom_blow_set_freq;
int qfprom_blow_uV;
};
/**
* struct qfprom_priv - structure holding qfprom attributes
*
* @qfpraw: iomapped memory space for qfprom-efuse raw address space.
* @qfpconf: iomapped memory space for qfprom-efuse configuration address
* space.
* @qfpcorrected: iomapped memory space for qfprom corrected address space.
* @qfpsecurity: iomapped memory space for qfprom security control space.
* @dev: qfprom device structure.
* @secclk: Clock supply.
* @vcc: Regulator supply.
* @soc_data: Data that for things that varies from SoC to SoC.
*/
struct qfprom_priv {
void __iomem *qfpraw;
void __iomem *qfpconf;
void __iomem *qfpcorrected;
void __iomem *qfpsecurity;
struct device *dev;
struct clk *secclk;
struct regulator *vcc;
const struct qfprom_soc_data *soc_data;
};
/**
* struct qfprom_touched_values - saved values to restore after blowing
*
* @clk_rate: The rate the clock was at before blowing.
* @accel_val: The value of the accel reg before blowing.
* @timer_val: The value of the timer before blowing.
*/
struct qfprom_touched_values {
unsigned long clk_rate;
u32 accel_val;
u32 timer_val;
};
/**
* struct qfprom_soc_compatible_data - Data matched against the SoC
* compatible string.
*
* @keepout: Array of keepout regions for this SoC.
* @nkeepout: Number of elements in the keepout array.
*/
struct qfprom_soc_compatible_data {
const struct nvmem_keepout *keepout;
unsigned int nkeepout;
};
static const struct nvmem_keepout sc7180_qfprom_keepout[] = {
{.start = 0x128, .end = 0x148},
{.start = 0x220, .end = 0x228}
};
static const struct qfprom_soc_compatible_data sc7180_qfprom = {
.keepout = sc7180_qfprom_keepout,
.nkeepout = ARRAY_SIZE(sc7180_qfprom_keepout)
};
static const struct nvmem_keepout sc7280_qfprom_keepout[] = {
{.start = 0x128, .end = 0x148},
{.start = 0x238, .end = 0x248}
};
static const struct qfprom_soc_compatible_data sc7280_qfprom = {
.keepout = sc7280_qfprom_keepout,
.nkeepout = ARRAY_SIZE(sc7280_qfprom_keepout)
};
/**
* qfprom_disable_fuse_blowing() - Undo enabling of fuse blowing.
* @priv: Our driver data.
* @old: The data that was stashed from before fuse blowing.
*
* Resets the value of the blow timer, accel register and the clock
* and voltage settings.
*
* Prints messages if there are errors but doesn't return an error code
* since there's not much we can do upon failure.
*/
static void qfprom_disable_fuse_blowing(const struct qfprom_priv *priv,
const struct qfprom_touched_values *old)
{
Annotation
- Immediate include surface: `linux/clk.h`, `linux/device.h`, `linux/io.h`, `linux/iopoll.h`, `linux/kernel.h`, `linux/module.h`, `linux/mod_devicetable.h`, `linux/nvmem-provider.h`.
- Detected declarations: `struct qfprom_soc_data`, `struct qfprom_priv`, `struct qfprom_touched_values`, `struct qfprom_soc_compatible_data`, `function qfprom_disable_fuse_blowing`, `function qfprom_enable_fuse_blowing`, `function qfprom_reg_write`, `function qfprom_reg_read`, `function qfprom_fixup_dt_cell_info`, `function qfprom_runtime_disable`.
- Atlas domain: Driver Families / drivers/nvmem.
- 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.