mirror of https://gitee.com/openkylin/linux.git
mmc: mmci: add optional reset property
This patch adds a optional reset management. STM32 sdmmc variant needs to reset hardware block during the power cycle procedure (for re-initialization). Signed-off-by: Ludovic Barre <ludovic.barre@st.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
c86a988885
commit
15878e5846
|
@ -36,6 +36,7 @@
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/pinctrl/consumer.h>
|
#include <linux/pinctrl/consumer.h>
|
||||||
|
#include <linux/reset.h>
|
||||||
|
|
||||||
#include <asm/div64.h>
|
#include <asm/div64.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
@ -1882,6 +1883,12 @@ static int mmci_probe(struct amba_device *dev,
|
||||||
|
|
||||||
dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);
|
dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);
|
||||||
|
|
||||||
|
host->rst = devm_reset_control_get_optional_exclusive(&dev->dev, NULL);
|
||||||
|
if (IS_ERR(host->rst)) {
|
||||||
|
ret = PTR_ERR(host->rst);
|
||||||
|
goto clk_disable;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get regulators and the supported OCR mask */
|
/* Get regulators and the supported OCR mask */
|
||||||
ret = mmc_regulator_get_supply(mmc);
|
ret = mmc_regulator_get_supply(mmc);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -318,6 +318,8 @@ struct mmci_host {
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
u8 singleirq:1;
|
u8 singleirq:1;
|
||||||
|
|
||||||
|
struct reset_control *rst;
|
||||||
|
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
|
|
||||||
unsigned int mclk;
|
unsigned int mclk;
|
||||||
|
|
Loading…
Reference in New Issue