/* SPDX-License-Identifier: GPL-2.0-only */ /* * fwnode.h - Firmware device node object handle type definition. * * This header file provides low-level data types and definitions for firmware * and device property providers. The respective API header files supplied by * them should contain all of the requisite data types and definitions for end * users, so including it directly should not be necessary. * * Copyright (C) 2015, Intel Corporation * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
*/
/* * fwnode flags * * LINKS_ADDED: The fwnode has already be parsed to add fwnode links. * NOT_DEVICE: The fwnode will never be populated as a struct device. * INITIALIZED: The hardware corresponding to fwnode has been initialized. * NEEDS_CHILD_BOUND_ON_ADD: For this fwnode/device to probe successfully, its * driver needs its child devices to be bound with * their respective drivers as soon as they are * added. * BEST_EFFORT: The fwnode/device needs to probe early and might be missing some * suppliers. Only enforce ordering with suppliers that have * drivers.
*/ #define FWNODE_FLAG_LINKS_ADDED BIT(0) #define FWNODE_FLAG_NOT_DEVICE BIT(1) #define FWNODE_FLAG_INITIALIZED BIT(2) #define FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD BIT(3) #define FWNODE_FLAG_BEST_EFFORT BIT(4) #define FWNODE_FLAG_VISITED BIT(5)
/* The below is used solely by device links, don't use otherwise */ struct device *dev; struct list_head suppliers; struct list_head consumers;
u8 flags;
};
/* * fwnode link flags * * CYCLE: The fwnode link is part of a cycle. Don't defer probe. * IGNORE: Completely ignore this link, even during cycle detection.
*/ #define FWLINK_FLAG_CYCLE BIT(0) #define FWLINK_FLAG_IGNORE BIT(1)
/** * struct fwnode_endpoint - Fwnode graph endpoint * @port: Port number * @id: Endpoint id * @local_fwnode: reference to the related fwnode
*/ struct fwnode_endpoint { unsignedint port; unsignedint id; conststruct fwnode_handle *local_fwnode;
};
/* * ports and endpoints defined as software_nodes should all follow a common * naming scheme; use these macros to ensure commonality.
*/ #define SWNODE_GRAPH_PORT_NAME_FMT "port@%u" #define SWNODE_GRAPH_ENDPOINT_NAME_FMT "endpoint@%u"
#define NR_FWNODE_REFERENCE_ARGS 16
/** * struct fwnode_reference_args - Fwnode reference with additional arguments * @fwnode:- A reference to the base fwnode * @nargs: Number of elements in @args array * @args: Integer arguments on the fwnode
*/ struct fwnode_reference_args { struct fwnode_handle *fwnode; unsignedint nargs;
u64 args[NR_FWNODE_REFERENCE_ARGS];
};
/** * struct fwnode_operations - Operations for fwnode interface * @get: Get a reference to an fwnode. * @put: Put a reference to an fwnode. * @device_is_available: Return true if the device is available. * @device_get_match_data: Return the device driver match data. * @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). * @get_parent: Return the parent of an fwnode. * @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 args * @graph_get_next_endpoint: Return an endpoint node in an iteration. * @graph_get_remote_endpoint: Return the remote endpoint node of a local * endpoint node. * @graph_get_port_parent: Return the parent node of a port node. * @graph_parse_endpoint: Parse endpoint for port and endpoint id. * @add_links: Create fwnode links to all the suppliers of the fwnode. Return * zero on success, a negative error code otherwise.
*/ struct fwnode_operations { struct fwnode_handle *(*get)(struct fwnode_handle *fwnode); void (*put)(struct fwnode_handle *fwnode); bool (*device_is_available)(conststruct fwnode_handle *fwnode); constvoid *(*device_get_match_data)(conststruct fwnode_handle *fwnode, conststruct device *dev); bool (*device_dma_supported)(conststruct fwnode_handle *fwnode); enum dev_dma_attr
(*device_get_dma_attr)(conststruct fwnode_handle *fwnode); bool (*property_present)(conststruct fwnode_handle *fwnode, constchar *propname); bool (*property_read_bool)(conststruct fwnode_handle *fwnode, constchar *propname); int (*property_read_int_array)(conststruct fwnode_handle *fwnode, constchar *propname, unsignedint elem_size, void *val,
size_t nval); int
(*property_read_string_array)(conststruct fwnode_handle *fwnode_handle, constchar *propname, constchar **val,
size_t nval); constchar *(*get_name)(conststruct fwnode_handle *fwnode); constchar *(*get_name_prefix)(conststruct fwnode_handle *fwnode); struct fwnode_handle *(*get_parent)(conststruct fwnode_handle *fwnode); struct fwnode_handle *
(*get_next_child_node)(conststruct fwnode_handle *fwnode, struct fwnode_handle *child); struct fwnode_handle *
(*get_named_child_node)(conststruct fwnode_handle *fwnode, constchar *name); int (*get_reference_args)(conststruct fwnode_handle *fwnode, constchar *prop, constchar *nargs_prop, unsignedint nargs, unsignedint index, struct fwnode_reference_args *args); struct fwnode_handle *
(*graph_get_next_endpoint)(conststruct fwnode_handle *fwnode, struct fwnode_handle *prev); struct fwnode_handle *
(*graph_get_remote_endpoint)(conststruct fwnode_handle *fwnode); struct fwnode_handle *
(*graph_get_port_parent)(struct fwnode_handle *fwnode); int (*graph_parse_endpoint)(conststruct fwnode_handle *fwnode, struct fwnode_endpoint *endpoint); void __iomem *(*iomap)(struct fwnode_handle *fwnode, int index); int (*irq_get)(conststruct fwnode_handle *fwnode, unsignedint index); int (*add_links)(struct fwnode_handle *fwnode);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.