include/linux/spmi.h
Source file repositories/reference/linux-study-clean/include/linux/spmi.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/spmi.h- Extension
.h- Size
- 5991 bytes
- Lines
- 190
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- 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/types.hlinux/device.hlinux/mod_devicetable.h
Detected Declarations
struct spmi_devicestruct spmi_controllerstruct spmi_driverstruct device_nodefunction spmi_device_set_drvdatafunction spmi_device_putfunction spmi_controller_set_drvdatafunction spmi_controller_putfunction spmi_driver_unregister
Annotated Snippet
struct device_driver driver;
int (*probe)(struct spmi_device *sdev);
void (*remove)(struct spmi_device *sdev);
void (*shutdown)(struct spmi_device *sdev);
};
static inline struct spmi_driver *to_spmi_driver(struct device_driver *d)
{
return container_of(d, struct spmi_driver, driver);
}
#define spmi_driver_register(sdrv) \
__spmi_driver_register(sdrv, THIS_MODULE)
int __spmi_driver_register(struct spmi_driver *sdrv, struct module *owner);
/**
* spmi_driver_unregister() - unregister an SPMI client driver
* @sdrv: the driver to unregister
*/
static inline void spmi_driver_unregister(struct spmi_driver *sdrv)
{
if (sdrv)
driver_unregister(&sdrv->driver);
}
#define module_spmi_driver(__spmi_driver) \
module_driver(__spmi_driver, spmi_driver_register, \
spmi_driver_unregister)
struct device_node;
struct spmi_device *spmi_find_device_by_of_node(struct device_node *np);
int spmi_register_read(struct spmi_device *sdev, u8 addr, u8 *buf);
int spmi_ext_register_read(struct spmi_device *sdev, u8 addr, u8 *buf,
size_t len);
int spmi_ext_register_readl(struct spmi_device *sdev, u16 addr, u8 *buf,
size_t len);
int spmi_register_write(struct spmi_device *sdev, u8 addr, u8 data);
int spmi_register_zero_write(struct spmi_device *sdev, u8 data);
int spmi_ext_register_write(struct spmi_device *sdev, u8 addr,
const u8 *buf, size_t len);
int spmi_ext_register_writel(struct spmi_device *sdev, u16 addr,
const u8 *buf, size_t len);
int spmi_command_reset(struct spmi_device *sdev);
int spmi_command_sleep(struct spmi_device *sdev);
int spmi_command_wakeup(struct spmi_device *sdev);
int spmi_command_shutdown(struct spmi_device *sdev);
#endif
Annotation
- Immediate include surface: `linux/types.h`, `linux/device.h`, `linux/mod_devicetable.h`.
- Detected declarations: `struct spmi_device`, `struct spmi_controller`, `struct spmi_driver`, `struct device_node`, `function spmi_device_set_drvdata`, `function spmi_device_put`, `function spmi_controller_set_drvdata`, `function spmi_controller_put`, `function spmi_driver_unregister`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.