include/linux/platform_device.h
Source file repositories/reference/linux-study-clean/include/linux/platform_device.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/platform_device.h- Extension
.h- Size
- 15570 bytes
- Lines
- 434
- 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/device.h
Detected Declarations
struct irq_affinitystruct mfd_cellstruct property_entrystruct platform_device_idstruct platform_devicestruct platform_device_infostruct platform_driverfunction devm_platform_get_and_ioremap_resourcefunction devm_platform_ioremap_resourcefunction devm_platform_ioremap_resource_bynamefunction platform_set_drvdatafunction is_sh_early_platform_device
Annotated Snippet
extern const struct bus_type platform_bus_type;
extern struct device platform_bus;
extern struct resource *platform_get_resource(struct platform_device *,
unsigned int, unsigned int);
extern struct resource *platform_get_mem_or_io(struct platform_device *,
unsigned int);
extern struct device *
platform_find_device_by_driver(struct device *start,
const struct device_driver *drv);
#ifdef CONFIG_HAS_IOMEM
extern void __iomem *
devm_platform_get_and_ioremap_resource(struct platform_device *pdev,
unsigned int index, struct resource **res);
extern void __iomem *
devm_platform_ioremap_resource(struct platform_device *pdev,
unsigned int index);
extern void __iomem *
devm_platform_ioremap_resource_byname(struct platform_device *pdev,
const char *name);
#else
static inline void __iomem *
devm_platform_get_and_ioremap_resource(struct platform_device *pdev,
unsigned int index, struct resource **res)
{
return IOMEM_ERR_PTR(-EINVAL);
}
static inline void __iomem *
devm_platform_ioremap_resource(struct platform_device *pdev,
unsigned int index)
{
return IOMEM_ERR_PTR(-EINVAL);
}
static inline void __iomem *
devm_platform_ioremap_resource_byname(struct platform_device *pdev,
const char *name)
{
return IOMEM_ERR_PTR(-EINVAL);
}
#endif
extern int platform_get_irq(struct platform_device *, unsigned int);
extern int platform_get_irq_optional(struct platform_device *, unsigned int);
extern int platform_get_irq_affinity(struct platform_device *, unsigned int,
const struct cpumask **);
extern int platform_irq_count(struct platform_device *);
extern int devm_platform_get_irqs_affinity(struct platform_device *dev,
struct irq_affinity *affd,
unsigned int minvec,
unsigned int maxvec,
int **irqs);
extern struct resource *platform_get_resource_byname(struct platform_device *,
unsigned int,
const char *);
extern int platform_get_irq_byname(struct platform_device *, const char *);
extern int platform_get_irq_byname_optional(struct platform_device *dev,
const char *name);
extern int platform_add_devices(struct platform_device **, int);
/**
* struct platform_device_info - set of parameters for creating a platform device
* @parent: parent device for the new platform device.
* @fwnode: firmware node associated with the device.
* @of_node_reused: indicates that device tree node associated with the device
* is shared with another device, typically its ancestor. Setting this to
* %true prevents the device from being matched via the OF match table,
* and stops the device core from automatically binding pinctrl
* configuration to avoid disrupting the other device.
* @name: name of the device.
* @id: instance ID of the device. Use %PLATFORM_DEVID_NONE if there is only
* one instance of the device, or %PLATFORM_DEVID_AUTO to let the
* kernel automatically assign a unique instance ID.
* @res: set of resources to attach to the device.
* @num_res: number of entries in @res.
* @data: device-specific data for this platform device.
* @size_data: size of device-specific data.
* @dma_mask: DMA mask for the device.
* @swnode: a secondary software node to be attached to the device. The node
* will be automatically registered and its lifetime tied to the platform
* device if it is not registered yet.
* @properties: a set of software properties for the device. If provided,
* a managed software node will be automatically created and
* assigned to the device. The properties array must be terminated
Annotation
- Immediate include surface: `linux/device.h`.
- Detected declarations: `struct irq_affinity`, `struct mfd_cell`, `struct property_entry`, `struct platform_device_id`, `struct platform_device`, `struct platform_device_info`, `struct platform_driver`, `function devm_platform_get_and_ioremap_resource`, `function devm_platform_ioremap_resource`, `function devm_platform_ioremap_resource_byname`.
- 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.