include/linux/pwrseq/provider.h

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

File Facts

System
Linux kernel
Corpus path
include/linux/pwrseq/provider.h
Extension
.h
Size
2586 bytes
Lines
79
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 pwrseq_unit_data {
	const char *name;
	const struct pwrseq_unit_data **deps;
	pwrseq_power_state_func enable;
	pwrseq_power_state_func disable;
};

/**
 * struct pwrseq_target_data - Configuration of a power sequencing target.
 * @name: Name of the target.
 * @unit: Final unit that this target must reach in order to be considered
 *        enabled.
 * @post_enable: Callback run after the target unit has been enabled, *after*
 *               the state lock has been released. It's useful for implementing
 *               boot-up delays without blocking other users from powering up
 *               using the same power sequencer.
 */
struct pwrseq_target_data {
	const char *name;
	const struct pwrseq_unit_data *unit;
	pwrseq_power_state_func post_enable;
};

/**
 * struct pwrseq_config - Configuration used for registering a new provider.
 * @parent: Parent device for the sequencer. Must be set.
 * @owner: Module providing this device.
 * @drvdata: Private driver data.
 * @match: Provider callback used to match the consumer device to the sequencer.
 * @targets: Array of targets for this power sequencer. Must be NULL-terminated.
 */
struct pwrseq_config {
	struct device *parent;
	struct module *owner;
	void *drvdata;
	pwrseq_match_func match;
	const struct pwrseq_target_data **targets;
};

struct pwrseq_device *
pwrseq_device_register(const struct pwrseq_config *config);
void pwrseq_device_unregister(struct pwrseq_device *pwrseq);
struct pwrseq_device *
devm_pwrseq_device_register(struct device *dev,
			    const struct pwrseq_config *config);

void *pwrseq_device_get_drvdata(struct pwrseq_device *pwrseq);

#endif /* __POWER_SEQUENCING_PROVIDER_H__ */

Annotation

Implementation Notes