Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2024 Linaro Ltd.
4 */
5
6#ifndef __POWER_SEQUENCING_CONSUMER_H__
7#define __POWER_SEQUENCING_CONSUMER_H__
8
9#include <linux/err.h>
10
11struct device;
12struct pwrseq_desc;
13
14#if IS_ENABLED(CONFIG_POWER_SEQUENCING)
15
16struct pwrseq_desc * __must_check
17pwrseq_get(struct device *dev, const char *target);
18void pwrseq_put(struct pwrseq_desc *desc);
19
20struct pwrseq_desc * __must_check
21devm_pwrseq_get(struct device *dev, const char *target);
22
23int pwrseq_power_on(struct pwrseq_desc *desc);
24int pwrseq_power_off(struct pwrseq_desc *desc);
25
26#else /* CONFIG_POWER_SEQUENCING */
27
28static inline struct pwrseq_desc * __must_check
29pwrseq_get(struct device *dev, const char *target)
30{
31 return ERR_PTR(-ENOSYS);
32}
33
34static inline void pwrseq_put(struct pwrseq_desc *desc)
35{
36}
37
38static inline struct pwrseq_desc * __must_check
39devm_pwrseq_get(struct device *dev, const char *target)
40{
41 return ERR_PTR(-ENOSYS);
42}
43
44static inline int pwrseq_power_on(struct pwrseq_desc *desc)
45{
46 return -ENOSYS;
47}
48
49static inline int pwrseq_power_off(struct pwrseq_desc *desc)
50{
51 return -ENOSYS;
52}
53
54#endif /* CONFIG_POWER_SEQUENCING */
55
56#endif /* __POWER_SEQUENCING_CONSUMER_H__ */