blob: bd860d88f116c920077754ef28ab9741825622d7 [file] [log] [blame]
Ulf Hansson3aa87932014-11-28 14:38:36 +01001/*
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
11struct 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
18struct mmc_pwrseq {
19 struct mmc_pwrseq_ops *ops;
20};
21
22#ifdef CONFIG_OF
23
24int mmc_pwrseq_alloc(struct mmc_host *host);
25void mmc_pwrseq_pre_power_on(struct mmc_host *host);
26void mmc_pwrseq_post_power_on(struct mmc_host *host);
27void mmc_pwrseq_power_off(struct mmc_host *host);
28void mmc_pwrseq_free(struct mmc_host *host);
29
Ulf Hansson8c96f892014-12-05 14:36:58 +010030int mmc_pwrseq_simple_alloc(struct mmc_host *host, struct device *dev);
31
Ulf Hansson3aa87932014-11-28 14:38:36 +010032#else
33
34static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; }
35static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {}
36static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {}
37static inline void mmc_pwrseq_power_off(struct mmc_host *host) {}
38static inline void mmc_pwrseq_free(struct mmc_host *host) {}
39
40#endif
41
42#endif