linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] pinctrl: sunxi: misc improvements for gpio
@ 2014-07-14 17:24 Chen-Yu Tsai
  2014-07-14 17:24 ` [PATCH 1/2] pinctrl: sunxi: use gpiolib API to mark a GPIO used as an IRQ Chen-Yu Tsai
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Chen-Yu Tsai @ 2014-07-14 17:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

These 2 patches are fixes / improvements to the gpio side of the
sunxi pinctrl driver. They are based on pinctrl/devel (3a19805).
The patches change the same lines of code, so they are sent together.

Patch 1 adds locking gpio lines when used as external interrupts.
Similar patches were done by Linus and other maintainers for various
platforms.

A somewhat related issue is that the sunxi pinctrl driver does not
block users from requesting an already muxed pin as a gpio line.
Maybe we should do some locking there as well? Are there any kernel
interfaces for this? Or do we need to do it in the driver specifically
for our hardware?

(I had the unfortunate experience of poking GPIOs listed in the fex
files, not noticing they were used by the uart console.)


Patch 2 changes the gpio ranges registered by the pinctrl driver.
Instead of just passing the pin number, we pass the pin offset,
so that the range is not out of bounds (with respect to gpiochip.ngpio).
This happens on sun6i/sun8i platforms for the R_PIO controllers.

As gpiochip.base currently matches the pin number base, we get the nice
result that gpio numbers match pin numbers again.

AFAIK pinctrl pin numbers are device specific, so I'm wondering if we
should also number them in terms of offsets, rather than absolute pin
numbers. It's more of an asthetic change though. Any thoughts?

Thank you


Cheers
ChenYu


Chen-Yu Tsai (2):
  pinctrl: sunxi: use gpiolib API to mark a GPIO used as an IRQ
  pinctrl: sunxi: number gpio ranges starting from 0

 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

-- 
2.0.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-07-28 10:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-14 17:24 [PATCH 0/2] pinctrl: sunxi: misc improvements for gpio Chen-Yu Tsai
2014-07-14 17:24 ` [PATCH 1/2] pinctrl: sunxi: use gpiolib API to mark a GPIO used as an IRQ Chen-Yu Tsai
2014-07-24 11:46   ` Maxime Ripard
2014-07-28 10:11   ` Linus Walleij
2014-07-14 17:24 ` [PATCH 2/2] pinctrl: sunxi: number gpio ranges starting from 0 Chen-Yu Tsai
2014-07-24 12:48   ` Maxime Ripard
2014-07-24 13:19   ` Chen-Yu Tsai
2014-07-24 16:01     ` Maxime Ripard
2014-07-24 16:17       ` Chen-Yu Tsai
2014-07-28 10:14   ` Linus Walleij
2014-07-22 16:33 ` [PATCH 0/2] pinctrl: sunxi: misc improvements for gpio Linus Walleij
2014-07-24 12:57   ` Maxime Ripard

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).