aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/host.c')
-rw-r--r--drivers/mmc/core/host.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 64b03d6eaf18..abf9e884386c 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -143,9 +143,6 @@ int mmc_retune(struct mmc_host *host)
143 goto out; 143 goto out;
144 144
145 return_to_hs400 = true; 145 return_to_hs400 = true;
146
147 if (host->ops->prepare_hs400_tuning)
148 host->ops->prepare_hs400_tuning(host, &host->ios);
149 } 146 }
150 147
151 err = mmc_execute_tuning(host->card); 148 err = mmc_execute_tuning(host->card);
@@ -179,7 +176,7 @@ static void mmc_retune_timer(struct timer_list *t)
179int mmc_of_parse(struct mmc_host *host) 176int mmc_of_parse(struct mmc_host *host)
180{ 177{
181 struct device *dev = host->parent; 178 struct device *dev = host->parent;
182 u32 bus_width, drv_type; 179 u32 bus_width, drv_type, cd_debounce_delay_ms;
183 int ret; 180 int ret;
184 bool cd_cap_invert, cd_gpio_invert = false; 181 bool cd_cap_invert, cd_gpio_invert = false;
185 bool ro_cap_invert, ro_gpio_invert = false; 182 bool ro_cap_invert, ro_gpio_invert = false;
@@ -230,11 +227,16 @@ int mmc_of_parse(struct mmc_host *host)
230 } else { 227 } else {
231 cd_cap_invert = device_property_read_bool(dev, "cd-inverted"); 228 cd_cap_invert = device_property_read_bool(dev, "cd-inverted");
232 229
230 if (device_property_read_u32(dev, "cd-debounce-delay-ms",
231 &cd_debounce_delay_ms))
232 cd_debounce_delay_ms = 200;
233
233 if (device_property_read_bool(dev, "broken-cd")) 234 if (device_property_read_bool(dev, "broken-cd"))
234 host->caps |= MMC_CAP_NEEDS_POLL; 235 host->caps |= MMC_CAP_NEEDS_POLL;
235 236
236 ret = mmc_gpiod_request_cd(host, "cd", 0, true, 237 ret = mmc_gpiod_request_cd(host, "cd", 0, true,
237 0, &cd_gpio_invert); 238 cd_debounce_delay_ms,
239 &cd_gpio_invert);
238 if (!ret) 240 if (!ret)
239 dev_info(host->parent, "Got CD GPIO\n"); 241 dev_info(host->parent, "Got CD GPIO\n");
240 else if (ret != -ENOENT && ret != -ENOSYS) 242 else if (ret != -ENOENT && ret != -ENOSYS)
@@ -338,6 +340,9 @@ int mmc_of_parse(struct mmc_host *host)
338 host->dsr_req = 0; 340 host->dsr_req = 0;
339 } 341 }
340 342
343 device_property_read_u32(dev, "post-power-on-delay-ms",
344 &host->ios.power_delay_ms);
345
341 return mmc_pwrseq_alloc(host); 346 return mmc_pwrseq_alloc(host);
342} 347}
343 348
@@ -403,6 +408,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
403 host->max_blk_count = PAGE_SIZE / 512; 408 host->max_blk_count = PAGE_SIZE / 512;
404 409
405 host->fixed_drv_type = -EINVAL; 410 host->fixed_drv_type = -EINVAL;
411 host->ios.power_delay_ms = 10;
406 412
407 return host; 413 return host;
408} 414}