From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] gpio/mxc: use the edge_sel feature if available
Date: Wed, 20 Jun 2012 11:19:59 +0200 [thread overview]
Message-ID: <20120620091959.GQ28394@pengutronix.de> (raw)
In-Reply-To: <375509863.2886324.1340049432848.JavaMail.root@advansee.com>
On Mon, Jun 18, 2012 at 09:57:12PM +0200, Beno?t Th?baudeau wrote:
> Some mxc processors have an edge_sel feature, which allows the IRQ to be
> triggered by any edge.
>
> This patch makes use of this feature if available, which skips mxc_flip_edge().
>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Linus Walleij <linus.walleij@stericsson.com>
> Cc: Sascha Hauer <kernel@pengutronix.de>
> Cc: <linux-arm-kernel@lists.infradead.org>
> Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> ---
> .../drivers/gpio/gpio-mxc.c | 44 ++++++++++++++------
> 1 file changed, 32 insertions(+), 12 deletions(-)
>
> diff --git linux-next-HEAD-6c86b58.orig/drivers/gpio/gpio-mxc.c linux-next-HEAD-6c86b58/drivers/gpio/gpio-mxc.c
> index c337143..4c74482 100644
> --- linux-next-HEAD-6c86b58.orig/drivers/gpio/gpio-mxc.c
> +++ linux-next-HEAD-6c86b58/drivers/gpio/gpio-mxc.c
> @@ -30,6 +30,7 @@
> #include <linux/of.h>
> #include <linux/of_device.h>
> #include <linux/module.h>
> +#include <mach/hardware.h>
> #include <asm-generic/bug.h>
> #include <asm/mach/irq.h>
>
> @@ -104,12 +105,13 @@ static struct mxc_gpio_hwdata *mxc_gpio_hwdata;
> #define GPIO_ICR2 (mxc_gpio_hwdata->icr2_reg)
> #define GPIO_IMR (mxc_gpio_hwdata->imr_reg)
> #define GPIO_ISR (mxc_gpio_hwdata->isr_reg)
> +#define GPIO_EDGE_SEL 0x1c
>
> #define GPIO_INT_LOW_LEV (mxc_gpio_hwdata->low_level)
> #define GPIO_INT_HIGH_LEV (mxc_gpio_hwdata->high_level)
> #define GPIO_INT_RISE_EDGE (mxc_gpio_hwdata->rise_edge)
> #define GPIO_INT_FALL_EDGE (mxc_gpio_hwdata->fall_edge)
> -#define GPIO_INT_NONE 0x4
> +#define GPIO_INT_BOTH_EDGES 0x4
>
> static struct platform_device_id mxc_gpio_devtype[] = {
> {
> @@ -150,6 +152,7 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
> u32 bit, val;
> int edge;
> void __iomem *reg = port->base;
> + bool edge_sel = cpu_is_mx25() || cpu_is_mx35() || cpu_is_mx51() || cpu_is_mx53();
To make Shawns suggestion a bit more clear:
What you should do here is to add flags describing differences between
SoCs in mxc_gpio_hwdata.
This means that you have to:
- add IMX35_GPIO to enum mxc_gpio_hwtype
- add imx35-gpio to mxc_gpio_devtype[]
- add "fsl,imx35-gpio" to the compatible list.
- fix all devicetree bindings and platform device bindings for
i.MX25,35,51,53 and probably i.MX6
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2012-06-20 9:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-18 19:57 [PATCH] gpio/mxc: use the edge_sel feature if available Benoît Thébaudeau
2012-06-19 1:24 ` Shawn Guo
2012-06-19 12:00 ` Benoît Thébaudeau
2012-06-19 13:18 ` Benoît Thébaudeau
2012-06-20 8:35 ` Linus Walleij
2012-06-20 9:21 ` Sascha Hauer
2012-06-20 9:19 ` Sascha Hauer [this message]
2012-06-20 18:27 ` Benoît Thébaudeau
2012-06-20 18:36 ` Benoît Thébaudeau
2012-06-21 6:43 ` Sascha Hauer
2012-06-21 11:23 ` Benoît Thébaudeau
2012-06-22 13:46 ` Guennadi Liakhovetski
2012-06-22 19:04 ` Benoît Thébaudeau
2012-06-27 6:59 ` Sascha Hauer
2012-07-05 13:51 ` Linus Walleij
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=20120620091959.GQ28394@pengutronix.de \
--to=s.hauer@pengutronix.de \
--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).