linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: b-cousson@ti.com (Benoit Cousson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 12/12] ARM: OMAP2+: board-omap4-*: Do not use anymore TWL6030_IRQ_BASE in board files
Date: Fri, 2 Mar 2012 17:50:24 +0100	[thread overview]
Message-ID: <1330707024-23730-13-git-send-email-b-cousson@ti.com> (raw)
In-Reply-To: <1330707024-23730-1-git-send-email-b-cousson@ti.com>

With the introduction of dynamically allocated IRQ in the twl6030 driver,
the board files can no longer rely of static IRQ defines like before.

Retrieve the value dynamically allocated from the mmc -> twl6030 init
callback.

Note: The Panda board does not seems to use the card detect IRQ.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/board-4430sdp.c    |   13 +++++++------
 arch/arm/mach-omap2/board-omap4panda.c |   15 ++++++++-------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 4e90715..79c4eba 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -457,21 +457,22 @@ static struct platform_device omap_vwlan_device = {
 
 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
 {
-	int ret = 0;
+	int irq = 0;
 	struct platform_device *pdev = container_of(dev,
 				struct platform_device, dev);
 	struct omap_mmc_platform_data *pdata = dev->platform_data;
 
 	/* Setting MMC1 Card detect Irq */
 	if (pdev->id == 0) {
-		ret = twl6030_mmc_card_detect_config();
-		if (ret)
+		irq = twl6030_mmc_card_detect_config();
+		if (irq < 0) {
 			pr_err("Failed configuring MMC1 card detect\n");
-		pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
-						MMCDETECT_INTR_OFFSET;
+			return irq;
+		}
+		pdata->slots[0].card_detect_irq = irq;
 		pdata->slots[0].card_detect = twl6030_mmc_card_detect;
 	}
-	return ret;
+	return 0;
 }
 
 static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 28fc271..297f30b 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -206,7 +206,7 @@ struct wl12xx_platform_data omap_panda_wlan_data  __initdata = {
 
 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
 {
-	int ret = 0;
+	int irq = 0;
 	struct platform_device *pdev = container_of(dev,
 				struct platform_device, dev);
 	struct omap_mmc_platform_data *pdata = dev->platform_data;
@@ -217,14 +217,15 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)
 	}
 	/* Setting MMC1 Card detect Irq */
 	if (pdev->id == 0) {
-		ret = twl6030_mmc_card_detect_config();
-		 if (ret)
+		irq = twl6030_mmc_card_detect_config();
+		if (irq < 0) {
 			dev_err(dev, "%s: Error card detect config(%d)\n",
-				__func__, ret);
-		 else
-			pdata->slots[0].card_detect = twl6030_mmc_card_detect;
+				__func__, irq);
+			return irq;
+		}
+		pdata->slots[0].card_detect = twl6030_mmc_card_detect;
 	}
-	return ret;
+	return 0;
 }
 
 static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
-- 
1.7.0.4

  parent reply	other threads:[~2012-03-02 16:50 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 16:50 [PATCH 00/12] mfd: twl: Fix for irqdomain/next + SPARSE_IRQ + MMC card detect Benoit Cousson
2012-03-02 16:50 ` [PATCH 01/12] mfd: twl-core: don't depend on pdata->irq_base/end Benoit Cousson
2012-03-14 20:59   ` Kevin Hilman
2012-03-14 21:08     ` Cousson, Benoit
2012-03-14 21:17       ` Kevin Hilman
2012-03-14 21:53     ` Kevin Hilman
2012-03-19 14:23       ` Cousson, Benoit
2012-03-14 22:14     ` Tony Lindgren
2012-03-19 15:07     ` Felipe Balbi
2012-03-02 16:50 ` [PATCH 02/12] mfd: twl-core: remove unneeded header Benoit Cousson
2012-03-02 16:50 ` [PATCH 03/12] mfd: twl-core: Remove references already defined in header file Benoit Cousson
2012-03-02 16:50 ` [PATCH 04/12] mfd: twl-core: Move IRQ allocation into twl[4030|6030]-irq files Benoit Cousson
2012-03-02 16:50 ` [PATCH 05/12] mfd: twl4030-irq: Make SIH SPARSE_IRQ capable Benoit Cousson
2012-03-02 16:50 ` [PATCH 06/12] mfd: twl4030-irq: micro-optimization on IRQ handler Benoit Cousson
2012-03-02 16:50 ` [PATCH 07/12] mfd: twl-*: Change from pr_XXX to dev_XXX macros and various cleanups Benoit Cousson
2012-03-02 16:50 ` [PATCH 08/12] gpio/twl: Allocate irq_desc dynamically for SPARSE_IRQ support Benoit Cousson
2012-03-07 12:57   ` Cousson, Benoit
2012-03-09 16:39     ` Cousson, Benoit
2012-03-12 17:46     ` Grant Likely
2012-03-02 16:50 ` [PATCH 09/12] gpio/twl: Add DT support to gpio-twl4030 driver Benoit Cousson
2012-03-12 17:48   ` Grant Likely
2012-03-02 16:50 ` [PATCH 10/12] arm/dts: twl4030: Add twl4030-gpio node Benoit Cousson
2012-03-02 16:50 ` [PATCH 11/12] mfd: twl4030-irq: Return twl6030_mmc_card_detect IRQ for board setup Benoit Cousson
2012-03-02 18:15   ` Felipe Balbi
2012-03-02 19:20     ` Tony Lindgren
2012-03-02 20:28       ` Cousson, Benoit
2012-03-02 21:38         ` Cousson, Benoit
2012-03-02 21:44           ` Tony Lindgren
2012-03-05  8:19     ` Rajendra Nayak
2012-03-05  8:58       ` Cousson, Benoit
2012-03-03 15:09   ` Sergei Shtylyov
2012-03-05  8:29     ` Cousson, Benoit
2012-03-02 16:50 ` Benoit Cousson [this message]
2012-03-13 17:07   ` [PATCH 12/12] ARM: OMAP2+: board-omap4-*: Do not use anymore TWL6030_IRQ_BASE in board files Tony Lindgren
2012-03-13 21:35     ` Cousson, Benoit
2012-03-02 20:33 ` [PATCH 07/12] mfd: twl-*: Replace pr_ macros by the dev_ equivalent and do various cleanups Benoit Cousson
2012-03-02 20:49   ` Cousson, Benoit
2012-03-14 20:50 ` [PATCH 00/12] mfd: twl: Fix for irqdomain/next + SPARSE_IRQ + MMC card detect Kevin Hilman
2012-03-14 21:01   ` Cousson, Benoit
2012-03-14 21:24     ` Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330707024-23730-13-git-send-email-b-cousson@ti.com \
    --to=b-cousson@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).