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: Thu, 21 Jun 2012 08:43:47 +0200 [thread overview]
Message-ID: <20120621064347.GW28394@pengutronix.de> (raw)
In-Reply-To: <1469075585.3041816.1340216842779.JavaMail.root@advansee.com>
On Wed, Jun 20, 2012 at 08:27:22PM +0200, Beno?t Th?baudeau wrote:
> On Wed, Jun 20, 2012 at 11:19:59AM +0200, Sascha Hauer wrote:
> > 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
>
> Thanks for your suggestion. I have implemented it in the reworked patch below.
>
> I have checked the reference manuals for i.MX25/35/5x and tested it on
> i.MX25/35. The reference manual of the i.MX6Q is not public (yet?), so I need
> someone who has it to check that this change is valid for the i.MX6Q too. I
> assumed in this patch that the i.MX6Q has this EDGE_SEL register at offset 0x1c.
Just checked, that's correct.
>
> I have a question regarding the fallback mechanism in the i.MX31 case: it has
> been created in commit 910862e using levels instead of edges, and this has not
> been changed since. Why? Is it a bug or on purpose?
I assume that implementing this using level irqs is less racy. If you
implement it using edge irqs the edge could come during the time you
reconfigure the edge in the controller in which case the interrupt would
get lost.
> @@ -338,10 +365,15 @@ static void __devinit mxc_gpio_get_hw(struct platform_device *pdev)
> return;
> }
>
> - if (hwtype == IMX31_GPIO)
> - mxc_gpio_hwdata = &imx31_gpio_hwdata;
> - else
> + switch (hwtype) {
> + case IMX31_GPIO:
> + imx31_imx35_gpio_hwdata.edge_sel_reg = -1;
missing 'break'
Also I think we should not modify imx31_gpio_hwdata but instead add an
additional imx35_gpio_hwdata. It will waste a few bytes but make the
code more straightforward.
Sascha
> + case IMX35_GPIO:
> + mxc_gpio_hwdata = &imx31_imx35_gpio_hwdata;
> + break;
> + default:
> mxc_gpio_hwdata = &imx1_imx21_gpio_hwdata;
> + }
>
> mxc_gpio_hwtype = hwtype;
> }
>
--
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-21 6:43 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
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 [this message]
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=20120621064347.GW28394@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).