Something went wrong. Try again.
Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364/* SPDX-License-Identifier: GPL-2.0-only *//* * Copyright (C) 2024 Linaro Ltd. */
#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_checkpwrseq_get(struct device *dev, const char *target);void pwrseq_put(struct pwrseq_desc *desc);
struct pwrseq_desc * __must_checkdevm_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_checkpwrseq_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_checkdevm_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__ */