Commit 6ade9a2c authored by Wolfram Sang's avatar Wolfram Sang Committed by Ulf Hansson

mmc: sh_mobile_sdhi: improve prerequisite for hw_reset

We need a SCC unit for hw_reset. Those units can only be described in
of_data. So, of_data and a valid SCC offset are prerequisites for
enabling the hw_reset capability. Merge the two 'if' conditions into one
and add a check for an scc offset.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent dc9f1a8d
...@@ -666,13 +666,12 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -666,13 +666,12 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto efree; goto efree;
if (host->mmc->caps & MMC_CAP_UHS_SDR104) { if (of_data && of_data->scc_offset && host->mmc->caps & MMC_CAP_UHS_SDR104) {
host->mmc->caps |= MMC_CAP_HW_RESET;
if (of_data) {
const struct sh_mobile_sdhi_scc *taps = of_data->taps; const struct sh_mobile_sdhi_scc *taps = of_data->taps;
bool hit = false; bool hit = false;
host->mmc->caps |= MMC_CAP_HW_RESET;
for (i = 0; i < of_data->taps_num; i++) { for (i = 0; i < of_data->taps_num; i++) {
if (taps[i].clk_rate == 0 || if (taps[i].clk_rate == 0 ||
taps[i].clk_rate == host->mmc->f_max) { taps[i].clk_rate == host->mmc->f_max) {
...@@ -687,7 +686,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -687,7 +686,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
priv->scc_ctl = host->ctl + of_data->scc_offset; priv->scc_ctl = host->ctl + of_data->scc_offset;
} }
}
i = 0; i = 0;
while (1) { while (1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment