mirror of
https://github.com/LineageOS/android_kernel_samsung_msm8226.git
synced 2026-09-28 00:00:22 +02:00
mmc: msm_sdcc: Update hw_reset functionality for resetting SD card
Some targets whose regulators are controlled through platform-data in the board files. Add support for such SDC slots to enable hw_reset functionality Change-Id: I5033cd96f8816008ee7fa546bd81d83a33373299 Signed-off-by: Pratibhasagar V <pratibha@codeaurora.org>
This commit is contained in:
committed by
Jay Chokshi
parent
f57880a55f
commit
1aa03dce3e
+33
-28
@@ -4280,35 +4280,40 @@ void msmsdcc_hw_reset(struct mmc_host *mmc)
|
||||
if (!card || !mmc_card_sd(card))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Continuing on failing to disable regulator would lead to a panic
|
||||
* anyway, since the commands would fail and console would be flooded
|
||||
* with prints, eventually leading to a watchdog bark
|
||||
*/
|
||||
rc = msmsdcc_setup_vreg(host, false, false);
|
||||
if (rc) {
|
||||
pr_err("%s: %s disable regulator: failed: %d\n",
|
||||
mmc_hostname(mmc), __func__, rc);
|
||||
BUG_ON(rc);
|
||||
pr_debug("%s: Starting h/w reset\n", mmc_hostname(host->mmc));
|
||||
|
||||
if (host->plat->translate_vdd || host->plat->vreg_data) {
|
||||
|
||||
/* Disable the regulators */
|
||||
if (host->plat->translate_vdd)
|
||||
rc = host->plat->translate_vdd(mmc_dev(mmc), 0);
|
||||
else if (host->plat->vreg_data)
|
||||
rc = msmsdcc_setup_vreg(host, false, false);
|
||||
|
||||
if (rc) {
|
||||
pr_err("%s: Failed to disable voltage regulator\n",
|
||||
mmc_hostname(host->mmc));
|
||||
BUG_ON(rc);
|
||||
}
|
||||
|
||||
/* 10ms delay for supply to reach the desired voltage level */
|
||||
usleep_range(10000, 12000);
|
||||
|
||||
/* Enable the regulators */
|
||||
if (host->plat->translate_vdd)
|
||||
rc = host->plat->translate_vdd(mmc_dev(mmc), 1);
|
||||
else if (host->plat->vreg_data)
|
||||
rc = msmsdcc_setup_vreg(host, true, false);
|
||||
|
||||
if (rc) {
|
||||
pr_err("%s: Failed to enable voltage regulator\n",
|
||||
mmc_hostname(host->mmc));
|
||||
BUG_ON(rc);
|
||||
}
|
||||
|
||||
/* 10ms delay for supply to reach the desired voltage level */
|
||||
usleep_range(10000, 12000);
|
||||
}
|
||||
|
||||
/* 10ms delay for the supply to reach the desired voltage level */
|
||||
usleep_range(10000, 12000);
|
||||
|
||||
/*
|
||||
* Continuing on failing to enable regulator would lead to a panic
|
||||
* anyway, since the commands would fail and console would be flooded
|
||||
* with prints, eventually leading to a watchdog bark
|
||||
*/
|
||||
rc = msmsdcc_setup_vreg(host, true, false);
|
||||
if (rc) {
|
||||
pr_err("%s: %s enable regulator: failed: %d\n",
|
||||
mmc_hostname(mmc), __func__, rc);
|
||||
BUG_ON(rc);
|
||||
}
|
||||
|
||||
/* 10ms delay for the supply to reach the desired voltage level */
|
||||
usleep_range(10000, 12000);
|
||||
}
|
||||
|
||||
static const struct mmc_host_ops msmsdcc_ops = {
|
||||
|
||||
Reference in New Issue
Block a user