Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / linux / pwrseq / consumer.h
blob7d583b4f266e625fa61a8a424a9dfbca7aab1603
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2024 Linaro Ltd.
4 */
6 #ifndef __POWER_SEQUENCING_CONSUMER_H__
7 #define __POWER_SEQUENCING_CONSUMER_H__
9 #include <linux/err.h>
11 struct device;
12 struct pwrseq_desc;
14 #if IS_ENABLED(CONFIG_POWER_SEQUENCING)
16 struct pwrseq_desc * __must_check
17 pwrseq_get(struct device *dev, const char *target);
18 void pwrseq_put(struct pwrseq_desc *desc);
20 struct pwrseq_desc * __must_check
21 devm_pwrseq_get(struct device *dev, const char *target);
23 int pwrseq_power_on(struct pwrseq_desc *desc);
24 int pwrseq_power_off(struct pwrseq_desc *desc);
26 #else /* CONFIG_POWER_SEQUENCING */
28 static inline struct pwrseq_desc * __must_check
29 pwrseq_get(struct device *dev, const char *target)
31 return ERR_PTR(-ENOSYS);
34 static inline void pwrseq_put(struct pwrseq_desc *desc)
38 static inline struct pwrseq_desc * __must_check
39 devm_pwrseq_get(struct device *dev, const char *target)
41 return ERR_PTR(-ENOSYS);
44 static inline int pwrseq_power_on(struct pwrseq_desc *desc)
46 return -ENOSYS;
49 static inline int pwrseq_power_off(struct pwrseq_desc *desc)
51 return -ENOSYS;
54 #endif /* CONFIG_POWER_SEQUENCING */
56 #endif /* __POWER_SEQUENCING_CONSUMER_H__ */