summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-09-21 11:36:33 +0200
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-09-21 11:36:33 +0200
commit09baa2f4caab013160eed975db47235e6c930af4 (patch)
treec8beea50021fc6473537281282d3c20a68975e08 /include/linux
parentc42e50314a7629ada42a605666b18e22867a6b44 (diff)
parent295eeaf2c6543f746c1c7d9871f6d2f71a7ed4cc (diff)
downloadlinux-09baa2f4caab013160eed975db47235e6c930af4.tar.gz
linux-09baa2f4caab013160eed975db47235e6c930af4.zip
Merge tag 'pwrseq-is-controllable-for-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into pwrseq/for-next
Add a new core power sequencing consumer functions: pwrseq_is_controllable(). This allows users to check whether the sequencer's target is actually host-controllable.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pwrseq/consumer.h7
-rw-r--r--include/linux/pwrseq/provider.h8
2 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/pwrseq/consumer.h b/include/linux/pwrseq/consumer.h
index 16fad5f3e3ab..b69117ad3fa7 100644
--- a/include/linux/pwrseq/consumer.h
+++ b/include/linux/pwrseq/consumer.h
@@ -25,6 +25,8 @@ int pwrseq_disable(struct pwrseq_desc *desc);
struct device *pwrseq_to_device(struct pwrseq_desc *desc);
+bool pwrseq_is_controllable(struct pwrseq_desc *desc);
+
#else /* CONFIG_POWER_SEQUENCING */
static inline struct pwrseq_desc * __must_check
@@ -58,6 +60,11 @@ static inline struct device *pwrseq_to_device(struct pwrseq_desc *desc)
return NULL;
}
+static inline bool pwrseq_is_controllable(struct pwrseq_desc *desc)
+{
+ return false;
+}
+
#endif /* CONFIG_POWER_SEQUENCING */
#endif /* __POWER_SEQUENCING_CONSUMER_H__ */
diff --git a/include/linux/pwrseq/provider.h b/include/linux/pwrseq/provider.h
index 33b3d2c2e39d..7285ad94a221 100644
--- a/include/linux/pwrseq/provider.h
+++ b/include/linux/pwrseq/provider.h
@@ -6,12 +6,15 @@
#ifndef __POWER_SEQUENCING_PROVIDER_H__
#define __POWER_SEQUENCING_PROVIDER_H__
+#include <linux/types.h>
+
struct device;
struct module;
struct pwrseq_device;
typedef int (*pwrseq_power_state_func)(struct pwrseq_device *);
typedef int (*pwrseq_match_func)(struct pwrseq_device *, struct device *);
+typedef bool (*pwrseq_is_controllable_func)(struct pwrseq_device *);
#define PWRSEQ_NO_MATCH 0
#define PWRSEQ_MATCH_OK 1
@@ -43,11 +46,16 @@ struct pwrseq_unit_data {
* the state lock has been released. It's useful for implementing
* boot-up delays without blocking other users from powering up
* using the same power sequencer.
+ * @is_controllable: Optional callback checking whether enabling/disabling this
+ * target actually controls power (for example when the
+ * controlling GPIO is wired up). If not provided, the
+ * target's power is assumed to be always controllable.
*/
struct pwrseq_target_data {
const char *name;
const struct pwrseq_unit_data *unit;
pwrseq_power_state_func post_enable;
+ pwrseq_is_controllable_func is_controllable;
};
/**