0001
0002
0003
0004
0005
0006
0007 #ifndef _MMC_CORE_PWRSEQ_H
0008 #define _MMC_CORE_PWRSEQ_H
0009
0010 #include <linux/types.h>
0011
0012 struct mmc_host;
0013 struct device;
0014 struct module;
0015
0016 struct mmc_pwrseq_ops {
0017 void (*pre_power_on)(struct mmc_host *host);
0018 void (*post_power_on)(struct mmc_host *host);
0019 void (*power_off)(struct mmc_host *host);
0020 void (*reset)(struct mmc_host *host);
0021 };
0022
0023 struct mmc_pwrseq {
0024 const struct mmc_pwrseq_ops *ops;
0025 struct device *dev;
0026 struct list_head pwrseq_node;
0027 struct module *owner;
0028 };
0029
0030 #ifdef CONFIG_OF
0031
0032 int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq);
0033 void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq);
0034
0035 int mmc_pwrseq_alloc(struct mmc_host *host);
0036 void mmc_pwrseq_pre_power_on(struct mmc_host *host);
0037 void mmc_pwrseq_post_power_on(struct mmc_host *host);
0038 void mmc_pwrseq_power_off(struct mmc_host *host);
0039 void mmc_pwrseq_reset(struct mmc_host *host);
0040 void mmc_pwrseq_free(struct mmc_host *host);
0041
0042 #else
0043
0044 static inline int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq)
0045 {
0046 return -ENOSYS;
0047 }
0048 static inline void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq) {}
0049 static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; }
0050 static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {}
0051 static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {}
0052 static inline void mmc_pwrseq_power_off(struct mmc_host *host) {}
0053 static inline void mmc_pwrseq_reset(struct mmc_host *host) {}
0054 static inline void mmc_pwrseq_free(struct mmc_host *host) {}
0055
0056 #endif
0057
0058 #endif