linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
To: Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Linus Walleij
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: [PATCH 0/2] pinctrl: sunxi: misc improvements for gpio
Date: Tue, 15 Jul 2014 01:24:35 +0800	[thread overview]
Message-ID: <1405358677-23657-1-git-send-email-wens@csie.org> (raw)

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

             reply	other threads:[~2014-07-14 17:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14 17:24 Chen-Yu Tsai [this message]
     [not found] ` <1405358677-23657-1-git-send-email-wens-jdAy2FN1RRM@public.gmane.org>
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
     [not found]     ` <1405358677-23657-3-git-send-email-wens-jdAy2FN1RRM@public.gmane.org>
2014-07-24 13:19       ` Chen-Yu Tsai
     [not found]         ` <CAGb2v64mZjmB+ftQ7yM5LzhUyPVGtCXq6DOUQ-pumLb73_DYLQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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
     [not found]     ` <CACRpkdZhZkB6=_ehVXxWAnvkVYy_KOU84fcGRSRTc9-2X2paqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-24 12:57       ` Maxime Ripard

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=1405358677-23657-1-git-send-email-wens@csie.org \
    --to=wens-jday2fn1rrm@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.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).