public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: b-cousson@ti•com (Cousson, Benoit)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 11/12] mfd: twl4030-irq: Return twl6030_mmc_card_detect IRQ for board setup
Date: Mon, 5 Mar 2012 09:58:37 +0100	[thread overview]
Message-ID: <4F54803D.3010102@ti.com> (raw)
In-Reply-To: <4F547721.4010107@ti.com>

On 3/5/2012 9:19 AM, Rajendra Nayak wrote:
> On Friday 02 March 2012 11:45 PM, Felipe Balbi wrote:
>> Hi,
>>
>> On Fri, Mar 02, 2012 at 05:50:23PM +0100, Benoit Cousson wrote:
>>> Card detect IRQ from the TWL6030 used to be provided to the MMC
>>> controller code using a statically allocated IRQ scheme:
>>>
>>> card_detect_irq = TWL6030_IRQ_BASE + MMCDETECT_INTR_OFFSET;
>>>
>>> This is no longer valid in a SPARSE_IRQ context since there is no more
>>> pre-defined TWL6030_IRQ_BASE.
>>>
>>> Return the proper card detect IRQ value in the
>>> twl6030_mmc_card_detect_config
>>> that will be called from the MMC controller.
>>>
>>> Signed-off-by: Benoit Cousson<b-cousson@ti•com>
>>> Cc: Felipe Balbi<balbi@ti•com>
>>> Cc: Tony Lindgren<tony@atomide•com>
>>> Cc: Rajendra Nayak<rnayak@ti•com>
>>
>> Reviewed-by: Felipe Balbi<balbi@ti•com>
>>
>>> ---
>>> drivers/mfd/twl6030-irq.c | 3 ++-
>>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
>>> index a1c7183..4a63de2 100644
>>> --- a/drivers/mfd/twl6030-irq.c
>>> +++ b/drivers/mfd/twl6030-irq.c
>>> @@ -308,7 +308,8 @@ int twl6030_mmc_card_detect_config(void)
>>> ret);
>>> return ret;
>>> }
>>> - return 0;
>>> +
>>> + return twl6030_irq_base + MMCDETECT_INTR_OFFSET;
>>> }
>>> EXPORT_SYMBOL(twl6030_mmc_card_detect_config);
>>
>> At some point this twl6030_mmc_card_detect_config() needs to vanish in
>> favor of a better mechanism. Maybe passing the GPIO number an requiring
>> the driver to request the GPIO, set its direction and use it as IRQ
>> line.
>>
>> the only problem would arise if we end up hooking the Card Detect pin to
>> a real IRQ line, but then we can use a flag to differentiate.
>
> Shouldn't this be hidden from the driver completely if the card detect
> pin is a GPIO or connected to a real IRQ line? And the board/DT handle
> this instead of the driver knowing when to do a gpio_to_irq()?

It work fine for a pure GPIO, but in this case, this is an IRQ handled 
by twl6030. So I'm not sure we have any API for the non-DT case.

DT will clearly help getting rid of such hacks.

Regards,
Benoit

  reply	other threads:[~2012-03-05  8:58 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 [this message]
2012-03-03 15:09   ` Sergei Shtylyov
2012-03-05  8:29     ` Cousson, Benoit
2012-03-02 16:50 ` [PATCH 12/12] ARM: OMAP2+: board-omap4-*: Do not use anymore TWL6030_IRQ_BASE in board files Benoit Cousson
2012-03-13 17:07   ` 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=4F54803D.3010102@ti.com \
    --to=b-cousson@ti$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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