include/linux/pwrseq/consumer.h

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

File Facts

System
Linux kernel
Corpus path
include/linux/pwrseq/consumer.h
Extension
.h
Size
1348 bytes
Lines
64
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

#ifndef __POWER_SEQUENCING_CONSUMER_H__
#define __POWER_SEQUENCING_CONSUMER_H__

#include <linux/err.h>

struct device;
struct pwrseq_desc;

#if IS_ENABLED(CONFIG_POWER_SEQUENCING)

struct pwrseq_desc * __must_check
pwrseq_get(struct device *dev, const char *target);
void pwrseq_put(struct pwrseq_desc *desc);

struct pwrseq_desc * __must_check
devm_pwrseq_get(struct device *dev, const char *target);

int pwrseq_power_on(struct pwrseq_desc *desc);
int pwrseq_power_off(struct pwrseq_desc *desc);

struct device *pwrseq_to_device(struct pwrseq_desc *desc);

#else /* CONFIG_POWER_SEQUENCING */

static inline struct pwrseq_desc * __must_check
pwrseq_get(struct device *dev, const char *target)
{
	return ERR_PTR(-ENOSYS);
}

static inline void pwrseq_put(struct pwrseq_desc *desc)
{
}

static inline struct pwrseq_desc * __must_check
devm_pwrseq_get(struct device *dev, const char *target)
{
	return ERR_PTR(-ENOSYS);
}

static inline int pwrseq_power_on(struct pwrseq_desc *desc)
{
	return -ENOSYS;
}

static inline int pwrseq_power_off(struct pwrseq_desc *desc)
{
	return -ENOSYS;
}

static inline struct device *pwrseq_to_device(struct pwrseq_desc *desc)
{
	return NULL;
}

#endif /* CONFIG_POWER_SEQUENCING */

#endif /* __POWER_SEQUENCING_CONSUMER_H__ */

Annotation

Implementation Notes