mirror of
https://github.com/torvalds/linux.git
synced 2024-12-10 13:12:04 +00:00
726b6324e3
This patch provides a simple mmc-pwrseq-emmc driver, which controls single gpio line. It perform standard eMMC hw reset procedure, as descibed by Jedec 4.4 specification. This procedure is performed just after MMC core enabled power to the given mmc host (to fix possible issues if bootloader has left eMMC card in initialized or unknown state), and before performing complete system reboot (also in case of emergency reboot call). The latter is needed on boards, which doesn't have hardware reset logic connected to emmc card and (limited or broken) ROM bootloaders are unable to read second stage from the emmc card if the card is left in unknown or already initialized state. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
/*
|
|
* Copyright (C) 2014 Linaro Ltd
|
|
*
|
|
* Author: Ulf Hansson <ulf.hansson@linaro.org>
|
|
*
|
|
* License terms: GNU General Public License (GPL) version 2
|
|
*/
|
|
#ifndef _MMC_CORE_PWRSEQ_H
|
|
#define _MMC_CORE_PWRSEQ_H
|
|
|
|
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);
|
|
void (*free)(struct mmc_host *host);
|
|
};
|
|
|
|
struct mmc_pwrseq {
|
|
struct mmc_pwrseq_ops *ops;
|
|
};
|
|
|
|
#ifdef CONFIG_OF
|
|
|
|
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);
|
|
void mmc_pwrseq_free(struct mmc_host *host);
|
|
|
|
int mmc_pwrseq_simple_alloc(struct mmc_host *host, struct device *dev);
|
|
int mmc_pwrseq_emmc_alloc(struct mmc_host *host, struct device *dev);
|
|
|
|
#else
|
|
|
|
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) {}
|
|
static inline void mmc_pwrseq_free(struct mmc_host *host) {}
|
|
|
|
#endif
|
|
|
|
#endif
|