pwrseq.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2014 Linaro Ltd
  3. *
  4. * Author: Ulf Hansson <ulf.hansson@linaro.org>
  5. *
  6. * License terms: GNU General Public License (GPL) version 2
  7. */
  8. #ifndef _MMC_CORE_PWRSEQ_H
  9. #define _MMC_CORE_PWRSEQ_H
  10. struct mmc_pwrseq_ops {
  11. void (*pre_power_on)(struct mmc_host *host);
  12. void (*post_power_on)(struct mmc_host *host);
  13. void (*power_off)(struct mmc_host *host);
  14. void (*free)(struct mmc_host *host);
  15. };
  16. struct mmc_pwrseq {
  17. struct mmc_pwrseq_ops *ops;
  18. };
  19. #ifdef CONFIG_OF
  20. int mmc_pwrseq_alloc(struct mmc_host *host);
  21. void mmc_pwrseq_pre_power_on(struct mmc_host *host);
  22. void mmc_pwrseq_post_power_on(struct mmc_host *host);
  23. void mmc_pwrseq_power_off(struct mmc_host *host);
  24. void mmc_pwrseq_free(struct mmc_host *host);
  25. struct mmc_pwrseq *mmc_pwrseq_simple_alloc(struct mmc_host *host,
  26. struct device *dev);
  27. struct mmc_pwrseq *mmc_pwrseq_emmc_alloc(struct mmc_host *host,
  28. struct device *dev);
  29. #else
  30. static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; }
  31. static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {}
  32. static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {}
  33. static inline void mmc_pwrseq_power_off(struct mmc_host *host) {}
  34. static inline void mmc_pwrseq_free(struct mmc_host *host) {}
  35. #endif
  36. #endif