2019-05-29 00:57:21 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2014-11-28 21:38:36 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Linaro Ltd
|
|
|
|
*
|
|
|
|
* Author: Ulf Hansson <ulf.hansson@linaro.org>
|
|
|
|
*/
|
|
|
|
#ifndef _MMC_CORE_PWRSEQ_H
|
|
|
|
#define _MMC_CORE_PWRSEQ_H
|
|
|
|
|
2017-01-13 21:14:07 +08:00
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
|
|
struct mmc_host;
|
|
|
|
struct device;
|
|
|
|
struct module;
|
2016-04-14 21:02:16 +08:00
|
|
|
|
2014-11-28 21:38:36 +08:00
|
|
|
struct mmc_pwrseq_ops {
|
|
|
|
void (*pre_power_on)(struct mmc_host *host);
|
|
|
|
void (*post_power_on)(struct mmc_host *host);
|
|
|
|
void (*power_off)(struct mmc_host *host);
|
2017-05-09 05:49:12 +08:00
|
|
|
void (*reset)(struct mmc_host *host);
|
2014-11-28 21:38:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct mmc_pwrseq {
|
2015-11-15 01:05:20 +08:00
|
|
|
const struct mmc_pwrseq_ops *ops;
|
2016-04-14 21:02:16 +08:00
|
|
|
struct device *dev;
|
|
|
|
struct list_head pwrseq_node;
|
|
|
|
struct module *owner;
|
2014-11-28 21:38:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef CONFIG_OF
|
|
|
|
|
2016-04-14 21:02:16 +08:00
|
|
|
int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq);
|
|
|
|
void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq);
|
|
|
|
|
2014-11-28 21:38:36 +08:00
|
|
|
int mmc_pwrseq_alloc(struct mmc_host *host);
|
|
|
|
void mmc_pwrseq_pre_power_on(struct mmc_host *host);
|
|
|
|
void mmc_pwrseq_post_power_on(struct mmc_host *host);
|
|
|
|
void mmc_pwrseq_power_off(struct mmc_host *host);
|
2017-05-09 05:49:12 +08:00
|
|
|
void mmc_pwrseq_reset(struct mmc_host *host);
|
2014-11-28 21:38:36 +08:00
|
|
|
void mmc_pwrseq_free(struct mmc_host *host);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2016-04-14 21:02:16 +08:00
|
|
|
static inline int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
static inline void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq) {}
|
2014-11-28 21:38:36 +08:00
|
|
|
static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; }
|
|
|
|
static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {}
|
|
|
|
static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {}
|
|
|
|
static inline void mmc_pwrseq_power_off(struct mmc_host *host) {}
|
2017-05-09 05:49:12 +08:00
|
|
|
static inline void mmc_pwrseq_reset(struct mmc_host *host) {}
|
2014-11-28 21:38:36 +08:00
|
|
|
static inline void mmc_pwrseq_free(struct mmc_host *host) {}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|