include/linux/reset.h

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

File Facts

System
Linux kernel
Corpus path
include/linux/reset.h
Extension
.h
Size
39383 bytes
Lines
1075
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 reset_control_bulk_data {
	const char			*id;
	struct reset_control		*rstc;
};

#define RESET_CONTROL_FLAGS_BIT_SHARED		BIT(0)	/* not exclusive */
#define RESET_CONTROL_FLAGS_BIT_OPTIONAL	BIT(1)
#define RESET_CONTROL_FLAGS_BIT_ACQUIRED	BIT(2)	/* iff exclusive, not released */
#define RESET_CONTROL_FLAGS_BIT_DEASSERTED	BIT(3)

/**
 * enum reset_control_flags - Flags that can be passed to the reset_control_get functions
 *                    to determine the type of reset control.
 *                    These values cannot be OR'd.
 *
 * @RESET_CONTROL_EXCLUSIVE:				exclusive, acquired,
 * @RESET_CONTROL_EXCLUSIVE_DEASSERTED:			exclusive, acquired, deasserted
 * @RESET_CONTROL_EXCLUSIVE_RELEASED:			exclusive, released,
 * @RESET_CONTROL_SHARED:				shared
 * @RESET_CONTROL_SHARED_DEASSERTED:			shared, deasserted
 * @RESET_CONTROL_OPTIONAL_EXCLUSIVE:			optional, exclusive, acquired
 * @RESET_CONTROL_OPTIONAL_EXCLUSIVE_DEASSERTED:	optional, exclusive, acquired, deasserted
 * @RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED:		optional, exclusive, released
 * @RESET_CONTROL_OPTIONAL_SHARED:			optional, shared
 * @RESET_CONTROL_OPTIONAL_SHARED_DEASSERTED:		optional, shared, deasserted
 */
enum reset_control_flags {
	RESET_CONTROL_EXCLUSIVE				= RESET_CONTROL_FLAGS_BIT_ACQUIRED,
	RESET_CONTROL_EXCLUSIVE_DEASSERTED		= RESET_CONTROL_FLAGS_BIT_ACQUIRED |
							  RESET_CONTROL_FLAGS_BIT_DEASSERTED,
	RESET_CONTROL_EXCLUSIVE_RELEASED		= 0,
	RESET_CONTROL_SHARED				= RESET_CONTROL_FLAGS_BIT_SHARED,
	RESET_CONTROL_SHARED_DEASSERTED			= RESET_CONTROL_FLAGS_BIT_SHARED |
							  RESET_CONTROL_FLAGS_BIT_DEASSERTED,
	RESET_CONTROL_OPTIONAL_EXCLUSIVE		= RESET_CONTROL_FLAGS_BIT_OPTIONAL |
							  RESET_CONTROL_FLAGS_BIT_ACQUIRED,
	RESET_CONTROL_OPTIONAL_EXCLUSIVE_DEASSERTED	= RESET_CONTROL_FLAGS_BIT_OPTIONAL |
							  RESET_CONTROL_FLAGS_BIT_ACQUIRED |
							  RESET_CONTROL_FLAGS_BIT_DEASSERTED,
	RESET_CONTROL_OPTIONAL_EXCLUSIVE_RELEASED	= RESET_CONTROL_FLAGS_BIT_OPTIONAL,
	RESET_CONTROL_OPTIONAL_SHARED			= RESET_CONTROL_FLAGS_BIT_OPTIONAL |
							  RESET_CONTROL_FLAGS_BIT_SHARED,
	RESET_CONTROL_OPTIONAL_SHARED_DEASSERTED	= RESET_CONTROL_FLAGS_BIT_OPTIONAL |
							  RESET_CONTROL_FLAGS_BIT_SHARED |
							  RESET_CONTROL_FLAGS_BIT_DEASSERTED,
};

#ifdef CONFIG_RESET_CONTROLLER

int reset_control_reset(struct reset_control *rstc);
int reset_control_rearm(struct reset_control *rstc);
int reset_control_assert(struct reset_control *rstc);
int reset_control_deassert(struct reset_control *rstc);
int reset_control_status(struct reset_control *rstc);
int reset_control_acquire(struct reset_control *rstc);
void reset_control_release(struct reset_control *rstc);

int reset_control_bulk_reset(int num_rstcs, struct reset_control_bulk_data *rstcs);
int reset_control_bulk_assert(int num_rstcs, struct reset_control_bulk_data *rstcs);
int reset_control_bulk_deassert(int num_rstcs, struct reset_control_bulk_data *rstcs);
int reset_control_bulk_acquire(int num_rstcs, struct reset_control_bulk_data *rstcs);
void reset_control_bulk_release(int num_rstcs, struct reset_control_bulk_data *rstcs);

struct reset_control *__fwnode_reset_control_get(struct fwnode_handle *fwnode,
				     const char *id, int index, enum reset_control_flags flags);
struct reset_control *__reset_control_get(struct device *dev, const char *id,
					  int index, enum reset_control_flags flags);
void reset_control_put(struct reset_control *rstc);
int __reset_control_bulk_get(struct device *dev, int num_rstcs,
			     struct reset_control_bulk_data *rstcs,
			     enum reset_control_flags flags);
void reset_control_bulk_put(int num_rstcs, struct reset_control_bulk_data *rstcs);

int __device_reset(struct device *dev, bool optional);
struct reset_control *__devm_reset_control_get(struct device *dev,
				     const char *id, int index, enum reset_control_flags flags);
int __devm_reset_control_bulk_get(struct device *dev, int num_rstcs,
				  struct reset_control_bulk_data *rstcs,
				  enum reset_control_flags flags);

struct reset_control *devm_reset_control_array_get(struct device *dev,
						   enum reset_control_flags flags);
struct reset_control *fwnode_reset_control_array_get(struct fwnode_handle *fwnode,
						     enum reset_control_flags);

int reset_control_get_count(struct device *dev);

#else

static inline int reset_control_reset(struct reset_control *rstc)

Annotation

Implementation Notes