mmc: Prepare all code for mmc_regulator_set_vqmmc() returning > 0
Subsystems (11)
PATCH v2 1/3 mmc: Prepare all code for mmc_regulator_set_vqmmc() returning > 0
Patch all drivers which use mmc_regulator_set_vqmmc() and prepare them for the fact that mmc_regulator_set_vqmmc() can return a value > 0, which would happen if the signal voltage switch did NOT happen, because the voltage was already set correctly.
To: [email protected]
---
V2: Patch only mmc_regulator_set_vqmmc()
--- drivers/mmc/host/dw_mmc-k3.c | 2 ++ drivers/mmc/host/dw_mmc.c | 2 ++ drivers/mmc/host/meson-gx-mmc.c | 7 ++++++- drivers/mmc/host/mtk-sd.c | 2 ++ drivers/mmc/host/renesas_sdhi_core.c | 2 ++ drivers/mmc/host/sdhci-sprd.c | 2 ++ drivers/mmc/host/sdhci.c | 6 ++++++ drivers/mmc/host/sunxi-mmc.c | 10 ++++++++-- drivers/mmc/host/usdhi6rol0.c | 2 ++ 9 files changed, 32 insertions(+), 3 deletions(-)
drivers/mmc/host/dw_mmc-k3.c +2 -0
@@ -424,6 +424,8 @@ static int dw_mci_hi3660_switch_voltage(struct mmc_host *mmc,if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {dev_err (host->dev,"Regulator set error %d\n" , ret);return ret;
drivers/mmc/host/dw_mmc.c +2 -0
@@ -1546,6 +1546,8 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) { dev_dbg(&mmc->class_dev,
drivers/mmc/host/meson-gx-mmc.c +6 -1
@@ -1004,6 +1004,8 @@ static int meson_mmc_card_busy(struct mmc_host *mmc)static int meson_mmc_voltage_switch (struct mmc_host *mmc,struct mmc_ios *ios) { +int ret; +/* vqmmc regulator is available */ if (!IS_ERR (mmc->supply.vqmmc)) {/*
@@ -1013,7 +1015,10 @@ static int meson_mmc_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)* to 1.8v. Please make sure the regulator framework is aware * of your own regulator constraints */ -return mmc_regulator_set_vqmmc (mmc, ios); + ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ; +return ret; }/* no vqmmc regulator, assume fixed regulator at 3/3.3V */
drivers/mmc/host/mtk-sd.c +2 -0
@@ -1379,6 +1379,8 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios) } ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {dev_dbg (host->dev,"Regulator set error %d (%d)\n" , ret, ios->signal_voltage);
drivers/mmc/host/renesas_sdhi_core.c +2 -0
@@ -237,6 +237,8 @@ static int renesas_sdhi_start_signal_voltage_switch(struct mmc_host *mmc,MMC_SIGNAL_VOLTAGE_330 ?0 : -EINVAL ; ret =mmc_regulator_set_vqmmc (host->mmc, ios); +if (ret >0 ) + ret =0 ;if (ret)return ret;
drivers/mmc/host/sdhci-sprd.c +2 -0
@@ -434,6 +434,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {pr_err ("%s: Switching signalling voltage failed\n" ,mmc_hostname (mmc));
drivers/mmc/host/sdhci.c +6 -0
@@ -2411,6 +2411,8 @@ int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {pr_warn ("%s: Switching to 3.3V signalling voltage failed\n" ,mmc_hostname (mmc));
@@ -2434,6 +2436,8 @@ int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,return -EINVAL ;if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {pr_warn ("%s: Switching to 1.8V signalling voltage failed\n" ,mmc_hostname (mmc));
@@ -2466,6 +2470,8 @@ int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,return -EINVAL ;if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {pr_warn ("%s: Switching to 1.2V signalling voltage failed\n" ,mmc_hostname (mmc));
drivers/mmc/host/sunxi-mmc.c +8 -2
@@ -951,9 +951,15 @@ static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)static int sunxi_mmc_volt_switch (struct mmc_host *mmc,struct mmc_ios *ios) { +int ret; +/* vqmmc regulator is available */ -if (!IS_ERR (mmc->supply.vqmmc)) -return mmc_regulator_set_vqmmc (mmc, ios); +if (!IS_ERR (mmc->supply.vqmmc)) { + ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ; +return ret; + }/* no vqmmc regulator, assume fixed regulator at 3/3.3V */ if (mmc->ios.signal_voltage ==MMC_SIGNAL_VOLTAGE_330 )
drivers/mmc/host/usdhi6rol0.c +2 -0
@@ -1174,6 +1174,8 @@ static int usdhi6_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios)int ret; ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret <0 )return ret;
Signature · 1 line
2.25.1
PATCH v2 2/3 mmc: Return 1 from mmc_regulator_set_vqmmc() if switch skipped
Adjust mmc_regulator_set_vqmmc() to return 1 if the voltage switch was skipped because the regulator voltage was already correct. This allows drivers to detect such condition and possibly skip various voltage switching extras.
To: [email protected]
---
V2: - Rename variable curr_voltage to current_uV
- Update mmc_regulator_set_vqmmc() to handle the fact that mmc_regulator_set_voltage_if_supported() can return value > 0
--- drivers/mmc/core/regulator.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/mmc/core/regulator.c +14 -3
@@ -136,6 +136,8 @@ static int mmc_regulator_set_voltage_if_supported(struct regulator *regulator, int min_uV, int target_uV, int max_uV) { + int current_uV; +/* * Check if supported first to avoid errors since we may try several * signal levels during power up and don't want to show errors.
@@ -143,6 +145,14 @@ static int mmc_regulator_set_voltage_if_supported(struct regulator *regulator,if (!regulator_is_supported_voltage (regulator, min_uV, max_uV))return -EINVAL ; +/* +* The voltage is already set, no need to switch. +* Return 1 to indicate that no switch happened. +*/ + current_uV =regulator_get_voltage (regulator); +if (current_uV == target_uV) +return 1 ; +return regulator_set_voltage_triplet (regulator, min_uV, target_uV, max_uV); }
@@ -198,9 +208,10 @@ int mmc_regulator_set_vqmmc(struct mmc_host *mmc, struct mmc_ios *ios)* voltage in two steps and try to stay close to vmmc * with a 0.3V tolerance at first. */ -if (!mmc_regulator_set_voltage_if_supported (mmc->supply.vqmmc, - min_uV, volt, max_uV)) -return 0 ; + ret =mmc_regulator_set_voltage_if_supported (mmc->supply.vqmmc, + min_uV, volt, max_uV); +if (ret >=0 ) +return ret;return mmc_regulator_set_voltage_if_supported (mmc->supply.vqmmc,2700000 , volt,3600000 );
Signature · 1 line
2.25.1
Re: [PATCH V2 2/3] mmc: Return 1 from mmc_regulator_set_vqmmc() if switch skipped
Quoted 17 lines · Marek Vasut
Adjust
mmc_regulator_set_vqmmc()to return 1 if the voltage switch was skipped because the regulator voltage was already correct. This allows drivers to detect such condition and possibly skip various voltage switching extras.Signed-off-by Marek Vasut <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Linus Walleij <[email protected]>Cc Ludovic Barre <[email protected]>Cc Manivannan Sadhasivam <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Patrice Chotard <[email protected]>Cc Patrick Delaunay <[email protected]>Cc Russell King <[email protected]>Cc Ulf Hansson <[email protected]>
Quoted 1 line
Applied for next, thanks!
Kind regards
Uffe
Quoted 53 lines
---
V2: - Rename variablecurr_voltagetocurrent_uV
- Updatemmc_regulator_set_vqmmc()to handle the fact thatmmc_regulator_set_voltage_if_supported()can return value > 0--- drivers/mmc/core/regulator.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)drivers/mmc/core/regulator.c +14
-4@@ -136,6 +136,8 @@ static int mmc_regulator_set_voltage_if_supported(struct regulator *regulator, int min_uV, int target_uV, int max_uV) { + int current_uV; +/* * Check if supported first to avoid errors since we may try several * signal levels during power up and don't want to show errors. @@ -143,6 +145,14 @@ static int mmc_regulator_set_voltage_if_supported(struct regulator *regulator,if (!regulator_is_supported_voltage (regulator, min_uV, max_uV))return -EINVAL ; +/* +* The voltage is already set, no need to switch. +* Return 1 to indicate that no switch happened. +*/ + current_uV =regulator_get_voltage (regulator); +if (current_uV == target_uV) +return 1 ; +return regulator_set_voltage_triplet (regulator, min_uV, target_uV, max_uV); }@@ -198,9 +208,10 @@ int mmc_regulator_set_vqmmc(struct mmc_host *mmc, struct mmc_ios *ios)* voltage in two steps and try to stay close to vmmc * with a 0.3V tolerance at first. */ -if (!mmc_regulator_set_voltage_if_supported (mmc->supply.vqmmc, - min_uV, volt, max_uV)) -return 0 ; + ret =mmc_regulator_set_voltage_if_supported (mmc->supply.vqmmc, + min_uV, volt, max_uV); +if (ret >=0 ) +return ret;return mmc_regulator_set_voltage_if_supported (mmc->supply.vqmmc,2700000 , volt,3600000 ); --2.25.1
PATCH v2 3/3 mmc: mmci: Switch to mmc_regulator_set_vqmmc()
In reply to Marek VasutInstead of reimplementing the logic in mmc_regulator_set_vqmmc(), use the mmc code function directly.
This fixes a real issue on STM32MP1 where, if the eMMC is supplied with VccQ=1.8 V, the post voltage switch code will spin indefinitelly waiting for the voltage switch to complete, even though no voltage switch really happened. But since mmc_set_signal_voltage() would return 0, then the condition for calling .post_sig_volt_switch() is not satisfied if the switch did not happen.
To: [email protected]
---
V2: Reword commit message
--- drivers/mmc/host/mmci.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-)
drivers/mmc/host/mmci.c +8 -22
@@ -1861,31 +1861,17 @@ static int mmci_get_cd(struct mmc_host *mmc)static int mmci_sig_volt_switch (struct mmc_host *mmc,struct mmc_ios *ios) {struct mmci_host *host =mmc_priv (mmc); -int ret =0 ; - -if (!IS_ERR (mmc->supply.vqmmc)) { +int ret; -switch (ios->signal_voltage) { -case MMC_SIGNAL_VOLTAGE_330 : - ret =regulator_set_voltage (mmc->supply.vqmmc, -2700000 ,3600000 ); -break ; -case MMC_SIGNAL_VOLTAGE_180 : - ret =regulator_set_voltage (mmc->supply.vqmmc, -1700000 ,1950000 ); -break ; -case MMC_SIGNAL_VOLTAGE_120 : - ret =regulator_set_voltage (mmc->supply.vqmmc, -1100000 ,1300000 ); -break ; - } + ret =mmc_regulator_set_vqmmc (mmc, ios); -if (!ret && host->ops && host->ops->post_sig_volt_switch) - ret = host->ops->post_sig_volt_switch (host, ios); +if (!ret && host->ops && host->ops->post_sig_volt_switch) + ret = host->ops->post_sig_volt_switch (host, ios); +else if (ret) + ret =0 ; -if (ret) -dev_warn (mmc_dev (mmc),"Voltage switch failed\n" ); - } +if (ret <0 ) +dev_warn (mmc_dev (mmc),"Voltage switch failed\n" );return ret; }
Signature · 1 line
2.25.1
Re: [PATCH V2 3/3] mmc: mmci: Switch to mmc_regulator_set_vqmmc()
Quoted 22 lines · Marek Vasut
Instead of reimplementing the logic in
mmc_regulator_set_vqmmc(), use the mmc code function directly.This fixes a real issue on STM32MP1 where, if the eMMC is supplied with VccQ=1.8 V, the post voltage switch code will spin indefinitelly waiting for the voltage switch to complete, even though no voltage switch really happened. But since
mmc_set_signal_voltage()would return 0, then the condition for calling .post_sig_volt_switch() is not satisfied if the switch did not happen.Signed-off-by Marek Vasut <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Linus Walleij <[email protected]>Cc Ludovic Barre <[email protected]>Cc Manivannan Sadhasivam <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Patrice Chotard <[email protected]>Cc Patrick Delaunay <[email protected]>Cc Russell King <[email protected]>Cc Ulf Hansson <[email protected]>
Quoted 1 line
Applied for next, thanks!
I did some additional amendments to the commit message, just tell me if you want some additional changes on top.
Kind regards
Uffe
Quoted 53 lines
---
V2: Reword commit message--- drivers/mmc/host/mmci.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-)drivers/mmc/host/mmci.c +8
-23@@ -1861,31 +1861,17 @@ static int mmci_get_cd(struct mmc_host *mmc)static int mmci_sig_volt_switch (struct mmc_host *mmc,struct mmc_ios *ios) {struct mmci_host *host =mmc_priv (mmc); -int ret =0 ; - -if (!IS_ERR (mmc->supply.vqmmc)) { +int ret; -switch (ios->signal_voltage) { -case MMC_SIGNAL_VOLTAGE_330 : - ret =regulator_set_voltage (mmc->supply.vqmmc, -2700000 ,3600000 ); -break ; -case MMC_SIGNAL_VOLTAGE_180 : - ret =regulator_set_voltage (mmc->supply.vqmmc, -1700000 ,1950000 ); -break ; -case MMC_SIGNAL_VOLTAGE_120 : - ret =regulator_set_voltage (mmc->supply.vqmmc, -1100000 ,1300000 ); -break ; - } + ret =mmc_regulator_set_vqmmc (mmc, ios); -if (!ret && host->ops && host->ops->post_sig_volt_switch) - ret = host->ops->post_sig_volt_switch (host, ios); +if (!ret && host->ops && host->ops->post_sig_volt_switch) + ret = host->ops->post_sig_volt_switch (host, ios); +else if (ret) + ret =0 ; -if (ret) -dev_warn (mmc_dev (mmc),"Voltage switch failed\n" ); - } +if (ret <0 ) +dev_warn (mmc_dev (mmc),"Voltage switch failed\n" );return ret; } --2.25.1
Quoted 17 lines · Marek Vasut
Patch all drivers which use
mmc_regulator_set_vqmmc()and prepare them for the fact thatmmc_regulator_set_vqmmc()can return a value > 0, which would happen if the signal voltage switch did NOT happen, because the voltage was already set correctly.Signed-off-by Marek Vasut <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Linus Walleij <[email protected]>Cc Ludovic Barre <[email protected]>Cc Manivannan Sadhasivam <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Patrice Chotard <[email protected]>Cc Patrick Delaunay <[email protected]>Cc Russell King <[email protected]>Cc Ulf Hansson <[email protected]>
Quoted 1 line
Applied for next, thanks!
I took the liberty to re-work and simplify some of the code, please have a look at my next branch to make sure I didn't screw something up.
Kind regards
Uffe
drivers/mmc/host/dw_mmc-k3.c +0 -0
@@ -424,7 +424,7 @@ static int dw_mci_hi3660_switch_voltage(struct
mmc_host *mmc,
if (!IS_ERR(mmc->supply.vqmmc)) {
ret = mmc_regulator_set_vqmmc(mmc, ios);
- if (ret) {
+ if (ret < 0) {
dev_err(host->dev, "Regulator set error %d\n", ret);
return ret;
}drivers/mmc/host/dw_mmc.c +0 -0
@@ -1546,8 +1546,7 @@ static int dw_mci_switch_voltage(struct mmc_host
*mmc, struct mmc_ios *ios)
if (!IS_ERR(mmc->supply.vqmmc)) {
ret = mmc_regulator_set_vqmmc(mmc, ios);
-
- if (ret) {
+ if (ret < 0) {
dev_dbg(&mmc->class_dev,
"Regulator set error %d - %s V\n",
ret, uhs & v18 ? "1.8" : "3.3");Quoted 173 lines
---
V2: Patch onlymmc_regulator_set_vqmmc()--- drivers/mmc/host/dw_mmc-k3.c | 2 ++ drivers/mmc/host/dw_mmc.c | 2 ++ drivers/mmc/host/meson-gx-mmc.c | 7 ++++++- drivers/mmc/host/mtk-sd.c | 2 ++ drivers/mmc/host/renesas_sdhi_core.c | 2 ++ drivers/mmc/host/sdhci-sprd.c | 2 ++ drivers/mmc/host/sdhci.c | 6 ++++++ drivers/mmc/host/sunxi-mmc.c | 10 ++++++++-- drivers/mmc/host/usdhi6rol0.c | 2 ++ 9 files changed, 32 insertions(+), 3 deletions(-)drivers/mmc/host/dw_mmc-k3.c +2
-0@@ -424,6 +424,8 @@ static int dw_mci_hi3660_switch_voltage(struct mmc_host *mmc,if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {dev_err (host->dev,"Regulator set error %d\n" , ret);return ret;drivers/mmc/host/dw_mmc.c +2
-0@@ -1546,6 +1546,8 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) { dev_dbg(&mmc->class_dev,drivers/mmc/host/meson-gx-mmc.c +6
-1@@ -1004,6 +1004,8 @@ static int meson_mmc_card_busy(struct mmc_host *mmc)static int meson_mmc_voltage_switch (struct mmc_host *mmc,struct mmc_ios *ios) { +int ret; +/* vqmmc regulator is available */ if (!IS_ERR (mmc->supply.vqmmc)) {/* @@ -1013,7 +1015,10 @@ static int meson_mmc_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)* to 1.8v. Please make sure the regulator framework is aware * of your own regulator constraints */ -return mmc_regulator_set_vqmmc (mmc, ios); + ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ; +return ret; }/* no vqmmc regulator, assume fixed regulator at 3/3.3V */ drivers/mmc/host/mtk-sd.c +2
-0@@ -1379,6 +1379,8 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios) } ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {dev_dbg (host->dev,"Regulator set error %d (%d)\n" , ret, ios->signal_voltage);drivers/mmc/host/renesas_sdhi_core.c +2
-0@@ -237,6 +237,8 @@ static int renesas_sdhi_start_signal_voltage_switch(struct mmc_host *mmc,MMC_SIGNAL_VOLTAGE_330 ?0 : -EINVAL ; ret =mmc_regulator_set_vqmmc (host->mmc, ios); +if (ret >0 ) + ret =0 ;if (ret)return ret;drivers/mmc/host/sdhci-sprd.c +2
-0@@ -434,6 +434,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {pr_err ("%s: Switching signalling voltage failed\n" ,mmc_hostname (mmc));drivers/mmc/host/sdhci.c +6
-0@@ -2411,6 +2411,8 @@ int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {pr_warn ("%s: Switching to 3.3V signalling voltage failed\n" ,mmc_hostname (mmc));@@ -2434,6 +2436,8 @@ int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,return -EINVAL ;if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {pr_warn ("%s: Switching to 1.8V signalling voltage failed\n" ,mmc_hostname (mmc));@@ -2466,6 +2470,8 @@ int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,return -EINVAL ;if (!IS_ERR (mmc->supply.vqmmc)) { ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret) {pr_warn ("%s: Switching to 1.2V signalling voltage failed\n" ,mmc_hostname (mmc));drivers/mmc/host/sunxi-mmc.c +8
-2@@ -951,9 +951,15 @@ static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)static int sunxi_mmc_volt_switch (struct mmc_host *mmc,struct mmc_ios *ios) { +int ret; +/* vqmmc regulator is available */ -if (!IS_ERR (mmc->supply.vqmmc)) -return mmc_regulator_set_vqmmc (mmc, ios); +if (!IS_ERR (mmc->supply.vqmmc)) { + ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ; +return ret; + }/* no vqmmc regulator, assume fixed regulator at 3/3.3V */ if (mmc->ios.signal_voltage ==MMC_SIGNAL_VOLTAGE_330 )drivers/mmc/host/usdhi6rol0.c +2
-1@@ -1174,6 +1174,8 @@ static int usdhi6_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios)int ret; ret =mmc_regulator_set_vqmmc (mmc, ios); +if (ret >0 ) + ret =0 ;if (ret <0 )return ret; --2.25.1
Quoted 20 lines · Ulf Hansson
Quoted 17 lines · Marek Vasut
Patch all drivers which use
mmc_regulator_set_vqmmc()and prepare them for the fact thatmmc_regulator_set_vqmmc()can return a value > 0, which would happen if the signal voltage switch did NOT happen, because the voltage was already set correctly.Signed-off-by Marek Vasut <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Linus Walleij <[email protected]>Cc Ludovic Barre <[email protected]>Cc Manivannan Sadhasivam <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Patrice Chotard <[email protected]>Cc Patrick Delaunay <[email protected]>Cc Russell King <[email protected]>Cc Ulf Hansson <[email protected]>Quoted 1 line
Quoted 5 lines
Applied for next, thanks!
I took the liberty to re-work and simplify some of the code, please have a look at my next branch to make sure I didn't screw something up.
Where is your next branch ?
Quoted 22 lines · Marek Vasut
Quoted 20 lines · Ulf Hansson
Quoted 18 lines · Marek Vasut
Patch all drivers which use
mmc_regulator_set_vqmmc()and prepare them for the fact thatmmc_regulator_set_vqmmc()can return a value > 0, which would happen if the signal voltage switch did NOT happen, because the voltage was already set correctly.Signed-off-by Marek Vasut <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Linus Walleij <[email protected]>Cc Ludovic Barre <[email protected]>Cc Manivannan Sadhasivam <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Patrice Chotard <[email protected]>Cc Patrick Delaunay <[email protected]>Cc Russell King <[email protected]>Cc Ulf Hansson <[email protected]>
Quoted 7 lines
Quoted 5 lines
Applied for next, thanks!
I took the liberty to re-work and simplify some of the code, please have a look at my next branch to make sure I didn't screw something up.
Where is your next branch ?
It's listed in the MAINTAINERS file.
git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git
Kind regards
Uffe
Quoted 29 lines · Ulf Hansson
Quoted 28 lines · Marek Vasut
Quoted 25 lines · Ulf Hansson
Quoted 17 lines · Marek Vasut
Patch all drivers which use
mmc_regulator_set_vqmmc()and prepare them for the fact thatmmc_regulator_set_vqmmc()can return a value > 0, which would happen if the signal voltage switch did NOT happen, because the voltage was already set correctly.Signed-off-by Marek Vasut <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Linus Walleij <[email protected]>Cc Ludovic Barre <[email protected]>Cc Manivannan Sadhasivam <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Patrice Chotard <[email protected]>Cc Patrick Delaunay <[email protected]>Cc Russell King <[email protected]>Cc Ulf Hansson <[email protected]>Quoted 1 line
Applied for next, thanks!
I took the liberty to re-work and simplify some of the code, please have a look at my next branch to make sure I didn't screw something up.
Quoted 5 lines
Quoted 1 line
Where is your next branch ?
It's listed in the
MAINTAINERSfile.
git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git
All right, this one. The adjustments look OK, thanks.
I noticed this one in mtk-sd.c:
/* Apply different pinctrl settings for different signal voltage */ if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
pinctrl_select_state(host->pinctrl, host->pins_uhs); else pinctrl_select_state(host->pinctrl, host->pins_default);
I would almost think that the MTK platforms would support 1V2 modes too, so the above should rather be:
if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330)
pinctrl_select_state(host->pinctrl, host->pins_default); else pinctrl_select_state(host->pinctrl, host->pins_uhs);
But I have no hardware to test, and it's a topic for another patch.