1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2024 Linaro Ltd.
6 #ifndef __POWER_SEQUENCING_CONSUMER_H__
7 #define __POWER_SEQUENCING_CONSUMER_H__
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
)
49 static inline int pwrseq_power_off(struct pwrseq_desc
*desc
)
54 #endif /* CONFIG_POWER_SEQUENCING */
56 #endif /* __POWER_SEQUENCING_CONSUMER_H__ */