Ulf Hansson | 3aa8793 | 2014-11-28 14:38:36 +0100 | [diff] [blame] | 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 | |
| 11 | struct mmc_pwrseq_ops { |
| 12 | void (*pre_power_on)(struct mmc_host *host); |
| 13 | void (*post_power_on)(struct mmc_host *host); |
| 14 | void (*power_off)(struct mmc_host *host); |
| 15 | void (*free)(struct mmc_host *host); |
| 16 | }; |
| 17 | |
| 18 | struct mmc_pwrseq { |
Julia Lawall | ffedbd2 | 2015-11-14 18:05:20 +0100 | [diff] [blame^] | 19 | const struct mmc_pwrseq_ops *ops; |
Ulf Hansson | 3aa8793 | 2014-11-28 14:38:36 +0100 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | #ifdef CONFIG_OF |
| 23 | |
| 24 | int mmc_pwrseq_alloc(struct mmc_host *host); |
| 25 | void mmc_pwrseq_pre_power_on(struct mmc_host *host); |
| 26 | void mmc_pwrseq_post_power_on(struct mmc_host *host); |
| 27 | void mmc_pwrseq_power_off(struct mmc_host *host); |
| 28 | void mmc_pwrseq_free(struct mmc_host *host); |
| 29 | |
Alexandre Courbot | 0f12a0c | 2015-02-12 13:36:11 +0900 | [diff] [blame] | 30 | struct mmc_pwrseq *mmc_pwrseq_simple_alloc(struct mmc_host *host, |
| 31 | struct device *dev); |
| 32 | struct mmc_pwrseq *mmc_pwrseq_emmc_alloc(struct mmc_host *host, |
| 33 | struct device *dev); |
Ulf Hansson | 8c96f89 | 2014-12-05 14:36:58 +0100 | [diff] [blame] | 34 | |
Ulf Hansson | 3aa8793 | 2014-11-28 14:38:36 +0100 | [diff] [blame] | 35 | #else |
| 36 | |
| 37 | static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; } |
| 38 | static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {} |
| 39 | static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {} |
| 40 | static inline void mmc_pwrseq_power_off(struct mmc_host *host) {} |
| 41 | static inline void mmc_pwrseq_free(struct mmc_host *host) {} |
| 42 | |
| 43 | #endif |
| 44 | |
| 45 | #endif |