* [PATCH 1/1] mmc: Support of SDIO irq for dw_mmc
@ 2011-08-23 8:20 Shashidhar Hiremath
2011-08-23 8:38 ` Shashidhar Hiremath
2011-08-23 9:10 ` Will Newton
0 siblings, 2 replies; 4+ messages in thread
From: Shashidhar Hiremath @ 2011-08-23 8:20 UTC (permalink / raw)
To: Chris Ball, Will Newton, Jaehoon Chung, Kyungmin Park, Matt Fleming
Cc: linux-mmc, Shashidhar Hiremath
The Patch adds the support for SDIO interrupts for all slots.
It includes enabling of SDIO interrupts through dw_mci_enable_sdio_irq
and the handling of the slot specific interrupts in the Interrupt Service
Routine.
Signed-off-by: shashidhar Hiremath <shashidharh@vayavyalabs.com>
---
drivers/mmc/host/dw_mmc.c | 37 +++++++++++++++++++++++++++++++++----
drivers/mmc/host/dw_mmc.h | 2 +-
2 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 66dcddb..00f207a 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -746,11 +746,31 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
return present;
}
+static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb)
+{
+ struct dw_mci_slot *slot = mmc_priv(mmc);
+ struct dw_mci *host = slot->host;
+ u32 int_mask;
+
+ /* Enable/disable Slot Specific SDIO interrupt */
+ int_mask = mci_readl(host, INTMASK);
+ if (enb) {
+ /* Dont disturb the Non-SDIO Interrupts */
+ int_mask &= 0xFFFF;
+ mci_writel(host, INTMASK, (int_mask | (1 << (slot->id + 16))));
+ } else {
+ /* Dont disturb the SDIO Interrupts */
+ int_mask &= 0xFFFF0000;
+ mci_writel(host, INTMASK, (0 << (slot->id + 16)));
+ }
+}
+
static const struct mmc_host_ops dw_mci_ops = {
- .request = dw_mci_request,
- .set_ios = dw_mci_set_ios,
- .get_ro = dw_mci_get_ro,
- .get_cd = dw_mci_get_cd,
+ .request = dw_mci_request,
+ .set_ios = dw_mci_set_ios,
+ .get_ro = dw_mci_get_ro,
+ .get_cd = dw_mci_get_cd,
+ .enable_sdio_irq = dw_mci_enable_sdio_irq,
};
static void dw_mci_request_end(struct dw_mci *host, struct mmc_request *mrq)
@@ -1179,6 +1199,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
struct dw_mci *host = dev_id;
u32 status, pending;
unsigned int pass_count = 0;
+ int i;
do {
status = mci_readl(host, RINTSTS);
@@ -1249,6 +1270,14 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
tasklet_schedule(&host->card_tasklet);
}
+ /* Handle SDIO Interrupts */
+ for (i = 0; i < host->num_slots; i++) {
+ struct dw_mci_slot *slot = host->slot[i];
+ if (pending & SDMMC_INT_SDIO(i)) {
+ mci_writel(host, RINTSTS, SDMMC_INT_SDIO(i));
+ mmc_signal_sdio_irq(slot->mmc);
+ }
+ }
} while (pass_count++ < 5);
#ifdef CONFIG_MMC_DW_IDMAC
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index 23c662a..ecf1043 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -82,7 +82,7 @@
#define SDMMC_CTYPE_4BIT BIT(0)
#define SDMMC_CTYPE_1BIT 0
/* Interrupt status & mask register defines */
-#define SDMMC_INT_SDIO BIT(16)
+#define SDMMC_INT_SDIO(n) BIT((16 + (n)))
#define SDMMC_INT_EBE BIT(15)
#define SDMMC_INT_ACD BIT(14)
#define SDMMC_INT_SBE BIT(13)
--
1.7.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 1/1] mmc: Support of SDIO irq for dw_mmc
2011-08-23 8:20 [PATCH 1/1] mmc: Support of SDIO irq for dw_mmc Shashidhar Hiremath
@ 2011-08-23 8:38 ` Shashidhar Hiremath
2011-08-23 10:08 ` James Hogan
2011-08-23 9:10 ` Will Newton
1 sibling, 1 reply; 4+ messages in thread
From: Shashidhar Hiremath @ 2011-08-23 8:38 UTC (permalink / raw)
To: Chris Ball, Will Newton, Jaehoon Chung, Kyungmin Park, Matt Fleming
Cc: linux-mmc, Shashidhar Hiremath
Resending the patch in plain text format.
The Patch adds the support for SDIO interrupts for all slots.
It includes enabling of SDIO interrupts through dw_mci_enable_sdio_irq
and the handling of the slot specific interrupts in the Interrupt Service
Routine.
Signed-off-by: shashidhar Hiremath <shashidharh@vayavyalabs.com>
---
drivers/mmc/host/dw_mmc.c | 37 +++++++++++++++++++++++++++++++++----
drivers/mmc/host/dw_mmc.h | 2 +-
2 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 66dcddb..00f207a 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -746,11 +746,31 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
return present;
}
+static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb)
+{
+ struct dw_mci_slot *slot = mmc_priv(mmc);
+ struct dw_mci *host = slot->host;
+ u32 int_mask;
+
+ /* Enable/disable Slot Specific SDIO interrupt */
+ int_mask = mci_readl(host, INTMASK);
+ if (enb) {
+ /* Dont disturb the Non-SDIO Interrupts */
+ int_mask &= 0xFFFF;
+ mci_writel(host, INTMASK, (int_mask | (1 << (slot->id + 16))));
+ } else {
+ /* Dont disturb the SDIO Interrupts */
+ int_mask &= 0xFFFF0000;
+ mci_writel(host, INTMASK, (0 << (slot->id + 16)));
+ }
+}
+
static const struct mmc_host_ops dw_mci_ops = {
- .request = dw_mci_request,
- .set_ios = dw_mci_set_ios,
- .get_ro = dw_mci_get_ro,
- .get_cd = dw_mci_get_cd,
+ .request = dw_mci_request,
+ .set_ios = dw_mci_set_ios,
+ .get_ro = dw_mci_get_ro,
+ .get_cd = dw_mci_get_cd,
+ .enable_sdio_irq = dw_mci_enable_sdio_irq,
};
static void dw_mci_request_end(struct dw_mci *host, struct mmc_request *mrq)
@@ -1179,6 +1199,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
struct dw_mci *host = dev_id;
u32 status, pending;
unsigned int pass_count = 0;
+ int i;
do {
status = mci_readl(host, RINTSTS);
@@ -1249,6 +1270,14 @@ static irqreturn_t dw_mci_interrupt(int irq,
void *dev_id)
tasklet_schedule(&host->card_tasklet);
}
+ /* Handle SDIO Interrupts */
+ for (i = 0; i < host->num_slots; i++) {
+ struct dw_mci_slot *slot = host->slot[i];
+ if (pending & SDMMC_INT_SDIO(i)) {
+ mci_writel(host, RINTSTS, SDMMC_INT_SDIO(i));
+ mmc_signal_sdio_irq(slot->mmc);
+ }
+ }
} while (pass_count++ < 5);
#ifdef CONFIG_MMC_DW_IDMAC
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index 23c662a..ecf1043 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -82,7 +82,7 @@
#define SDMMC_CTYPE_4BIT BIT(0)
#define SDMMC_CTYPE_1BIT 0
/* Interrupt status & mask register defines */
-#define SDMMC_INT_SDIO BIT(16)
+#define SDMMC_INT_SDIO(n) BIT((16 + (n)))
#define SDMMC_INT_EBE BIT(15)
#define SDMMC_INT_ACD BIT(14)
#define SDMMC_INT_SBE BIT(13)
--
1.7.2.3
--
regards,
Shashidhar Hiremath
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] mmc: Support of SDIO irq for dw_mmc
2011-08-23 8:20 [PATCH 1/1] mmc: Support of SDIO irq for dw_mmc Shashidhar Hiremath
2011-08-23 8:38 ` Shashidhar Hiremath
@ 2011-08-23 9:10 ` Will Newton
1 sibling, 0 replies; 4+ messages in thread
From: Will Newton @ 2011-08-23 9:10 UTC (permalink / raw)
To: Shashidhar Hiremath
Cc: Chris Ball, Jaehoon Chung, Kyungmin Park, Matt Fleming, linux-mmc
On Tue, Aug 23, 2011 at 9:20 AM, Shashidhar Hiremath
<shashidharh@vayavyalabs.com> wrote:
> The Patch adds the support for SDIO interrupts for all slots.
> It includes enabling of SDIO interrupts through dw_mci_enable_sdio_irq
> and the handling of the slot specific interrupts in the Interrupt Service
> Routine.
>
> Signed-off-by: shashidhar Hiremath <shashidharh@vayavyalabs.com>
> ---
> drivers/mmc/host/dw_mmc.c | 37 +++++++++++++++++++++++++++++++++----
> drivers/mmc/host/dw_mmc.h | 2 +-
> 2 files changed, 34 insertions(+), 5 deletions(-)
This looks fine.
Acked-by: Will Newton <will.newton@imgtec.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] mmc: Support of SDIO irq for dw_mmc
2011-08-23 8:38 ` Shashidhar Hiremath
@ 2011-08-23 10:08 ` James Hogan
0 siblings, 0 replies; 4+ messages in thread
From: James Hogan @ 2011-08-23 10:08 UTC (permalink / raw)
To: Shashidhar Hiremath
Cc: Chris Ball, Will Newton, Jaehoon Chung, Kyungmin Park,
Matt Fleming, linux-mmc
Hi
On 23 August 2011 09:38, Shashidhar Hiremath
<shashidharh@vayavyalabs.com> wrote:
> Resending the patch in plain text format.
>
>
>
> The Patch adds the support for SDIO interrupts for all slots.
> It includes enabling of SDIO interrupts through dw_mci_enable_sdio_irq
> and the handling of the slot specific interrupts in the Interrupt Service
> Routine.
>
> Signed-off-by: shashidhar Hiremath <shashidharh@vayavyalabs.com>
> ---
> drivers/mmc/host/dw_mmc.c | 37 +++++++++++++++++++++++++++++++++----
> drivers/mmc/host/dw_mmc.h | 2 +-
> 2 files changed, 34 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 66dcddb..00f207a 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -746,11 +746,31 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
> return present;
> }
>
> +static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb)
> +{
> + struct dw_mci_slot *slot = mmc_priv(mmc);
> + struct dw_mci *host = slot->host;
> + u32 int_mask;
> +
> + /* Enable/disable Slot Specific SDIO interrupt */
> + int_mask = mci_readl(host, INTMASK);
> + if (enb) {
> + /* Dont disturb the Non-SDIO Interrupts */
> + int_mask &= 0xFFFF;
this will disable the interrupts of all other slots, which doesn't seem right.
> + mci_writel(host, INTMASK, (int_mask | (1 << (slot->id + 16))));
you could use 1 << SDMMC_INT_SDIO(slot->id) here
> + } else {
> + /* Dont disturb the SDIO Interrupts */
> + int_mask &= 0xFFFF0000;
similarly this would disable all normal interrupts which doesn't seem right.
> + mci_writel(host, INTMASK, (0 << (slot->id + 16)));
This just looks wrong
1) you're not using int_mask anyway
2) you're shifting the value 0, so the result is all interrupts disabled
i guess you want something like "int_mask & ~(1 << SDMMC_INT_SDIO(slot->id))"
> + }
> +}
> +
> static const struct mmc_host_ops dw_mci_ops = {
> - .request = dw_mci_request,
> - .set_ios = dw_mci_set_ios,
> - .get_ro = dw_mci_get_ro,
> - .get_cd = dw_mci_get_cd,
> + .request = dw_mci_request,
> + .set_ios = dw_mci_set_ios,
> + .get_ro = dw_mci_get_ro,
> + .get_cd = dw_mci_get_cd,
> + .enable_sdio_irq = dw_mci_enable_sdio_irq,
> };
>
> static void dw_mci_request_end(struct dw_mci *host, struct mmc_request *mrq)
> @@ -1179,6 +1199,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
> struct dw_mci *host = dev_id;
> u32 status, pending;
> unsigned int pass_count = 0;
> + int i;
>
> do {
> status = mci_readl(host, RINTSTS);
> @@ -1249,6 +1270,14 @@ static irqreturn_t dw_mci_interrupt(int irq,
> void *dev_id)
> tasklet_schedule(&host->card_tasklet);
> }
>
> + /* Handle SDIO Interrupts */
> + for (i = 0; i < host->num_slots; i++) {
> + struct dw_mci_slot *slot = host->slot[i];
> + if (pending & SDMMC_INT_SDIO(i)) {
> + mci_writel(host, RINTSTS, SDMMC_INT_SDIO(i));
> + mmc_signal_sdio_irq(slot->mmc);
> + }
> + }
> } while (pass_count++ < 5);
>
> #ifdef CONFIG_MMC_DW_IDMAC
> diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
> index 23c662a..ecf1043 100644
> --- a/drivers/mmc/host/dw_mmc.h
> +++ b/drivers/mmc/host/dw_mmc.h
> @@ -82,7 +82,7 @@
> #define SDMMC_CTYPE_4BIT BIT(0)
> #define SDMMC_CTYPE_1BIT 0
> /* Interrupt status & mask register defines */
> -#define SDMMC_INT_SDIO BIT(16)
> +#define SDMMC_INT_SDIO(n) BIT((16 + (n)))
> #define SDMMC_INT_EBE BIT(15)
> #define SDMMC_INT_ACD BIT(14)
> #define SDMMC_INT_SBE BIT(13)
Cheers
--
James Hogan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-23 10:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-23 8:20 [PATCH 1/1] mmc: Support of SDIO irq for dw_mmc Shashidhar Hiremath
2011-08-23 8:38 ` Shashidhar Hiremath
2011-08-23 10:08 ` James Hogan
2011-08-23 9:10 ` Will Newton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.