aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2014-11-04 05:42:39 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2014-11-10 06:40:50 -0500
commit4efaa6fbe1fd5e86ab2fee4cdcfc6873dab60716 (patch)
treeadae970906093fd2dfe9c46abfce9294880841ac
parent08621b18a15ee21601ad8133565d283610b493d8 (diff)
mmc: sdhci: Rename adma_desc to adma_table
In preparation for 64-bit ADMA, rename adma_desc to adma_table. That is because members will be added for descriptor size and table size, so using adma_desc (which is the table) is confusing. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/sdhci.c31
-rw-r--r--include/linux/mmc/sdhci.h2
2 files changed, 17 insertions, 16 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index e40414ab7ef8..f2062b073e00 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -505,7 +505,7 @@ static int sdhci_adma_table_pre(struct sdhci_host *host,
505 if (host->sg_count == 0) 505 if (host->sg_count == 0)
506 goto unmap_align; 506 goto unmap_align;
507 507
508 desc = host->adma_desc; 508 desc = host->adma_table;
509 align = host->align_buffer; 509 align = host->align_buffer;
510 510
511 align_addr = host->align_addr; 511 align_addr = host->align_addr;
@@ -555,14 +555,14 @@ static int sdhci_adma_table_pre(struct sdhci_host *host,
555 * If this triggers then we have a calculation bug 555 * If this triggers then we have a calculation bug
556 * somewhere. :/ 556 * somewhere. :/
557 */ 557 */
558 WARN_ON((desc - host->adma_desc) >= ADMA_SIZE); 558 WARN_ON((desc - host->adma_table) >= ADMA_SIZE);
559 } 559 }
560 560
561 if (host->quirks & SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC) { 561 if (host->quirks & SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC) {
562 /* 562 /*
563 * Mark the last descriptor as the terminating descriptor 563 * Mark the last descriptor as the terminating descriptor
564 */ 564 */
565 if (desc != host->adma_desc) { 565 if (desc != host->adma_table) {
566 desc -= 8; 566 desc -= 8;
567 desc[0] |= 0x2; /* end */ 567 desc[0] |= 0x2; /* end */
568 } 568 }
@@ -2294,7 +2294,7 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *mask)
2294static void sdhci_adma_show_error(struct sdhci_host *host) 2294static void sdhci_adma_show_error(struct sdhci_host *host)
2295{ 2295{
2296 const char *name = mmc_hostname(host->mmc); 2296 const char *name = mmc_hostname(host->mmc);
2297 u8 *desc = host->adma_desc; 2297 u8 *desc = host->adma_table;
2298 __le32 *dma; 2298 __le32 *dma;
2299 __le16 *len; 2299 __le16 *len;
2300 u8 attr; 2300 u8 attr;
@@ -2875,27 +2875,28 @@ int sdhci_add_host(struct sdhci_host *host)
2875 * (128) and potentially one alignment transfer for 2875 * (128) and potentially one alignment transfer for
2876 * each of those entries. 2876 * each of those entries.
2877 */ 2877 */
2878 host->adma_desc = dma_alloc_coherent(mmc_dev(mmc), 2878 host->adma_table = dma_alloc_coherent(mmc_dev(mmc),
2879 ADMA_SIZE, &host->adma_addr, 2879 ADMA_SIZE,
2880 GFP_KERNEL); 2880 &host->adma_addr,
2881 GFP_KERNEL);
2881 host->align_buffer = kmalloc(128 * 4, GFP_KERNEL); 2882 host->align_buffer = kmalloc(128 * 4, GFP_KERNEL);
2882 if (!host->adma_desc || !host->align_buffer) { 2883 if (!host->adma_table || !host->align_buffer) {
2883 dma_free_coherent(mmc_dev(mmc), ADMA_SIZE, 2884 dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
2884 host->adma_desc, host->adma_addr); 2885 host->adma_table, host->adma_addr);
2885 kfree(host->align_buffer); 2886 kfree(host->align_buffer);
2886 pr_warn("%s: Unable to allocate ADMA buffers - falling back to standard DMA\n", 2887 pr_warn("%s: Unable to allocate ADMA buffers - falling back to standard DMA\n",
2887 mmc_hostname(mmc)); 2888 mmc_hostname(mmc));
2888 host->flags &= ~SDHCI_USE_ADMA; 2889 host->flags &= ~SDHCI_USE_ADMA;
2889 host->adma_desc = NULL; 2890 host->adma_table = NULL;
2890 host->align_buffer = NULL; 2891 host->align_buffer = NULL;
2891 } else if (host->adma_addr & 3) { 2892 } else if (host->adma_addr & 3) {
2892 pr_warn("%s: unable to allocate aligned ADMA descriptor\n", 2893 pr_warn("%s: unable to allocate aligned ADMA descriptor\n",
2893 mmc_hostname(mmc)); 2894 mmc_hostname(mmc));
2894 host->flags &= ~SDHCI_USE_ADMA; 2895 host->flags &= ~SDHCI_USE_ADMA;
2895 dma_free_coherent(mmc_dev(mmc), ADMA_SIZE, 2896 dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
2896 host->adma_desc, host->adma_addr); 2897 host->adma_table, host->adma_addr);
2897 kfree(host->align_buffer); 2898 kfree(host->align_buffer);
2898 host->adma_desc = NULL; 2899 host->adma_table = NULL;
2899 host->align_buffer = NULL; 2900 host->align_buffer = NULL;
2900 } 2901 }
2901 } 2902 }
@@ -3351,12 +3352,12 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
3351 if (!IS_ERR(mmc->supply.vqmmc)) 3352 if (!IS_ERR(mmc->supply.vqmmc))
3352 regulator_disable(mmc->supply.vqmmc); 3353 regulator_disable(mmc->supply.vqmmc);
3353 3354
3354 if (host->adma_desc) 3355 if (host->adma_table)
3355 dma_free_coherent(mmc_dev(mmc), ADMA_SIZE, 3356 dma_free_coherent(mmc_dev(mmc), ADMA_SIZE,
3356 host->adma_desc, host->adma_addr); 3357 host->adma_table, host->adma_addr);
3357 kfree(host->align_buffer); 3358 kfree(host->align_buffer);
3358 3359
3359 host->adma_desc = NULL; 3360 host->adma_table = NULL;
3360 host->align_buffer = NULL; 3361 host->align_buffer = NULL;
3361} 3362}
3362 3363
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index dba793e3a331..76e04324cc33 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -155,7 +155,7 @@ struct sdhci_host {
155 155
156 int sg_count; /* Mapped sg entries */ 156 int sg_count; /* Mapped sg entries */
157 157
158 u8 *adma_desc; /* ADMA descriptor table */ 158 u8 *adma_table; /* ADMA descriptor table */
159 u8 *align_buffer; /* Bounce buffer */ 159 u8 *align_buffer; /* Bounce buffer */
160 160
161 dma_addr_t adma_addr; /* Mapped ADMA descr. table */ 161 dma_addr_t adma_addr; /* Mapped ADMA descr. table */