include/linux/framer/framer-provider.h

Source file repositories/reference/linux-study-clean/include/linux/framer/framer-provider.h

File Facts

System
Linux kernel
Corpus path
include/linux/framer/framer-provider.h
Extension
.h
Size
5714 bytes
Lines
194
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct framer_ops {
	int	(*init)(struct framer *framer);
	void	(*exit)(struct framer *framer);
	int	(*power_on)(struct framer *framer);
	int	(*power_off)(struct framer *framer);

	/**
	 * @get_status:
	 *
	 * Optional.
	 *
	 * Used to get the framer status. framer_init() must have
	 * been called on the framer.
	 *
	 * Returns: 0 if successful, an negative error code otherwise
	 */
	int	(*get_status)(struct framer *framer, struct framer_status *status);

	/**
	 * @set_config:
	 *
	 * Optional.
	 *
	 * Used to set the framer configuration. framer_init() must have
	 * been called on the framer.
	 *
	 * Returns: 0 if successful, an negative error code otherwise
	 */
	int	(*set_config)(struct framer *framer, const struct framer_config *config);

	/**
	 * @get_config:
	 *
	 * Optional.
	 *
	 * Used to get the framer configuration. framer_init() must have
	 * been called on the framer.
	 *
	 * Returns: 0 if successful, an negative error code otherwise
	 */
	int	(*get_config)(struct framer *framer, struct framer_config *config);

	u32 flags;
	struct module *owner;
};

/**
 * struct framer_provider - represents the framer provider
 * @dev: framer provider device
 * @owner: the module owner having of_xlate
 * @list: to maintain a linked list of framer providers
 * @of_xlate: function pointer to obtain framer instance from framer pointer
 */
struct framer_provider {
	struct device		*dev;
	struct module		*owner;
	struct list_head	list;
	struct framer * (*of_xlate)(struct device *dev,
				    const struct of_phandle_args *args);
};

static inline void framer_set_drvdata(struct framer *framer, void *data)
{
	dev_set_drvdata(&framer->dev, data);
}

static inline void *framer_get_drvdata(struct framer *framer)
{
	return dev_get_drvdata(&framer->dev);
}

#if IS_ENABLED(CONFIG_GENERIC_FRAMER)

/* Create and destroy a framer */
struct framer *framer_create(struct device *dev, struct device_node *node,
			     const struct framer_ops *ops);
void framer_destroy(struct framer *framer);

/* devm version */
struct framer *devm_framer_create(struct device *dev, struct device_node *node,
				  const struct framer_ops *ops);

struct framer *framer_provider_simple_of_xlate(struct device *dev,
					       const struct of_phandle_args *args);

struct framer_provider *
__framer_provider_of_register(struct device *dev, struct module *owner,
			      struct framer *(*of_xlate)(struct device *dev,
							 const struct of_phandle_args *args));

Annotation

Implementation Notes