~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/pwrseq/provider.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright (C) 2024 Linaro Ltd.
  4  */
  5 
  6 #ifndef __POWER_SEQUENCING_PROVIDER_H__
  7 #define __POWER_SEQUENCING_PROVIDER_H__
  8 
  9 struct device;
 10 struct module;
 11 struct pwrseq_device;
 12 
 13 typedef int (*pwrseq_power_state_func)(struct pwrseq_device *);
 14 typedef int (*pwrseq_match_func)(struct pwrseq_device *, struct device *);
 15 
 16 /**
 17  * struct pwrseq_unit_data - Configuration of a single power sequencing
 18  *                           unit.
 19  * @name: Name of the unit.
 20  * @deps: Units that must be enabled before this one and disabled after it
 21  *        in the order they come in this array. Must be NULL-terminated.
 22  * @enable: Callback running the part of the power-on sequence provided by
 23  *          this unit.
 24  * @disable: Callback running the part of the power-off sequence provided
 25  *           by this unit.
 26  */
 27 struct pwrseq_unit_data {
 28         const char *name;
 29         const struct pwrseq_unit_data **deps;
 30         pwrseq_power_state_func enable;
 31         pwrseq_power_state_func disable;
 32 };
 33 
 34 /**
 35  * struct pwrseq_target_data - Configuration of a power sequencing target.
 36  * @name: Name of the target.
 37  * @unit: Final unit that this target must reach in order to be considered
 38  *        enabled.
 39  * @post_enable: Callback run after the target unit has been enabled, *after*
 40  *               the state lock has been released. It's useful for implementing
 41  *               boot-up delays without blocking other users from powering up
 42  *               using the same power sequencer.
 43  */
 44 struct pwrseq_target_data {
 45         const char *name;
 46         const struct pwrseq_unit_data *unit;
 47         pwrseq_power_state_func post_enable;
 48 };
 49 
 50 /**
 51  * struct pwrseq_config - Configuration used for registering a new provider.
 52  * @parent: Parent device for the sequencer. Must be set.
 53  * @owner: Module providing this device.
 54  * @drvdata: Private driver data.
 55  * @match: Provider callback used to match the consumer device to the sequencer.
 56  * @targets: Array of targets for this power sequencer. Must be NULL-terminated.
 57  */
 58 struct pwrseq_config {
 59         struct device *parent;
 60         struct module *owner;
 61         void *drvdata;
 62         pwrseq_match_func match;
 63         const struct pwrseq_target_data **targets;
 64 };
 65 
 66 struct pwrseq_device *
 67 pwrseq_device_register(const struct pwrseq_config *config);
 68 void pwrseq_device_unregister(struct pwrseq_device *pwrseq);
 69 struct pwrseq_device *
 70 devm_pwrseq_device_register(struct device *dev,
 71                             const struct pwrseq_config *config);
 72 
 73 void *pwrseq_device_get_drvdata(struct pwrseq_device *pwrseq);
 74 
 75 #endif /* __POWER_SEQUENCING_PROVIDER_H__ */
 76 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php