aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorAndreas Fenkart <afenkart@gmail.com>2014-11-08 09:33:17 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2014-11-26 08:30:56 -0500
commit80412ca8abf087354891108d2f888ad3de56e73c (patch)
tree718cc12ad96919af4c4e18fa94cdeddf3547275d /drivers/mmc
parentb5cd43f062717b6c92f93bc0c593764e144ea331 (diff)
mmc: omap_hsmmc: remove unused slot_id parameter
omap_hsmmc only supports one slot. So slot id is always zero, and slot id was never used in the callbacks anyway Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c65
1 files changed, 26 insertions, 39 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index f4f1bcd632f3..82b40b85293f 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -207,7 +207,6 @@ struct omap_hsmmc_host {
207 int use_dma, dma_ch; 207 int use_dma, dma_ch;
208 struct dma_chan *tx_chan; 208 struct dma_chan *tx_chan;
209 struct dma_chan *rx_chan; 209 struct dma_chan *rx_chan;
210 int slot_id;
211 int response_busy; 210 int response_busy;
212 int context_loss; 211 int context_loss;
213 int protect_card; 212 int protect_card;
@@ -223,8 +222,8 @@ struct omap_hsmmc_host {
223 struct omap_hsmmc_platform_data *pdata; 222 struct omap_hsmmc_platform_data *pdata;
224 223
225 /* To handle board related suspend/resume functionality for MMC */ 224 /* To handle board related suspend/resume functionality for MMC */
226 int (*suspend)(struct device *dev, int slot); 225 int (*suspend)(struct device *dev);
227 int (*resume)(struct device *dev, int slot); 226 int (*resume)(struct device *dev);
228 227
229 /* return MMC cover switch state, can be NULL if not supported. 228 /* return MMC cover switch state, can be NULL if not supported.
230 * 229 *
@@ -232,13 +231,13 @@ struct omap_hsmmc_host {
232 * 0 - closed 231 * 0 - closed
233 * 1 - open 232 * 1 - open
234 */ 233 */
235 int (*get_cover_state)(struct device *dev, int slot); 234 int (*get_cover_state)(struct device *dev);
236 235
237 /* Card detection IRQs */ 236 /* Card detection IRQs */
238 int card_detect_irq; 237 int card_detect_irq;
239 238
240 int (*card_detect)(struct device *dev, int slot); 239 int (*card_detect)(struct device *dev);
241 int (*get_ro)(struct device *dev, int slot); 240 int (*get_ro)(struct device *dev);
242 241
243}; 242};
244 243
@@ -249,7 +248,7 @@ struct omap_mmc_of_data {
249 248
250static void omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host); 249static void omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host);
251 250
252static int omap_hsmmc_card_detect(struct device *dev, int slot) 251static int omap_hsmmc_card_detect(struct device *dev)
253{ 252{
254 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 253 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
255 struct omap_hsmmc_platform_data *mmc = host->pdata; 254 struct omap_hsmmc_platform_data *mmc = host->pdata;
@@ -258,7 +257,7 @@ static int omap_hsmmc_card_detect(struct device *dev, int slot)
258 return !gpio_get_value_cansleep(mmc->switch_pin); 257 return !gpio_get_value_cansleep(mmc->switch_pin);
259} 258}
260 259
261static int omap_hsmmc_get_wp(struct device *dev, int slot) 260static int omap_hsmmc_get_wp(struct device *dev)
262{ 261{
263 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 262 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
264 struct omap_hsmmc_platform_data *mmc = host->pdata; 263 struct omap_hsmmc_platform_data *mmc = host->pdata;
@@ -267,7 +266,7 @@ static int omap_hsmmc_get_wp(struct device *dev, int slot)
267 return gpio_get_value_cansleep(mmc->gpio_wp); 266 return gpio_get_value_cansleep(mmc->gpio_wp);
268} 267}
269 268
270static int omap_hsmmc_get_cover_state(struct device *dev, int slot) 269static int omap_hsmmc_get_cover_state(struct device *dev)
271{ 270{
272 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 271 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
273 struct omap_hsmmc_platform_data *mmc = host->pdata; 272 struct omap_hsmmc_platform_data *mmc = host->pdata;
@@ -278,7 +277,7 @@ static int omap_hsmmc_get_cover_state(struct device *dev, int slot)
278 277
279#ifdef CONFIG_PM 278#ifdef CONFIG_PM
280 279
281static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot) 280static int omap_hsmmc_suspend_cdirq(struct device *dev)
282{ 281{
283 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 282 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
284 283
@@ -286,7 +285,7 @@ static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
286 return 0; 285 return 0;
287} 286}
288 287
289static int omap_hsmmc_resume_cdirq(struct device *dev, int slot) 288static int omap_hsmmc_resume_cdirq(struct device *dev)
290{ 289{
291 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 290 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
292 291
@@ -303,8 +302,7 @@ static int omap_hsmmc_resume_cdirq(struct device *dev, int slot)
303 302
304#ifdef CONFIG_REGULATOR 303#ifdef CONFIG_REGULATOR
305 304
306static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on, 305static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd)
307 int vdd)
308{ 306{
309 struct omap_hsmmc_host *host = 307 struct omap_hsmmc_host *host =
310 platform_get_drvdata(to_platform_device(dev)); 308 platform_get_drvdata(to_platform_device(dev));
@@ -318,7 +316,7 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
318 return 0; 316 return 0;
319 317
320 if (mmc_pdata(host)->before_set_reg) 318 if (mmc_pdata(host)->before_set_reg)
321 mmc_pdata(host)->before_set_reg(dev, slot, power_on, vdd); 319 mmc_pdata(host)->before_set_reg(dev, power_on, vdd);
322 320
323 if (host->pbias) { 321 if (host->pbias) {
324 if (host->pbias_enabled == 1) { 322 if (host->pbias_enabled == 1) {
@@ -381,7 +379,7 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
381 } 379 }
382 380
383 if (mmc_pdata(host)->after_set_reg) 381 if (mmc_pdata(host)->after_set_reg)
384 mmc_pdata(host)->after_set_reg(dev, slot, power_on, vdd); 382 mmc_pdata(host)->after_set_reg(dev, power_on, vdd);
385 383
386error_set_power: 384error_set_power:
387 return ret; 385 return ret;
@@ -431,8 +429,8 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
431 (host->vcc_aux && regulator_is_enabled(host->vcc_aux))) { 429 (host->vcc_aux && regulator_is_enabled(host->vcc_aux))) {
432 int vdd = ffs(mmc_pdata(host)->ocr_mask) - 1; 430 int vdd = ffs(mmc_pdata(host)->ocr_mask) - 1;
433 431
434 mmc_pdata(host)->set_power(host->dev, host->slot_id, 1, vdd); 432 mmc_pdata(host)->set_power(host->dev, 1, vdd);
435 mmc_pdata(host)->set_power(host->dev, host->slot_id, 0, 0); 433 mmc_pdata(host)->set_power(host->dev, 0, 0);
436 } 434 }
437 435
438 return 0; 436 return 0;
@@ -813,7 +811,7 @@ int omap_hsmmc_cover_is_closed(struct omap_hsmmc_host *host)
813 int r = 1; 811 int r = 1;
814 812
815 if (host->get_cover_state) 813 if (host->get_cover_state)
816 r = host->get_cover_state(host->dev, host->slot_id); 814 r = host->get_cover_state(host->dev);
817 return r; 815 return r;
818} 816}
819 817
@@ -1231,12 +1229,11 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
1231 clk_disable_unprepare(host->dbclk); 1229 clk_disable_unprepare(host->dbclk);
1232 1230
1233 /* Turn the power off */ 1231 /* Turn the power off */
1234 ret = mmc_pdata(host)->set_power(host->dev, host->slot_id, 0, 0); 1232 ret = mmc_pdata(host)->set_power(host->dev, 0, 0);
1235 1233
1236 /* Turn the power ON with given VDD 1.8 or 3.0v */ 1234 /* Turn the power ON with given VDD 1.8 or 3.0v */
1237 if (!ret) 1235 if (!ret)
1238 ret = mmc_pdata(host)->set_power(host->dev, host->slot_id, 1, 1236 ret = mmc_pdata(host)->set_power(host->dev, 1, vdd);
1239 vdd);
1240 pm_runtime_get_sync(host->dev); 1237 pm_runtime_get_sync(host->dev);
1241 if (host->dbclk) 1238 if (host->dbclk)
1242 clk_prepare_enable(host->dbclk); 1239 clk_prepare_enable(host->dbclk);
@@ -1284,7 +1281,7 @@ static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host)
1284 return; 1281 return;
1285 1282
1286 host->reqs_blocked = 0; 1283 host->reqs_blocked = 0;
1287 if (host->get_cover_state(host->dev, host->slot_id)) { 1284 if (host->get_cover_state(host->dev)) {
1288 if (host->protect_card) { 1285 if (host->protect_card) {
1289 dev_info(host->dev, "%s: cover is closed, " 1286 dev_info(host->dev, "%s: cover is closed, "
1290 "card is now accessible\n", 1287 "card is now accessible\n",
@@ -1312,7 +1309,7 @@ static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
1312 sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); 1309 sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
1313 1310
1314 if (host->card_detect) 1311 if (host->card_detect)
1315 carddetect = host->card_detect(host->dev, host->slot_id); 1312 carddetect = host->card_detect(host->dev);
1316 else { 1313 else {
1317 omap_hsmmc_protect_card(host); 1314 omap_hsmmc_protect_card(host);
1318 carddetect = -ENOSYS; 1315 carddetect = -ENOSYS;
@@ -1638,12 +1635,10 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1638 if (ios->power_mode != host->power_mode) { 1635 if (ios->power_mode != host->power_mode) {
1639 switch (ios->power_mode) { 1636 switch (ios->power_mode) {
1640 case MMC_POWER_OFF: 1637 case MMC_POWER_OFF:
1641 mmc_pdata(host)->set_power(host->dev, host->slot_id, 1638 mmc_pdata(host)->set_power(host->dev, 0, 0);
1642 0, 0);
1643 break; 1639 break;
1644 case MMC_POWER_UP: 1640 case MMC_POWER_UP:
1645 mmc_pdata(host)->set_power(host->dev, host->slot_id, 1641 mmc_pdata(host)->set_power(host->dev, 1, ios->vdd);
1646 1, ios->vdd);
1647 break; 1642 break;
1648 case MMC_POWER_ON: 1643 case MMC_POWER_ON:
1649 do_send_init_stream = 1; 1644 do_send_init_stream = 1;
@@ -1690,7 +1685,7 @@ static int omap_hsmmc_get_cd(struct mmc_host *mmc)
1690 1685
1691 if (!host->card_detect) 1686 if (!host->card_detect)
1692 return -ENOSYS; 1687 return -ENOSYS;
1693 return host->card_detect(host->dev, host->slot_id); 1688 return host->card_detect(host->dev);
1694} 1689}
1695 1690
1696static int omap_hsmmc_get_ro(struct mmc_host *mmc) 1691static int omap_hsmmc_get_ro(struct mmc_host *mmc)
@@ -1699,7 +1694,7 @@ static int omap_hsmmc_get_ro(struct mmc_host *mmc)
1699 1694
1700 if (!host->get_ro) 1695 if (!host->get_ro)
1701 return -ENOSYS; 1696 return -ENOSYS;
1702 return host->get_ro(host->dev, 0); 1697 return host->get_ro(host->dev);
1703} 1698}
1704 1699
1705static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card) 1700static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card)
@@ -1996,8 +1991,6 @@ static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
1996 if (of_find_property(np, "ti,dual-volt", NULL)) 1991 if (of_find_property(np, "ti,dual-volt", NULL))
1997 pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT; 1992 pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT;
1998 1993
1999 /* This driver only supports 1 slot */
2000 pdata->nr_slots = 1;
2001 pdata->switch_pin = cd_gpio; 1994 pdata->switch_pin = cd_gpio;
2002 pdata->gpio_wp = wp_gpio; 1995 pdata->gpio_wp = wp_gpio;
2003 1996
@@ -2068,11 +2061,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
2068 return -ENXIO; 2061 return -ENXIO;
2069 } 2062 }
2070 2063
2071 if (pdata->nr_slots == 0) {
2072 dev_err(&pdev->dev, "No Slots\n");
2073 return -ENXIO;
2074 }
2075
2076 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2064 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2077 irq = platform_get_irq(pdev, 0); 2065 irq = platform_get_irq(pdev, 0);
2078 if (res == NULL || irq < 0) 2066 if (res == NULL || irq < 0)
@@ -2095,7 +2083,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
2095 host->use_dma = 1; 2083 host->use_dma = 1;
2096 host->dma_ch = -1; 2084 host->dma_ch = -1;
2097 host->irq = irq; 2085 host->irq = irq;
2098 host->slot_id = 0;
2099 host->mapbase = res->start + pdata->reg_offset; 2086 host->mapbase = res->start + pdata->reg_offset;
2100 host->base = base + pdata->reg_offset; 2087 host->base = base + pdata->reg_offset;
2101 host->power_mode = MMC_POWER_OFF; 2088 host->power_mode = MMC_POWER_OFF;
@@ -2338,7 +2325,7 @@ static int omap_hsmmc_prepare(struct device *dev)
2338 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 2325 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
2339 2326
2340 if (host->suspend) 2327 if (host->suspend)
2341 return host->suspend(dev, host->slot_id); 2328 return host->suspend(dev);
2342 2329
2343 return 0; 2330 return 0;
2344} 2331}
@@ -2348,7 +2335,7 @@ static void omap_hsmmc_complete(struct device *dev)
2348 struct omap_hsmmc_host *host = dev_get_drvdata(dev); 2335 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
2349 2336
2350 if (host->resume) 2337 if (host->resume)
2351 host->resume(dev, host->slot_id); 2338 host->resume(dev);
2352 2339
2353} 2340}
2354 2341