* [PATCH 1/7] mmc: msm_sdcc: handle the platform gpio_data not present case
@ 2011-04-26 5:34 Sahitya Tummala
2011-04-26 5:34 ` [PATCH 2/7] mmc: msm_sdcc: Handle error cases in probe Sahitya Tummala
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: Sahitya Tummala @ 2011-04-26 5:34 UTC (permalink / raw)
To: davidb, dwalker, bryanh
Cc: linux-mmc, linux-arm-msm, san, Subhash Jadavani, Sahitya Tummala
From: Subhash Jadavani <subhashj@codeaurora.org>
If platform gpio_data is not present then don't do any
gpio configuration.
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index a4c865a..d06539d 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -939,7 +939,7 @@ static void msmsdcc_setup_gpio(struct msmsdcc_host *host, bool enable)
struct msm_mmc_gpio_data *curr;
int i, rc = 0;
- if (!host->plat->gpio_data && host->gpio_config_status == enable)
+ if (!host->plat->gpio_data || host->gpio_config_status == enable)
return;
curr = host->plat->gpio_data;
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/7] mmc: msm_sdcc: Handle error cases in probe
2011-04-26 5:34 [PATCH 1/7] mmc: msm_sdcc: handle the platform gpio_data not present case Sahitya Tummala
@ 2011-04-26 5:34 ` Sahitya Tummala
2011-05-02 12:36 ` [PATCH V2 " Sahitya Tummala
2011-04-26 5:34 ` [PATCH 3/7] mmc: msm_sdcc: Enable SDC host->clk only after setting the rate Sahitya Tummala
` (5 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Sahitya Tummala @ 2011-04-26 5:34 UTC (permalink / raw)
To: davidb, dwalker, bryanh; +Cc: linux-mmc, linux-arm-msm, san, Sahitya Tummala
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index d06539d..66ef5c3 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1206,7 +1206,7 @@ msmsdcc_probe(struct platform_device *pdev)
host->base = ioremap(memres->start, PAGE_SIZE);
if (!host->base) {
ret = -ENOMEM;
- goto out;
+ goto host_free;
}
host->cmd_irqres = cmd_irqres;
@@ -1221,13 +1221,15 @@ msmsdcc_probe(struct platform_device *pdev)
/*
* Setup DMA
*/
- msmsdcc_init_dma(host);
+ ret = msmsdcc_init_dma(host);
+ if (ret)
+ goto ioremap_free;
/* Get our clocks */
host->pclk = clk_get(&pdev->dev, "sdc_pclk");
if (IS_ERR(host->pclk)) {
ret = PTR_ERR(host->pclk);
- goto host_free;
+ goto dma_free;
}
host->clk = clk_get(&pdev->dev, "sdc_clk");
@@ -1368,6 +1370,12 @@ msmsdcc_probe(struct platform_device *pdev)
clk_put(host->clk);
pclk_put:
clk_put(host->pclk);
+dma_free:
+ dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata),
+ host->dma.nc, host->dma.nc_busaddr);
+ioremap_free:
+ tasklet_kill(&host->dma_tlet);
+ iounmap(host->base);
host_free:
mmc_free_host(mmc);
out:
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/7] mmc: msm_sdcc: Enable SDC host->clk only after setting the rate.
2011-04-26 5:34 [PATCH 1/7] mmc: msm_sdcc: handle the platform gpio_data not present case Sahitya Tummala
2011-04-26 5:34 ` [PATCH 2/7] mmc: msm_sdcc: Handle error cases in probe Sahitya Tummala
@ 2011-04-26 5:34 ` Sahitya Tummala
2011-05-02 12:37 ` [PATCH V2 " Sahitya Tummala
2011-04-26 5:34 ` [PATCH 4/7] msm: mmc: Remove "pio_irq" resource Sahitya Tummala
` (4 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Sahitya Tummala @ 2011-04-26 5:34 UTC (permalink / raw)
To: davidb, dwalker, bryanh
Cc: linux-mmc, linux-arm-msm, san, Sahitya Tummala, Murali Palnati
For clocks that support rates which can be set (most clocks other
than _pclk AHB clocks), a rate must be set using clk_set_rate()
before the clock is enabled for the first time with clk_enable().
Subsequent calls to clk_enable() need not be preceded with the
clk_set_rate() calls unless we wish to change the clock rate that
is set previously.
SDC host->clk is currently enabled without setting the clock rate
even once. This patch fixes this, by ensuring that the clock rate
for this clock is first set before enabling the clock.
Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 66ef5c3..3446cdd 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1238,17 +1238,17 @@ msmsdcc_probe(struct platform_device *pdev)
goto pclk_put;
}
- /* Enable clocks */
- ret = msmsdcc_enable_clocks(host);
- if (ret)
- goto clk_put;
-
ret = clk_set_rate(host->clk, msmsdcc_fmin);
if (ret) {
pr_err("%s: Clock rate set failed (%d)\n", __func__, ret);
- goto clk_disable;
+ goto clk_put;
}
+ /* Enable clocks */
+ ret = msmsdcc_enable_clocks(host);
+ if (ret)
+ goto clk_put;
+
host->pclk_rate = clk_get_rate(host->pclk);
host->clk_rate = clk_get_rate(host->clk);
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/7] msm: mmc: Remove "pio_irq" resource
2011-04-26 5:34 [PATCH 1/7] mmc: msm_sdcc: handle the platform gpio_data not present case Sahitya Tummala
2011-04-26 5:34 ` [PATCH 2/7] mmc: msm_sdcc: Handle error cases in probe Sahitya Tummala
2011-04-26 5:34 ` [PATCH 3/7] mmc: msm_sdcc: Enable SDC host->clk only after setting the rate Sahitya Tummala
@ 2011-04-26 5:34 ` Sahitya Tummala
2011-05-02 12:37 ` [PATCH V2 " Sahitya Tummala
2011-04-26 5:34 ` [PATCH 5/7] mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts Sahitya Tummala
` (3 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Sahitya Tummala @ 2011-04-26 5:34 UTC (permalink / raw)
To: davidb, dwalker, bryanh; +Cc: linux-mmc, linux-arm-msm, san, Sahitya Tummala
On some targets, MCI_IRQ_MASK1 is not routed to the MSM in which
case only "cmd_irq" must be used even for PIO. With this change,
all the targets will use only "cmd_irq" for both CMD and PIO.
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
arch/arm/mach-msm/devices-msm7x00.c | 24 ------------------------
arch/arm/mach-msm/devices-qsd8x50.c | 24 ------------------------
drivers/mmc/host/msm_sdcc.c | 8 ++------
drivers/mmc/host/msm_sdcc.h | 1 -
4 files changed, 2 insertions(+), 55 deletions(-)
diff --git a/arch/arm/mach-msm/devices-msm7x00.c b/arch/arm/mach-msm/devices-msm7x00.c
index 3ef38a5..a164830 100644
--- a/arch/arm/mach-msm/devices-msm7x00.c
+++ b/arch/arm/mach-msm/devices-msm7x00.c
@@ -176,12 +176,6 @@ static struct resource resources_sdc1[] = {
.name = "cmd_irq",
},
{
- .start = INT_SDC1_1,
- .end = INT_SDC1_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
- {
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
},
@@ -204,12 +198,6 @@ static struct resource resources_sdc2[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC2_1,
- .end = INT_SDC2_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
@@ -233,12 +221,6 @@ static struct resource resources_sdc3[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC3_1,
- .end = INT_SDC3_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
@@ -262,12 +244,6 @@ static struct resource resources_sdc4[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC4_1,
- .end = INT_SDC4_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c
index 730982f..2292883 100644
--- a/arch/arm/mach-msm/devices-qsd8x50.c
+++ b/arch/arm/mach-msm/devices-qsd8x50.c
@@ -140,12 +140,6 @@ static struct resource resources_sdc1[] = {
.name = "cmd_irq",
},
{
- .start = INT_SDC1_1,
- .end = INT_SDC1_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
- {
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
},
@@ -168,12 +162,6 @@ static struct resource resources_sdc2[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC2_1,
- .end = INT_SDC2_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
@@ -197,12 +185,6 @@ static struct resource resources_sdc3[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC3_1,
- .end = INT_SDC3_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
@@ -226,12 +208,6 @@ static struct resource resources_sdc4[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC4_1,
- .end = INT_SDC4_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 3446cdd..be45b6a 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1150,7 +1150,6 @@ msmsdcc_probe(struct platform_device *pdev)
struct msmsdcc_host *host;
struct mmc_host *mmc;
struct resource *cmd_irqres = NULL;
- struct resource *pio_irqres = NULL;
struct resource *stat_irqres = NULL;
struct resource *memres = NULL;
struct resource *dmares = NULL;
@@ -1175,12 +1174,10 @@ msmsdcc_probe(struct platform_device *pdev)
dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
cmd_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
"cmd_irq");
- pio_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
- "pio_irq");
stat_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
"status_irq");
- if (!cmd_irqres || !pio_irqres || !memres) {
+ if (!cmd_irqres || !memres) {
pr_err("%s: Invalid resource\n", __func__);
return -ENXIO;
}
@@ -1210,7 +1207,6 @@ msmsdcc_probe(struct platform_device *pdev)
}
host->cmd_irqres = cmd_irqres;
- host->pio_irqres = pio_irqres;
host->memres = memres;
host->dmares = dmares;
spin_lock_init(&host->lock);
@@ -1327,7 +1323,7 @@ msmsdcc_probe(struct platform_device *pdev)
if (ret)
goto stat_irq_free;
- ret = request_irq(pio_irqres->start, msmsdcc_pio_irq, IRQF_SHARED,
+ ret = request_irq(cmd_irqres->start, msmsdcc_pio_irq, IRQF_SHARED,
DRIVER_NAME " (pio)", host);
if (ret)
goto cmd_irq_free;
diff --git a/drivers/mmc/host/msm_sdcc.h b/drivers/mmc/host/msm_sdcc.h
index 42d7bbc..fa626ed 100644
--- a/drivers/mmc/host/msm_sdcc.h
+++ b/drivers/mmc/host/msm_sdcc.h
@@ -202,7 +202,6 @@ struct msmsdcc_stats {
struct msmsdcc_host {
struct resource *cmd_irqres;
- struct resource *pio_irqres;
struct resource *memres;
struct resource *dmares;
void __iomem *base;
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/7] mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts
2011-04-26 5:34 [PATCH 1/7] mmc: msm_sdcc: handle the platform gpio_data not present case Sahitya Tummala
` (2 preceding siblings ...)
2011-04-26 5:34 ` [PATCH 4/7] msm: mmc: Remove "pio_irq" resource Sahitya Tummala
@ 2011-04-26 5:34 ` Sahitya Tummala
2011-04-27 15:52 ` Stephen Boyd
2011-05-02 12:39 ` [PATCH V2 " Sahitya Tummala
2011-04-26 5:34 ` [PATCH 6/7] mmc: msm_sdcc: Change initialization order of busclk_timer in probe Sahitya Tummala
` (2 subsequent siblings)
6 siblings, 2 replies; 15+ messages in thread
From: Sahitya Tummala @ 2011-04-26 5:34 UTC (permalink / raw)
To: davidb, dwalker, bryanh
Cc: linux-mmc, linux-arm-msm, san, Sahitya Tummala, Murali Palnati
Not all targets have IRQ1 line routed from the SD controller to
the processor. So we cannot rely on IRQ1 for PIO interrupts.
This patch moves all PIO interrupts to IRQ0 and enables the PIO
mode.
Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 20 ++++++++++++++++----
drivers/mmc/host/msm_sdcc.h | 5 +++++
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index be45b6a..782e4cc 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -213,7 +213,8 @@ msmsdcc_dma_exec_func(struct msm_dmov_cmd *cmd)
msmsdcc_writel(host, host->cmd_timeout, MMCIDATATIMER);
msmsdcc_writel(host, (unsigned int)host->curr.xfer_size,
MMCIDATALENGTH);
- msmsdcc_writel(host, host->cmd_pio_irqmask, MMCIMASK1);
+ msmsdcc_writel(host, (msmsdcc_readl(host, MMCIMASK0) &
+ (~MCI_IRQ_PIO)) | host->cmd_pio_irqmask, MMCIMASK0);
msmsdcc_writel(host, host->cmd_datactrl, MMCIDATACTRL);
if (host->cmd_cmd) {
@@ -543,7 +544,9 @@ msmsdcc_start_data(struct msmsdcc_host *host, struct mmc_data *data,
msmsdcc_writel(host, host->curr.xfer_size, MMCIDATALENGTH);
- msmsdcc_writel(host, pio_irqmask, MMCIMASK1);
+ msmsdcc_writel(host, (msmsdcc_readl(host, MMCIMASK0) &
+ (~MCI_IRQ_PIO)) | pio_irqmask, MMCIMASK0);
+
msmsdcc_writel(host, datactrl, MMCIDATACTRL);
if (cmd) {
@@ -659,8 +662,13 @@ msmsdcc_pio_irq(int irq, void *dev_id)
{
struct msmsdcc_host *host = dev_id;
uint32_t status;
+ u32 mci_mask0 = 0;
status = msmsdcc_readl(host, MMCISTATUS);
+ mci_mask0 = msmsdcc_readl(host, MMCIMASK0);
+
+ if (((mci_mask0 & status) & MCI_IRQ_PIO) == 0)
+ return IRQ_NONE;
do {
unsigned long flags;
@@ -719,10 +727,12 @@ msmsdcc_pio_irq(int irq, void *dev_id)
} while (1);
if (status & MCI_RXACTIVE && host->curr.xfer_remain < MCI_FIFOSIZE)
- msmsdcc_writel(host, MCI_RXDATAAVLBLMASK, MMCIMASK1);
+ msmsdcc_writel(host, (mci_mask0 & (~MCI_IRQ_PIO)) |
+ MCI_RXDATAAVLBLMASK, MMCIMASK0);
if (!host->curr.xfer_remain)
- msmsdcc_writel(host, 0, MMCIMASK1);
+ msmsdcc_writel(host, (mci_mask0 & (~MCI_IRQ_PIO)) | 0,
+ MMCIMASK0);
return IRQ_HANDLED;
}
@@ -854,6 +864,8 @@ msmsdcc_irq(int irq, void *dev_id)
do {
status = msmsdcc_readl(host, MMCISTATUS);
status &= msmsdcc_readl(host, MMCIMASK0);
+ if ((status & (~MCI_IRQ_PIO)) == 0)
+ break;
msmsdcc_writel(host, status, MMCICLEAR);
if (status & MCI_SDIOINTR)
diff --git a/drivers/mmc/host/msm_sdcc.h b/drivers/mmc/host/msm_sdcc.h
index fa626ed..402028d 100644
--- a/drivers/mmc/host/msm_sdcc.h
+++ b/drivers/mmc/host/msm_sdcc.h
@@ -140,6 +140,11 @@
MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \
MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATAENDMASK|MCI_PROGDONEMASK)
+#define MCI_IRQ_PIO \
+ (MCI_RXDATAAVLBLMASK | MCI_TXDATAAVLBLMASK | MCI_RXFIFOEMPTYMASK | \
+ MCI_TXFIFOEMPTYMASK | MCI_RXFIFOFULLMASK | MCI_TXFIFOFULLMASK | \
+ MCI_RXFIFOHALFFULLMASK | MCI_TXFIFOHALFEMPTYMASK | \
+ MCI_RXACTIVEMASK | MCI_TXACTIVEMASK)
/*
* The size of the FIFO in bytes.
*/
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 6/7] mmc: msm_sdcc: Change initialization order of busclk_timer in probe
2011-04-26 5:34 [PATCH 1/7] mmc: msm_sdcc: handle the platform gpio_data not present case Sahitya Tummala
` (3 preceding siblings ...)
2011-04-26 5:34 ` [PATCH 5/7] mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts Sahitya Tummala
@ 2011-04-26 5:34 ` Sahitya Tummala
2011-05-02 12:40 ` [PATCH V2 " Sahitya Tummala
2011-04-26 5:34 ` [PATCH 7/7] mmc: msm_sdcc: Handle dma resource not present case Sahitya Tummala
2011-05-02 12:33 ` [PATCH V2 1/7] mmc: msm_sdcc: handle the platform gpio_data " Sahitya Tummala
6 siblings, 1 reply; 15+ messages in thread
From: Sahitya Tummala @ 2011-04-26 5:34 UTC (permalink / raw)
To: davidb, dwalker, bryanh; +Cc: linux-mmc, linux-arm-msm, san, Sahitya Tummala
Intialize busclk_timer before it is accessed in probe.
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 782e4cc..36fded7 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1209,6 +1209,10 @@ msmsdcc_probe(struct platform_device *pdev)
host->plat = plat;
host->mmc = mmc;
host->curr.cmd = NULL;
+ init_timer(&host->busclk_timer);
+ host->busclk_timer.data = (unsigned long) host;
+ host->busclk_timer.function = msmsdcc_busclk_expired;
+
host->cmdpoll = 1;
@@ -1326,10 +1330,6 @@ msmsdcc_probe(struct platform_device *pdev)
host->eject = !host->oldstat;
}
- init_timer(&host->busclk_timer);
- host->busclk_timer.data = (unsigned long) host;
- host->busclk_timer.function = msmsdcc_busclk_expired;
-
ret = request_irq(cmd_irqres->start, msmsdcc_irq, IRQF_SHARED,
DRIVER_NAME " (cmd)", host);
if (ret)
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 7/7] mmc: msm_sdcc: Handle dma resource not present case
2011-04-26 5:34 [PATCH 1/7] mmc: msm_sdcc: handle the platform gpio_data not present case Sahitya Tummala
` (4 preceding siblings ...)
2011-04-26 5:34 ` [PATCH 6/7] mmc: msm_sdcc: Change initialization order of busclk_timer in probe Sahitya Tummala
@ 2011-04-26 5:34 ` Sahitya Tummala
2011-05-02 12:40 ` [PATCH V2 " Sahitya Tummala
2011-05-02 12:33 ` [PATCH V2 1/7] mmc: msm_sdcc: handle the platform gpio_data " Sahitya Tummala
6 siblings, 1 reply; 15+ messages in thread
From: Sahitya Tummala @ 2011-04-26 5:34 UTC (permalink / raw)
To: davidb, dwalker, bryanh
Cc: linux-mmc, linux-arm-msm, san, Subhash Jadavani, Sahitya Tummala
From: Subhash Jadavani <subhashj@codeaurora.org>
If DMA resource is not available then SDCC driver
should atleast work in PIO data transfer mode.
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 36fded7..a7d7b5e 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1233,9 +1233,13 @@ msmsdcc_probe(struct platform_device *pdev)
/*
* Setup DMA
*/
- ret = msmsdcc_init_dma(host);
- if (ret)
- goto ioremap_free;
+ if (host->dmares) {
+ ret = msmsdcc_init_dma(host);
+ if (ret)
+ goto ioremap_free;
+ } else {
+ host->dma.channel = -1;
+ }
/* Get our clocks */
host->pclk = clk_get(&pdev->dev, "sdc_pclk");
@@ -1379,8 +1383,9 @@ msmsdcc_probe(struct platform_device *pdev)
pclk_put:
clk_put(host->pclk);
dma_free:
- dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata),
- host->dma.nc, host->dma.nc_busaddr);
+ if (host->dmares)
+ dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata),
+ host->dma.nc, host->dma.nc_busaddr);
ioremap_free:
tasklet_kill(&host->dma_tlet);
iounmap(host->base);
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 5/7] mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts
2011-04-26 5:34 ` [PATCH 5/7] mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts Sahitya Tummala
@ 2011-04-27 15:52 ` Stephen Boyd
2011-05-02 12:39 ` [PATCH V2 " Sahitya Tummala
1 sibling, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2011-04-27 15:52 UTC (permalink / raw)
To: Sahitya Tummala
Cc: davidb, dwalker, bryanh, linux-mmc, linux-arm-msm, san,
Murali Palnati
On 04/25/2011 10:34 PM, Sahitya Tummala wrote:
> @@ -659,8 +662,13 @@ msmsdcc_pio_irq(int irq, void *dev_id)
> {
> struct msmsdcc_host *host = dev_id;
> uint32_t status;
> + u32 mci_mask0 = 0;
Is this assignment there to silence an "unused variable" warning? If it
is, please use the uninitialized_var macro. If it isn't please remove
the assignment.
>
> status = msmsdcc_readl(host, MMCISTATUS);
> + mci_mask0 = msmsdcc_readl(host, MMCIMASK0);
> +
> + if (((mci_mask0 & status) & MCI_IRQ_PIO) == 0)
> + return IRQ_NONE;
>
> do {
> unsigned long flags;
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH V2 1/7] mmc: msm_sdcc: handle the platform gpio_data not present case
2011-04-26 5:34 [PATCH 1/7] mmc: msm_sdcc: handle the platform gpio_data not present case Sahitya Tummala
` (5 preceding siblings ...)
2011-04-26 5:34 ` [PATCH 7/7] mmc: msm_sdcc: Handle dma resource not present case Sahitya Tummala
@ 2011-05-02 12:33 ` Sahitya Tummala
6 siblings, 0 replies; 15+ messages in thread
From: Sahitya Tummala @ 2011-05-02 12:33 UTC (permalink / raw)
To: davidb, bryanh, dwalker
Cc: linux-mmc, linux-arm-msm, san, Subhash Jadavani, Sahitya Tummala
From: Subhash Jadavani <subhashj@codeaurora.org>
If platform gpio_data is not present then don't do any
gpio configuration.
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index a4c865a..d06539d 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -939,7 +939,7 @@ static void msmsdcc_setup_gpio(struct msmsdcc_host *host, bool enable)
struct msm_mmc_gpio_data *curr;
int i, rc = 0;
- if (!host->plat->gpio_data && host->gpio_config_status == enable)
+ if (!host->plat->gpio_data || host->gpio_config_status == enable)
return;
curr = host->plat->gpio_data;
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 2/7] mmc: msm_sdcc: Handle error cases in probe
2011-04-26 5:34 ` [PATCH 2/7] mmc: msm_sdcc: Handle error cases in probe Sahitya Tummala
@ 2011-05-02 12:36 ` Sahitya Tummala
0 siblings, 0 replies; 15+ messages in thread
From: Sahitya Tummala @ 2011-05-02 12:36 UTC (permalink / raw)
To: davidb, bryanh, dwalker; +Cc: linux-mmc, linux-arm-msm, san, Sahitya Tummala
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index d06539d..66ef5c3 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1206,7 +1206,7 @@ msmsdcc_probe(struct platform_device *pdev)
host->base = ioremap(memres->start, PAGE_SIZE);
if (!host->base) {
ret = -ENOMEM;
- goto out;
+ goto host_free;
}
host->cmd_irqres = cmd_irqres;
@@ -1221,13 +1221,15 @@ msmsdcc_probe(struct platform_device *pdev)
/*
* Setup DMA
*/
- msmsdcc_init_dma(host);
+ ret = msmsdcc_init_dma(host);
+ if (ret)
+ goto ioremap_free;
/* Get our clocks */
host->pclk = clk_get(&pdev->dev, "sdc_pclk");
if (IS_ERR(host->pclk)) {
ret = PTR_ERR(host->pclk);
- goto host_free;
+ goto dma_free;
}
host->clk = clk_get(&pdev->dev, "sdc_clk");
@@ -1368,6 +1370,12 @@ msmsdcc_probe(struct platform_device *pdev)
clk_put(host->clk);
pclk_put:
clk_put(host->pclk);
+dma_free:
+ dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata),
+ host->dma.nc, host->dma.nc_busaddr);
+ioremap_free:
+ tasklet_kill(&host->dma_tlet);
+ iounmap(host->base);
host_free:
mmc_free_host(mmc);
out:
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 3/7] mmc: msm_sdcc: Enable SDC host->clk only after setting the rate.
2011-04-26 5:34 ` [PATCH 3/7] mmc: msm_sdcc: Enable SDC host->clk only after setting the rate Sahitya Tummala
@ 2011-05-02 12:37 ` Sahitya Tummala
0 siblings, 0 replies; 15+ messages in thread
From: Sahitya Tummala @ 2011-05-02 12:37 UTC (permalink / raw)
To: davidb, bryanh, dwalker
Cc: linux-mmc, linux-arm-msm, san, Sahitya Tummala, Murali Palnati
For clocks that support rates which can be set (most clocks other
than _pclk AHB clocks), a rate must be set using clk_set_rate()
before the clock is enabled for the first time with clk_enable().
Subsequent calls to clk_enable() need not be preceded with the
clk_set_rate() calls unless we wish to change the clock rate that
is set previously.
SDC host->clk is currently enabled without setting the clock rate
even once. This patch fixes this, by ensuring that the clock rate
for this clock is first set before enabling the clock.
Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 66ef5c3..3446cdd 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1238,17 +1238,17 @@ msmsdcc_probe(struct platform_device *pdev)
goto pclk_put;
}
- /* Enable clocks */
- ret = msmsdcc_enable_clocks(host);
- if (ret)
- goto clk_put;
-
ret = clk_set_rate(host->clk, msmsdcc_fmin);
if (ret) {
pr_err("%s: Clock rate set failed (%d)\n", __func__, ret);
- goto clk_disable;
+ goto clk_put;
}
+ /* Enable clocks */
+ ret = msmsdcc_enable_clocks(host);
+ if (ret)
+ goto clk_put;
+
host->pclk_rate = clk_get_rate(host->pclk);
host->clk_rate = clk_get_rate(host->clk);
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 4/7] msm: mmc: Remove "pio_irq" resource
2011-04-26 5:34 ` [PATCH 4/7] msm: mmc: Remove "pio_irq" resource Sahitya Tummala
@ 2011-05-02 12:37 ` Sahitya Tummala
0 siblings, 0 replies; 15+ messages in thread
From: Sahitya Tummala @ 2011-05-02 12:37 UTC (permalink / raw)
To: davidb, bryanh, dwalker; +Cc: linux-mmc, linux-arm-msm, san, Sahitya Tummala
On some targets, MCI_IRQ_MASK1 is not routed to the MSM in which
case only "cmd_irq" must be used even for PIO. With this change,
all the targets will use only "cmd_irq" for both CMD and PIO.
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
arch/arm/mach-msm/devices-msm7x00.c | 24 ------------------------
arch/arm/mach-msm/devices-qsd8x50.c | 24 ------------------------
drivers/mmc/host/msm_sdcc.c | 8 ++------
drivers/mmc/host/msm_sdcc.h | 1 -
4 files changed, 2 insertions(+), 55 deletions(-)
diff --git a/arch/arm/mach-msm/devices-msm7x00.c b/arch/arm/mach-msm/devices-msm7x00.c
index 3ef38a5..a164830 100644
--- a/arch/arm/mach-msm/devices-msm7x00.c
+++ b/arch/arm/mach-msm/devices-msm7x00.c
@@ -176,12 +176,6 @@ static struct resource resources_sdc1[] = {
.name = "cmd_irq",
},
{
- .start = INT_SDC1_1,
- .end = INT_SDC1_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
- {
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
},
@@ -204,12 +198,6 @@ static struct resource resources_sdc2[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC2_1,
- .end = INT_SDC2_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
@@ -233,12 +221,6 @@ static struct resource resources_sdc3[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC3_1,
- .end = INT_SDC3_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
@@ -262,12 +244,6 @@ static struct resource resources_sdc4[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC4_1,
- .end = INT_SDC4_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c
index 730982f..2292883 100644
--- a/arch/arm/mach-msm/devices-qsd8x50.c
+++ b/arch/arm/mach-msm/devices-qsd8x50.c
@@ -140,12 +140,6 @@ static struct resource resources_sdc1[] = {
.name = "cmd_irq",
},
{
- .start = INT_SDC1_1,
- .end = INT_SDC1_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
- {
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
},
@@ -168,12 +162,6 @@ static struct resource resources_sdc2[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC2_1,
- .end = INT_SDC2_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
@@ -197,12 +185,6 @@ static struct resource resources_sdc3[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC3_1,
- .end = INT_SDC3_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
@@ -226,12 +208,6 @@ static struct resource resources_sdc4[] = {
.flags = IORESOURCE_IRQ,
.name = "cmd_irq",
},
- {
- .start = INT_SDC4_1,
- .end = INT_SDC4_1,
- .flags = IORESOURCE_IRQ,
- .name = "pio_irq",
- },
{
.flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
.name = "status_irq"
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 3446cdd..be45b6a 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1150,7 +1150,6 @@ msmsdcc_probe(struct platform_device *pdev)
struct msmsdcc_host *host;
struct mmc_host *mmc;
struct resource *cmd_irqres = NULL;
- struct resource *pio_irqres = NULL;
struct resource *stat_irqres = NULL;
struct resource *memres = NULL;
struct resource *dmares = NULL;
@@ -1175,12 +1174,10 @@ msmsdcc_probe(struct platform_device *pdev)
dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
cmd_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
"cmd_irq");
- pio_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
- "pio_irq");
stat_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
"status_irq");
- if (!cmd_irqres || !pio_irqres || !memres) {
+ if (!cmd_irqres || !memres) {
pr_err("%s: Invalid resource\n", __func__);
return -ENXIO;
}
@@ -1210,7 +1207,6 @@ msmsdcc_probe(struct platform_device *pdev)
}
host->cmd_irqres = cmd_irqres;
- host->pio_irqres = pio_irqres;
host->memres = memres;
host->dmares = dmares;
spin_lock_init(&host->lock);
@@ -1327,7 +1323,7 @@ msmsdcc_probe(struct platform_device *pdev)
if (ret)
goto stat_irq_free;
- ret = request_irq(pio_irqres->start, msmsdcc_pio_irq, IRQF_SHARED,
+ ret = request_irq(cmd_irqres->start, msmsdcc_pio_irq, IRQF_SHARED,
DRIVER_NAME " (pio)", host);
if (ret)
goto cmd_irq_free;
diff --git a/drivers/mmc/host/msm_sdcc.h b/drivers/mmc/host/msm_sdcc.h
index 42d7bbc..fa626ed 100644
--- a/drivers/mmc/host/msm_sdcc.h
+++ b/drivers/mmc/host/msm_sdcc.h
@@ -202,7 +202,6 @@ struct msmsdcc_stats {
struct msmsdcc_host {
struct resource *cmd_irqres;
- struct resource *pio_irqres;
struct resource *memres;
struct resource *dmares;
void __iomem *base;
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 5/7] mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts
2011-04-26 5:34 ` [PATCH 5/7] mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts Sahitya Tummala
2011-04-27 15:52 ` Stephen Boyd
@ 2011-05-02 12:39 ` Sahitya Tummala
1 sibling, 0 replies; 15+ messages in thread
From: Sahitya Tummala @ 2011-05-02 12:39 UTC (permalink / raw)
To: davidb, bryanh, dwalker
Cc: linux-mmc, linux-arm-msm, san, sboyd, Sahitya Tummala,
Murali Palnati
Not all targets have IRQ1 line routed from the SD controller to
the processor. So we cannot rely on IRQ1 for PIO interrupts.
This patch moves all PIO interrupts to IRQ0 and enables the PIO
mode.
Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 20 ++++++++++++++++----
drivers/mmc/host/msm_sdcc.h | 5 +++++
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index be45b6a..908524b 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -213,7 +213,8 @@ msmsdcc_dma_exec_func(struct msm_dmov_cmd *cmd)
msmsdcc_writel(host, host->cmd_timeout, MMCIDATATIMER);
msmsdcc_writel(host, (unsigned int)host->curr.xfer_size,
MMCIDATALENGTH);
- msmsdcc_writel(host, host->cmd_pio_irqmask, MMCIMASK1);
+ msmsdcc_writel(host, (msmsdcc_readl(host, MMCIMASK0) &
+ (~MCI_IRQ_PIO)) | host->cmd_pio_irqmask, MMCIMASK0);
msmsdcc_writel(host, host->cmd_datactrl, MMCIDATACTRL);
if (host->cmd_cmd) {
@@ -543,7 +544,9 @@ msmsdcc_start_data(struct msmsdcc_host *host, struct mmc_data *data,
msmsdcc_writel(host, host->curr.xfer_size, MMCIDATALENGTH);
- msmsdcc_writel(host, pio_irqmask, MMCIMASK1);
+ msmsdcc_writel(host, (msmsdcc_readl(host, MMCIMASK0) &
+ (~MCI_IRQ_PIO)) | pio_irqmask, MMCIMASK0);
+
msmsdcc_writel(host, datactrl, MMCIDATACTRL);
if (cmd) {
@@ -659,8 +662,13 @@ msmsdcc_pio_irq(int irq, void *dev_id)
{
struct msmsdcc_host *host = dev_id;
uint32_t status;
+ u32 mci_mask0;
status = msmsdcc_readl(host, MMCISTATUS);
+ mci_mask0 = msmsdcc_readl(host, MMCIMASK0);
+
+ if (((mci_mask0 & status) & MCI_IRQ_PIO) == 0)
+ return IRQ_NONE;
do {
unsigned long flags;
@@ -719,10 +727,12 @@ msmsdcc_pio_irq(int irq, void *dev_id)
} while (1);
if (status & MCI_RXACTIVE && host->curr.xfer_remain < MCI_FIFOSIZE)
- msmsdcc_writel(host, MCI_RXDATAAVLBLMASK, MMCIMASK1);
+ msmsdcc_writel(host, (mci_mask0 & (~MCI_IRQ_PIO)) |
+ MCI_RXDATAAVLBLMASK, MMCIMASK0);
if (!host->curr.xfer_remain)
- msmsdcc_writel(host, 0, MMCIMASK1);
+ msmsdcc_writel(host, (mci_mask0 & (~MCI_IRQ_PIO)) | 0,
+ MMCIMASK0);
return IRQ_HANDLED;
}
@@ -854,6 +864,8 @@ msmsdcc_irq(int irq, void *dev_id)
do {
status = msmsdcc_readl(host, MMCISTATUS);
status &= msmsdcc_readl(host, MMCIMASK0);
+ if ((status & (~MCI_IRQ_PIO)) == 0)
+ break;
msmsdcc_writel(host, status, MMCICLEAR);
if (status & MCI_SDIOINTR)
diff --git a/drivers/mmc/host/msm_sdcc.h b/drivers/mmc/host/msm_sdcc.h
index fa626ed..402028d 100644
--- a/drivers/mmc/host/msm_sdcc.h
+++ b/drivers/mmc/host/msm_sdcc.h
@@ -140,6 +140,11 @@
MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \
MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATAENDMASK|MCI_PROGDONEMASK)
+#define MCI_IRQ_PIO \
+ (MCI_RXDATAAVLBLMASK | MCI_TXDATAAVLBLMASK | MCI_RXFIFOEMPTYMASK | \
+ MCI_TXFIFOEMPTYMASK | MCI_RXFIFOFULLMASK | MCI_TXFIFOFULLMASK | \
+ MCI_RXFIFOHALFFULLMASK | MCI_TXFIFOHALFEMPTYMASK | \
+ MCI_RXACTIVEMASK | MCI_TXACTIVEMASK)
/*
* The size of the FIFO in bytes.
*/
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 6/7] mmc: msm_sdcc: Change initialization order of busclk_timer in probe
2011-04-26 5:34 ` [PATCH 6/7] mmc: msm_sdcc: Change initialization order of busclk_timer in probe Sahitya Tummala
@ 2011-05-02 12:40 ` Sahitya Tummala
0 siblings, 0 replies; 15+ messages in thread
From: Sahitya Tummala @ 2011-05-02 12:40 UTC (permalink / raw)
To: davidb, bryanh, dwalker; +Cc: linux-mmc, linux-arm-msm, san, Sahitya Tummala
Intialize busclk_timer before it is accessed in probe.
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 908524b..1fe4102 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1209,6 +1209,10 @@ msmsdcc_probe(struct platform_device *pdev)
host->plat = plat;
host->mmc = mmc;
host->curr.cmd = NULL;
+ init_timer(&host->busclk_timer);
+ host->busclk_timer.data = (unsigned long) host;
+ host->busclk_timer.function = msmsdcc_busclk_expired;
+
host->cmdpoll = 1;
@@ -1326,10 +1330,6 @@ msmsdcc_probe(struct platform_device *pdev)
host->eject = !host->oldstat;
}
- init_timer(&host->busclk_timer);
- host->busclk_timer.data = (unsigned long) host;
- host->busclk_timer.function = msmsdcc_busclk_expired;
-
ret = request_irq(cmd_irqres->start, msmsdcc_irq, IRQF_SHARED,
DRIVER_NAME " (cmd)", host);
if (ret)
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V2 7/7] mmc: msm_sdcc: Handle dma resource not present case
2011-04-26 5:34 ` [PATCH 7/7] mmc: msm_sdcc: Handle dma resource not present case Sahitya Tummala
@ 2011-05-02 12:40 ` Sahitya Tummala
0 siblings, 0 replies; 15+ messages in thread
From: Sahitya Tummala @ 2011-05-02 12:40 UTC (permalink / raw)
To: davidb, bryanh, dwalker
Cc: linux-mmc, linux-arm-msm, san, Subhash Jadavani, Sahitya Tummala
From: Subhash Jadavani <subhashj@codeaurora.org>
If DMA resource is not available then SDCC driver
should atleast work in PIO data transfer mode.
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
---
drivers/mmc/host/msm_sdcc.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 1fe4102..0a0d582 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1233,9 +1233,13 @@ msmsdcc_probe(struct platform_device *pdev)
/*
* Setup DMA
*/
- ret = msmsdcc_init_dma(host);
- if (ret)
- goto ioremap_free;
+ if (host->dmares) {
+ ret = msmsdcc_init_dma(host);
+ if (ret)
+ goto ioremap_free;
+ } else {
+ host->dma.channel = -1;
+ }
/* Get our clocks */
host->pclk = clk_get(&pdev->dev, "sdc_pclk");
@@ -1379,8 +1383,9 @@ msmsdcc_probe(struct platform_device *pdev)
pclk_put:
clk_put(host->pclk);
dma_free:
- dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata),
- host->dma.nc, host->dma.nc_busaddr);
+ if (host->dmares)
+ dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata),
+ host->dma.nc, host->dma.nc_busaddr);
ioremap_free:
tasklet_kill(&host->dma_tlet);
iounmap(host->base);
--
1.7.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 15+ messages in thread
end of thread, other threads:[~2011-05-02 12:40 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-26 5:34 [PATCH 1/7] mmc: msm_sdcc: handle the platform gpio_data not present case Sahitya Tummala
2011-04-26 5:34 ` [PATCH 2/7] mmc: msm_sdcc: Handle error cases in probe Sahitya Tummala
2011-05-02 12:36 ` [PATCH V2 " Sahitya Tummala
2011-04-26 5:34 ` [PATCH 3/7] mmc: msm_sdcc: Enable SDC host->clk only after setting the rate Sahitya Tummala
2011-05-02 12:37 ` [PATCH V2 " Sahitya Tummala
2011-04-26 5:34 ` [PATCH 4/7] msm: mmc: Remove "pio_irq" resource Sahitya Tummala
2011-05-02 12:37 ` [PATCH V2 " Sahitya Tummala
2011-04-26 5:34 ` [PATCH 5/7] mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts Sahitya Tummala
2011-04-27 15:52 ` Stephen Boyd
2011-05-02 12:39 ` [PATCH V2 " Sahitya Tummala
2011-04-26 5:34 ` [PATCH 6/7] mmc: msm_sdcc: Change initialization order of busclk_timer in probe Sahitya Tummala
2011-05-02 12:40 ` [PATCH V2 " Sahitya Tummala
2011-04-26 5:34 ` [PATCH 7/7] mmc: msm_sdcc: Handle dma resource not present case Sahitya Tummala
2011-05-02 12:40 ` [PATCH V2 " Sahitya Tummala
2011-05-02 12:33 ` [PATCH V2 1/7] mmc: msm_sdcc: handle the platform gpio_data " Sahitya Tummala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).