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 | * MMC power sequence management |
| 9 | */ |
| 10 | #include <linux/mmc/host.h> |
| 11 | |
| 12 | #include "pwrseq.h" |
| 13 | |
| 14 | |
| 15 | int mmc_pwrseq_alloc(struct mmc_host *host) |
| 16 | { |
| 17 | return 0; |
| 18 | } |
| 19 | |
| 20 | void mmc_pwrseq_pre_power_on(struct mmc_host *host) |
| 21 | { |
| 22 | struct mmc_pwrseq *pwrseq = host->pwrseq; |
| 23 | |
| 24 | if (pwrseq && pwrseq->ops && pwrseq->ops->pre_power_on) |
| 25 | pwrseq->ops->pre_power_on(host); |
| 26 | } |
| 27 | |
| 28 | void mmc_pwrseq_post_power_on(struct mmc_host *host) |
| 29 | { |
| 30 | struct mmc_pwrseq *pwrseq = host->pwrseq; |
| 31 | |
| 32 | if (pwrseq && pwrseq->ops && pwrseq->ops->post_power_on) |
| 33 | pwrseq->ops->post_power_on(host); |
| 34 | } |
| 35 | |
| 36 | void mmc_pwrseq_power_off(struct mmc_host *host) |
| 37 | { |
| 38 | struct mmc_pwrseq *pwrseq = host->pwrseq; |
| 39 | |
| 40 | if (pwrseq && pwrseq->ops && pwrseq->ops->power_off) |
| 41 | pwrseq->ops->power_off(host); |
| 42 | } |
| 43 | |
| 44 | void mmc_pwrseq_free(struct mmc_host *host) |
| 45 | { |
| 46 | struct mmc_pwrseq *pwrseq = host->pwrseq; |
| 47 | |
| 48 | if (pwrseq && pwrseq->ops && pwrseq->ops->free) |
| 49 | pwrseq->ops->free(host); |
| 50 | } |