mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01:00
Implement the power sequencing subsystem allowing devices to share complex powering-up and down procedures. It's split into the consumer and provider parts but does not implement any new DT bindings so that the actual power sequencing is never revealed in the DT representation. Tested-by: Amit Pundir <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8550-QRD, SM8650-QRD & SM8650-HDK Tested-by: Caleb Connolly <[email protected]> # OnePlus 8T Acked-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
57 lines
1.2 KiB
C
57 lines
1.2 KiB
C
/* 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_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);
|
|
|
|
#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;
|
|
}
|
|
|
|
#endif /* CONFIG_POWER_SEQUENCING */
|
|
|
|
#endif /* __POWER_SEQUENCING_CONSUMER_H__ */
|