mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luciano Coelho <coelho@ti.com>
To: <linux-wireless@vger.kernel.org>
Cc: <tony@atomide.com>, <nsekhar@ti.com>, <mturquette@linaro.org>,
	<mark.rutland@arm.com>, <balbi@ti.com>, <grant.likely@linaro.org>,
	<rob.herring@calxeda.com>, <devicetree-discuss@lists.ozlabs.org>,
	<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-omap@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <nm@ti.com>
Subject: Re: [PATCH v3 2/8] wlcore: set irq_flags in the board files instead of hiding behind a quirk
Date: Wed, 3 Jul 2013 17:15:25 +0300	[thread overview]
Message-ID: <1372860925.21065.115.camel@cumari.coelho.fi> (raw)
In-Reply-To: <1372860209-3504-3-git-send-email-coelho@ti.com>

On Wed, 2013-07-03 at 17:03 +0300, Luciano Coelho wrote:
> The platform_quirk element in the platform data was used to change the
> way the IRQ is triggered.  When set, the EDGE_IRQ quirk would change
> the irqflags used and treat edge trigger differently from the rest.
> 
> Instead of hiding this irq flag setting behind the quirk, have the
> board files set the flags during initialization.  This will be more
> meaningful than driver-specific quirks when we switch to DT.
> 
> Additionally, fix missing gpio_request() calls in the boarding files
> (so that setting the flags actually works).
> 
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Sekhar Nori <nsekhar@ti.com>
> Signed-off-by: Luciano Coelho <coelho@ti.com>
> ---

[...]

> @@ -5928,16 +5927,21 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
>  	wlcore_adjust_conf(wl);
>  
>  	wl->irq = platform_get_irq(pdev, 0);
> -	wl->platform_quirks = pdata->platform_quirks;
>  	wl->if_ops = pdev_data->if_ops;
>  
> -	if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ)
> -		irqflags = IRQF_TRIGGER_RISING;
> -	else
> -		irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
> +	irq_data = irq_get_irq_data(wl->irq);
> +	if (!irq_data) {
> +		wl1271_error("couldn't get irq data for irq %d\n", wl->irq);
> +		ret = -EINVAL;
> +		goto out_free_nvs;
> +	}
> +
> +	wl->irq_flags = irqd_get_trigger_type(irq_data);

BTW, there seems to be a patch on its way to make reading the flags
easier (ie. no need to get the irq_data first):

http://mid.gmane.org/1367945288-5625-1-git-send-email-javier@dowhile0.org

I'm not sure if this is going to be taken in, but if it does, it would
be nice to change the code here to use the new irq_get_trigger_type()
function.

--
Luca.


  parent reply	other threads:[~2013-07-03 14:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03 14:03 [PATCH v3 0/8] wilink: add device tree support Luciano Coelho
2013-07-03 14:03 ` [PATCH v3 1/8] wl1251: split wl251 platform data to a separate structure Luciano Coelho
2013-07-03 14:11   ` Felipe Balbi
2013-07-03 14:03 ` [PATCH v3 2/8] wlcore: set irq_flags in the board files instead of hiding behind a quirk Luciano Coelho
2013-07-03 14:13   ` Felipe Balbi
2013-07-03 14:18     ` Luciano Coelho
2013-07-03 14:23       ` Felipe Balbi
2013-07-03 14:15   ` Luciano Coelho [this message]
2013-07-03 15:12     ` Javier Martinez Canillas
2013-07-04 14:21       ` Luciano Coelho
2013-07-04  4:46   ` Sekhar Nori
2013-07-03 14:03 ` [PATCH v3 3/8] wlcore: remove pwr_in_suspend from platform data Luciano Coelho
2013-07-03 14:14   ` Felipe Balbi
2013-07-03 14:03 ` [PATCH v3 4/8] wl12xx: use frequency instead of enumerations for pdata clocks Luciano Coelho
2013-07-03 14:16   ` Felipe Balbi
2013-07-03 14:03 ` [PATCH v3 5/8] wlcore: add initial device tree support to the sdio module Luciano Coelho
2013-07-03 14:18   ` Felipe Balbi
2013-07-03 14:03 ` [PATCH v3 6/8] wlcore: sdio: add wilink clock providers Luciano Coelho
2013-07-03 14:03 ` [PATCH v3 7/8] wlcore: sdio: get clocks from device tree Luciano Coelho
2013-07-03 14:03 ` [PATCH v3 8/8] wlcore/wl12xx: check if we got correct clock data from DT Luciano Coelho
2013-07-03 14:19   ` Felipe Balbi

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=1372860925.21065.115.camel@cumari.coelho.fi \
    --to=coelho@ti.com \
    --cc=balbi@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@linaro.org \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=rob.herring@calxeda.com \
    --cc=tony@atomide.com \
    /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

all inboxes | Powered by JetHome®