include/linux/nvmem-provider.h
Source file repositories/reference/linux-study-clean/include/linux/nvmem-provider.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/nvmem-provider.h- Extension
.h- Size
- 7352 bytes
- Lines
- 241
- Domain
- Representative Device Path
- Bucket
- PCIe NVMe Storage Path
- Inferred role
- Representative Device Path: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/device/driver.hlinux/err.hlinux/errno.hlinux/gpio/consumer.h
Detected Declarations
struct nvmem_devicestruct nvmem_keepoutstruct nvmem_cell_infostruct nvmem_configstruct nvmem_layoutstruct nvmem_layout_driverenum nvmem_typefunction nvmem_unregisterfunction nvmem_add_one_cellfunction nvmem_layout_registerfunction nvmem_layout_unregister
Annotated Snippet
struct device_driver driver;
int (*probe)(struct nvmem_layout *layout);
void (*remove)(struct nvmem_layout *layout);
};
#if IS_ENABLED(CONFIG_NVMEM)
struct nvmem_device *nvmem_register(const struct nvmem_config *cfg);
void nvmem_unregister(struct nvmem_device *nvmem);
struct nvmem_device *devm_nvmem_register(struct device *dev,
const struct nvmem_config *cfg);
int nvmem_add_one_cell(struct nvmem_device *nvmem,
const struct nvmem_cell_info *info);
int nvmem_layout_register(struct nvmem_layout *layout);
void nvmem_layout_unregister(struct nvmem_layout *layout);
#define nvmem_layout_driver_register(drv) \
__nvmem_layout_driver_register(drv, THIS_MODULE)
int __nvmem_layout_driver_register(struct nvmem_layout_driver *drv,
struct module *owner);
void nvmem_layout_driver_unregister(struct nvmem_layout_driver *drv);
#define module_nvmem_layout_driver(__nvmem_layout_driver) \
module_driver(__nvmem_layout_driver, nvmem_layout_driver_register, \
nvmem_layout_driver_unregister)
#else
static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c)
{
return ERR_PTR(-EOPNOTSUPP);
}
static inline void nvmem_unregister(struct nvmem_device *nvmem) {}
static inline struct nvmem_device *
devm_nvmem_register(struct device *dev, const struct nvmem_config *c)
{
return nvmem_register(c);
}
static inline int nvmem_add_one_cell(struct nvmem_device *nvmem,
const struct nvmem_cell_info *info)
{
return -EOPNOTSUPP;
}
static inline int nvmem_layout_register(struct nvmem_layout *layout)
{
return -EOPNOTSUPP;
}
static inline void nvmem_layout_unregister(struct nvmem_layout *layout) {}
#endif /* CONFIG_NVMEM */
#if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF)
/**
* of_nvmem_layout_get_container() - Get OF node of layout container
*
* @nvmem: nvmem device
*
* Return: a node pointer with refcount incremented or NULL if no
* container exists. Use of_node_put() on it when done.
*/
struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem);
#else /* CONFIG_NVMEM && CONFIG_OF */
static inline struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem)
{
return NULL;
}
#endif /* CONFIG_NVMEM && CONFIG_OF */
#endif /* ifndef _LINUX_NVMEM_PROVIDER_H */
Annotation
- Immediate include surface: `linux/device.h`, `linux/device/driver.h`, `linux/err.h`, `linux/errno.h`, `linux/gpio/consumer.h`.
- Detected declarations: `struct nvmem_device`, `struct nvmem_keepout`, `struct nvmem_cell_info`, `struct nvmem_config`, `struct nvmem_layout`, `struct nvmem_layout_driver`, `enum nvmem_type`, `function nvmem_unregister`, `function nvmem_add_one_cell`, `function nvmem_layout_register`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- Implementation status: pattern 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.