STRUCT FWNODE_OPERATIONS(9)
β¨ struct fwnode_operations(9) β¨
okay so this is a page from the Kernel API Manual and bestie, it's literally the blueprint for struct fwnode_operations β the operations table for the fwnode interface π
like, every function pointer a firmware-node backend can implement lives right here. no cap.
πΈ NAME πΈ
struct fwnode_operations β the Operations for fwnode interface π
π¦ SYNOPSIS π¦
here's the whole struct, verbatim, don't touch a single character or I will cry π
struct fwnode_operations {
struct fwnode_handle *(*get)(struct fwnode_handle *fwnode);
void (*put)(struct fwnode_handle *fwnode);
bool (*device_is_available)(const struct fwnode_handle *fwnode);
const void *(*device_get_match_data)(const struct fwnode_handle
*fwnode, const struct device *dev);
bool (*device_dma_supported)(const struct fwnode_handle *fwnode);
enum dev_dma_attr (*device_get_dma_attr)(const struct fwnode_handle
*fwnode);
bool (*property_present)(const struct fwnode_handle *fwnode, const
char *propname);
bool (*property_read_bool)(const struct fwnode_handle *fwnode, const
char *propname);
int (*property_read_int_array)(const struct fwnode_handle *fwnode,
const char *propname, unsigned int elem_size, void *val, size_t nval);
int (*property_read_string_array)(const struct fwnode_handle
*fwnode_handle, const char *propname, const char **val, size_t nval);
const char *(*get_name)(const struct fwnode_handle *fwnode);
const char *(*get_name_prefix)(const struct fwnode_handle *fwnode);
struct fwnode_handle *(*get_parent)(const struct fwnode_handle
*fwnode);
struct fwnode_handle * (*get_next_child_node)(const struct
fwnode_handle *fwnode, struct fwnode_handle *child);
struct fwnode_handle * (*get_named_child_node)(const struct
fwnode_handle *fwnode, const char *name);
int (*get_reference_args)(const struct fwnode_handle *fwnode, const
char *prop, const char *nargs_prop, unsigned int nargs, unsigned int
index, struct fwnode_reference_args *args);
struct fwnode_handle * (*graph_get_next_endpoint)(const struct
fwnode_handle *fwnode, struct fwnode_handle *prev);
struct fwnode_handle * (*graph_get_remote_endpoint)(const struct
fwnode_handle *fwnode);
struct fwnode_handle * (*graph_get_port_parent)(struct fwnode_handle
*fwnode);
int (*graph_parse_endpoint)(const struct fwnode_handle *fwnode,
struct fwnode_endpoint *endpoint);
void __iomem *(*iomap)(struct fwnode_handle *fwnode, int index);
int (*irq_get)(const struct fwnode_handle *fwnode, unsigned int
index);
int (*add_links)(struct fwnode_handle *fwnode);
};
likeβ¦ that's a lot of function pointers. she's got range π
π Members π
okay group chat, let's go through every single one, no skipping, we don't do that here π«Ά
getβ Get a reference to an fwnode. (grabby hands, but make it refcounting β¨)putβ Put a reference to an fwnode. (the breakup arc π)device_is_availableβ Return true if the device is available.device_get_match_dataβ Return the device driver match data.device_dma_supportedβ Return true if DMA is supported.device_get_dma_attrβ Return the device DMA attribute.property_presentβ Return true if a property is present.property_read_boolβ Return a boolean property value.property_read_int_arrayβ Read an array of integer properties. Return zero on success, a negative error code otherwise. π―property_read_string_arrayβ Read an array of string properties. Return zero on success, a negative error code otherwise. π―get_nameβ Return the name of an fwnode.get_name_prefixβ Get a prefix for a node (for printing purposes). π for the aesthetic onlyget_parentβ Return the parent of an fwnode. (family tree moment π³)get_next_child_nodeβ Return the next child node in an iteration. πget_named_child_nodeβ Return a child node with a given name.get_reference_argsβ Return a reference pointed to by a property, with argsgraph_get_next_endpointβ Return an endpoint node in an iteration. πgraph_get_remote_endpointβ Return the remote endpoint node of a local endpoint node. (long distance relationship core π)graph_get_port_parentβ Return the parent node of a port node.graph_parse_endpointβ Parse endpoint for port and endpoint id.iomapβ Map the I/O memory of a given index for a fwnode. πΊοΈirq_getβ Get the IRQ of a given index for a fwnode. β‘add_linksβ Create fwnode links to all the suppliers of the fwnode. Return zero on success, a negative error code otherwise. π
π SEE ALSO π
check these out, they're literally in the Kernel file ./include/linux/fwnode.h β go read them, iykyk π
struct fwnode_endpoint(9)struct fwnode_reference_args(9)
π friendly reminder that this is the interface, so if you're implementing one of these backends you're on the hook for making every pointer behave. no pressure or whatever π
okay that's the whole page!! mwah π and for the receipts: this came from ./include/linux, dated October 2026, and it's struct fwnode_operations(9) all the way down β periodt. πβ¨π¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms