drivers/of/property.c
Source file repositories/reference/linux-study-clean/drivers/of/property.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/of/property.c- Extension
.c- Size
- 50087 bytes
- Lines
- 1705
- Domain
- Driver Families
- Bucket
- drivers/of
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ctype.hlinux/of.hlinux/of_address.hlinux/of_device.hlinux/of_graph.hlinux/of_irq.hlinux/string.hlinux/moduleparam.hof_private.h
Detected Declarations
struct supplier_bindingsfunction Copyrightfunction of_graph_is_presentfunction of_property_count_elems_of_sizefunction of_property_read_u8_indexfunction of_property_read_u16_indexfunction of_property_read_u32_indexfunction of_property_read_u64_indexfunction of_property_read_variable_u8_arrayfunction of_property_read_variable_u16_arrayfunction of_property_read_variable_u32_arrayfunction of_property_read_u64function of_property_read_variable_u64_arrayfunction valuefunction of_property_match_stringfunction of_property_read_string_helperfunction of_graph_parse_endpointfunction of_graph_get_port_by_idfunction for_each_child_of_node_scopedfunction of_graph_get_next_portfunction of_graph_get_next_port_endpointfunction of_graph_get_next_endpointfunction of_graph_get_endpoint_by_regsfunction for_each_endpoint_of_nodefunction of_graph_get_remote_endpointfunction of_graph_get_port_parentfunction of_graph_get_remote_port_parentfunction of_graph_get_remote_portfunction of_graph_get_endpoint_countfunction of_graph_get_port_countfunction of_graph_get_remote_nodefunction of_fwnode_putfunction of_fwnode_device_is_availablefunction of_fwnode_device_dma_supportedfunction of_fwnode_device_get_dma_attrfunction of_fwnode_property_presentfunction of_fwnode_property_read_boolfunction of_fwnode_property_read_int_arrayfunction of_fwnode_property_read_string_arrayfunction of_fwnode_get_parentfunction of_fwnode_get_next_child_nodefunction of_fwnode_get_named_child_nodefunction of_fwnode_get_reference_argsfunction of_fwnode_graph_get_next_endpointfunction of_fwnode_graph_get_remote_endpointfunction of_fwnode_graph_get_port_parentfunction of_fwnode_graph_parse_endpointfunction of_fwnode_device_get_match_data
Annotated Snippet
struct supplier_bindings {
struct device_node *(*parse_prop)(struct device_node *np,
const char *prop_name, int index);
struct device_node *(*get_con_dev)(struct device_node *np);
bool optional;
u8 fwlink_flags;
};
DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells")
DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells")
DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells")
DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells")
DEFINE_SIMPLE_PROP(io_channels, "io-channels", "#io-channel-cells")
DEFINE_SIMPLE_PROP(io_backends, "io-backends", "#io-backend-cells")
DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells")
DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells")
DEFINE_SIMPLE_PROP(hwlocks, "hwlocks", "#hwlock-cells")
DEFINE_SIMPLE_PROP(extcon, "extcon", NULL)
DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", "#nvmem-cell-cells")
DEFINE_SIMPLE_PROP(phys, "phys", "#phy-cells")
DEFINE_SIMPLE_PROP(wakeup_parent, "wakeup-parent", NULL)
DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells")
DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells")
DEFINE_SIMPLE_PROP(leds, "leds", NULL)
DEFINE_SIMPLE_PROP(backlight, "backlight", NULL)
DEFINE_SIMPLE_PROP(panel, "panel", NULL)
DEFINE_SIMPLE_PROP(msi_parent, "msi-parent", "#msi-cells")
DEFINE_SIMPLE_PROP(post_init_providers, "post-init-providers", NULL)
DEFINE_SIMPLE_PROP(access_controllers, "access-controllers", "#access-controller-cells")
DEFINE_SIMPLE_PROP(pses, "pses", "#pse-cells")
DEFINE_SIMPLE_PROP(power_supplies, "power-supplies", NULL)
DEFINE_SIMPLE_PROP(mmc_pwrseq, "mmc-pwrseq", NULL)
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
static struct device_node *parse_pinctrl_n(struct device_node *np,
const char *prop_name, int index)
{
if (!strstarts(prop_name, "pinctrl-"))
return NULL;
if (!isdigit(prop_name[strlen("pinctrl-")]))
return NULL;
return of_parse_phandle(np, prop_name, index);
}
static struct device_node *parse_gpios(struct device_node *np,
const char *prop_name, int index)
{
if (strends(prop_name, ",nr-gpios"))
return NULL;
return parse_suffix_prop_cells(np, prop_name, index, "-gpios",
"#gpio-cells");
}
static struct device_node *parse_iommu_maps(struct device_node *np,
const char *prop_name, int index)
{
if (strcmp(prop_name, "iommu-map"))
return NULL;
return of_parse_phandle(np, prop_name, (index * 4) + 1);
}
static struct device_node *parse_gpio_compat(struct device_node *np,
const char *prop_name, int index)
{
struct of_phandle_args sup_args;
if (strcmp(prop_name, "gpio") && strcmp(prop_name, "gpios"))
return NULL;
/*
* Ignore node with gpio-hog property since its gpios are all provided
* by its parent.
*/
if (of_property_read_bool(np, "gpio-hog"))
return NULL;
if (of_parse_phandle_with_args(np, prop_name, "#gpio-cells", index,
&sup_args))
return NULL;
return sup_args.np;
}
static struct device_node *parse_interrupts(struct device_node *np,
const char *prop_name, int index)
Annotation
- Immediate include surface: `linux/ctype.h`, `linux/of.h`, `linux/of_address.h`, `linux/of_device.h`, `linux/of_graph.h`, `linux/of_irq.h`, `linux/string.h`, `linux/moduleparam.h`.
- Detected declarations: `struct supplier_bindings`, `function Copyright`, `function of_graph_is_present`, `function of_property_count_elems_of_size`, `function of_property_read_u8_index`, `function of_property_read_u16_index`, `function of_property_read_u32_index`, `function of_property_read_u64_index`, `function of_property_read_variable_u8_array`, `function of_property_read_variable_u16_array`.
- Atlas domain: Driver Families / drivers/of.
- Implementation status: integration 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.